ST_CM_SpikeEnergySpectrum_InitPars
Function block-specific structure with initialization parameters, which are analyzed when the function block is initialized.
TYPE ST_CM_SpikeEnergySpectrum_InitPars EXTENDS ST_CM_Object_InitPars :
STRUCT
nFFT_Length : UDINT := 1024; (* Length of FFT. *)
nWindowLength : UDINT := 800; (* Length of analysis window. *)
fSampleRate : LREAL := 10000.0; (* Sample rate in Hertz. *)
fDecayTime : LREAL := 0.08; (* Decay time constant in seconds. *)
fLowerFrequencyLimit : LREAL := 500.0; (* Lower limit of frequency band in Hertz. *)
fUpperFrequencyLimit : LREAL := 4950.0; (* Upper limit of frequency band in Hertz. *)
nOrder : UDINT := 4; (* Order of bandpass filter in range [1 .. 10]. *)
eWindowType : E_CM_WindowType := E_CM_WindowType.eCM_HannWindow; (* Window type. *)
aWindowParameters : T_CM_WindowParameters := [2.5, 1.0, 1.0, 1.0, 1.0]; (* Window parameters for specific windows, e.g. FlatTop. *)
nOverlap : UDINT := 4294967295; (* Size of overlap in samples. *)
eScalingType : E_CM_ScalingType := E_CM_ScalingType.eCM_RootPowerSum; (* Scaling type. *)
bTransformToDecibel : BOOL := FALSE; (* Transform to decibel. *)
fDecibelThreshold : LREAL := 2.3e-308; (* Minimum argument of decadic logarithm for 64- bit IEEE 754 arithmetic. *)
nChannels : UDINT := 1; (* Number of channels. *)
END_STRUCT
END_TYPE
nFFT_Length
is the length of the FFT. It must be greater than one and an integral power of two.nWindowLength
is the length of the analysis window in samples. The length must be greater than one and an even number.fSampleRate
Sampling rate of the incoming time signal. The value is used for the scaling of the result in Hz.-
fDecayTime
defines the decay time of the time-wave form (spike function). The value can be configured using theConfigure()
method in order to improve the accuracy of the calculated spikes. -
fLowerFrequencyLimit
is the lower limit of the internally used bandpass (bandwidth filter). The value should be higher than the expected machine vibration. -
fUpperFrequencyLimit
is the upper limit of the internally used bandpass (bandwidth filter). The value should be chosen as high as possible in order to be able to identify high-frequency shocks. nOrder
defines the order of the IIR filter used.eWindowType
defines the used window function (of the type E_CM_WindowType). A good default value is the window typeeCM_HannWindow
.aWindowParameters
contains the free parameters of selected window functions. When usingeCM_KaiserWindow
, the first entry defines the parameter beta; ifeCM_FlatTopWindow
is used, all parameters are used. See section Window functions.nOverlap
defines the number of overlapping samples. This must be greater than or equal to zero. If the valuecCM_OverlapRecommended
is selected, a recommended overlap is calculated internally (see F_CM_CalculateRecommendedOverlap); the valuecCM_OverlapInactive
deactivates the internally used buffer and sets the value to zero.eScalingType
enables the selection of the scaling to be used (of the type E_CM_ScalingType), in case absolute scaling is required. The default value iseCM_DiracScaling
. When selecting the scaling the type of signal should be considered: either deterministic signals or wide-band signals with stochastic portion. Both types require different scalings.bTransformToDecibel
is a Boolean value that indicates whether the result of the FFT is to be transformed to the decibel scale, according to transformation x → 20 * log10(x).fDecibelThreshold
is a very small floating point value greater than zero. Values that are less than this number are replaced with this value before any transformation to the decibel scale. (The purpose is the avoidance of value range errors. The logarithm of zero is not defined and strives infinitely towards minus for the limit value of small arguments. The same applies to the argument of the number zero, arg(0). The smallest possible value is 2.3e-308, which is equivalent to the constantcCM_MinArgLog10
.)nChannels
defines the number of independent channels. This must be greater than zero.
Requirements
Development environment | Target platform | PLC libraries to include |
---|---|---|
TwinCAT v3.1.4022.25 | PC or CX (x86, x64) | Tc3_CM_Base |