Adaptive Filtering
Prince E. Adjei
Kwame Nkrumah University of Science and Technology
Topic: Adaptive Filtering Module 2: Signal Processing
Biosignal Processes And Analysis (BME 366)
© 2025 Prince E. Adjei
Topics:
(1). Introduction to Adaptive Filtering
(2). LMS Algorithm and Step-Size Stability
(3). Motion Artifact Removal Using Accelerometer Data
(4). Adaptive Noise Cancellation for Fetal ECG Extraction
(5). Block LMS (BLMS) vs LMS: Convergence and Efficiency
Adaptive Filtering
Learning Objectives
Explain the concept and applications of adaptive filtering in
biomedical signals.
Apply the LMS algorithm; analyze the impact of step size.
Use accelerometer signals with adaptive filtering to remove motion
artifacts.
Compare Block LMS and standard LMS in terms of convergence and
efficiency.
Design an adaptive noise canceller to extract fetal ECG and
evaluate its performance.
Adaptive Filtering
Adaptive filtering is a digital filtering technique where the filter
automatically adjusts its internal parameters over time.
Unlike fixed filters, it can respond to changes in the signal or
noise characteristics.
Designed to minimize an error signal, often by comparing the
filter output to adesired reference.
Uses algorithms like LMS or RLS to update filter weights.
Reduces noise or extracts useful components dynamically.
Motion-artefact anatomy
Motion artefacts distort ECG signals due to movement (e.g.,
walking, shifting electrodes).
These artefacts often cannot be removed by fixed filters
because they overlap with ECG frequencies and do not change
over time (non-stationary)
However, they are often correlated with accelerometer signals
from wearables.
Adaptive filters can track and cancel this noise in real time by:
Taking the accelerometer signal as a reference.
Dynamically adapting to the noise pattern.
Subtracting motion-related components from the ECG.
Motion-artefact anatomy
LMS (Least Mean Squares) is an adaptive algorithm that updates
filter weights to minimize the error between the desired signal and
the filter output.
Weight-Update Rule
Where:
w[n] = filter weights at time n
μ= step size (learning rate)
e[n]=d[n]−y[n] = error between desired signal and filter output
x[n] = input signal vector
LMS Algorithm
The step size, denoted by μ, controls how fast the adaptive filter
updates its weights.
Small μ:Slow learning, but stable and precise.
Large μ:Fast learning, but can overshoot and become unstable.
Choose μto balance speed and stability
Rule of thumb:
Step size in LMS
Demo: LMS on noisy wrist ECG
A variation of the LMS algorithm where updates are done in blocks
rather than sample-by-sample.
Faster convergence: Updates weights using information from a full
block of data.
Better numerical stability on some systems (e.g., DSPs, GPUs).
Useful for processing signals in batches, e.g., ECG chunks or long EMG
sequences.
Block Length Matters:
Small block size more frequent updates, but higher computational
overhead.
Large block size smoother updates, but may miss quick signal
changes.
Trade-off between responsiveness and efficiency.
Block LMS
Demo: BLMS vs LMS convergence plot
Questions
1) What does the LMS algorithm aim to
minimize during filtering?
2) What role does the step size(μ) play
in the LMS algorithm, and how does it
affect accuracy and convergence?
3) How does Block LMS improve on the
standard LMS, and what does the
block length influence?
In some scenarios (like fetal ECG), a clean reference signal (e.g., chest
lead for maternal QRS) isn’t available.
Adaptive filtering needs smarter methods to still work reliably.
NLMS (Normalized LMS)
A variant of LMS that automatically scales the step size (μ) based on
input power.
Helps prevent instability when signal amplitude changes.
Update Rule:
More stable than standard LMS when signal power varies.
Reference-free adaptive tricks
RLS (Recursive Least Squares)
An advanced adaptive filtering algorithm that minimizes the total
squared error over time, giving more weight to recent errors.
Achieves much faster convergence than LMS or NLMS, especially in
environments where signals or noise characteristics change quickly.
Highly effective in scenarios where the signal properties vary rapidly,
such as:
Real-time ECG denoising
BrainComputer Interfaces (BCI)
Hearing aids and speech enhancement.
Reference-free adaptive tricks
In fetal ECG (fECG) monitoring, we place electrodes on the
maternal abdomen to measure fetal heart activity.
However, the signal we record is a mixture of:
Abdominal ECG=Maternal ECG+Fetal ECG+Noise
Abdominal leads capture both maternal and fetal ECG.
Thoracic (chest) leads record mainly maternal ECG, used as a clean
reference.
Fetalmaternal ECG mixing model
Problem: The fetal ECG (fECG) is buried within the abdominal signal:
Abdomen=Maternal ECG+Fetal ECG+Noise
Maternal ECG dominates the signal and must be removed.
Solution ANC Approach:
Use the maternal chest ECG as a reference (maternal-only).
Apply the LMS adaptive filter:
Reference input: maternal chest ECG
Primary input: abdominal ECG (mixed signal)
LMS adapts to model the maternal component and subtract it.
Output: cleaned fetal ECG with reduced maternal interference.
Adaptive Noise Canceller (ANC) for Fetal ECG
After extracting the fetal ECG, we need objective measures to evaluate
signal quality and clinical usefulness.
Key Metrics:
Signal-to-Noise Ratio (SNR):
Measures how clean the extracted fetal ECG is.
Higher SNR = less interference from maternal ECG and noise.
Fetal Heart Rate (HR) Accuracy:
Compares detected fetal beats to the true beat locations (ground
truth or clinical reference).
The accuracy of heart rate estimates is critical for fetal monitoring.
Quality Metrics for fECG Extraction
Objective: Apply adaptive filtering techniques (LMS and Block LMS) to a
real-world wearable ECG dataset.
What You’ll Do:
Load ECG recordings with motion artefacts (e.g., wrist-based ECG).
Implement:
LMS filter to cancel noise using reference (e.g., accelerometer or chest
ECG).
Block LMS (BLMS) for faster convergence and efficiency.
Compare results:
Evaluate noise reduction, convergence, and fetal signal clarity
Lab Preview: LMS & BLMS on Wearable ECG
Adaptive filters are essential when signal conditions change over time,
making fixed filters ineffective.
The Least Mean Squares (LMS) algorithm updates weights iteratively to
minimize the error between desired and actual outputs.
Filter performance depends on careful selection of parameters like step
size, which affects both stability and convergence speed.
Advanced variants like Block LMS and Normalized LMS improve
convergence and robustness under varying signal conditions.
Summary