RealFFT2

Example demonstrating the use of an FFT calculation during simulation (and storing only amplitudes on file)

Information

This information is part of the Modelica Standard Library maintained by the Modelica Association.

This is the same example as Examples.RealFFT1 with the only difference that just the amplitudes of the FFT are stored on file (but not the phases).

Parameters (7)

f_max

Value: 4

Type: Frequency (Hz)

Description: Maximum frequency of interest

f_resolution

Value: 0.2

Type: Frequency (Hz)

Description: Frequency resolution

f1

Value: 2

Type: Frequency (Hz)

Description: Frequency of sine

f2

Value: 3

Type: Frequency (Hz)

Description: Frequency of cosine

FFT_resultFileName

Value: "RealFFT2_resultFFT.mat"

Type: String

Description: File where FFT will be stored as [f,A,Phi], with f in [Hz] and A the amplitudes and Phi the phases in [rad]

nfi

Value: max(1, min(integer(ceil(f_max / f_resolution)) + 1, nf))

Type: Integer

Description: Number of frequency points of the interested frequency range (only up to f_max)

fi

Value:

Type: Frequency[nfi] (Hz)

Description: FFT frequencies of interested frequency points

Outputs (2)

Ai

Type: Real[nfi]

Description: FFT amplitudes of interested frequency points

info

Type: Integer

Description: Information flag from FFT computation; = 0: FFT successfully computed