modelPartialFFT

Partial model containing the common part of the FFT blocks

Parameters

TypeNameDefaultDescription
BooleanstoreFFTonFiletrue= true, if FFT results shall be stored on file <modelName>/FFT.<instanceName>.<index>.mat
Modelica.Units.SI.Frequencyf_maxMaximum frequency of interest (sampling frequency >= 10*f_max)
Modelica.Units.SI.Frequencyf_resolutionFrequency resolution (frequency axis points are an integer multiple of f_resolution)
IntegernsInternal.get_ns(f_max, f_resolution)Number of FFT sample points (is even and can be expressed as ns = 2^i*3^j*5^k)
Modelica.Units.SI.Frequencyf_max_FFTf_resolution*div(ns, 2)Maximum frequency used by FFT
Integernfdiv(ns, 2) + 1Number of frequency points
Modelica.Units.SI.TimeTs1/(2*f_max_FFT)Sample period
Modelica.Units.SI.TimeT(ns - 1)*TsSimulation time for one FFT calculation
Integernpmax(1, min(integer(ceil(f_max/f_resolution)) + 1, nf))Number of frequency points used for plotting (only up to interested frequency
Modelica.Units.SI.Frequencyf_max_plot(np - 1)*f_resolution

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.BooleanInputconditionBoolean input condition signal (a rising edge signals to store u-values in a buffer; if there are enough values in the buffer, an FFT is computed)
Modelica.Blocks.Interfaces.RealInputuSignal on which an FFT is performed
Modelica_Requirements.Interfaces.PropertyOutputyProperty output signal (= Satisfied, if FFT Amplitudes of u are within maxAmplitude)
Modelica.Blocks.Interfaces.BooleanOutputFFT_computation= true, when u is stored in buffer for FFT computation
Modelica.Blocks.Interfaces.RealOutputscaledDistanceMinimum distance of FFT Amplitudes of u to maxAmplitude (>= 0 if inside, otherwise outside of maxAmplitude)

Components

TypeNameDefaultDescription
Booleanperiods_ok= true, if all periods for FFT computations have been long enough
Integer[3]fillColorif scaledDistance >= 0 then {245, 245, 245} else {255, 218, 213}
Real[3*np,2]fA_plot[frequency, amplitude] matrix used for plotting in icon

Revisions

Date Description
Nov. 29, 2015 Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control)
The research leading to these results has received funding from the European Union’s Seventh Framework Programme (FP7/2007-2016) for the Clean Sky Joint Technology Initiative under grant agreement no. CSJU-GAM-SGO-2008-001.