LabVIEW 2015 Help | |

LabVIEW 2016 Help | |

LabVIEW 2017 Help | |

LabVIEW 2018 Help | |

LabVIEW 2019 Help |

**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.

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 (V_{rms}^{2}). 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. |

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 (V_{rms}^{2}). 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. |

The **Power Spectrum** *S*_{xx}(*f*) of a function *x*(*t*) is defined as

*S*_{xx}(*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 *S*_{xx} 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* = 2^{m}

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 2^{23} (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 2^{22} – 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

|*Y*_{n –i}|^{2} = |*Y*_{–i}^{2}|.

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

Power in the *i*^{th} harmonic = 2|*Y*_{i}|^{2} = |*Y*_{i}|^{2} + |*Y*_{n – 1}|^{2} 0 < *i* < *n*/2

The total power in the DC and Nyquist components are |*Y*_{0}|^{2} and |*Y*_{n/2}|^{2} respectively.

If *n* is even, let . The following table shows the format of the output sequence *S*_{xx} corresponding to the **Power Spectrum**.

Array Element | Interpretation |
---|---|

Sxx_{0} | Power in DC component |

Sxx_{1} = Sxx_{(n – 1)} | Power at frequency f |

Sxx_{2} = Sxx_{(n – 2)} | Power at frequency 2f |

Sxx_{3} = Sxx_{(n – 3)} | Power at frequency 3f |

Sxx_{(k – 2)} = Sxx_{n – (k – 2)} | Power at frequency (k – 2)f |

Sxx_{(k – 1)} = Sxx_{n – (k – 1)} | Power at frequency (k – 1)f |

Sxx_{k} | Power 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 *S*_{xx} corresponding to the **Power Spectrum**.

Array Element | Interpretation |
---|---|

Sxx_{0} | Power in DC component |

Sxx_{1} = Sxx_{(n – 1)} | Power at frequency f |

Sxx_{2} = Sxx_{(n – 2)} | Power at frequency 2f |

Sxx_{3} = Sxx_{(n – 3)} | Power at frequency 3f |

Sxx_{(k – 2)} = Sxx_{n – (k – 2)} | Power at frequency (k – 2)f |

Sxx_{(k – 1)} = Sxx_{n – (k – 1)} | Power at frequency (k – 1)f |

Sxx_{k} = Sxx_{n – k} | Power 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.

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

- DC Centered Spectrum VI: labview\examples\Signal Processing\Spectral Analysis
- Generalized Fourier Spectrum VI: labview\examples\Signal Processing\Transforms
- FFT and Power Spectrum Units VI: labview\examples\Signal Processing\Transforms

Helpful

Not Helpful