ECG filtration, baseline wander

6 visualizzazioni (ultimi 30 giorni)
Petra
Petra il 10 Dic 2016
Commentato: Star Strider il 10 Dic 2016
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.

Risposte (1)

Star Strider
Star Strider il 10 Dic 2016
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 Commenti
Image Analyst
Image Analyst il 10 Dic 2016
Can you post a screenshot of your data plotted to help us visualize the baseline wander?
Star Strider
Star Strider il 10 Dic 2016
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).

Accedi per commentare.

Community Treasure Hunt

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

Start Hunting!

Translated by