How to handle ECG muscle noise artifacts correctly ?
조회 수: 12 (최근 30일)
이전 댓글 표시
I'm trying to process ECG recordings taken by Holter (bipolar chest leads) during simulations in virtual reality. Therefore, people move a lot when measuring so I often encounter movement and muscle artifacts. What is the best approach or what filter design should be used to efficiently suppress the EMG artifacts which overlap the R waves. I will be happy for any advice. Thank you in advance (attachment is sample of used signal).
![](https://www.mathworks.com/matlabcentral/answers/uploaded_files/570899/image.png)
댓글 수: 0
채택된 답변
Star Strider
2021년 4월 2일
Example —
D = load('ecg.mat');
EKG = D.ecg;
L = numel(EKG);
Fs = 125; % Use Actual Sampling Frequency
tv = linspace(0, L, L)/Fs; % Time Vector
Fn = Fs/2;
EKGmc = EKG-mean(EKG);
FTEKG = fft(EKGmc)/L;
Fv = linspace(0, 1, fix(L/2)+1)*Fn;
Iv = 1:numel(Fv);
figure
plot(Fv, abs(FTEKG(Iv))*2)
grid
xlim([0 1])
title('Fourier Transform')
EKGfilt = bandpass(EKG, [0.03 0.2]);
figure
subplot(2,1,1)
plot(tv, EKG)
grid
title('Unfiltered')
subplot(2,1,2)
plot(tv, EKGfilt)
grid
ylim([-0.5 1.5])
title('Bandpass Filtered')
xlabel('t')
Use the Fourier transform plot to guide the filter design.
댓글 수: 2
Star Strider
2021년 4월 2일
As always, my pleasure!
It is straightforward to design filters using command-line funcitons. I prefer elliptic filters (the ellip function and its firends) since it is computationally more efficent than the others.
That would go something like this:
Fs = 125;
Fn = Fs/2;
Wp = [0.03 0.2]/Fn;
Ws = Wp.*[0.95 1.05];
Rs = 50;
Rp = 1;
[n,Wn] = ellipord(Wp,Ws,Rp,Rs);
[z,p,k] = ellip(n,Rp,Rs,Wp);
[sos,g] = zp2sos(z,p,k);
figure
freqz(sos, 2^16, Fs)
set(subplot(2,1,1), 'XLim',[0 0.5])
set(subplot(2,1,2), 'XLim',[0 0.5])
EKGfilt = filtfilt(sos, g, EKG);
Use the corredct value for ‘Fs’. The rest automaticaly scales with it, so no other changes are necessary, unless the desired performance is different than in this filter.
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Analog Filters에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!