How points score changes FFT in MATLAB

When accepting the fft(signal, nfft) signal, how does nfft change the result, and why? Can I have a fixed value for nfft, say 2^18 , or do I need to go 2^nextpow2(2*length(signal)-1) ?

I calculate the power spectral density (PSD) of the two signals by taking the FFT autocorrelation, and I want to compare the results. Since the signals have different lengths, I worry if nfft is not fixed, this would make the comparison really difficult!

+4
source share
2 answers

There is no inherent reason to use force two (this may make processing more effective in some circumstances).

However, in order to make the FFT of two different signals “comparable”, you really need to lay one or more (or both) signals at the same length to their FFT.


However, I feel obligated to say: if you need to ask about this, then you are probably not at the point of the DSP learning curve where you can do anything useful with the results. You should get a decent book on DSP theory, for example. this .

+3
source

Most modern FFT implementations (including FFTW-based MATLAB) now rarely require filling the time series of a signal with a length equal to the power of two. However, almost all implementations will offer better, and sometimes much better, performance for FFT data vectors with a power of 2 lengths. For MATLAB in particular, retreating to degree 2 or in length with many low basic ratios will give you better performance (N = 1000 = 2 ^ 3 * 5 ^ 3 would be excellent, N = 997 would be a terrible choice).

Zero-padding does not increase the frequency resolution in your PSD, however it reduces the size of the buffer in the frequency domain. Therefore, if you add NZeros to a signal vector of length N, now FFT will output a vector of length (N + NZeros) / 2 + 1. This means that each frequency bit will now have a width:

Bean Width (Hz) = F_s / (N + NZeros)

Where F_s is the sampling frequency of the signal.

If you find that you need to separate or identify two closely spaced spaces in the frequency domain, you need to increase your sample time . You will quickly find that zero filling does not bring you anything for this purpose - and intuitively what we expect. How can we expect more information in our power spectrum without adding additional information (longer time series) at our input?

Best

Floor

+3
source

Source: https://habr.com/ru/post/1416235/


All Articles