Owning Palette: Spectral Analysis VIs
Requires: Full Development System
Computes the single-sided, scaled amplitude spectrum of a real-valued time-domain signal and returns the amplitude spectrum as magnitude and phase.
Add to the block diagram | Find on the palette |
Signal specifies the input time-domain signal, usually in volts. The time-domain record must contain at least three cycles of the signal for a valid estimate. | |
unwrap phase, when TRUE, enables phase unwrapping on the output Amp Spectrum Phase. The default is TRUE. If unwrap phase is FALSE, this VI does not unwrap the output phase. | |
dt is the sample period of the time-domain signal, usually in seconds. Set dt to 1/fs, where fs is the sampling frequency of the time-domain signal. The default is 1. | |
Amp Spectrum Mag returns the magnitude of the single-sided power spectrum. If the input signal is in volts (V), Amp Spectrum Mag has units of volts-rms (Vrms). If the input signal is not in volts, Amp Spectrum Mag has units of the input signal unit-rms. | |
Amp Spectrum Phase is the single-sided amplitude spectrum phase in radians. | |
df is the frequency interval of the power spectrum in hertz, if dt is in seconds. |
The Amplitude and Phase Spectrum VI uses two steps to compute the single-sided, scaled amplitude spectrum.
First, this VI uses the following equation to compute the two-sided amplitude spectrum:
where A is the two-sided amplitude spectrum, X is the discrete Fourier transform of Signal, and N is the number of points in Signal.
Second, this VI uses the following equation to convert the two-sided amplitude spectrum to the single-sided amplitude spectrum:
where B is the single-sided amplitude spectrum, and is the floor operation.
Amp Spectrum Mag is the magnitude of the single-sided amplitude spectrum B, as shown in the following equation:
Amp Spectrum Mag = |B|
Amp Spectrum Phase is the corresponding phase in radians, as shown in the following equation:
Amp Spectrum Phase = phase(B)
df returns the frequency interval, which typically is used as the multiplier of the frequency axis in order to display the frequency domain.
Note If you specify the same inputs for this VI and the Auto Power Spectrum VI, Amp Spectrum Mag equals the square root of the Power Spectrum that the Auto Power Spectrum VI returns. |
Output Units for FFT-Based VIs
Refer to the following VIs for examples of using the Amplitude and Phase Spectrum VI: