<jupyter_start><jupyter_text>Senóides---$x[n] = x(n T_s)$$x(t) = \cos(2 \pi f_0 t)$$x[n] = \cos(2 \pi f_0 n T_s)$<jupyter_code>import matplotlib.pyplot as plt
import numpy as np
from IPython.display import Audio
fs = 44100
Ts = 1/fs
f0 = 500
n = np.arange(44100*5)
#n = np.arange(44100)
#xn = np.cos(2 * np.pi * f0 * n * Ts)
#xn = np.cos(2 * np.pi * f0 * n * Ts) * 0.1
#xn = np.random.rand(len(n)) * 0.1
xn = np.cos(2 * np.pi * 2 * f0 * n * Ts) * 0.1
plt.figure()
plt.plot(n[0:200]*Ts, xn[0:200], label='Sinal amostrado')
plt.ylabel('Magnitude')
plt.xlabel('Tempo (s)')
#plt.legend()
plt.show()
Audio(data=xn, rate=fs)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.21604938271604937, 'fraction_numerical': 0.07098765432098765, 'mean_word_length': 4.150793650793651, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '37173', 'license': 'MIT', 'n_tokens_mistral': 360, 'n_tokens_neox': 323, 'n_words': 69, 'path': 'notebooks/02-senoide.ipynb', 'repo_name': 'EliasJuk/sound_processing', 'size': '648'}