Version:

Last Modified: January 9, 2017

Computes the single-sided or double-sided power spectrum of a time-domain signal.

The input time-domain signal, usually in volts.

This input can be a 1D array of double-precision floating-point numbers or a 1D array of complex double-precision floating-point numbers.

The time-domain record must contain at least three cycles of the signal for a valid estimate.

Error conditions that occur before this node runs. The node responds to this input according to standard error behavior.

**Default: **No error

The sample period of the time-domain signal, usually in seconds.

Set this input to 1/*fs*, where *fs* is the sampling frequency of the time-domain signal.

**Default: **1

Power spectrum of the input signal. If the input signal is in volts (V), the units of this output is volts-rms squared (Vrms^{2}). If the input signal is not in volts, the units of this output is the input signal unit-rms squared.

The frequency interval of the power spectrum. The unit of this output is Hz if the sample period is in seconds.

If **single-sided** is True, this node first computes the double-sided power spectrum, and then converts the power spectrum into a single-sided power spectrum.

This node uses the fast Fourier transform (FFT) and discrete Fourier transform (DFT) routines to compute the double-sided power spectrum, which is given by the following equation:

${S}_{xx}=\frac{{\left|F\left\{X\right\}\right|}^{2}}{{n}^{2}}$

where

*x*is the input**signal***S*_{xx}is the output sequence**power spectrum**-
*n*is the number of samples in the input**signal**

When the number of samples in the input signal is a valid power of 2, such that
$n={2}^{m}$ for
$m=1,\text{\hspace{0.17em}}2,3,\text{\hspace{0.17em}}\text{\hspace{0.17em}}\mathrm{...},\text{\hspace{0.17em}}23$, this node computes the fast Fourier transform of a real-valued sequence using the fast radix-2 FFT algorithm and efficiently scales the magnitude square. The largest **power spectrum** the node can compute using the FFT is 2^{23} (8,388,608 or 8M).

When the number of samples in the input signal is not a valid power of 2 but is factorable as the product of small prime numbers, this node 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 node 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 **signal** and *n* be the number of samples in it. Then the following equation is true.

${\left|{Y}_{n-i}\right|}^{2}=\left|{Y}_{-i}^{2}\right|$

You can interpret the power in the (*n* - *i*)^{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 (excluding DC and Nyquist components) by using the following equation.

$\begin{array}{cc}\text{Power in the}{i}^{th}\text{harmonic}=2{\left|{Y}_{i}\right|}^{2}={\left|{Y}_{i}\right|}^{2}+{\left|{Y}_{n-1}\right|}^{2}& 0<i<\frac{n}{2}\end{array}$

The total power in the DC and Nyquist components are ${\left|{Y}_{0}\right|}^{2}$ and ${\left|{Y}_{\frac{n}{2}}\right|}^{2}$ respectively.

If *n* is even, let
$k=\frac{n}{2}$. The following table shows the format of the output sequence *S*_{xx} corresponding to **power spectrum**.

Array Element of Double-Sided Spectrum | Array Element of Single-Sided Spectrum | Interpretation |
---|---|---|

${S}_{x{x}_{0}}$ | ${S}_{x{x}_{0}}$ | Power in DC component |

${S}_{x{x}_{1}}={S}_{x{x}_{(n-1)}}$ | ${S}_{x{x}_{1}}*2$ | Power at frequency Δf |

${S}_{x{x}_{2}}={S}_{x{x}_{(n-2)}}$ | ${S}_{x{x}_{2}}*2$ | Power at frequency 2Δf |

${S}_{x{x}_{3}}={S}_{x{x}_{(n-3)}}$ | ${S}_{x{x}_{3}}*2$ | Power at frequency 3Δf |

$\vdots $ | $\vdots $ | $\vdots $ |

${S}_{x{x}_{(k-2)}}={S}_{x{x}_{n-(k-2)}}$ | ${S}_{x{x}_{(k-2)}}*2$ | Power at frequency (k - 2)Δf |

${S}_{x{x}_{(k-1)}}={S}_{x{x}_{n-(k-1)}}$ | ${S}_{x{x}_{(k-1)}}*2$ | Power at frequency (k - 1)Δf |

${S}_{x{x}_{k}}$ | ${S}_{x{x}_{k}}$ | Power in Nyquist harmonic |

If *n* is odd, let
$k=\frac{n-1}{2}$. The following table shows the format of the output sequence *S*_{xx} corresponding to **power spectrum**.

Array Element of Double-Sided Spectrum | Array Element of Single-Sided Spectrum | Interpretation |
---|---|---|

${S}_{x{x}_{0}}$ | ${S}_{x{x}_{0}}$ | Power in DC component |

${S}_{x{x}_{1}}={S}_{x{x}_{(n-1)}}$ | ${S}_{x{x}_{1}}*2$ | Power at frequency Δf |

${S}_{x{x}_{2}}={S}_{x{x}_{(n-2)}}$ | ${S}_{x{x}_{2}}*2$ | Power at frequency 2Δf |

${S}_{x{x}_{3}}={S}_{x{x}_{(n-3)}}$ | ${S}_{x{x}_{3}}*2$ | Power at frequency 3Δf |

$\vdots $ | $\vdots $ | $\vdots $ |

${S}_{x{x}_{(k-2)}}={S}_{x{x}_{n-(k-2)}}$ | ${S}_{x{x}_{(k-2)}}*2$ | Power at frequency (k - 2)Δf |

${S}_{x{x}_{(k-1)}}={S}_{x{x}_{n-(k-1)}}$ | ${S}_{x{x}_{(k-1)}}*2$ | Power at frequency (k - 1)Δf |

${S}_{x{x}_{n-k}}$ | ${S}_{x{x}_{k}}*2$ | Power at frequency kΔf |

**Where This Node Can Run: **

Desktop OS: Windows

FPGA: Not supported