C12 Embedded systems in MicroPython and C · Practice
Filtering in firmware: moving averages, smoothers and medians
Problems dealt one at a time, with new numbers every time. The kinds you miss come back more often, and you can keep going as long as you like.
0 solved
0 in a row
0 of 9 kinds solid
Check
A moving average of 16 samples runs on readings with 2 codes of rms noise, at 1000 Hz.
(a)
How much noise is left?
(b)
How much delay does it add?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
Readings arrive at 1000 Hz with hum at 50 Hz.
(a)
What moving-average length puts its first null on the hum?
(b)
What delay does that average add?
Write units the way you normally would: 1.5 ms, 1500 µs and 0.0015 s are the same answer.
Check
An exponential smoother uses .
(a)
What is its time constant?
(b)
After how many samples is a step within 1% (whole samples)?
(c)
What fraction of white noise's rms passes?
Check
A running sum averages 64 samples of a 10-bit unsigned ADC.
(a)
What is the largest sum?
(b)
How many bits does the sum need?
Check
A smoother y = y + ((x - y) >> 4) without extra fraction bits starts at 0 with a steady input of 700.
(a)
What is the largest gap at which it stops moving?
(b)
How many fraction bits must the state carry to fix it?
Check
A filter costs 60 cycles per sample on the 10 MHz board and runs at 1 kHz.
(a)
What share of the processor does it use?
(b)
How many such filters could run, at most?
Check
Noise after a 25-sample average of 3 codes rms?
Check
Time constant of a smoother with α = 2^−4?
Check
Moving-average length for a null at 50 Hz, sampling at 1200 Hz?
A kind of problem counts as solid once you've got it right on the first try twice in a row. Back to the lesson · Practice every topic in C12