LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Power Spectral Density amplitude is about 1e6 times larger than what it should be

Solved!
Go to solution

Hi,

 

I'm using Power Spectral Density (PSD) vi and Power spectrum vi to process the same time signal acquired  by DAQ (block diagram attached). I sent in a 0.1V 1kHz sinusoidal signal into DAQ, and the Power spectrum gives me the right RMS power at 1kHz (which is 0.05), however the PSD vi gives me 1670, which is just not right. The amplitude PSD gives me should be smaller than the amplitude Power spectrum gives me. This is supposed to be a simple processing but it is driving me crazy. Can somebody please help me resolve this issue?

Thank you very much.

Chuming

Download All
0 Kudos
Message 1 of 10
(4,160 Views)

Hi Chuming,

 

welcome to the forum!

 

As usual for requests like yours the answer is: Please attach a real VI with real example data. We cannot debug images!

Best regards,
GerdW


using LV2016/2019/2021 on Win10/11+cRIO, TestStand2016/2019
Message 2 of 10
(4,129 Views)

What's your FFT bin width? Why haven't you wired all the inputs? e.g. Sample rate into the calculations?

Message 3 of 10
(4,114 Views)
Why are you converting to DBL instead of the waveform data type that the functions expect?
Message 4 of 10
(4,099 Views)

Hi,

 

Thanks for the quick reply. I'm attaching my program. Thank you very much. In this program, I included the calculation with sampling rate, frequency bin size and everything here, which I didn't include before. I also take the squre root of both result to see the result more directly. The input is an 0.1V 1kHz sin signal and Power spectrum gives me the right amplitude but PSD gives me 3300 V/sqrt(Hz) which is too high. Please help.

Thank you very much.

Chuming

0 Kudos
Message 5 of 10
(4,072 Views)
Solution
Accepted by Chuming

If you convert the (Evil) Dynamic Data Type coming from the DAQ Assistant to an array of waveforms, the sampling rate information shouldbe included and none of your extra calculations should be required because the Power Sprctrum and PSD VIs will take care of that.. This is what Dennis referred to in his post.

 

We cannot do much without data. Please chage to waveform data type and add an indicator Array of Waveform. Run the VI until the indicator has data. Stop the VI. From the Edit menu select Make Current Values Default. Save that VI, possible with a different name, and post it. Then we will have access to your data.

 

Lynn

 

PSD.png

Message 6 of 10
(4,056 Views)

Hi Lynn,

 

Thanks for the reponse. The reason I used DBL instead of waveform is two-fold. 1. I have two channels of data for me to do FRF transfer function later. 2. I would like to save both PS and PSD data. I'm attaching the complete file in my dropbox and shared here because of the size limit. Thank you very much!

https://www.dropbox.com/sh/f36v3zbemnwcwm4/AABYnOjeEkfLzHSmIyg7kVOoa?dl=0

Chuming

0 Kudos
Message 7 of 10
(4,035 Views)

I have not dug into your math but when I take the data, convert it to a waveform, and send that to the FFT Power Spectral Density.vi, I get a peak PSD value af about 1.7 mV per root Hz at 2 kHz.

 

It is so easy to use the waveform datatype and the VIs which accept it automatically do all the scaling for you.

 

I recommend that you use waveforms for these calculations and arrays for the others if necessary. Newer versions of LV have FRF functions which accept waveforms. As they are in the same palette as the spectrum VIs you are using, your version may have them also. I have attached the modifications I made.  When I saved for previous version I got several warnings so some things may not convert correctly.  All the graphs have been cleared and the empty graphs saved as default. This way only one copy of the data exists (about 3 MB) and the main VI is much smaller.

 

Lynn

Download All
Message 8 of 10
(3,999 Views)

Hi Lynn,

 

Thank you so much. It looks like PSD module does require the waveform data input. Interestingly, Power spectrum doesn't

Thank you! 

Chuming

0 Kudos
Message 9 of 10
(3,964 Views)
The Context Help shows you the expected data type. The red dots on the inputs is an indication that the input is being coerced to something else.
0 Kudos
Message 10 of 10
(3,953 Views)