20 lines
297 B
Python
20 lines
297 B
Python
from matplotlib import pyplot as plt
|
|
import numpy as np
|
|
|
|
PI = np.pi
|
|
|
|
fs = 100
|
|
t = np.arange(0, 100/fs, 1/fs)
|
|
|
|
f2 = 80
|
|
f1 = 40
|
|
|
|
x1 = np.cos(2*PI*f1*t)
|
|
x2 = np.cos(2*PI*f2*t)
|
|
|
|
x = np.cos(2*PI*t/7) + np.sin(4*PI*t/7) + np.cos(16*PI*t/9)
|
|
|
|
plt.plot(np.arange(0,fs), abs(np.fft.fft(x1*x2)))
|
|
|
|
plt.show()
|