Noise and filtering · University · about 30 min
A moving average, then the exponential filter that does the same job in one line and no memory.
[1 mark]An exponential filter starts at 50 and sees three readings of 60. What does it print?
ALPHA = 0.2
filtered = 50.0
for raw in (60, 60, 60):
filtered = ALPHA * raw + (1 - ALPHA) * filtered
print(round(filtered, 2))[1 mark]Using the lesson's rule of thumb, an exponential filter with alpha = 0.1 behaves roughly like a moving average of how many readings?
[1 mark]Why should an exponential filter be started at the first reading rather than at 0?
[1 mark]Compared with a moving average giving similar smoothing, what is the main practical advantage of the exponential filter?
[1 mark]Rearranged, the filter is filtered = filtered + alpha * (raw - filtered). In the Kalman filter of U6.3 the update has the same shape. What is different there?
[1 mark]In signal processing terms, the exponential filter is a first order what kind of filter?
[1 mark]Put these lines in order to run an exponential filter while driving.
Number the lines 1 to 5 to put them in the right order.
filtered = ALPHA * raw + (1 - ALPHA) * filteredfor i in range(60): raw = distance() plot("filtered", filtered)filtered = distance()Drive towards the wall with an exponential filter running, plotting raw and filtered as you go, and print the alpha: you chose.
from bugbot import * connect() ALPHA = 0.25 filtered = distance()
Plan your program here, then type it in and press Run.
imu()[1] instead. What is a sensible alpha for a signal you want to use in a controller?