BLMS adaptive filter result

2 views (last 30 days)
Søren Jensen
Søren Jensen on 14 Jan 2015
Hi Mathworks! I have a problem getting the function "adaptfilt.blms" to return anything usefull.
Inspired by an article, my challenge is to eliminate baseline wandering and high frequency noise from an ECG signal (downloaded from physionet)
To do this, the ECG signal is decomposed into sub-signals using emperical mode decomposition. The code for this is acquired at http://www.mathworks.com/matlabcentral/fileexchange/19681-hilbert-huang-transform/content/emd.m
After decomposing the signal, the high frequency and 3 low frequency components are added to create a signal that is correlated to high and low frequency noise.. Everything goes smoothly..
However, when trying to implement an adaptive noise canceler with "adaptfilt.blms" nothing good happens (error signal dives towards infinity) Maybe this is because of the initial setup of filter coefficients (since all matlab examples are set up with coefficient estimations from the filter model), but i have no idea of how to estimate these initial conditions.
The matlab code can be seen below:
.
clear all, clc, close all path='...'; load([path, '\rec_1m']);
%FIND IMF'S (noise estimation)
sample_noise = val(1,1:1000); % Noisy ECG
sample_clean = val(2,1:1000); % Clean ECG
imf = emd(sample_noise); % sub-signals
noise_estimation = imf(1,:)+ imf(11,:)+ imf(10,:)+imf(9,:); % signal that correlation with high and low frequency noise
%ADAPTIVE FILTERING
x = noise_estimation; % Input to the filter
d = sample_noise; % signal + noise
mu = 0.008; % Block LMS step size
n = 5; % Block length
ha = adaptfilt.blms(32,mu,1,n);
[y,e] = filter(ha,x,d);
% for the noise canceller, the signal is obtained from the error.
figure(1)
plot(d)
hold on
plot(e)

Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!