checkRelativeDomain function

Requirements.ChecksInFixedWindow_withFFT.Internal.checkRelativeDomain  · source

Icon of checkRelativeDomain

WithinRelativeDomain's whole evaluation in one call: base frequency, scaled limit curve, check, icon curves

Extends Modelica.Icons.Function

Performs the complete evaluation of block WithinRelativeDomain after an FFT has been computed, in one call:

  1. findBaseFrequency determines the real base frequency f_base2 (largest amplitude A_base2 within searchInterval [%] around f_base).
  2. The relative limit curve maxAmplitude (amplitudes in [%]) is scaled to absolute amplitudes: maxAmplitude2 = [maxAmplitude[:,1], maxAmplitude[:,2]*A_base2/100].
  3. The icon curves maxAmplitudePlot, f_base2_line and fA_plot are computed with A_max_plot = max(maxAmplitude2[:,2]) + 0.1*A_base2 as top of the plot.
  4. checkDomain checks A_buf against maxAmplitude2 and returns property and scaledDistance.

See WithinRelativeDomain for why this is one function rather than several equations in a when-clause.

Inputs

NameTypeDescription
A_buf[…] inputRealAmplitudes
f_resolution inputSI.FrequencyFrequency resolution of A_buf
f_base inputSI.FrequencyNominal base frequency
searchInterval inputRealin [%] of f_base
maxAmplitude[…] inputReal[frequency in Hz, amplitude in %]
f_max_plot inputSI.FrequencyFrequency of the last element of A_buf
periods_ok inputBoolean= true, if all FFTs so far covered the required period

Outputs

NameTypeDescription
f_base2 outputSI.FrequencyReal base frequency
A_base2 outputRealAmplitude at the real base frequency
maxAmplitude2[…] outputReal[frequency in Hz, amplitude]
A_max_plot outputRealAmplitude at the top of the icon plot
A_max_plot_perCent outputRealA_max_plot in [%] of A_base2
maxAmplitudePlot[…] outputRealScaled limit curve in icon coordinates
f_base2_line[…] outputRealVertical line at f_base2 in icon coordinates
fA_plot[…] outputRealAmplitude spectrum in icon coordinates
property outputPropertyResult of the check
scaledDistance outputRealMinimum distance of A_buf to the scaled limit curve, divided by its maximum