Version:

Last Modified: August 28, 2017

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,

$\stackrel{\xaf}{x}=\frac{1}{n}\underset{k=0}{\overset{n-1}{\sum}}{x}_{k}$

and

${\sigma}^{2}=\frac{1}{n-1}\underset{k=0}{\overset{n-1}{\sum}}{({x}_{k}-\stackrel{\xaf}{x})}^{2}$

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

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

with

$\tau =\frac{1}{2\omega}\mathrm{arctan}\left(\frac{\underset{k=0}{\overset{n-1}{\sum}}\mathrm{sin}2\omega {t}_{k}}{\underset{k=0}{\overset{n-1}{\sum}}\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: This product does not support FPGA devices

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