.Modelica_Requirements.ChecksInFixedWindow_withFFT

Information

This library provides blocks that check properties based on FFT (Fast Fourier Transform) computations in fixed time windows. An FFT determines the frequency content and amplitudes of a sampled, periodic signal, and the blocks in this package check whether these frequencies and amplitudes fulfill certain conditions. The approach is to trigger the sampling of the periodic signal by a rising edge of Boolean input variable condition, storing the values in an internal buffer and computing the FFT once "sufficient" values are available.

Other blocks performing checks in a fixed time window are provided in sublibrary ChecksInFixedWindow.
Blocks performing checks in a sliding time window are provided in sublibrary ChecksInSlidingWindow.

All blocks of this library have the following interfaces:

All blocks of this library have the following features:

Before starting a simulation, the needed simulation time for the FFT is typically not known. You can handle this in the following way:

In the icon of the blocks the last computed FFT is shown, see example in the next figure:

The Boolean parameter storeFFTonFile defines whether the result of every FFT computation is also stored on file (storeFFTonFile = true) or not. By default, every FFT computation is stored on a separate file in MATLAB 4 binary format. For example, if the FFT computation is performed in a model with the instance name "MyModel.Requirements.Rectifier.R2", then in the current directoy the following files will be stored (during initialization, all files FFT.* in directory MyModel are deleted in order to remove potentially old results. If directory MyModel does not exist, it is created):

   MyModel
     FFT.Requirements.Rectifier.R2.1.mat   // first FFT
     FFT.Requirements.Rectifier.R2.2.mat   // second FFT
       ...

All files consist of a matrix FFT[f,A] where the first column are the frequency values in [Hz] and the second column are the amplitudes at the corresponding frequency. The FFTs can be plotted with functions plot_FFT_fromFile, plot_FFTs_of_model, plot_FFTs_from_directory. For example, all FFTs of the last simulation run can be plotted by calling function plot_FFTs_of_model. The FFT plot of signal

     y = 5 + 3*sin(2*pi*2) + 1.5*sin(2*pi*3)

is shown in the next figure:

As can be seen, the mean value = 5 of y is present at f = 0 Hz. The amplitudes and frequencies of the two sin-functions are precisely reported in the plot. This FFT was computed with f_resolution = 0.2 Hz.

References

Mark Borgerding (2010):
KissFFT, version 1.3.0. http://sourceforge.net/projects/kissfft/.
 
James W. Cooley, John W. Tukey (1965):
An algorithm for the machine calculation of complex Fourier series. Math. Comput. 19: 297–301. doi:10.2307/2003354.
 
Martin R. Kuhn (2011):
Advanced generator design using pareto-optimization. 2011 IEEE Ninth International Conference on Power Electronics and Drive Systems (PEDS), pp. 1061 –1067, Dec. DOI: 10.1109/PEDS.2011.6147391.
 
Martin R. Kuhn, Martin Otter, Tim Giese (2015):
Model Based Specifications in Aircraft Systems Design. Modelica 2015 Conference, Versailles, France, pp. 491-500, Sept.23-25, 2015. Download from: http://www.ep.liu.se/ecp/118/053/ecp15118491.pdf

Contents

NameDescription
 WithinAbsoluteDomainA rising condition input triggers an FFT calculation. The amplitudes of the FFTs must be below a frequency dependent limit
 WithinRelativeDomainA rising condition input triggers an FFT calculation. The amplitudes of the FFTs must be below a frequency dependent limit that is defined relative to the amplitude of the base frequency
 MaxTotalHarmonicDistortionA rising condition input triggers an FFT calculation. The Total Harmonic Distortion (THD) of the FFTs must be below the given limit.
 InternalLibrary of internal components used by FFT blocks (should not be directly used)

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.

Generated at 2024-04-25T18:15:59Z by OpenModelicaOpenModelica 1.22.3 using GenerateDoc.mos