ECG filtration, baseline wander
6 次查看(过去 30 天)
显示 更早的评论
Hello everyone :) I have a problem with ECG filtration. I need to get rid off the baseline wander, like HP filter with a frequency 0.1 Hz. My signal is sampled by 10 kHz. Thats why I stuggle with setting up the filter. I have tried to use this: d = fdesign.highpass('Fst,Fp,Ast,Ap',0.5,0.7,40,1,sampFreq); but the effective value at -3 dB is at about 1.2 Hz, which is too much. I think there will have to be a filter with much higher order, but to be honest, I am not sure how to set it up.
Could any of you help me with it, please? It will be much appreciated! :)
Thank you.
0 个评论
回答(1 个)
Star Strider
2016-12-10
There are several ways to design filters in MATLAB.
This design may do what you want:
Fs = 1E+4; % Sampling Frequency
Fn = Fs/2; % Nyquist Frequency
Wp = [0.1 0.5 100 110];
fsamp = Fs;
fcuts = Wp;
mags = [0 1 0];
devs = [0.05 0.01 0.05];
[n,Wn,beta,ftype] = kaiserord(fcuts,mags,devs,fsamp);
n = n + rem(n,2);
hh = fir1(n,Wn,ftype,kaiser(n+1,beta),'scale');
figure(1)
freqz(hh, 1, 2^nextpow2(length(hh)), Fs)
figure(2)
freqz(hh, 1, 2^nextpow2(length(hh)), Fs)
set(subplot(2,1,1), 'XLim', [0 150]) % Zoom Frequency-Axis
set(subplot(2,1,2), 'XLim', [0 150]) % Zoom Frequency-Axis
figure(3)
freqz(hh, 1, 2^nextpow2(length(hh)), Fs)
set(subplot(2,1,1), 'XLim', [0 10]) % Zoom Frequency-Axis
set(subplot(2,1,2), 'XLim', [0 10]) % Zoom Frequency-Axis
The usual frequency content of a EKG is <=100 Hz, so a bandpass filter to eliminate high-frequency noise is a better choice than a highpass filter. You can also use a high-frequency cutoff of about 50 Hz for a normal EKG, but arrhythmias can increase the bandwidth to a maximum of about 100 Hz.
3 个评论
Image Analyst
2016-12-10
Can you post a screenshot of your data plotted to help us visualize the baseline wander?
Star Strider
2016-12-10
My pleasure!
You don’t need the higher frequencies if you are only filtering your EKG. You can prove this easily enough by taking the fft (link) of your EKG signal. (We can discuss this in detail if you want to. I’m a Physician and Biomedical Engineer.) If there is something higher than 100 Hz in your signal, it’s likely not related to the EKG.
The Kaiser (and other) windows are ways to compensate for finite terms of an infinite series of a Fourier transform. As I mentioned, there are many ways to design filters in MATLAB, so I variously suggest different methods and designs just for variety. This one works for EKGs.
I’ve suggested others using the designfilt function, and lower-level functions such as in How to design a lowpass filter for ocean wave data in Matlab? (although that was not for EKGs, it could easily be adapted for them).
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Single-Rate Filters 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!