.Modelica.Math.FastFourierTransform.realFFTsamplePoints

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:

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

realFFTinfo, realFFT, realFFTwriteToFile

Interface

function realFFTsamplePoints
  extends Modelica.Icons.Function;
  input Modelica.SIunits.Frequency f_max "Maximum frequency of interest";
  input Modelica.SIunits.Frequency f_resolution "Frequency resolution";
  input Integer f_max_factor(min = 1) = 5 "Maximum FFT frequency >= f_max*f_max_factor (sample frequency = 2*Maximum FFT Frequency)";
  output Integer ns "Number of sample points that can be expressed as ns = 2^i*3^j*5^k and ns is even";
end realFFTsamplePoints;

Revisions

Date Description
Nov. 29, 2015 Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control.

Generated at 2020-06-05T07:38:22Z by OpenModelica 1.16.0~dev-420-gc007a39