modelRealFFT2
Example demonstrating the use of an FFT calculation during simulation (and storing only amplitudes on file)
Extends from Modelica.Icons.Example (Icon for runnable examples).
Information
This is the same example as Examples.RealFFT1 with the only difference that just the amplitudes of the FFT are stored on file (but not the phases).
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Frequency | f_max | 4 | Maximum frequency of interest |
| SI.Frequency | f_resolution | 0.2 | Frequency resolution |
| SI.Frequency | f1 | 2 | Frequency of sine |
| SI.Frequency | f2 | 3 | Frequency of cosine |
| String | FFT_resultFileName | "RealFFT2_resultFFT.mat" | File where FFT will be stored as [f,A,Phi], with f in [Hz] and A the amplitudes and Phi the phases in [rad] |
| Integer | nfi | max(1, min(integer(ceil(f_max/f_resolution)) + 1, nf)) | Number of frequency points of the interested frequency range (only up to f_max) |
| SI.Frequency[nfi] | fi | FFT frequencies of interested frequency points |
Components
| Type | Name | Default | Description |
|---|---|---|---|
| Real | y | Signal from which FFT is computed | |
| Real[nfi] | Ai | FFT amplitudes of interested frequency points | |
| Integer | info | Information flag from FFT computation; = 0: FFT successfully computed |
Revisions
| Date | Description |
|---|---|
| Nov. 29, 2015 | Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control. |