FFT The program shown below is the program created by the experiment
FFT.py
F = np.fft.fft(Y)
Amp = np.abs(F/(frames/2))
freq = np.fft.fftfreq(frames, 1/Fs)
plt.plot(freq[1:int(frames/2)],Amp[1:int(frames/2)])
plt.xlabel("Freqency [Hz]")
fig.savefig("FFT.png ")
plt.show()
plt.close()
↓ Execution result
Y: Voice data Fs: 20000 Hz (sampling frequency)
The FFT can only see up to half the sampling frequency (Nyquist frequency).
Recommended Posts