modelRealFFT2

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

Extends from Modelica.Icons.Example (Icon for runnable examples).

Information

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

TypeNameDefaultDescription
SI.Frequencyf_max4Maximum frequency of interest
SI.Frequencyf_resolution0.2Frequency resolution
SI.Frequencyf12Frequency of sine
SI.Frequencyf23Frequency of cosine
StringFFT_resultFileName"RealFFT2_resultFFT.mat"File where FFT will be stored as [f,A,Phi], with f in [Hz] and A the amplitudes and Phi the phases in [rad]
Integernfimax(1, min(integer(ceil(f_max/f_resolution)) + 1, nf))Number of frequency points of the interested frequency range (only up to f_max)
SI.Frequency[nfi]fiFFT frequencies of interested frequency points

Components

TypeNameDefaultDescription
RealySignal from which FFT is computed
Real[nfi]AiFFT amplitudes of interested frequency points
IntegerinfoInformation flag from FFT computation; = 0: FFT successfully computed

Revisions

Date Description
Nov. 29, 2015 Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control.