From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Example Code

Power Spectrum Measurements for Simulated Signal

Products and Environment

This section reflects the products and operating system used to create the example.

To download NI software, including the products shown below, visit ni.com/downloads.

    Software

  • LabVIEW

Code and Documents

Attachment

Overview

Power Spectral Measurements for a simulated signal.

 

 

Description

This example computes the averaged power spectrum of a simulated input signal. You can specify various averaging modes for your measurement, such as RMS averaging, vector averaging, or peak hold, as well as the number of averages. You can observe the influence of these averaging parameters, typically on the noise floor, and notice that vector averaging requires the use of a trigger in order to lower the noise floor without lowering the fundamental along with it. You also can specify the type of window to use in this measurement, such as a Hanning or Flat Top.

The power spectrum, also called the energy spectral density, uses windowing, averaging, and Fast Fourier Transforms (FFT) to describe the energy of a signal distributed across frequency. That is, the power spectrum captures the power of a signal per unit frequency. A clarifying method for seeing the capability of the power spectrum is to analyze a signal containing a known frequency but have noise and other components added to the signal. The power spectrum will capture the energy of the embedded periodic signal in relation to the other components such as noise, this is also known as the signal to noise ratio.

 

 

Requirements

LabVIEW 2012 (or compatible)

 

 

Steps to Implement or Execute Code
1. Set the amplitude and frequency at which you would like to have the signal.
2. Select the Window, and averaging parameters that you would like to apply to the signal.
3. Run the VI

 

 

Additional Information or References

Capture.PNG

Product Support Engineer
National Instruments

Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.