What determines the maximum frequency when taking the FFT?
조회 수: 24(최근 30일)
This is part conceptual, part MATLAB, but how do you set the maximum frequency when taking the FFT of a signal? According to the Nyquist, the frequency is set by something like
Freq = (df/2)*linspace(0,1,nfft/2+1);
where df is the spacing and nfft determines the length, but how do you determine the maximum?
Star Strider 2022년 5월 2일
The maximum is the Nyquist frequency, since that is the highest frequency that is uniquely resolvable in a sampled signal.
I am not certain what ‘df’ is, however if it is the sampling frequency of the original signal, then that is correct. This suggests that ‘nfft’ is something different from the length of the original signal vector, so the frequency resolution will be different as ‘nfft’ changes. The fundamental characteristic of the fft however, including the Nyquist frequency, does not change with changing values for ‘nfft’.
Paul 2022년 5월 2일
If X is the output of Matlab's fft() function, then the corresponding frequency vector is:
N = numel(X);
wn = (0:(N-1))/N*2*pi, where wn has units of rad/sample (or just rad if you like), Nyquist frequency is wn = pi
wn can then be scaled to convert to other representations:
fn = wn/2/pi (cycles/sample), Nyquist frequency is fn = 1/2
wc = wn/Ts (rad/sec) where Ts is the sampling period (sec) applied to the underlying continuous-time signal used to form the input sequence to fft(), Nyquist frequency is pi/Ts
fc = wn/2/pi/Ts (cycles/sec, or Hz), Nyquist frequency is 1/Ts/2 or fs/2 where fs = 1/Ts