FFT Spectrum (Mag-Phase) VI

FFT Spectrum (Mag-Phase) VI

FFT Spectrum (Mag-Phase) VI

Owning Palette: Waveform Measurements VIs

Installed With: Full Development System

Computes the averaged FFT spectrum of time signal. This VI returns the FFT results as magnitude and phase. Wire data to the time signal input to determine the polymorphic instance to use or manually select the instance.

Details  Example

Use the pull-down menu to select an instance of this VI.

 Place on the block diagram  Find on the Functions palette

FFT Spectrum (Mag-Phase) for 1 Chan

restart averaging specifies whether the VI restarts the selected averaging process. If restart averaging is TRUE, the VI restarts the selected averaging process. If restart averaging is FALSE, the VI does not restart the selected averaging process. The default is FALSE. When you call this VI for the first time, the averaging process restarts automatically. A typical case when you should restart averaging is when a major input change occurs in the middle of the averaging process.
time signal is the input time-domain waveform.
window is the time-domain window to apply to the time signal.

0Rectangle
1Hanning (default)
2Hamming
3Blackman-Harris
4Exact Blackman
5Blackman
6Flat Top
7Four Term Blackman-Harris
8Seven Term Blackman-Harris
9Low Sidelobe
11Blackman Nutall
30Triangle
60Kaiser
61Dolph-Chebyshev
62Gaussian
view defines how the different results from this VI are returned.
dB On specifies whether the magnitude results are expressed in decibels.
unwrap phase specifies whether to unwrap the phase. Unwrapping eliminates discontinuities that have an absolute value greater than pi. The default is FALSE, meaning the phase is not unwrapped. When unwrap phase is TRUE, the phase is unwrapped.
convert to degree specifies whether the phase results are converted from radians to degrees. The default is FALSE, which means that results are expressed in radians.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use exception control to treat what is normally an error as no error or to treat a warning as an error. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
averaging parameters is a cluster that defines how this VI computes the averaging.
averaging mode specifies the averaging mode.

0No averaging (default)
1Vector averaging
2RMS averaging
3Peak hold
weighting mode specifies the weighting mode for RMS and vector averaging.

0Linear
1Exponential (default)
number of averages specifies the number of averages used for RMS and vector averaging. If weighting mode is exponential, the averaging process is continuous. If weighting mode is linear, the averaging process stops after this VI computes the selected number of averages.
averaging done returns TRUE when averages completed is greater than or equal to the number of averages specified in averaging parameters. Otherwise, averaging done returns FALSE. averaging done is always TRUE if the selected averaging mode is No averaging.
magnitude returns the magnitude of the averaged FFT spectrum and the frequency scale.
f0 returns the start frequency, in hertz, of the spectrum.
df returns the frequency resolution, in hertz, of the spectrum.
magnitude is the magnitude of the averaged FFT spectrum. If the input signal is in volts (V), magnitude has units of volts-rms (Vrms). If the input signal is not in volts, magnitude has units of the input signal unit-rms.
phase returns the phase of the averaged FFT spectrum and the frequency scale.
f0 returns the start frequency, in hertz, of the spectrum.
df returns the frequency resolution, in hertz, of the spectrum.
phase is the phase, in radians, of the averaged FFT spectrum.
averages completed returns the number of averages completed by the VI at that time.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

FFT Spectrum (Mag-Phase) for N Chan

This VI applies the same averaging parameters settings to each waveform in time signals.

restart averaging specifies whether the VI restarts the selected averaging process. If restart averaging is TRUE, the VI restarts the selected averaging process. If restart averaging is FALSE, the VI does not restart the selected averaging process. The default is FALSE. When you call this VI for the first time, the averaging process restarts automatically. A typical case when you should restart averaging is when a major input change occurs in the middle of the averaging process.
time signals is the input array of time-domain waveforms.
window is the time-domain window to apply to the time signal.

0Rectangle
1Hanning (default)
2Hamming
3Blackman-Harris
4Exact Blackman
5Blackman
6Flat Top
7Four Term Blackman-Harris
8Seven Term Blackman-Harris
9Low Sidelobe
11Blackman Nutall
30Triangle
60Kaiser
61Dolph-Chebyshev
62Gaussian
view defines how the different results from this VI are returned.
dB On specifies whether the magnitude results are expressed in decibels.
unwrap phase specifies whether to unwrap the phase. Unwrapping eliminates discontinuities that have an absolute value greater than pi. The default is FALSE, meaning the phase is not unwrapped. When unwrap phase is TRUE, the phase is unwrapped.
convert to degree specifies whether the phase results are converted from radians to degrees. The default is FALSE, which means that results are expressed in radians.
error in describes error conditions that occur before this VI or function runs. The default is no error. If an error occurred before this VI or function runs, the VI or function passes the error in value to error out. This VI or function runs normally only if no error occurred before this VI or function runs. If an error occurs while this VI or function runs, it runs normally and sets its own error status in error out. Use the Simple Error Handler or General Error Handler VIs to display the description of the error code. Use exception control to treat what is normally an error as no error or to treat a warning as an error. Use error in and error out to check errors and to specify execution order by wiring error out from one node to error in of the next node.
status is TRUE (X) if an error occurred before this VI or function ran or FALSE (checkmark) to indicate a warning or that no error occurred before this VI or function ran. The default is FALSE.
code is the error or warning code. The default is 0. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source specifies the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning. The default is an empty string.
averaging parameters is a cluster that defines how this VI computes the averaging.
averaging mode specifies the averaging mode.

0No averaging (default)
1Vector averaging
2RMS averaging
3Peak hold
weighting mode specifies the weighting mode for RMS and vector averaging.

0Linear
1Exponential (default)
number of averages specifies the number of averages used for RMS and vector averaging. If weighting mode is exponential, the averaging process is continuous. If weighting mode is linear, the averaging process stops after this VI computes the selected number of averages.
averaging done returns TRUE when averages completed is greater than or equal to the number of averages specified in averaging parameters. Otherwise, averaging done returns FALSE. averaging done is always TRUE if the selected averaging mode is No averaging.
magnitudes is an array of magnitudes of the averaged FFT spectra, one per input waveform.
f0 returns the start frequency, in hertz, of the spectrum.
df returns the frequency resolution, in hertz, of the spectrum.
magnitude is the magnitude of the averaged FFT spectrum. If the input signal is in volts (V), magnitude has units of volts-rms (Vrms). If the input signal is not in volts, magnitude has units of the input signal unit-rms.
phases is an array of phases of the averaged FFT spectra, one per input waveform.
f0 returns the start frequency, in hertz, of the spectrum.
df returns the frequency resolution, in hertz, of the spectrum.
phase is the phase, in radians, of the averaged FFT spectrum.
averages completed returns the number of averages completed by the VI at that time.
error out contains error information. If error in indicates that an error occurred before this VI or function ran, error out contains the same error information. Otherwise, it describes the error status that this VI or function produces. Right-click the error out front panel indicator and select Explain Error from the shortcut menu for more information about the error.
status is TRUE (X) if an error occurred or FALSE (checkmark) to indicate a warning or that no error occurred.
code is the error or warning code. If status is TRUE, code is a nonzero error code. If status is FALSE, code is 0 or a warning code.
source describes the origin of the error or warning and is, in most cases, the name of the VI or function that produced the error or warning.

FFT Spectrum (Mag-Phase) Details

The FFT Spectrum (Mag-Phase) VI completes the following steps to compute magnitude and phase:

  1. Computes the FFT of time signal.
  2. Averages the current FFT spectrum of time signal with the FFT spectra computed by the VI since the last time the averaging process was reset.
  3. Returns the magnitude and phase of the averaged spectrum.

The single-channel version of this VI can perform single-channel measurements in both one-shot mode, meaning a single call, and continuous mode, meaning multiple calls with history. The single-channel version can perform multichannel measurements only in one-shot mode. If you want to make multichannel measurements in continuous mode, use the multichannel version of this VI.

The single-channel version of this VI maintains internal state information for a single channel only. Calling the single-channel version to process another channel without using the restart averaging control to clear the history results in an unexpected behavior of this VI. The unexpected behavior results from the VI passing the internal state information from one channel to another.

Note  The single-channel version of this VI is intended primarily for continuous processing of a single channel. Do not generalize this behavior to the multichannel case and use the single-channel version in a For Loop to continuously process multiple channels by indexing an array of waveforms.

Refer to the following VIs for examples of using a multichannel version of a VI like the FFT Spectrum (Mag-Phase) VI in a loop:

  • labview\examples\measure\maxmpl.llb

     Open examples  Browse related examples

  • labview\examples\analysis\measxmpl.llb

     Open examples  Browse related examples

Example

Refer to the Amplitude Spectrum (sim) VI in the labview\examples\analysis\measxmpl.llb for an example of using the FFT Spectrum (Mag-Phase) VI.

 Open example  Browse related examples