findBaseFrequency function
Requirements.ChecksInFixedWindow_withFFT.Internal.findBaseFrequency
· source
Find real base frequency (search around an interval of f_base for the largest amplitude
Extends Modelica.Icons.Function
Searches the amplitude spectrum A_buf (A_buf[i] at frequency
(i-1)*f_resolution) for the largest amplitude near the nominal base frequency
f_base and returns this real base frequency f_baseReal, its amplitude
A_baseReal and its index index_baseReal. The search interval is meant to be
f_base ± searchInterval [%], that is the indices from
floor(f1/f_resolution)+1 to ceil(f2/f_resolution)+1 with
f1 = (1 - searchInterval/100)*f_base and f2 = (1 + searchInterval/100)*f_base,
limited to 1 .. size(A_buf,1). If both indices coincide, the range is widened by one
frequency point on each side (again limited to 1 .. size(A_buf,1)).
Used by checkRelativeDomain and checkTHD.
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. |
| Dec. 3, 2026 | Upper search index computed from f2 instead of f1 (the range above f_base was never searched); if both indices coincide, the range is widened by one point on each side instead of to the whole spectrum (which also gave index 0 or nf+1, out of range); the lower index is limited to nf (H. Tummescheit, Model Based Innovation LLC) |
Inputs
| Name | Type | Description |
|---|---|---|
f_resolution input | SI.Frequency | Frequency resolution of A_buf |
f_base input | SI.Frequency | Nominal base frequency |
searchInterval input | Real | in [%] of f_base |
A_buf[…] input | Real | Amplitudes (A_buf[i] at frequency (i-1)*f_resolution) |
Outputs
| Name | Type | Description |
|---|---|---|
f_baseReal output | SI.Frequency | Real base frequency (largest amplitude in the search range) |
A_baseReal output | Real | Amplitude at f_baseReal |
index_baseReal output | Integer | Index of f_baseReal in A_buf |