The answersDownload the PDF
Worksheet

U4.1 A reading is a distribution

Noise and filtering · University · about 25 min

BugBotLab
NameClassDate

What this lesson is about

Mean, standard deviation, and what one number from a sensor is actually telling you.

Questions 6 marks in all

  1. [1 mark]A still robot's depth readings have mean 57.0 cm and standard deviation 2.0 cm, and are Gaussian. About what fraction of readings land between 55 and 59 cm?

    1. AAbout 68 percent
    2. BAbout 95 percent
    3. CAbout 50 percent
    4. DAbout 99.7 percent
  2. [1 mark]Same sensor: mean 57.0 cm, sigma 2.0 cm. About what percentage of readings fall outside 51 to 63 cm? Give a percentage to one decimal place.

  3. [1 mark]This computes the mean and sigma exactly as the lesson does. What does it print?

    readings = [56, 58, 60, 62, 64]
    mean = sum(readings) / len(readings)
    var = sum((r - mean) ** 2 for r in readings) / len(readings)
    sigma = var ** 0.5
    print(mean, var, round(sigma, 2))
  4. [1 mark]A sensor gives readings with sigma 0.3 cm, but their mean is 4 cm short of a tape-measured distance. What will fix it?

    1. ACalibrate against the tape measure
    2. BAverage more readings
    3. CUse a stronger low pass filter
    4. DTake the readings further apart in time
  5. [1 mark]A student reads the depth sensor 100 times in a tight loop with no wait and gets sigma = 0.4 cm, much smaller than with a 0.1 s wait. Why is that number a lie?

    1. AThe sensor only produces a new measurement about every 0.1 s, so most reads repeat the same sample
    2. BReading quickly lets the sensor warm up and become more precise
    3. CThe variance should have been divided by 99, not 100
    4. DSigma is the square of the variance, so it was computed wrongly
  6. [1 mark]A reading's spread is described by its standard deviation. What is the name of its square, measured in squared units?

The task: measure the noise

Standing still, print mean: and sigma: for this sensor, in centimetres.

from bugbot import *
connect()

readings = []

Plan your program here, then type it in and press Run.

QR code
Do it on the robot
www.bugbotlab.com/learn/u4-1-a-reading-is-a-distribution/
The simulator checks it and tells you when it passes. Nothing to install, no account.

Challenges

  1. Print how many readings fall within one, two and three sigma. Is it 68, 95, 99.7?
  2. Change the robot's distance from the wall and measure sigma again. Does the noise grow with range?
  3. Read the sensor a hundred times with no wait at all. What is sigma now, and why is it a lie?