saveFFTonFile impure function
Requirements.ChecksInFixedWindow_withFFT.Internal.saveFFTonFile
· source
Save FFT computation on file
Extends Modelica.Icons.Function
Stores the amplitudes A of one FFT computation in the MATLAB file
resultDirectory/filePrefix<fileIndex>.mat as matrix FFT and prints the file
name. The directory is created if needed and an existing file of the same name is removed first. Each
amplitude A[i] at frequency f = f_max*(i-1)/(size(A,1)-1) is written as the three
rows [f,0; f,A[i]; f,0], so that plotting column 2 over column 1 shows the spectrum as vertical
lines. Nothing is stored if iTick ≤ 1. Called by
PartialFFT after every FFT when storeFFTonFile = true.
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. |
Inputs
| Name | Type | Description |
|---|---|---|
resultDirectory input | String | Directory where results shall be stored |
filePrefix input | String | First part of file name (= FFT.<instanceName>.) |
fileIndex input | Integer | Index of FFT computation |
f_max input | SI.Frequency | Maximum frequency |
A[…] input | Real | Amplitude |
iTick input | Integer | Number of stored sample points (nothing is stored if iTick <= 1) |