Smooth Block
Exponentially weighted moving average filter. Smooths noisy input signals using a specified averaging time.
Open Smooth in BlockWerk →Description
The Smooth block implements exponential smoothing (also known as a first-order low-pass filter). It is used to filter out noise or short-term fluctuations from a signal, focusing on the long-term trend.
Mathematical Model
d(Out)/dt = (In - Out) / T
The block computes the output $Out$ such that its rate of change is proportional to the discrepancy between the input $In$ and the current output, controlled by an averaging time $T$:
$$\frac{d(Out)}{dt} = \frac{In - Out}{T}$$
In terms of smoothing: $$Out_{n} = (1 - \alpha) \cdot Out_{n-1} + \alpha \cdot In_n$$ where $\alpha = \Delta t / T$.
Parameters
averagingTime
The time constant $T$ of the smoothing filter. A higher value means more smoothing but also more lag.
- Default: 1
- Tooltip: Time constant for the smoothing filter
initialValue
The starting value of the smoothed output at t=0.
- Default: 0
- Tooltip: Starting value of the smoothing output
Ports
in (Input)
The noisy or raw signal to be smoothed.
out (Output)
The resulting smoothed signal.
See Also
- Delay1: Mathematically identical, but conceptually used for delays instead of filtering.
- Integrator: A pure accumulator (averaging time = infinity).
- Gain: Can be used to manually scale signal components.