Variable frequency moving average-value computation
Simscape / Electrical / Control / General Control
The Moving Average (Variable Frequency) block computes the moving average value of an input signal of variable frequency. Use this block to filter higher frequency signal components and to smooth noisy signals.
The moving average is computed based on a moving time window. The moving average for continuous-time is calculated as
u(t) is the input signal.
T0 is equal to
f is the fundamental frequency of the signal.
The moving average for discrete-time is calculated as:
If you use this block for continuous-time operations and set the
Sample time (-1 for inherited) parameter to
0, you should also specify the value of the
Buffer size parameter to ensure it covers the
moving time window.
The output is initialized with an initial condition in the time interval
u— Moving average input
Moving average input, specified as a scalar or vector.
f— Frequency, Hz
Frequency, specified as a scalar or vector in Hz.
Mean— Moving average output
Moving average of the input signal, returned as a scalar or vector.
Initial frequency (Hz)— Initial signal frequency
60(default) | positive scalar | vector with positive values
Initial frequency of the signal, in Hz. If you specify the initial frequency using a vector, it must match the dimensions of the input vector.
Minimum frequency (Hz)— Minimum signal frequency
30(default) | positive scalar | vector with positive values
Minimum frequency of the signal, in Hz. If you specify the minimum frequency using a vector, it must match the dimensions of the input vector.
Initial value— Initial input signal value
0(default) | scalar
Initial value of the input signal.
Buffer size— Buffer size
8192(default) | scalar
Size of the buffer.
To enable this parameter, set Sample time (-1 for
Sample time (-1 for inherited)— Block sample time
-1(default) | 0 | positive scalar
Time between consecutive block executions. During execution, the block produces outputs and, if appropriate, updates its internal state. For more information, see What Is Sample Time? and Specify Sample Time.
For inherited discrete-time operation, specify
discrete-time operation, specify a positive integer. For continuous-time operation,
If this block is in a masked subsystem, or other variant subsystem that allows you to switch between continuous operation and discrete operation, promote the sample time parameter. Promoting the sample time parameter ensures correct switching between the continuous and discrete implementations of the block. For more information, see Promote Parameter to Mask.