checkRelativeDomain function
Requirements.ChecksInFixedWindow_withFFT.Internal.checkRelativeDomain
· source
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:
- findBaseFrequency
determines the real base frequency
f_base2(largest amplitudeA_base2withinsearchInterval[%] aroundf_base). - The relative limit curve
maxAmplitude(amplitudes in [%]) is scaled to absolute amplitudes:maxAmplitude2 = [maxAmplitude[:,1], maxAmplitude[:,2]*A_base2/100]. - The icon curves
maxAmplitudePlot,f_base2_lineandfA_plotare computed withA_max_plot = max(maxAmplitude2[:,2]) + 0.1*A_base2as top of the plot. - checkDomain
checks
A_bufagainstmaxAmplitude2and returnspropertyandscaledDistance.
See WithinRelativeDomain for why this is one function rather than several equations in a when-clause.
Inputs
| Name | Type | Description |
|---|---|---|
A_buf[…] input | Real | Amplitudes |
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 |
maxAmplitude[…] input | Real | [frequency in Hz, amplitude in %] |
f_max_plot input | SI.Frequency | Frequency of the last element of A_buf |
periods_ok input | Boolean | = true, if all FFTs so far covered the required period |
Outputs
| Name | Type | Description |
|---|---|---|
f_base2 output | SI.Frequency | Real base frequency |
A_base2 output | Real | Amplitude at the real base frequency |
maxAmplitude2[…] output | Real | [frequency in Hz, amplitude] |
A_max_plot output | Real | Amplitude at the top of the icon plot |
A_max_plot_perCent output | Real | A_max_plot in [%] of A_base2 |
maxAmplitudePlot[…] output | Real | Scaled limit curve in icon coordinates |
f_base2_line[…] output | Real | Vertical line at f_base2 in icon coordinates |
fA_plot[…] output | Real | Amplitude spectrum in icon coordinates |
property output | Property | Result of the check |
scaledDistance output | Real | Minimum distance of A_buf to the scaled limit curve, divided by its maximum |