functionrealFFTsamplePoints
Return number of sample points for a real FFT
Extends from Modelica.Icons.Function (Icon for functions).
Information
Syntax
ns = realFFTsamplePoints(f_max, f_resolution, f_max_factor=5);
Description
From the maximum interested frequency f_max (in [Hz]) and the frequency resolution f_resolution (in [Hz]) the function computes the number of sample points ns that is as small as possible and fulfills the following criteria:
- Maximum FFT frequency ≥ f_max_factor*f_max (= the largest frequency value of the frequency vector).
- Frequency axis resolution is f_resolution.
- The number of sample points is expressed as 2^a*3^b*5^c (and a,b,c are appropriate Integers).
- The number of sample points is even.
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
References
- Mark Borgerding (2010):
- KissFFT, version 1.3.0.
http://sourceforge.net/projects/kissfft/.
- James W. Cooley, John W. Tukey (1965):
- An algorithm for the machine calculation of complex Fourier series.
Math. Comput. 19: 297-301. doi:10.2307/2003354.
- Martin R. Kuhn, Martin Otter, Tim Giese (2015):
- Model Based Specifications in Aircraft Systems Design. Modelica 2015 Conference, Versailles, France, pp. 491-500, Sept.23-25, 2015. Download from: http://www.ep.liu.se/ecp/118/053/ecp15118491.pdf
Example
ns = realFFTinfo(f_max=170, f_resolution=0.3)
results in the following output:
ns = 5760
See also
Inputs
| Type | Name | Default | Description |
|---|---|---|---|
| SI.Frequency | f_max | Maximum frequency of interest | |
| SI.Frequency | f_resolution | Frequency resolution | |
| Integer | f_max_factor | 5 | Maximum FFT frequency >= f_max*f_max_factor (sample frequency = 2*Maximum FFT Frequency) |
Outputs
| Type | Name | Default | Description |
|---|---|---|---|
| Integer | ns | Number of sample points that can be expressed as ns = 2^i*3^j*5^k and ns is even |
Revisions
| Date | Description |
|---|---|
| Nov. 29, 2015 | Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control. |