Table Of Contents

Cross Spectrum (Complex) (G Dataflow)

Version:
    Last Modified: January 9, 2017

    Computes the cross power spectrum of the signals.

    connector_pane_image
    datatype_icon

    signal x

    The first input sequence.

    This input accepts the following data types:

    • 1D array of double-precision, floating-point numbers.
    • 1D array of complex double-precision, floating-point numbers.
    datatype_icon

    signal y

    The second input sequence.

    This input accepts the following data types:

    • 1D array of double-precision, floating-point numbers.
    • 1D array of complex double-precision, floating-point numbers.
    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

    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

    cross spectrum

    The cross power spectrum of the input sequences.

    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 Calculating the Cross Power Spectrum

    The cross power, S x y ( f ) , of the signals x(t) and y(t) is defined as

    S x y ( f ) = X * ( f ) Y ( f )

    where

    • X*(f) is the complex conjugate of X(f)
    • X(f)=F{x(t)}
    • Y(f)=F{y(t)}

    This node uses the FFT or DFT routine to compute the cross power spectrum, which is given by

    S x y = 1 n 2 F * { X } F { Y }

    where Sxy represents the complex sequence cross spectrum and n is the number of samples that can accommodate input sequences signal x and signal y.

    The largest cross power that this node can compute by the FFT is 223 (8,388,608 or 8M).

    spd-note-note
    Note  

    Some textbooks define the cross power spectrum as S x y ( f ) = X ( f ) Y * ( f ) . If you prefer this definition of cross power to the one specified in this node, take the complex conjugate of the output sequence cross spectrum, because this node operates on the real and imaginary portions separately.

    How the Number of Samples Affects this Node

    When the number of samples in the inputs signal x and signal y are equal and are a valid power of 2, such that n = m = 2 k for k = 1, 2, 3,..., 23, this node makes direct calls to the FFT routine to compute the complex cross power sequence. This technique is efficient in both execution time and memory management because this node performs the operations in place.

    When the number of samples in the inputs signal x and signal y are not equal, this node first resizes the smaller sequence by padding it with zeros to match the size of the larger sequence. If this size is a valid power of 2, such that max ( n , m ) = 2 k for k = 1, 2, 3,..., 23, this node computes the cross power spectrum using the FFT. Otherwise, this node uses the slower DFT to compute the cross power spectrum. Thus, the size of the complex output sequence is defined by size = max ( n , m ) .

    Where This Node Can Run:

    Desktop OS: Windows

    FPGA: Not supported


    Recently Viewed Topics