FFT Spectrum (Mag-Phase » Single-shot) (G Dataflow)

Version:

Computes the single-sided, scaled amplitude spectrum of a time-domain signal.

unwrap phase

A Boolean specifying whether to unwrap the phase.

 True Unwraps the phase. False Does not unwrap the phase.

Unwrapping eliminates discontinuities that have an absolute value greater than pi.

Default: False

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 in

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

Default: No error

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

magnitude

The magnitude of the single-sided power spectrum.

phase

The single-sided amplitude spectrum phase, in radians.

error out

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

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 Amplitude Spectrum

To compute the single-sided, scaled amplitude spectrum, this node first uses the following equation to compute the two-sided amplitude spectrum:

$\begin{array}{cc}A\left(i\right)=\frac{X\left(i\right)}{N}& i=0,\text{\hspace{0.17em}}1,\text{\hspace{0.17em}}...,\text{\hspace{0.17em}}N-1\end{array}$

where

• A is the two-sided amplitude spectrum
• X is the discrete Fourier transform of signal
• N is the number of points in signal

Then, this node uses the following equation to convert the two-sided amplitude spectrum to the single-sided amplitude spectrum:

$B\left(i\right)=\left\{\begin{array}{cc}A\left(0\right)& i=0\\ \sqrt{2}A\left(i\right)& i=1,\text{\hspace{0.17em}}2,\text{\hspace{0.17em}}...,\text{\hspace{0.17em}}⌊\frac{N}{2}-1⌋\end{array}$

where B is the single-sided amplitude spectrum and is the floor operation.

This node computes the magnitude of the single-sided amplitude spectrum B as magnitude = B and the phase as phase(B).

Where This Node Can Run:

Desktop OS: Windows

FPGA: Not supported