Noise
Every measurement wobbles. Learn to read the wobble.
Quick quiz
Answer by instinct. You will see at once if you were right.
A thermometer sits in a bath held at exactly 50.0 °C. It reads 50.2, then 49.9, then 50.1. Why?
- the bath is drifting
- the thermometer is broken
- ✓ every reading wobbles around the true value
Always. Even a perfect thermometer wobbles. The wobble is called noise, and, as you will see, it has a shape.
You average \(100\) readings. How much smaller is the error of the average than the error of one reading?
- the same
- \(2\) times smaller
- ✓ \(10\) times smaller
\(\sqrt{100} = 10\). But this works only if each wobble forgets the one before. Not all noise does. That is the plot of this chapter.
A walker takes \(100\) random steps, left or right, one metre each. Where does he typically end up?
- \(100\ \text{m}\) away
- ✓ about \(10\ \text{m}\) away
- back at the start
Random steps neither cancel nor add up: \(\sqrt{100} = 10\). A path made of random steps is a noise that remembers. It has a colour: brown.
What is noise?
Signal what the cup really does.
Noise the part of a reading you cannot predict.
Reading what the thermometer shows: signal + noise.
Now in Python
Make a reading
Press Run Code. Then change sigma to 6 and run again.
- ·
from noiselab import *brings in this chapter's toolbox. Nothing to learn here. - ①
seconds(300, every=5)one time for each reading: 0, 5, 10 … 300 s. - ②
cooling(t)the true temperature at those times. The blue strip. - ③
white(…, sigma=2.5)one random wobble per reading.sigmasets how big. The amber strip. - ④
signal + noisewhat the thermometer shows. The green strip.
Where do we find noise?
Noise is not a flaw of cheap instruments. It comes with the world.
- Heat. Above absolute zero atoms never stop moving, so every resistor, sensor and eye jitters a little.
- Everything else. Rounding, draughts, a trembling hand, a passing truck.
You can lower noise. You can never reach zero.
Why study it?
- It tells you how far to trust a number.
- It tells you whether averaging will help.
- Its shape is a fingerprint of what produced it.
How big is it?
σ (sigma) the typical size of the wobble. About two readings in three fall within ±σ.
Measure σ
Press Run Code. Then change 0.5 to 2. Does the printed σ follow?
- ①
white(1000, sigma=0.5)a thousand readings of pure noise, built with σ = 0.5. - ②
noise.std()σ measured from the numbers: the standard deviation. - ③
show_noise(noise)the series on the left, the histogram on the right.
Does it remember?
Some noise forgets at once. Some does not.
Memory (r₁) how well one value predicts the next. 0 = none, 1 = total.
Frequency (f) how many times per second a wobble repeats. Slow wobbles: low f. Fast ones: high f.
Spectrum how much wobble there is at each f. For pink noise, power ∝ 1/f: the slower the swing, the stronger it is.
Hear the colours
Press Run Code. Then replace pink with white, then with brown, and compare the numbers.
- ①
pink(512)512 values of pink noise. Trywhiteorbrown. - ②
memory(x)r₁: does a value predict the next? Near 0 for white, near 1 for brown. - ③
slope(x)how steeply the spectrum falls: about 0 for white, −1 for pink, −2 for brown. - ④
show_colour(x)the noise, the memory plot and the spectrum.
Does averaging help?
Averaging cancels a wobble only if the next one is new.
What is left over?
In real data you do not know the signal. You fit a model, then look at what the model leaves behind.
Residual reading − model, point by point.
If the model is right, the residuals are pure noise. If they show a pattern, they remember: r₁ is far from 0, and the model is missing something.
Judge a model
Press Run Code. Then change tau=200 in the model to 300 and run again.
- ·the data: the true curve plus new noise at every run.
- ①
cooling(t, tau=200)the model: Newton's law, with cooling time τ = 200 s. - ②
reading - modelthe residuals: what is left once the model is taken away. - ③
memory(residual)r₁ of the leftovers: near 0 means no pattern.
Noise is what no model can explain. Its memory tells you whether the model is done.
Play
Guess the colour
Pattern or noise?
Check yourself
White noise with σ = 2 °C. You average 25 readings. The error of the average is about:
- 2 °C
- 1 °C
- ✓ 0.4 °C
- 0.08 °C
σ/√N = 2/5 = 0.4 °C. Only for noise with no memory.
You average 100 readings of brown noise. Compared with one reading, the error is:
- 100 times smaller
- 10 times smaller
- 2 times smaller
- ✓ about the same
Brown noise remembers everything: the average wanders with it.
A noise has r₁ ≈ 0. This means:
- each value equals the next
- σ is zero
- ✓ each value tells you nothing about the next
- the model is wrong
r₁ measures memory: 0 none, 1 total.
The residuals of a fit form a clear arch. Most likely:
- the thermometer is broken
- ✓ the model is missing something
- σ is too big
- bad luck
Noise has no shape. A shape in the leftovers is signal the model failed to take.
On log-log axes, the spectrum of pink noise has slope:
- 0
- ✓ −1
- −2
- +1
Power ∝ 1/f. White: slope 0. Brown: slope −2.
Use it on real data
Now take a real measurement. Snake Lab reads your data and runs these steps for you: noise, memory, fit, residuals.
- signal: what the system really does.
- noise: the part of a reading you cannot predict.
- σ (sigma): the typical size of the noise (its standard deviation).
- memory (r₁): how well one value predicts the next. 0 none, 1 total.
- frequency (f): how many times per second a wobble repeats.
- spectrum: how much noise there is at each frequency.
- white, pink, brown noise: spectrum flat, 1/f, 1/f². Memory: none, some, total.
- model: a curve that describes the signal, like Newton’s law of cooling.
- τ (tau): the cooling time of the tea. Larger means slower cooling.
- residual: reading minus model, point by point.
- χ² (chi-squared): residuals measured in units of σ. Around 1, the model fits. You will meet it in Snake Lab.
The drawings are plain JavaScript. The code boxes run Python inside your browser (Pyodide, WebAssembly): nothing you type is sent to a server. The first time, they download tens of MB of Python files from a public content delivery network (jsDelivr), which can see your IP address; later visits use the browser cache. The data are simulated.