Noise and filtering · University · about 25 min
Matching the cut-off to the signal you care about, by measurement rather than by taste.
[1 mark]The lesson gives alpha ~ 2 / (window + 1). What alpha gives an effective window of 9 readings?
[1 mark]This adds how far a robot at 20 cm/s travels during each filter's delay. What does it print?
DT, SPEED = 0.1, 20
for a in (0.05, 0.1, 0.3, 0.6):
lag = (1 - a) / a * DT
print(a, round(lag, 2), round(SPEED * lag, 1))[1 mark]A stationary test shows alpha = 0.05 leaves the smallest spread. Why might it still be the wrong choice?
[1 mark]The signal you care about and the noise are at the same frequency. What does the lesson say?
[1 mark]Put the lesson's filter-choosing procedure in order.
Number the lines 1 to 4 to put them in the right order.
Turn that ratio into an effective window and an alphaDecide how much noise the controller's input can tolerateCheck the resulting delay against the system's time constantMeasure the noise sigma with the robot still[1 mark]The delay of the alpha you need is too large for the system's time constant. What does the lesson say the answer is?
Standing still, run at least three alphas at once, print the spread each one leaves, and print best alpha:.
from bugbot import * connect() ALPHAS = [0.05, 0.1, 0.3, 0.6]
Plan your program here, then type it in and press Run.