checkDomain function
Requirements.ChecksInFixedWindow_withFFT.Internal.checkDomain
· source
Check whether FFT is in required domain
Extends Modelica.Icons.Function
Checks whether the FFT amplitudes A (equidistant frequency points from 0 to f_max)
lie below the limit curve maxAmplitude (a polygon [frequency in Hz, amplitude]).
Only the frequency band covered by both the FFT and the limit curve is checked, that is from
max(0, maxAmplitude[1,1]) to min(f_max, maxAmplitude[end,1]).
The limit curve is linearly interpolated with
interpolate at the frequency points of this band and enlarged by 0.1 %
to tolerate rounding.
scaledDistance is the smallest difference "limit minus amplitude" in the band, divided by the
largest value of the limit curve (guarded against a curve that is all zeros). property is
Violated if scaledDistance < 0; otherwise Satisfied if periods_ok and Undecided
if not (the FFT was computed from a partially filled buffer).
Used by WithinAbsoluteDomain and checkRelativeDomain.
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. |
| Sept. 14, 2026 | Local arrays diff and f sized by the input A instead of [:], the checked band as the slice 1:n; division by the limit curve's maximum guarded against an all-zero curve. Modelon Impact refuses a local array of undefined size (H. Tummescheit, Model Based Innovation LLC) |
Inputs
| Name | Type | Description |
|---|---|---|
A[…] input | Real | Amplitudes |
f_max input | SI.Frequency | Frequency value of A[n] |
maxAmplitude[…] input | Real | Maximum amplitude |
periods_ok input | Boolean | = true, if all FFTs so far covered the required period |
Outputs
| Name | Type | Description |
|---|---|---|
property output | Requirements.Types.Property | Result of the check |
scaledDistance output | Real | Minimum distance of A to maxAmplitude in the checked band, divided by the largest value of maxAmplitude |