LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

FFT and Tone Measurements

Does the Express VI, Spectral Measurements and the Extract Multiple Tone Information VI return the same data?  The express VI displays the information in dB and the Extract Multiple Tone Information VI returns the amplitude in volts.  The issue is that the amplitude don't seem to match.  I am using 20log(volts) to convert to dB.  The chart shows about -14 dB and the Extract Multiple Tone Information VI returns -27 dB (volts convert to dB).
 
Any help is appreciated,
 
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 1 of 9
(4,892 Views)


@mfitzsimons wrote:
Does the Express VI, Spectral Measurements and the Extract Multiple Tone Information VI return the same data?  The express VI displays the information in dB and the Extract Multiple Tone Information VI returns the amplitude in volts.  The issue is that the amplitude don't seem to match.  I am using 20log(volts) to convert to dB.  The chart shows about -14 dB and the Extract Multiple Tone Information VI returns -27 dB (volts convert to dB).
 
Any help is appreciated,
 


Spectral measurements can be configured to show the output in linear values.  When I do that and get the magnitude (peak), the values match.  If I reconfigure it to result in dBs, it is correctly calculated.  This is with a square wave input so that I know what to expect. 

With real-world data, you might have a frequency that is binned differently depending on the sampling frequency, the number of points sampled, etc.  Perhaps that is causing the error to show up.

I know, not a good answer, but hey, I'm trying.Smiley Wink

Hope that this helps,
Bob Young

Message 2 of 9
(4,892 Views)

See attached VI in LabVIEW 8.0 to see what I am talking about.

First tone is at 298.9 Hz at 486.792 milliVolts
20 log(.486792) = -6.253 dB
But Chart is showing about -18 dB

What is the difference????

 

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 3 of 9
(4,885 Views)

Bob,

I gave you 5 stars for the effort!  Simulated data shows same issue.

Matt

Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 4 of 9
(4,885 Views)
You are calculating a power spectal density in the spectral measurements Express VI.  If you configure it to calculate the spectral measurement magnitude (peak) the values will match.  The difference from the help file is:
  • Magnitude (peak)—Measures the spectrum and displays the results in terms of peak amplitude. You typically use this measurement with more advanced measurements that require magnitude and phase information. The magnitude of the spectrum is measured in peak values. For example, a sine tone of amplitude A yields a magnitude spectral value of A at the sine tone frequency. You can unwrap the phase spectrum or convert it from radians to degrees by setting Phase to Unwrap phase or Convert to degree, respectively. If you place a checkmark in the Averaging checkbox, the phase of the spectrum is zero for averaging.
  • Power spectral density—Measures the spectrum and displays the results in terms of power spectral density (PSD). Power spectral density is a scaled version of Power spectrum, where the power present within each spectral bin is normalized by the frequency bin width. You typically use this measurement to examine the noise floor of a signal or the power in a specific frequency range. Normalizing the power spectrum by the bin width makes this measurement independent of the signal duration, or number of samples.
So, they are the same if they are the same.

Hope that this helps,
Bob Young

Message 5 of 9
(4,879 Views)
Bob,
 
I still don't think is is working correctly even after changing to Peak Mode.  Look at the attached image and let me know what you think.
 
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
Download All
0 Kudos
Message 6 of 9
(4,850 Views)
Here is a better quality image
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 7 of 9
(4,848 Views)
Matthew,

The two representations of the data are actually showing the same data though it does not appear that way from the graph. The problem lies in the fact that the waveform graph showing your spectrum is actually plotting one point every 10Hz. This is not apparent until you zoom in on a region and change the common plots option to show individual points that are then connected. The cursors on the graph actually show this as well; you will notice that the step size is 10Hz. Take a look at the attached VI and move the cursor to see what I am talking about.

This leads into why we see a discrepancy: the Extract Multiple Tone Information VI is calculating the peaks that exist even between those 10Hz steps shown on the plot. For an application that requires precise calculation of those peaks, this VI would give the best results. If you would like to find only those peaks that are displayed on the graph, you can convert the dynamic data that is plotted to an array. With this array you can then create an algorithm that finds the x highest elements and returns those as the peak values. I hope this helps!

Mike
National Instruments
Applications Engineer

Message 8 of 9
(4,827 Views)
Thanks!  5-Star response.
Matthew Fitzsimons

Certified LabVIEW Architect
LabVIEW 6.1 ... 2013, LVOOP, GOOP, TestStand, DAQ, and Vison
0 Kudos
Message 9 of 9
(4,821 Views)