.Modelica.Blocks.Math.RealFFT

Information

This block samples the input signal, calculates the Fast Fourier Transform by function Math.realFFT, and (when simulation terminates) writes the output to result file resultFileName by function Math.realFFTwriteToFile.

The number of sampling points as well as the samplePeriod is calculated from desired maximum frequency f_max and frequency resolution f_res.

Note

The user has to take care that enough points can be sampled before the simulation ends: startTime + (ns - 1)*samplePeriod <= stopTime.

The result file is written as mat, first column = frequency, second column = amplitudes, third column = phases. The frequency points are separated by rows with amplitude and phase = 0, so one can plot the result directly as frequency lines.


Generated at 2020-06-05T21:39:08Z by OpenModelica 1.16.0~dev-442-g2e5bc9f