rawRealFFTCompute raw Fast Fourier Transform for real signal vector |
This information is part of the Modelica Standard Library maintained by the Modelica Association.
(info, amplitudes, phases) = rawRealFFT(u);
Raw interface to a function of the Kiss_FFT package to compute the FFT of a real, sampled signal. The input argument of this function is a Real vector u. size(u,1) must be even. An efficient computation is performed, if size(u,1) = 2^a*3^b*5^c (a,b,c Integer ≥ 0). The function computes a real FFT (Fast Fourier Transform) of u and returns the result in form of the outputs amplitudes and phases. Argument info provides additional information:
info = 0: Successful FFT computation. info = 1: size(u,1) is not even. info = 2: size(work,1) is not correct (= a protected utility array). info = 3: Another error.
Note, in the original publication about the efficient computation of FFT (Cooley and Tukey, 1965), the number of sample points must be 2^a. However, all newer FFT algorithms do not have this strong restriction and especially not the open source software KissFFT from Mark Borgerding used in this function.
(info, A, phases) = realFFT({0,0.1,0.2,0.4,0.5, 0.6})
u |
Type: Real[:] Description: Signal for which FFT shall be computed (size(nu,1) MUST be EVEN and should be an integer multiple of 2,3,5, that is size(nu,1) = 2^a*3^b*5^c, with a,b,c Integer >= 0) |
---|
info |
Type: Integer Description: Information flag (0: FFT computed, 1: nu is not even, 2: nwork is wrong, 3: another error) |
---|---|
amplitudes |
Type: Real[div(size(u, 1), 2) + 1] Description: Amplitudes of FFT |
phases |
Type: Real[div(size(u, 1), 2) + 1] Description: Phases of FFT |