Filter Performance Analysis: Temperature sensor with 50 Hz noise (1°C amplitude) on 25°C signal:
Low-pass RC filter with time constant τ: \[f_c = \frac{1}{2\pi\tau}\]
For 10 Hz cutoff (reject 50 Hz noise): \(\tau = \frac{1}{2\pi \times 10} = 15.9\) ms
Digital equivalent (exponential moving average): \[y[n] = \alpha \cdot y[n-1] + (1-\alpha) \cdot x[n]\]
where \(\alpha = e^{-\Delta t/\tau}\). Sampling at 100 Hz (Δt = 10 ms): \[\alpha = e^{-10/15.9} = 0.53\]
Attenuation at 50 Hz: \[H(50) = \frac{1}{\sqrt{1 + (f/f_c)^2}} = \frac{1}{\sqrt{1 + (50/10)^2}} = 0.196\]
50 Hz noise: 1°C × 0.196 = 0.196°C remaining (80% rejection)
Moving average (5-sample at 100 Hz = 50 ms window): - Frequency response zeros at 20, 40, 60, 80 Hz (multiples of \(f_s/N\) = 100/5 = 20 Hz) - 50 Hz attenuation: \(\left|\frac{\sin(\pi N f / f_s)}{N \sin(\pi f / f_s)}\right| = \left|\frac{\sin(2.5\pi)}{5 \sin(0.5\pi)}\right| = \frac{1}{5} = 0.2\)
50 Hz noise: 1°C x 0.2 = 0.2°C remaining (80% rejection) — comparable to the low-pass filter at this frequency. However, at frequencies near the zeros (e.g., 40 Hz or 60 Hz), rejection approaches 100%.