﻿

# Power Spectrum VI

LabVIEW 2011 Help

Edition Date: June 2011

Part Number: 371361H-01

»View Product Info

Owning Palette: Spectral Analysis VIs

Requires: Full Development System

Computes the Power Spectrum, Sxx, of the input sequence X. Wire data to the X input to determine the polymorphic instance to use or manually select the instance.

Use the pull-down menu to select an instance of this VI.

 Select an instance Power Spectrum (DBL)Power Spectrum (CDB)

## Power Spectrum (DBL)

 X is the input sequence. Power Spectrum returns the double-sided power spectrum of X. If the input signal is in volts (V), Power Spectrum has units of volts-rms squared (Vrms2). If the input signal is not in volts, Power Spectrum has units of the input signal unit-rms squared. error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

## Power Spectrum (CDB)

 X is the complex valued input sequence. Power Spectrum returns the double-sided power spectrum of X. If the input signal is in volts (V), Power Spectrum has units of volts-rms squared (Vrms2). If the input signal is not in volts, Power Spectrum has units of the input signal unit-rms squared. error returns any error or warning from the VI. You can wire error to the Error Cluster From Error Code VI to convert the error code or warning into an error cluster.

## Power Spectrum Details

The Power Spectrum Sxx(f) of a function x(t) is defined as

Sxx(f) = X*(f)X(f) = |X(f)|2,

where X(f) = F{x(t)}, and X* (f) is the complex conjugate of X(f).

The Power Spectrum VI uses the FFT and DFT routines to compute the power spectrum, which is given by

where Sxx represents the output sequence Power Spectrum, and n is the number of samples in the input sequence X.

When the number of samples, n, in the input sequence X is a valid power of 2

n = 2m

for m = 1, 2, 3, …, 23,

the Power Spectrum VI computes the fast Fourier transform of a real-valued sequence using the a fast radix-2 FFT algorithm and efficiently scales the magnitude square. The largest Power Spectrum the VI can compute using the FFT is 223 (8,388,608 or 8M).

When the number of samples in the input sequence X is not a valid power of 2 but is factorable as the product of small prime numbers, the Power Spectrum VI computes the discrete Fourier transform of a real-valued sequence using an efficient DFT algorithm and scales the magnitude square. The largest Power Spectrum the VI can compute using the fast DFT is 222 – 1(4,194,303 or 4M – 1).

Let Y be the Fourier transform of the input sequence X and n be the number of samples in it. You can show that

|Yn i|2 = |Yi2|.

You can interpret the power in the (n – 1)th element of Y as the power in the –ith element of the sequence, which represents the power in the –ith harmonic. You can find the total power for the ith harmonic (DC and Nyquist component not included) using

Power in the ith harmonic = 2|Yi|2 = |Yi|2 + |Yn – 1|2   0 < i < n/2

The total power in the DC and Nyquist components are |Y0|2 and |Yn/2|2 respectively.

If n is even, let . The following table shows the format of the output sequence Sxx corresponding to the Power Spectrum.

Array Element Interpretation
Sxx0Power in DC component
Sxx1 = Sxx(n – 1)Power at frequency f
Sxx2 = Sxx(n – 2)Power at frequency 2f
Sxx3 = Sxx(n – 3)Power at frequency 3f
Sxx(k – 2) = Sxxn – (k – 2)Power at frequency (k – 2)f
Sxx(k – 1) = Sxxn – (k – 1)Power at frequency (k – 1)f
SxxkPower in Nyquist harmonic

The following illustration represents the preceding table information.

Notice that the power spectrum is symmetric about the Nyquist frequency as the following illustration shows.

If n is odd, let . The following table shows the format of the output sequence Sxx corresponding to the Power Spectrum.

Array Element Interpretation
Sxx0Power in DC component
Sxx1 = Sxx(n – 1)Power at frequency f
Sxx2 = Sxx(n – 2)Power at frequency 2f
Sxx3 = Sxx(n – 3)Power at frequency 3f
Sxx(k – 2) = Sxxn – (k – 2)Power at frequency (k – 2)f
Sxx(k – 1) = Sxxn – (k – 1)Power at frequency (k – 1)f
Sxxk = SxxnkPower at frequency kf

The following illustration shows that when n is odd, the power spectrum is symmetric about the Nyquist frequency, but the Nyquist frequency does not fall on a frequency bin.

The format described in the preceding tables is an accepted standard in digital signal processing applications.

## Examples

Refer to the following VIs for examples of using the Power Spectrum VI:

• DC Centered Spectrum VI: labview\examples\analysis\dspxmpl.llb
• Generalized Fourier Spectrum VI: labview\examples\math\sig_proc.llb
• power VI: labview\examples\viserver\plugins
• FFT and Power Spectrum Units VI: labview\examples\measure\maxmpl.llb

Your Feedback!  Poor  |  Excellent    Yes No
 Document Quality?