Main Content

power_fftscope

Fourier analysis of simulation data signals

Description

FFTDATA = power_fftscope(ScopeData) returns the FFT results for the signal saved in the ScopeData structure-with-time.

FFTDATA = power_fftscope(FFTDATA) uses the FFTDATA structure as a template variable to modify analysis settings and signal selection, and to perform FFT analysis. The power_fftscope function ignores any user-defined FFTDATA fields that are not listed in the FFTDATA structure.

power_fftscope(ScopeData) plots the FFT analysis results for the last simulation cycle of the signal saved in the ScopeData variable.

power_fftscope(FFTDATA) plots the FFT analysis results for the signal options specified in the FFTDATA structure.

Input Arguments

collapse all

Signal you want to perform the Fourier analysis on, specified as a structure with time.

Signal options, specified as a structure with these fields:

FieldDescription
timeThe time vector of the simulation data signal saved in the ScopeData variable.
signalsThe signals saved in the ScopeData variable.
blockNameThe name of the Scope block associated with the ScopeData variable.
inputThe input signal of the selected simulation data variable.
signalThe index of the selected input signal specified by the Input field.
startTimeThe start time of the FFT window.
cyclesThe number of cycles of the FFT window.
fundamentalThe fundamental frequency of the analyzed signal.
maxFrequencyThe maximum frequency evaluated by the FFT analysis.
THDmaxFrequencyThe maximum frequency for the total harmonic distortion (THD) calculation. Set the value to inf to calculate the THD at the Nyquist frequency.
FFTdataThe analyzed signal (FFT window data).
THDbaseThe base used to compute the THD. Set to fund to normalize the THD with respect to fundamental value. Set the THDbase to DC to normalize the THD with respect to the DC component value.
freqAxisThe type of frequency axis of the FFT analysis plot. Set to hertz to display the frequency axis in hertz. Set to harmonicorder to display the frequency axis in harmonic orders.
magThe computed magnitude of FFT.
phaseThe computed phase of FFT.
freqThe frequency vector.
THDThe computed THD for the analyzed signal. The THD calculation includes all the inter-harmonics of the selected input signal.
samplingTimeThe sampling time of the selected input signal.
samplePerCycleThe number of samples per cycle of the selected input signal.
DCcomponentThe DC component value of the selected input signal.
magFundamentalThe fundamental component value of the selected input signal.

Output Arguments

collapse all

FFT results for the signal saved in the ScopeData argument, returned as a structure with these fields:

FieldDescription
timeThe time vector of the simulation data signal saved in the ScopeData variable.
signalsThe signals saved in the ScopeData variable.
blockNameThe name of the Scope block associated with the ScopeData variable.
inputThe input signal of the selected simulation data variable.
signalThe index of the selected input signal specified by the Input field.
startTimeThe start time of the FFT window.
cyclesThe number of cycles of the FFT window.
fundamentalThe fundamental frequency of the analyzed signal.
maxFrequencyThe maximum frequency evaluated by the FFT analysis.
THDmaxFrequencyThe maximum frequency for the total harmonic distortion (THD) calculation. Set the value to inf to calculate the THD at the Nyquist frequency.
FFTdataThe analyzed signal (FFT window data).
THDbaseThe base used to compute the THD. Set to fund to normalize the THD with respect to fundamental value. Set the THDbase to DC to normalize the THD with respect to the DC component value.
freqAxisThe type of frequency axis of the FFT analysis plot. Set to hertz to display the frequency axis in hertz. Set to harmonicorder to display the frequency axis in harmonic orders.
magThe computed magnitude of FFT.
phaseThe computed phase of FFT.
freqThe frequency vector.
THDThe computed THD for the analyzed signal. The THD calculation includes all the inter-harmonics of the selected input signal.
samplingTimeThe sampling time of the selected input signal.
samplePerCycleThe number of samples per cycle of the selected input signal.
DCcomponentThe DC component value of the selected input signal.
magFundamentalThe fundamental component value of the selected input signal.

Version History

Introduced before R2006a

See Also