Fundamentals of Biosignal Measurement and Signal Processing
From the principles of the ECG and pulse wave to filters, spectral analysis, peak detection, and accuracy assessment
Today’s goals
- Explain ECG waveforms and what a lead means
- Explain why ECG amplifiers need differential amplification, CMRR and a driven right leg
- Explain PPG and the Ratio of Ratios for SpO₂
- Explain aliasing and quantization
- Explain the side effects of filters and the trade-offs of spectral estimation
- Explain the Pan-Tompkins algorithm and Bland-Altman analysis
Principle and SpO₂
- Beer-Lambert law: pulsatile arterial blood → small AC + large DC
- Heart rate: green (shallow, robust to motion); SpO₂: red + infrared
- R = \dfrac{(AC/DC)_{red}}{(AC/DC)_{IR}} → empirical calibration (e.g. 110 - 25R)
- Limitations: motion, low perfusion, skin colour, carbon monoxide
Aliasing and quantization
- f_s > 2 f_{\max}. Components above that turn into spurious low frequencies
- Cannot be removed afterwards → anti-aliasing filter before the A/D converter
- For HRV, 250–500 Hz or more for timing accuracy
- LSB = input range / 2^N, SNR ≈ 6.02N + 1.76 dB
Know the side effects
- FIR: linear phase / IIR: less computation but phase distortion
- Offline, use filtfilt (zero phase)
- ECG HPF: diagnostic 0.05 Hz, monitoring 0.5 Hz → raising it distorts the ST segment
- EMG and motion overlap in frequency and cannot be fully removed
Three trade-offs
| Longer recording |
Resolution 1/T |
Tracking changes over time |
| Hann window |
Less leakage |
Resolution |
| Welch’s method |
Less variance |
Resolution |
- Zero padding does not increase resolution
- Unevenly sampled data: resampling or Lomb-Scargle
The Pan-Tompkins algorithm
- Band-pass 5–15 Hz
- Derivative (steepness)
- Squaring
- Moving-window integration 150 ms
- Adaptive threshold + refractory period 200 ms + T-wave discrimination 360 ms
- Evaluation: Se and PPV (MIT-BIH database)
Bland-Altman analysis
- The correlation coefficient does not express agreement (systematic error does not show up in r; a wide range raises r)
- Difference vs. mean → bias and LoA = bias ± 1.96 SD
- Watch for proportional error and heteroscedasticity
- Decide acceptance criteria in advance, based on the intended use
Summary
- Information lost at any stage of measurement cannot be recovered later
- Keep noise out with hardware (electrodes, differential amplification)
- Choose sampling, filtering and spectral estimation with an understanding of the trade-offs
- Assess accuracy with Bland-Altman, for each condition of use