From 1:00 AM - 6:00 AM CST on Saturday, January 23, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

From 1:00 AM - 6:00 AM CST on Saturday, January 23, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Version:

Last Modified: June 25, 2019

Calculates the power spectrum of a signal that is unevenly spaced in time.

The data material at the discrete- and unevenly-spaced times.

The discrete- and unevenly-spaced times.

Error conditions that occur before this node runs.

The node responds to this input according to standard error behavior.

Standard Error Behavior

Many nodes provide an **error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

**Default: **No error

The power spectrum, in the sense of the Lomb normalized periodogram.

The frequency points at which this node calculates the power spectrum.

Error information.

The node produces this output according to standard error behavior.

Standard Error Behavior

**error in** input and an **error out** output so that the node can respond to and communicate errors that occur while code is running. The value of **error in** specifies whether an error occurred before the node runs. Most nodes respond to values of **error in** in a standard, predictable way.

Given the data *x*_{k} at the time points *t*_{k}, the following equations define the data material **x** and the discrete- and unevenly-spaced times **x time**:

$x=\{{x}_{0},{x}_{1},\mathrm{...},{x}_{n-1}\}$

and

$\text{x times}=\{{t}_{0},{t}_{1},\mathrm{...},{t}_{n-1}\}$

Furthermore,

$\overline{x}=\frac{1}{n}\sum _{k=0}^{n-1}{x}_{k}$

and

${\sigma}^{2}=\frac{1}{n-1}\sum _{k=0}^{n-1}{({x}_{k}-\overline{x})}^{2}$

Then the Lomb normalized periodogram is defined by the following equation:

$p\left(\omega \right)=\frac{1}{2{\sigma}^{2}}(\frac{{\left[\sum _{k=0}^{n-1}({x}_{k}-\overline{x})\mathrm{cos}\omega ({t}_{k}-\tau )\right]}^{2}}{\sum _{k=0}^{n-1}{\mathrm{cos}}^{2}\omega ({t}_{k}-\tau )}+\frac{{\left[\sum _{k=0}^{n-1}({x}_{k}-\overline{x})\mathrm{sin}\omega ({t}_{k}-\tau )\right]}^{2}}{\sum _{k=0}^{n-1}{\mathrm{sin}}^{2}\omega ({t}_{k}-\tau )})$

with

$\tau =\frac{1}{2\omega}\mathrm{arctan}\left(\frac{\sum _{k=0}^{n-1}\mathrm{sin}2\omega {t}_{k}}{\sum _{k=0}^{n-1}\mathrm{cos}2\omega {t}_{k}}\right)$

The following diagram shows the spectrum of length 256 of a signal that has been sampled at unequal intervals of time. The signal is a combination of sine waves of frequencies 20, 40, 60, and 80 Hz. The duration of the signal is 1 sec. The sampling frequency was chosen as 256 Hz, giving the frequency resolution of 1 Hz.

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported

Web Server: Not supported in VIs that run in a web application