ECG signal baseline drift correction

30 次查看(过去 30 天)
I'm at the start of learning signal processing.
I'm trying to denoising this ECG signal using Wavelet Trasform to correct the baseline drift. This is my attempt, but I am very doubtful about it. I do not know if my attempt is correct or not (the signal does not seems so). I need an advice from someone more experienced than me, so in this way I can understand better and improve my work.
%--Load Real signal--%
load ('100m.mat');
RealECG = val/200;
Fs = 360; % Hz
L = length(RealECG); % Signal Length
TimeInterval = 10; % sec
T = linspace(0,TimeInterval,L); % time axis
%--Plot--%
figure (1); plot(T, RealECG); grid on;
title('ECG Signal'); xlabel('time (sec)'); ylabel('voltage (mV)');
%% Correction of the wandering baseline of the ecg signal
wv = 'db9';
[c,l] = wavedec(RealECG,8,wv);
nc = wthcoef('a',c,l);
rec = waverec(nc,l,wv);
figure(2); plot(T,rec); grid on;
title('WT Baseline Correction');
xlabel('time (sec)'); ylabel('voltage (mV)');
  1 个评论
Sabaudian
Sabaudian 2022-6-6
Since nobody wants to reply, you can at least redirect me to some material that can clarify the concepts related to the Wavelet transorm and how to use it to correct the baseline

请先登录,再进行评论。

回答(1 个)

Mathieu NOE
Mathieu NOE 2022-6-7
hello
a simple high pass filter suffices
%--Load Real signal--%
load ('100m.mat');
RealECG = val/200;
Fs = 360; % Hz
L = length(RealECG); % Signal Length
TimeInterval = 10; % sec
T = linspace(0,TimeInterval,L); % time axis
%--Plot--%
figure (1); plot(T, RealECG); grid on;
title('ECG Signal'); xlabel('time (sec)'); ylabel('voltage (mV)');
%% Correction of the wandering baseline of the ecg signal
% wv = 'db9';
% [c,l] = wavedec(RealECG,8,wv);
% nc = wthcoef('a',c,l);
% rec = waverec(nc,l,wv);
% some high pass filtering % baseline correction
N = 2;
fc = 1; % Hz
[B,A] = butter(N,2*fc/Fs,'high');
rec = filtfilt(B,A,RealECG);
figure(2); plot(T,rec); grid on;
title('WT Baseline Correction');
xlabel('time (sec)'); ylabel('voltage (mV)');
  2 个评论
Sabaudian
Sabaudian 2022-6-7
Ok, but I want to do it with the Wavelet Transform
Mathieu NOE
Mathieu NOE 2022-6-8
ok - i will let someone else answer it , as I don't have this toolbox

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Discrete Multiresolution Analysis 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by