LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to plot power spectrum vs frequency

 

I want to do FFT of a signal to get a plot of its power spectrum vs frequency. I tried to create a function using spectral measurements in signal analysis in the function palette. However, it shows a plot of power vs time. I need to find the PSD at a particular value of frequency. How can I do that?

 

Also when defining the properties of DAQ assistant they ask for a Rate and Samples to read... What exactly is this rate? 

 

I have an analog signal and I want to find its power spectrum and the peak value at a particular frequency..

 

How should I set these parameters?

0 Kudos
Message 1 of 5
(10,331 Views)

There are several examples available.  From Help go Find Examples...   Do a search on PSD.  There is an example which uses the Advanced Signal Processing Toolkit.  So depends whether you have the Developer Suite.  Search on Power and you will find an example called Power Spectrum Measurement.vi  That uses the FFT Power Spectrum and PSD vi which is in basic LabVIEW.  The output is the PSD vs Frequency as you require. 

I don't use the DAQ assistant so someone else may be able to advise on that.

0 Kudos
Message 2 of 5
(10,323 Views)
The ' time' on the x axis is just the default label. Change it to whatever you want. Rate is exactly what the help explains for data acquisition. Usually expressed as samples per second.
0 Kudos
Message 3 of 5
(10,319 Views)

if rate is samples per second then why do they ask for samples to read. Shouldn't it be dependent on rate?

 

If i need a graph that first takes average of 128 samples and then find its fourier transform then what should my parameters be?

 

Should the rate be 128 or samples to read be 128?

 

0 Kudos
Message 4 of 5
(10,289 Views)

The rate you want is dependent on the signal you want to capture. Select a rate that is about 10 times the frequency of the input signal. The number of samples then is how long your capture is. Set a rate of 1000 Samples/sec and request 500 samples, you will have .5 seconds worth of data.

 

If you want to take an average of 128 samples, then the number of samples to read would be 128. A graph does not an average and does not find a fourier transform. A graph is for displaying those operations.

0 Kudos
Message 5 of 5
(10,284 Views)