filtering ECG signal using 4th order low pass filter
2 views (last 30 days)
Show older comments
Pallabi dey
on 21 Aug 2018
Commented: Pallabi dey
on 29 Aug 2018
hello friends, i have written matlab code for 4th order butterworth filter of 70 hertz along with poles, zeros, transfer. Now, how can i apply this designed filter on an ecg signal? thanks. i am sharing my code here. clc; wc= 70; N= 4; K= 2.575; for k= 0:N-1 Sk(k+1)= wc*exp(1i*(pi/2))*exp(1i*(2*k+1)*(pi/(2*N)));
end
[NUM,DEN]=zp2tf([],Sk,K);
b0=DEN(end)*K;
Hs=tf(b0,DEN);
figure();
freqs(b0,DEN)
figure();
plot(Sk./10^2, 'x')
xlim([-10,10]);
title('Pole placement in s-plane')
%
for x = 1:10
disp(x)
end
[NUM,DEN]=lp2lp(NUM,DEN,wc);
fs=1000;
[NUMd,DENd]=bilinear(NUM,DEN,fs);
disp('NUMd='),disp(NUMd')
disp('DENd='),disp(DENd')
[Hd,wd]=freqz(NUMd,DENd);
Magd=abs(Hd);
subplot(2,1,1);
plot(wd/pi,Magd);
grid on;
title('Digital Lowpass Butterworth Filter');
ylabel('Amplitude response')
axis([0 0.2 0 1])
subplot(2,1,2);
plot(wd/pi,angle(Hd));
grid on;
axis([0 0.2 -200 200])
ylabel('Phase response')
xlabel('Frequency,[unit of pi]')
4 Comments
KALYAN ACHARJYA
on 21 Aug 2018
Is this following output (Magd)>> the final line for filter response?
Magd=abs(Hd);
Accepted Answer
KALYAN ACHARJYA
on 21 Aug 2018
Edited: KALYAN ACHARJYA
on 21 Aug 2018
tic;
while toc<t %mention time of the signal to be observed here e.g. t=20,30 etc
filtered_ECG_Signal=mgd(Original_ECG_signal); %make the designed filer as a custom function or you can apply directly too.
TS(Original_ECG_signal,filtered_ECG_Signal);
end
% Finalize
release(TS)
2 Comments
More Answers (0)
See Also
Categories
Find more on Analog Filters in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!