blockMovingAverage

Output is the continuous moving average of the input

Extends from Modelica_Requirements.Interfaces.PartialTriggeredMovingWindow (Icon and equationns for a block with a trigger signal and a moving time window).

Information

Syntax

u_filt = MovingAverage(u=..., active=...).y;

Description

Real output y is the moving average over the input u as long as Boolean input active is true. If active = true, the output is computed as:

Example

This block is demonstrated with the following example:

results in

simulation result

Parameters

TypeNameDefaultDescription
Modelica.Units.SI.TimeT (from PartialTriggeredMovingWindow)Length of sliding time window

Connectors

TypeNameDefaultDescription
Modelica.Blocks.Interfaces.RealInputu (from PartialTriggeredMovingWindow)Real input signal
Modelica.Blocks.Interfaces.RealOutputy (from PartialTriggeredMovingWindow)Real output signal
Modelica.Blocks.Interfaces.BooleanInputactive (from PartialTriggeredMovingWindow)Boolean input signal