There is a sampling theorem (sampling theorem). By sampling twice for one wavelength, the original signal can be completely restored. This sampling interval is called the sampling rate, and half the frequency is called the Nyquist frequency. Aliasing occurs when the signal to be measured exceeds the Nyquist frequency. Even if I knew this kind of thing as knowledge, I thought that I had never seen an animation of what it would look like in the frequency space beyond the Nyquist frequency, so I made it.
I read it to recall the sampling theorem. Ono Sokki: About FFT Analyzer (page4)
import numpy as np
import matplotlib.pyplot as plt
N = 512 #FFT sample score
fs = 2000.0 #Sampling rate
t = np.linspace(0.0,N/fs,N)
fft_freq = np.linspace(0.0,fs,N) #FFT frequency axis
f_array = np.linspace(10.0,4000.0,200)
for i,f in enumerate(f_array):
sig = np.sin(2.0*np.pi*f*t) * np.hamming(N)
fft_amp = np.abs(np.fft.fft(sig)) / N * 2.0 / 0.54
fig,axes = plt.subplots()
axes.plot(fft_freq,fft_amp,label="{} Hz".format(np.round(f)))
axes.set_xlabel("Frequency Hz")
axes.set_ylabel("Amplitude")
axes.set_ylim(0.0,1.1)
axes.legend(loc="upper right")
fig.savefig("{}.png ".format(i))
plt.close()
The serial number photos were converted to animation with GIMP.
It moves like a mirror at the Nyquist frequency. This will give you a good idea of why you shouldn't exceed the Nyquist frequency. You can see the frequency this time, but if you look only at the result, you can't tell whether it was folded or measured correctly.
Even if you remember that you shouldn't exceed the Nyquist frequency, you'll rarely see what happens if you do. I hope it helps someone.
Recommended Posts