LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT problem if number of smaples is not power of 2

Hi, i have a problem w. labview 7.0: when computing the fft of a signal with the vi "real fft" the program "duplicates" the central part of the spectrum. The result is a central "step" with double magnitude... Do you know how to eliminate it? signals are already sampled, i just have to analyze the machanical impedance of a tool, and i need the frequency domain function in order to compute the impedance.
Here is attached the vi file and a jpg with the result of the file.
Can somebody help me?
Thanks
Marco
Download All
0 Kudos
Message 1 of 2
(2,826 Views)
If by "central part" of the spectrum you mean the center bin, that is the value of the spectrum array that is in the middle, you have to be careful how you interpret that value. Normally when you analyze a signal using FFT you should only use the spectral values that are below the Nyquist frequency (half the sample rate). I'll suggest you to use the high-level Power spectrum or FFT VI(s) in the main palette Analyze>>Waveform Measurements instead of the low-level FFT VI. These VIs do some "clean-up" for you and only return the relevant values.

If your number of samples is even (2*N) (not just only power of two), the value at index N (called Nyquist frequency) will be totally unreliable. Think of it as a sine tone that is sampled exactly twice per period. If yo
u are "unlucky", you may sample exactly at the zero-crossing points and the resulting value will be zero, or you could sample exactly at the positive/negative tops, in which case the value is maximum. So don't count on that value.

If the number of samples is odd (2*N+1), then the values at index N and N+1 will be equal in magnitude, (N-1) and (N+2) are also equal in magnitude and so on. Is this what you are seeing? If yes that is normal.

The VI you attached can not be open because it is missing sub-VI(s). Use the Save with Options features and select "Development Distribution", and remember to save default data if needed.
Message 2 of 2
(2,826 Views)