MATLAB Answers

How do you design your ECG bandpass?

조회 수: 131(최근 30일)
Hallo,
currently i'am working on a ecg bandpass. To design my filter i use mostly "filterDesigner"-Tool by Matlab.
What are the specifications?
  • Band of choice is 0.05 Hz - 150 Hz (recommended by American Hearth Association)
  • sample rate = 500 Hz
  • Take a stopband between 40 dB - 60 dB
  • group delay has to be minimal
What filter would i choose?
  • Because of minimal group delay i would choose a FIR-Filter, BUT the first cut-off is 0.05 Hz (the transition band has to be very sharp for example 0.01 Hz- 0.05 Hz) -> the filter order is about 15.000 i think with Equiripple design
  • Lets take IIR-Filter -> here Butterworth Bandpass because it has the best phase response and a smooth passband
  • But huge group delay at cut-off frequencies
FilterDesign Example
  • Method: IIR-Butterworth Bandpass
  • Minimum Order
  • Fs = 500
  • Fstop 1 [0.01] - Fpass1 [0.05]
  • Fpass2 [150] - Fstop2 [200]
  • Astop [40] , Apass [1], Astop [60]
My question to the experts, can you recommend a better design? The result is okay but the huge group delay looks very bad.
Best regards!

  댓글 수: 5

표시 이전 댓글 수: 2
Stephan Lallinger
Stephan Lallinger 5 Dec 2019
Sorry for my late answer.
I know the 0.05 Hz sounds extrem, but i have problems with 0.5/0.67 because the ST-Segment gets distorted.
I rather take the baseline wander then the distorten.
Here are some papers and links which refer to 0.05 Hz - 150 Hz
Advanced Journal ofVascular Medicine: https://www.scireslit.com/VascularMedicine/AJVM-ID18.pdf
International Scholarly Research Network: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC3388307/
Iam not sure if iam allowed to link here.
Stephan Lallinger
Stephan Lallinger 5 Dec 2019
I never used elliptic filters because they have the worst "phase" i think.
I really never thought about bi-directional filtering. I have to work with that more.
Star Strider
Star Strider 5 Dec 2019
The filtfilt function creates all digital filters as phase-neutral.
The only phase-neutral hardware filter is the bessel filter. It is not possible to create a digital filter from it, unlinke other FIR and IIR filter designs, so it is only useful in a hardware implementation. This is the reason that Bessel filters are used as anti-aliasing filters in instrumentation inputs prior to the ADC stage.

댓글을 달려면 로그인하십시오.

채택된 답변

Daniel M
Daniel M 29 Nov 2019
편집: Daniel M 29 Nov 2019
Hi Stephan, here is a script that creates some filters and view them. You may often find that creating filters using the transfer function approach (e.g [B,A] = ...) can lead to unstable filters. This is usually cleared up with the functions tf2sos or zp2sos (after using the [z,p,k] approach for filters). I don't know enough to explain the difference between the approaches, so maybe Star Strider can comment. But here is a starting point for you. Run them on your data and see how they work for you.
clearvars
close all
clc
Np = 2^14;
Rp = 1; % passband ripple
Rs = 40; % stopband ripple
Fs = 500; % sampling frequency
Fn = Fs/2; % nyquist frequency
Fpass = [0.05 150]; % passband
Fstop = [0.01 200]; % stopband
Wp = Fpass/Fn; % normalized
Ws = Fstop/Fn;
% Create a butterworth filter using several methods
[N,Wn] = buttord(Wp,Ws,Rp,Rs);
[B,A] = butter(N,Wn);
[sos1,g1] = tf2sos(B,A);
[z,p,k] = butter(N,Wn);
[sos2,g2] = zp2sos(z,p,k);
% View the filters
figure
freqz(B,A,Np,Fs)
title('Non-stable tf butterworth')
figure
freqz(sos1,Np,Fs)
title('butterworth tf2sos')
figure
freqz(sos2,Np,Fs)
title('butterworth zp2sos')
% Create an elliptic filter using several methods
Rs2 = 150; % all filters stable at Rs2 = 40. Try sharper cutoff.
[N,Wp] = ellipord(Wp,Ws,Rp,Rs2)
[B,A] = ellip(N,Rp,Rs2,Wp);
[sos1,g1] = tf2sos(B,A);
[z,p,k] = ellip(N,Rp,Rs2,Wp);
[sos2,g2] = zp2sos(z,p,k);
% View the filters
figure
freqz(B,A,Np,Fs)
title('Non-stable tf ellipse')
figure
freqz(sos1,Np,Fs)
title('ellipse tf2sos')
figure
freqz(sos2,Np,Fs)
title('ellipse zp2sos')

  댓글 수: 2

Daniel M
Daniel M 29 Nov 2019
Note I just ran this on some sample data and found that 0.05 was not effective to remove baseline wander, but 0.5 was. This will vary per the data.
Stephan Lallinger
Stephan Lallinger 5 Dec 2019
You are right 0.05 is not enough to get rid off baseline wander.
I will look at your filters closer.
Thank you for your response.

댓글을 달려면 로그인하십시오.

추가 답변(0개)

Community Treasure Hunt

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

Start Hunting!

Translated by