Signals to learning / 2. Maths for experiments

Lesson 7 of 40 · Beginner · About 25 minutes

Noise and signal-to-noise ratio

How much unwanted variation is in a measurement?

You will be able to

  • Calculate mean-square power and SNR in decibels.
  • Describe how averaging changes both signal and noise.

Specify the noise model

Write an observation as y[n]=s[n]+e[n], with clean signal s and disturbance e. Random sensor noise, a periodic hum and modelling error are different disturbances. The lab uses a deterministic 19 Hz interference tone so every run is reproducible; it is not white random noise.

Measure before cleaning

Mean-square power averages squared values over the same record. SNR in decibels compares signal power to noise power. A moving average may reduce high-frequency disturbance but also attenuates desired high-frequency structure and introduces delay. Averaging K independent zero-mean noise observations of the same fixed signal reduces their noise variance by K; that claim does not apply to arbitrary correlated samples.

Pₓ = (1/N)Σₙx[n]²; SNR = 10 log₁₀(Pₛ/Pₑ) dB

Worked example

Signal power 1 and noise power 0.01 give 20 dB. For equal-shaped signals with amplitude ratio 10, the power ratio is 100, not 10.

A common trap

Smoothing does not automatically recover ground truth; it can erase important transients as well as noise.

Predict, then experiment

Will a longer average suppress the 19 Hz tone without affecting the 3 Hz signal at all? Before touching the controls, say or write your prediction.

Try it yourself

Smoothness has a cost

What does a causal average preserve and suppress?

64 samples at 64 Hz: clean 3 Hz tone plus deterministic 19 Hz interference. Solid is observed; dashed is filtered; dotted is clean. Zero initial filter state; no delay compensation. Input SNR is a power ratio, not output quality.

Your experiment

Set interference amplitude to 0.5. Compare moving-average lengths 1, 3 and 9. Note both smoothing and the lag/attenuation of the desired waveform; the filter starts from zero.

Change one parameter at a time. Compare what you observed with your prediction and record an explanation in your notes.

Check your understanding

Try from memory first. Hints and feedback are part of learning, not a penalty. These checks are for self-study, not a graded qualification.

1. The lab disturbance is…
Give me a hint

Read the experiment assumptions.

2. What is SNR in dB when signal power is 1 and noise power is 0.1?

Accepted absolute tolerance: ±0.001 dB.

Give me a hint

Use a power ratio, not an amplitude ratio.

Reference answers (after your attempt)
  1. a reproducible interference tone — Correct: its frequency is explicitly fixed.
  2. 10dB — 10 log₁₀(10)=10 dB.

Apply it: Design a denoising test

Use paper, your notes, or a local notebook/editor. Code examples are Python 3 starting points to run yourself; this page does not execute code or automatically assess the practical task.

  1. State a clean reference and a disturbance model.
  2. Choose a distortion metric and a noise metric.
  3. Explain one failure case for a moving average.
Reference solution & review criteria

Measure MSE against a known clean synthetic reference and SNR with explicit alignment. A desired high-frequency component or impulse can be attenuated by the average, even when the output looks smoother.

Your notebook

Notes and progress stay in this browser. They are not sent to the server; ordinary web-server request logs still operate. Export a backup from the course page.

Review list

Completion requires both correct checks and your practical-task acknowledgement.

Go deeper

Sources support further study; the worked examples and questions here are original. Browser experiments are small, disclosed models—not evidence of production-model quality or hardware performance.