ns = realFFTsamplePoints(f_max, f_resolution, f_max_factor=5);
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
ns = realFFTinfo(f_max=170, f_resolution=0.3)
results in the following output:
ns = 5760
realFFTinfo, realFFT, realFFTwriteToFile
function realFFTsamplePoints extends Modelica.Icons.Function; input SI.Frequency f_max "Maximum frequency of interest"; input SI.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;
Date | Description |
---|---|
Nov. 29, 2015 | Initial version implemented by Martin R. Kuhn and Martin Otter (DLR Institute of System Dynamics and Control. |