Table Of Contents

FFT Power Spectrum and PSD (Power Spectrum » Single-shot) (G Dataflow)

Version:
    Last Modified: January 9, 2017

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

    connector_pane_image
    datatype_icon

    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.

    datatype_icon

    single-sided

    A Boolean specifying whether this node computes the single-sided or double-sided power spectrum.

    True Computes the single-sided power spectrum.
    False Computes the double-sided power spectrum.

    Default: False

    datatype_icon

    error in

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

    Default: No error

    datatype_icon

    dt

    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

    datatype_icon

    power spectrum

    Power spectrum of the input signal. If the input signal is in volts (V), the units of this output is volts-rms squared (Vrms2). If the input signal is not in volts, the units of this output is the input signal unit-rms squared.

    datatype_icon

    error out

    Error information. The node produces this output according to standard error behavior.

    datatype_icon

    df

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

    Algorithm for Computing the Power Spectrum

    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 x x = | F { X } | 2 n 2

    where

    • x is the input signal
    • Sxx 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 , 2 , 3 , ... , 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 223 (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 222 - 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.

    | Y n i | 2 = | Y i 2 |

    You can interpret the power in the (n - i)th element of Y as the power in the -ith element of the sequence, which represents the power in the -ith harmonic. You can find the total power for the ith harmonic (excluding DC and Nyquist components) by using the following equation.

    Power in the i t h 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 k = n 2 . The following table shows the format of the output sequence Sxx 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
    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 = n 1 2 . The following table shows the format of the output sequence Sxx 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
    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


    Recently Viewed Topics