June 2015
Beginner
348 pages
8h 44m
English
First, we will create a signal to transform. Calculate the Fourier transform with the following steps:
30 points as follows:x = np.linspace(0, 2 * np.pi, 30) wave = np.cos(x)
fft() function:transformed = np.fft.fft(wave)
ifft() function. It should approximately return the original signal. Check with the following line:print(np.all(np.abs(np.fft.ifft(transformed) - wave) < 10 ** -9))
The result appears as follows:
True
plt.plot(transformed)
plt.title('Transformed cosine')
plt.xlabel('Frequency')
plt.ylabel('Amplitude')
plt.grid()
plt.show()The following resulting ...
Read now
Unlock full access