How do you design your ECG bandpass?
조회 수: 51 (최근 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
Star Strider
2019년 12월 5일
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
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
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Digital Filtering에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!