The Signal State

The Signal State

Not enough ratings
Moving average
   
Award
Favorite
Favorited
Unfavorite
Tags: Puzzle
File Size
Posted
430.218 KB
8 Mar, 2022 @ 6:58pm
1 Change Note ( view )

Subscribe to download
Moving average

Description
We want to filter high frequency noise from a low frequency signal.
The filter should output the average of the most recent 8 time steps (including this one).
To simplify matters the signal is assumed to be zero for time steps before the start (i.e. out[1]=in[1]/8).

Implement the filter:

in=0 for i <=0
out=sum(in[j] for j=i-7 to i)/8
1 Comments
Kazitor 21 Jan, 2023 @ 3:16pm 
Haha, nice. If I hadn't peeked at the global best I might have ended up tracking all eight samples...