RF Measurement Devices

cancel
Showing results for 
Search instead for 
Did you mean: 

Error in LavVIEW Documentation?

Hello,
 
I'm unclear on a point made in an NI document on frequency analysis at:
 
 
In this document, Figure 1 shows the 2-sided power spectrum of two tones.  However, for a 2-sided spectrum, shouldn't baseband tones be an equal number of Hz above and below DC (i.e. positive and negative frequencies)? 
 
As shown, the signals in Figure 1 appear to be a double-side-band suppressed carrier signal...don't they?
 
This apparent discrepancy has be perpelxed...please help.
 
Best Regards,
Chris

0 Kudos
Message 1 of 4
(7,017 Views)
Hi Chris,

If you read in the section Converting from a Two-Sided Power Spectrum to a Single-Sided Power Spectrum, an explanation of the data returned for the two-sided spectrum is provided:

Most real-world frequency analysis instruments display only the positive half of the frequency spectrum because the spectrum of a real-world signal is symmetrical around DC.  Thus, the negative frequency information is redundant.  The two-sided results from the analysis functions include the positive half of the spectrum followed by the negative half of the spectrum, as shown in Figure 1.

In a two-sided spectrum, half the energy is displayed at the positive frequency, and half the energy is displayed at the negative frequency.  Therefore, to convert from a two-sided spectrum to a single-sided spectrum, discard the second half of the array and multiply every point except for DC by two.


The power spectrum is computed from the basic FFT function, as shown in Equation B of this document (linked at the bottom of the Developer Zone article).

Regards,
Andrew W
National Instruments
0 Kudos
Message 2 of 4
(7,002 Views)
Hello Andrew W.,
 
Thanks for the reply.  I understand converting the power from two-sided to single-sided.  What I don't quite understand is the frequencies at which the tones show up, in Figure 1.
 
1. If the tones are 128Hz and 256Hz, shouldn't the 2-sided spectrum have -256Hz, -128Hz, +128Hz, +256Hz?
 
2. How (mathematically) are the FREQUENCIES (i.e. not magnitudes) translated from the 2-sided to the 1-sided spectrum?  Are the positive frequencies simply the tones of interest (i.e. +128Hz and +256Hz) and the negative frequencies the Nyquist critical freq - the negative frequencies (i.e. (sample_freq/2) - 128Hz and (sample_freq/2)-256Hz)?
 
Thanks in advance for your help.
 
Chris 

Message Edited by chassan on 10-26-2007 04:02 PM

Message Edited by chassan on 10-26-2007 04:03 PM

0 Kudos
Message 3 of 4
(6,999 Views)
Hi Chris,

Hopefully I can answer all of your questions with a LabVIEW VI.  I have attached a VI written in LabVIEW 8.0, but included screenshots of the block diagram and front panel as well.  As a demonstration, I provide a 150Hz sine wave into the various power spectrum analysis VIs.  The top 2 plots on the front panel are the two-sided power spectrum before and after an FFT shift is implemented.  The algorithm used to shift the power spectrum comes from this document.  The bottom left plot is the output from the FFT Power Spectrum.vi that takes care of all these steps in one shot.  The bottom right plot is a DC-centered plot of the two-sided, shifted power spectrum.  Let me know if you have any other questions.





Regards,
Andrew W

Message Edited by TheWoost on 10-26-2007 06:22 PM

Message Edited by TheWoost on 10-26-2007 06:25 PM

Message Edited by TheWoost on 10-26-2007 06:27 PM

Download All
0 Kudos
Message 4 of 4
(6,990 Views)