LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

what is the output on the FFT PSD function?

I am trying to evaluate the FFT PSD function relative to frequency. I expect f(0) = the variance of all signals, but that is not what is given. Does anyone have any information about this. I ran a test array with a 1 Hz sin wave, with 10 samples/second, 120 total data points--the FFT PSD gives f(0)=0.
0 Kudos
Message 1 of 7
(3,682 Views)
 

Hi,

The LabVIEW help file gives the following information concerning this function:

The FFT Power Spectral Density VI completes the following steps to compute power spectral density.

  1. Computes the FFT of time signal.
  2. Forms the power spectral density of time signal.
  3. Averages the current power spectral density with the power spectral densities computed by the VI since the last time the averaging process was restarted.
  4. Returns the averaged power spectral density in power spectral density

The single-channel version of this VI can perform single-channel measurements in both one-shot mode, meaning a single call, and continuous mode, meaning multiple calls with history. The single-channel version can perform multichannel measurements only in one-shot mode. If you want to make multichannel measurements in continuous mode, use the multichannel version of this VI.

The single-channel version of this VI maintains internal state information for a single channel only. Calling the single-channel version to process another channel without using the restart averaging control to clear the history results in an unexpected behavior of this VI. The unexpected behavior results from the VI passing the internal state information from one channel to another.

  Note  The single-channel version of this VI is primarily intended for continuous processing of a single channel. Do not generalize this behavior to the multichannel case and use the single-channel version in a For Loop to continuously process multiple channels by indexing an array of waveforms. Refer to the examples\measure\maxmpl.llb and the examples\analysis\measxmpl.llb for examples of how to use a multichannel version of a VI like the FFT Power Spectral Density VI in a loop.

Refer to the Noise Waveforms and PS Density VI in the labview\examples\measure\maxmpl.llb for an example of using the FFT Power Spectral Density VI.

Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 2 of 7
(3,664 Views)
Thanks, Amanda. But our problem is with the content of the output in the PSD vector. According to the help file, the zeroth item should contain the DC component of the PSD, which is equal to the variance. The first item should contain the power at f0, the second item the power at f0+df, etc. In our hands, the zeroth element of the output of PDS is not the variance. With real stationary but noisy data, we get a huge number, five orders of magnitude higher than the sum of all the other powers (it should equal the sum, as I understand). The first element is also five orders of magnitude higher than every other. So, we did a test with a pure (computed) sine wave, where the amplitude was 1.0. Instead of giving a DC component of 0.5 (=var(sin(2*pi*omega))), the zeroth element was 0.0. The rest of the PSD looked good, with a peak at 1 Hz as we had expected. Is there a common bug or misunderstanding that Chris and I are hung up on?
 
0 Kudos
Message 3 of 7
(3,658 Views)
We carried out another test with a pure triangle wave and the PSD output seemed reasonable: peaked at the expected frequency when we took the zeroth element to be the DC component. Most importantly, the zeroth and first elements were not sky-high like we always seem to get with real data. We did get anomalous results when we used df=1 Hz for some reason, but other values of df seemed correct.
I suspect now that I misunderstood the meaning of DC component; perhaps it is not equal to the variance of the raw trace and the integral under the PSD, like I thought theory said.
0 Kudos
Message 4 of 7
(3,639 Views)

Hi,

Do you have your VI set up to take the following piece of information into consideration?

Calling the single-channel version to process another channel without using the restart averaging control to clear the history results in an unexpected behavior of this VI. The unexpected behavior results from the VI passing the internal state information from one channel to another."

 

 

Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 5 of 7
(3,624 Views)
Thank you. That helped. And by using flat and sloping sine and triangle waves, we have begun to realize that its probably sloping data that was giving us high numbers in the zeroth and first PSD elements. Also, we realize that it is crucial that several cycles of the lowest frequency components be included in the fft. Otherwise, they look like a slope.
0 Kudos
Message 6 of 7
(3,605 Views)
Great. Thanks for sharing! I'm glad your application is going well.
Amanda Howard
Americas Services and Support Recruiting Manager
National Instruments
0 Kudos
Message 7 of 7
(3,593 Views)