You are on page 1of 16

SCHOOL OF ELECTRICAL ENGINEERING

Class: TY BTECH/SEM VI Course: DSP (ET 322)

Application in Signal Processing


Course Instructor: Prof. Nutan Bansode
Prof. Smita Kulkarni

TETA50 0220190003 Dipti Darade


TETA51 0220190027 Vedant Naik
TETA54 0220190126 Rushikesh Shelke

Year : 2020-21
Comparative study of FIR and IIR filters for the
removal of Baseline noises from ECG signal

Abstract- In signal processing, the function of a filter is to remove unwanted


parts of the signal, such as random noise, or to extract useful parts of the
signal, such as the components lying within a certain frequency range. This
paper presents the comparisons of Digital FIR & IIR filter complexity and
their performances to remove Baseline noises from the ECG signal hence it is
desirable to remove these noises for proper analysis and display of the ECG
signal.

Keywords: Baseline Noises, FIR filters, IIR filters.


Problem Statement

Removal of Baseline noises from ECG signal


using IIR and FIR filter
What is ECG Signal?
Also known as an electrocardiogram or an EKG, an ECG is a test
that detects and records the strength and timing of the electrical
activity in your heart. This information is recorded on a graph that
shows each phase of the electrical signal as it travels through your
heart.

Fig1. Electrocardiogram Waveform [1]


Explain ECG Signal?

Fig 2. Electrocardiogram [2]

1- Sinoatrial node

2- Atrioventricular (AV) node


3- Bundle of His

4 , 5- Right and Left bundle branches


Baseline Noise
The main causes of baseline noise are breathing, lose sensor contact and body
movements. Baseline noise is a low frequency signal. Baseline will disturb the
whole cycle of ECG signal but mainly the low frequency part. T-wave is a part
of ECG signal related to a phenomenon associated with increased risk of death
and baseline wandering may prevent its correct detection.

Fig 3. Baseline waveform [3]


IIR
The infinite impulse response (IIR) filter is a recursive filter in that
the output from the filter is computed by using the current and
previous inputs and previous outputs. Because the filter uses
previous values of the output, there is feedback of the output in the
filter structure.

IIR (infinite impulse response) filters are generally chosen for


applications where linear phase is not too important and memory is
limited. They have been widely deployed in audio equalisation,
biomedical sensor signal processing, IoT/IIoT smart sensors and
high-speed telecommunication/RF applications.
Fig 4. Block diagram of IIR [4]
FIR
In signal processing, a finite impulse response (FIR) filter is a filter whose impulse response (or response
to any finite length input) is of finite duration, because it settles to zero in finite time. This is in contrast to
infinite impulse response (IIR) filters, which may have internal feedback and may continue to respond
indefinitely

Fig 5. Block diagram of IIR [5]

A finite impulse response (FIR) filter is a filter structure that can be used to implement almost any sort of
frequency response digitally. An FIR filter is usually implemented by using a series of delays, multipliers,
and adders to create the filter's output.
Why PSD? Why not ESD?

•Power Spectral Density (PSD) is the frequency response of a random or periodic signal. It tells us where
the average power is distributed as a function of frequency. The PSD is the Fourier transform of the
autocorrelation function.

•Energy density spectrum (ESD) is also called energy spectrum. The square of the amplitude of the
(complex) Fourier transform of an aperiodic function.

•As ECG is a periodic signal so we mostly use PSD instead of ESD.


MATLAB Code (IIR)
clear all; figure;
load('100m.mat');
subplot(2,1,1)
x= (val(1,:));
plot(t,x)
t = (0:length(x)-1)/360;
title('Original Signal')
Fs = 360; % Sampling Frequency
N = 2; % Order ys = ylim;
subplot(2,1,2)
Fstop = 0.5; % Stopband Frequency plot(t,y2)
Astop = 20; % Stopband Attenuation (dB) title('Highpass Filtered Signal')
xlabel('Time (s)')
% Construct an FDESIGN object and call its CHEBY2 method. ylim(ys)
h = fdesign.highpass('N,Fst,Ast', N, Fstop, Astop, Fs);
Hd = design(h, 'cheby2');
y2 = filter(Hd,x);
MATLAB Output (IIR)
MATLAB Code (FIR)
clc; subplot(2,1,1)

clear all; plot(t,y)

load ('100m.mat'); title('Original Signal')

ys = ylim;

y=val(1,:);
subplot(2,1,2)
t = (0:length(y)-1)/360; plot(t,outhi)
title('Highpass Filtered Signal')
xlabel('Time (s)')
bhi = fir1(320,0.5/180,'high',kaiser(321,0.5),'scale'); ylim(ys)
outhi = filter(bhi,1,y);
MATLAB Output (FIR)
Conclusion
•This problem can be solved by applying the IIR filter to the ECG signal in both directions.

•FIR and IIR filters both have removed the baseline noises at the expense of some ringing effect at the
starting of waveform.

•But their comparison shows that due large order of FIR filter there is a phase delay in FIR filtered
waveforms.

•The computational complexity of FIR filter is far greater than IIR filters. It increases the memory
requirement and power dissipation of FIR filter. So, IIR filters can be the better choice for removal of
Baseline noises.
References

1. https://www.alivecor.com/education/ecg.html#:~:text=Also%20known%20as%20an%20electroc
ardiogram,it%20travels%20through%20your%20heart
2. https://www.alivecor.com/education/ecg.html#:~:text=Also%20known%20as%20an%20electroc
ardiogram,it%20travels%20through%20your%20heart
3. https://www.researchgate.net/figure/An-example-of-baseline-wandering-removal-showing-a-
raw-signal-from-Lead-I-b-filtered_fig4_225040955
4. https://www.mikroe.com/ebooks/digital-filter-design/introduction-iir-filter
5. https://www.mikroe.com/ebooks/digital-filter-design/introduction-iir-filter
Thank You!

You might also like