フィルターのクリア

How do you design your ECG bandpass?

83 ビュー (過去 30 日間)
Stephan Lallinger
Stephan Lallinger 2019 年 11 月 28 日
コメント済み: Star Strider 2019 年 12 月 5 日
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 件のコメント
Stephan Lallinger
Stephan Lallinger 2019 年 12 月 5 日
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 2019 年 12 月 5 日
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 2019 年 11 月 29 日
編集済み: Daniel M 2019 年 11 月 29 日
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 2019 年 11 月 29 日
編集済み: Daniel M 2019 年 11 月 29 日
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 2019 年 12 月 5 日
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 件)

カテゴリ

Help Center および File ExchangeFrequency Transformations についてさらに検索

製品


リリース

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by