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
source share