Skip to contents

\(y[n] = (1/M)\sum_{k=0}^{M-1} x[n-k]\). Sinc magnitude response with zeros at multiples of fs/M, and group delay (M-1)/2 – the output is NOT aligned with the input. Mirrors morie.fn.rgmavg.

Usage

morie_moving_average(x, M = 8L)

Arguments

x

numeric signal.

M

window length.

Value

list: y, group_delay, M, N.

References

Rangayyan (2015), Ch. 3.

Examples

morie_moving_average(1:20, M = 4)$group_delay
#> [1] 1.5