Noise and filtering · University · about 25 min
Some readings are not noisy, they are wrong. The median, and gating on what you expected.
[1 mark]Nine readings of 60 cm and one of 400 cm are averaged. By how many centimetres does the outlier shift the mean away from 60?
[1 mark]A window of five holds two maximum-range readings. What does this print?
window = [61, 400, 59, 60, 400] median = sorted(window)[len(window) // 2] mean = sum(window) / len(window) print(median, mean)
[1 mark]How many bad readings out of five can a median of five survive with its output still one of the good readings?
[1 mark]A gate is rejecting about half of all readings. What does that most likely say?
[1 mark]Which of these are real costs of a median filter?
Tick every answer that is true.
[1 mark]In a Kalman filter, the validation gate is set from the covariance. What does that achieve?
Drive towards the wall with a median filter and a gate running, and stop 35 cm from it, without being fooled by the robot that crosses in front. Plot raw and median, and print thrown out:, the number of readings your gate rejected.
from bugbot import * connect() window = [] thrown = 0
Plan your program here, then type it in and press Run.