WOLFRAM SYSTEM MODELER
Write real FFT computation to file
This information is part of the Modelica Standard Library maintained by the Modelica Association.
success = realFFTwriteToFile(t_computed, fileName, f_max, amplitudes, phases, format);
This functions stores the result of an FFT computation on file, so that it can be easily plotted. amplitudes and phases are the vectors that hold the amplitudes and phases values of an FFT computation. If the size of the phases vector is zero, no phases will be stored on file. Otherwise, phases must have the same dimension as the amplitudes vector. The frequency vector f is constructed within the function from the dimension of the amplitudes vector and the information that amplitudes[end] is at frequency f_max. The format argument defines the file format (for details see writeRealMatrix). Argument t_computed is the actual time instant when the FFT was computed. It is used in the print message after the result was stored on file.
The matrix on file has the following structure:
See detailed example model: Examples.RealFFT1.
Description: Time instant at which the FFT was computed
Description: File where FFT shall be stored (if it exists, it is deleted and then re-created)
Type: Frequency (Hz)
Description: Maximum frequency
Description: Amplitudes of FFT
Default Value: fill(0.0, 0)
Description: Phases of FFT (either provide no argument, or a vector with the same length as amplitudes)
Default Value: "4"
Description: MATLAB MAT-file version: "4" -> v4, "6" -> v6, "7" -> v7
Description: true if successful