problem with filtering ECG signal

7 visualizaciones (últimos 30 días)
sereen masalha
sereen masalha el 16 de Dic. de 2020
hello, As you can see in the figure the signal isn't being filtered by the BPF( we can see basline wander noise ). Any suggestions on the frequencies that should be used in the filter? thank you so much !
function [clean_signal,fs] = clean_ECG(signal,T)
sig1 = dlmread('part1.txt','',1,0) ;
L1 = sig1(:,1) ;
L3 = sig1(:,2) ;
L2 = sig1(:,3) ;
f = 200; %Hz sampling frequency according to nyquest
T1 = 57.754; T2 = 62.59 ; T3 = 35.942; % according to the biopac
fs = length(signal)/T; % the sampling frequency for our signal Lead 2
signal = reshape(signal,1,[]);
%% designing zero order FIR filters :
% baseline wander noise - HPF with cuttof frequency 0.5 Hz
% EMG noise - LPF with cuttof frequency 100 Hz
% BPF between 0.5 - 100 Hz
BPF = bandpass(signal,[0.5 100],200);
%% POWER LINE INTERFERENCE noise - window based Stop Band Filter with cuttof frequencies 59.5 Hz and 60.5 Hz
fmax = 60.5; fmin = 59.5;
wp= 2*fmax/f;
ws= 2*fmin/f;
SPF = fir1(1,[ws wp],'stop');
% applying the filter:
y1 = filtfilt(SPF,1,BPF);
clean_signal = filter(SPF,1,BPF);
%}
end

Respuestas (0)

Community Treasure Hunt

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

Start Hunting!

Translated by