get_ns function
Requirements.ChecksInFixedWindow_withFFT.Internal.get_ns
· source
Return number of sample points
Extends Modelica.Icons.Function
Returns the number of sample points ns of the FFT buffer for a maximum frequency of interest
f_max and a frequency resolution f_resolution. Starting from
2*ceil(f_max*f_max_factor/f_resolution) (so that the maximum FFT frequency is at least
f_max_factor*f_max), ns is increased in steps of 2 until it is even and can be
written as ns = 2^i*3^j*5^k, which is the size the FFT of the Modelica Standard Library
computes efficiently. Requires f_resolution > 0 and f_max > f_resolution
(asserted). Used to set parameter ns of PartialFFT.
Revisions
| Date | Description |
|---|---|
| Nov. 29, 2015 | Initial version implemented by
Martin R. Kuhn and Martin Otter
(DLR Institute of System Dynamics and Control) The research leading to these results has received funding from the European Union’s Seventh Framework Programme (FP7/2007-2016) for the Clean Sky Joint Technology Initiative under grant agreement no. CSJU-GAM-SGO-2008-001. |
Inputs
| Name | Type | Description |
|---|---|---|
f_max input | SI.Frequency | Maximum frequency of interest |
f_resolution input | SI.Frequency | Frequency resolution |
f_max_factor input | Integer | Maximum FFT frequency >= f_max*f_max_factor (sample frequency = 2*Maximum FFT Frequency) |
Outputs
| Name | Type | Description |
|---|---|---|
ns output | Integer | Number of sample points that can be expressed as ns = 2^i*3^j*5^k and ns is even |