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

  1. Explain ECG waveforms and what a lead means
  2. Explain why ECG amplifiers need differential amplification, CMRR and a driven right leg
  3. Explain PPG and the Ratio of Ratios for SpO₂
  4. Explain aliasing and quantization
  5. Explain the side effects of filters and the trade-offs of spectral estimation
  6. Explain the Pan-Tompkins algorithm and Bland-Altman analysis

1. ECG physiology

Waveforms and leads

  • P (atrial depolarization) → PR (AV-node delay) → QRS (ventricular depolarization) → T (ventricular repolarization)
  • ECG = the cardiac vector projected onto the lead direction
  • I = LA − RA, II = LL − RA, III = LL − LA → II = I + III
  • Amplitude 0.5–3 mV, components 0.05–150 Hz

2. Hardware

Extracting a small signal from large noise

  • Electrode DC offset up to ±300 mV, power-line noise ~V, ECG mV
  • Instrumentation amplifier: amplifies only the differential signal; performance = CMRR
    • 60 dB → 1 V becomes 1 mV (same as an R wave!), 100 dB → 0.01 mV
  • Electrode impedance imbalance → common-mode-to-differential conversion (CMRR cannot remove it)
  • Driven right leg lowers the common-mode voltage itself

3. PPG

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

4. Sampling

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

5. Filters

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

6. Spectrum

Three trade-offs

What improves What you lose
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

7. Peak detection

The Pan-Tompkins algorithm

  1. Band-pass 5–15 Hz
  2. Derivative (steepness)
  3. Squaring
  4. Moving-window integration 150 ms
  5. Adaptive threshold + refractory period 200 ms + T-wave discrimination 360 ms
  • Evaluation: Se and PPV (MIT-BIH database)

8. Accuracy assessment

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