Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 33

BME 452 Biomedical Signal

Processing

Lecture 5
Digital filtering

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 1
Lecture 5 Outline
 In this lecture, we’ll study digital filtering
methods
 General considerations and filter specifications

 Filtering in frequency domain

 Filtering in time domain


 Sum and difference (SD) filter Finite Impulse Response
(FIR) filter
 Infinite Impulse Response (IIR) filter using MATLAB

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 2
General considerations
 As mentioned in earlier lectures, filtering is the process of
keeping components of the signal with certain desired
frequencies and removing components of the signal with
certain undesired frequencies

 Very often, we keep the gain of the required frequency


components to 1 or close to 1

 And the gain of the undesired frequency components will


be 0 or close to 0

 In general, there are 4 types of filtering: LPF, HPF, BPF,


BSF

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 3
Filter specifications
 Passband
 the range of frequency components that are allowed to pass
 Stopband
 the range of frequency components that are suppressed
 Passband ripple
 ripples in the passband
 the maximum amount by which attenuation in the passband may
deviate from gain (which is normally 1)
 Stopband ripple
 Ripples in the stopband
 The maximum amount by which attenuation in the stopband may
deviate from gain (which is normally 0)
 Stopband attenuation
 the minimum amount by which frequency components in the
stopband are attenuated
 Transition band
 The band between the passband and the stopband

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 4
Ideal filter and edge frequencies
 The edge frequencies are the end
frequencies of passband or
Gain Gain stopband
LPF HPF  fc= cut-off frequency
1 1

LPF: passband: 0  f  fc
freq
fc
freq fc Stopband: fc f  fs/2
fs/2
Last point in
Gain freq axis
Gain HPF: passband: fc  f  fs/2
BSF
BPF 1
1
Stopband: 0 f  fc

BPF: passband: fc1 f fc2


freq
freq fc1 fc2
fc1 fc2
fs/2 Stopband: 0 f  fc1 and fc2
Last point in
freq axis
 f  fs/2

Frequency response BSF: passband: 0  f  fc1


of ideal filters and fc2  f  fs/2
Stopband: fc1  f fc2

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 5
Actual LPF

 LPF
 Passes all low-
frequency
components below
fp and blocks all
higher frequency
components above
fs

 In reality, you can’t


design ‘square’ type of
filters
 So, there needs to be
transition betweens the
LPF: passband: 0f fp bands
Stopband: fsf fs/2
Transition band: fp<f <fs

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 6
LPF example
 Low-pass filter (LPF) 1.5 1.5 1.5

 Eg.: Consider a combination of 3 1 1 1

sinusoidal signals - 2 Hz, 5 Hz and 11 0.5 0.5 0.5

Hz. 0 0 0

-0.5 -0.5 -0.5

-1 -1 -1

 The final output signals after 2 LPF -1.5


0 200 400 600 800
-1.5
1000 0 200 400 600 800
-1.5
1000 0 200 400 600 800 1000

are shown
2 Hz signal 5 Hz signal 11 Hz signal

 LPF at fp=3 Hz and fs=4 Hz

 LPF at fp=8 Hz and fs=9 Hz

1.5

LPF, fp=3 Hz, fs=4 Hz 1

0.5

0
3
-0.5
2

1
-1
Only 2 Hz signal remains
-1.5
0 0 200 400 600 800 1000

-1

-2
3

-3
2
0 200 400 600 800 1000
1

Combined signal 0

Only 2 Hz and 5 Hz signals remain


-1

LPF, fp=8 Hz, fs=9 Hz -2

-3

0 200 400 600 800 1000

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 7
HPF
 Passes all high-frequency Gain
components above fp and Passband
blocks all higher frequency
components below fs
1 Passband
ripple
 Eg.: Consider the same combination Stopband
of 3 sinusoidal signals, 2 Hz, 5 Hz and attenuation
11 Hz. Stopband

 The final output signals after 2 HPF freq


are shown fs fp Fs/2
Stopband
ripple Transition
 HPF at fs=3 Hz and fp=4 Hz band From this point
onwards, we will use Fs
for sampling frequency
3

 HPF at fs=8 Hz and fp=9 Hz 2

HPF, fs=3 Hz, fp=4 Hz -1 Only 5 Hz and 11 Hz signals


-2
remain
-3

0 200 400 600 800 1000

2
1.5
1

1
0

0.5
-1

-2 0

-3 -0.5
Only 11 Hz signal remains
0 200 400 600 800 1000

HPF, fs=8 Hz, fp= 9 Hz


-1

Combined signal -1.5


0 200 400 600 800 1000

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 8
BPF
 Passes all frequency components between
edge passband frequencies,
fp1<freq(allow)<fp2 and blocks all frequencies
below and above edge stopband Gain
Passband
frequencies, freq(block)<fs1; freq(block)>fs2
1
 Eg.: Consider the same combination Passband
ripple
of 3 sinusoidal signals, 2 Hz, 5 Hz and
11 Hz. Stopband Stopband

 The final output signal after BPF at freq


fs1 fp1 fp2 fs2
fp1=4 Hz, fp2=6 Hz, fs1=3 Hz, fs2=7 Hz Stopband Stopband
Fs/2 freq
ripple Transition Transition ripple
is shown band band

1.5
3
1
2

0.5
1
BPF 0
0

-1 -0.5

-2 -1

-3
-1.5
0 200 400 600 800 1000
0 200 400 600 800 1000

Combined signal Only 5 Hz signal remains

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 9
BSF
 Band-stop filter (BSF)
 Passes all frequency components
lower and higher than edge passband Gain
frequencies, freq(allow)<fp1; freq(allow)>fp2
and blocks all frequencies between
fs1<freq(block)<fs2 1
Passband Passband
ripple ripple

 Eg.: Consider the same combination Passband


Passband Stopband
of 3 sinusoidal signals, 2 Hz, 5 Hz and ripple
11 Hz.
freq
fp1 fs1 fs2 fp2 Fs/2
 The final output signal after BSF at
Transition Transition
fp1=4 Hz, fp2=6 Hz, fs1=3 Hz, fs2=7 Hz band band
is shown Stopband
1.5
3

1
2

1 0.5

0 BSF 0

-1
-0.5
-2
-1
-3

0 200 400 600 800 1000 -1.5


5 Hz signal is filtered out,
only 2 Hz and 11 Hz signals
0 200 400 600 800 1000

Combined signal remain

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 10
Direct filtering (in frequency domain)
 A simple method of doing this
 Obtain the DFT of the signal (from 0 to fs)
 Set to zero the values that are not in the required frequency range i.e. apply a
RECTANGULAR window
 Compute the Inverse Discrete Fourier Transform (IDFT)
 Example: f1=8 Hz and f2=25 Hz with N=100, fs=200 Hz
 Say, we wish to design a LPF with fp=10 Hz and fs=12 Hz
1 1 2
Gain
0.8 0.8
1.5 LPF
0.6 0.6
1
0.4 0.4

+ =
0.5
0.2 0.2

0 0 0

-0.2 -0.2
-0.5
-0.4 -0.4
-1
-0.6 -0.6
-1.5
-0.8 -0.8

-1 -1 -2
0 20 40 60 80 100 0 20 40 60 80 100 0 20 40 60 80 100

123456 96 97 98 99 100

 Compute y=fft(x) in MATLAB 7 … …….. ..


51
...… …….. ..95
198
fs Hz Hz
 Set the values y(7:95)=0 WHY? This is important! Fs/2

 Compute yf=ifft(y,’symmetric’)
And you get the low pass filtered signal!
1.5

 1

 What is the main disadvantage of this technique?


0.5

 High computation and time -0.5


Low pass filtered
 Another disadvantage?? signal
-1

-1.5
0 20 40 60 80 100

In MATLAB, you have to force conjugate symmetry, else you will get complex values due round-off errors in doing FFT and IFFT

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 11
Direct filtering (in frequency domain) –cont.
 How it works:
1

Time domain 0.9

40
0.8
2
20
1.5
0 Real values 0.7

1
-20 0.6
0.5 DFT (or FFT) -40 0.5
0 20 40 60 80 100
0
50 0.4
-0.5

-1 Imaginary values 0.3


0
-1.5 0.2

-2
0 20 40 60 80 100 0.1
-50
Original signal X 0 20 40 60 80 100
0
0 20 40 60 80 100
with length=100 1

Hanning
0.9

0.8 Multiply with


0.7
rectangular
0.6

0.5 window on both window


0.4

0.3
sides/ends
0.2

0.1

H=hanning(12);
0
0 20 40 60 80 100

Hf(1:6) =H(7:12);
H(7:95)=0;
20
1.5

15

IDFT (or IFFT) Real values Hf(96:100)=H(2:6);


1
10

0.5 5

0
0 0 20 40 60 80 100

-0.5
50
y=fft(x);
-1
0
Imaginary values yy=y.*Hf;
yf=ifft(yy,'symmetric');
-1.5
0 20 40 60 80 100
-50
Low pass filtered 0 20 40 60 80 100

signal plot(yf);

 We can also use a different window say Hanning


window, instead of rectangular window to obtain a
smoother filtered output

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 12
Filtering in time domain
 Two disadvantages of direct filtering
 computational time and complexity is high
 there is distortion

 To solve, we should filter in time domain

 There are many types of time domain filtering


methods

 We will look at
 Simple FIR filters
 IIR filters using MATLAB codes

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 13
Filtering in time domain (in equation form)
 The output from a IIR digital filter in made Time domain
up of previous inputs and previous outputs 2
40

20

as well Real values


1.5
0
1
-20

0.5 DFT (or FFT) -40

M N 0 20 40 60 80 100

 B[k ] * x[n  k ]  A[ j ] * y[n  j ]


0

y[ n ] 
50
-0.5

-1 Imaginary values
0

k 1 j 1
-1.5

-2
0 20 40 60 80 100
-50
Original signal X 0 20 40 60 80 100

with length=100
 where B and A are the filter coefficients 0.9
1

Multiply with
and the operation * is convolution
0.8

Convolution with rectangular


Convolution with
0.7

coefficients A 0.6

window on both
coefficients B 0.5

and B that sides/ends


that represents
0.4

represents the 0.3

 Convolution in time domain is equivalent the suitable ‘filter’


suitable ‘filter’
0.2

(FIR filter) 0.1

to multiplying in frequency domain –do (IIR filter) 0


0 20 40 60 80 100

you remember that we did some


window multiplication for direct
20
1.5

15
1
IDFT (or IFFT) Real values
filtering
10

0.5 5

0
0 0 20 40 60 80 100

50
-0.5

Imaginary values
 Convolution operation will not be
-1
0

-1.5
0 20 40 60 80 100

discussed in this course


-50
Low pass filtered 0 20 40 60 80 100

signal

 The output from a FIR digital filter in made


up of previous inputs only, so no feedback
M
y[ n ]   B[k ] * x[n  k ]
k 1

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 14
Simple low pass FIR filter –sum filter
 Consider, y[n]=x[n]+x[n-1] for every data in the signal
 This filter is also known as the sum filter
 This simple addition acts as a LPF!
 This can be proved by using z=transform but is not needed for the purpose of this
course

 For hardware design, the block diagram would look like


x(n) x(n-1) y(n)
z-1 +

 Advantages:
 You just need one adder and one delay circuit – simple and cost effective (i.e.
cheap)
 The filter coefficients are integer values (in this case they are 1), so no round-off
errors
 It is an FIR filter so it is stable – why are FIR filters stable?  No feedback
 Disadvantage: Not very good LPF (see next slide)

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 15
Sum filter (cont.)
 The frequency response of the sum filter: not very good as it is far from
the ideal ‘square’ filter

Magnitude is
also known as
gain

Figure from S.K.Mitra, DSP 3e

 The gain at freq=0 is 1


 The stopband frequency (when gain=0) is at  rad/sample or at Fs/2 Hz
 So, there is no stopband
 So how to define the passband frequency and transition bands?
 For these cases, we use the 3 dB cut-off as the passband frequency

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 16
3 dB cut-off frequency
 The 3 dB cut-off frequency is defined as the frequency when the gain
drops 3 dB from maximum gain of 1, which is assumed to be 0 dB

 Gain=1, 20log10(1)=0 dB

 When energy is half, i.e. gain=(1/2)0.5=0.7071, we have


20log10(0.7071)=-3 dB

 From the figure


 We can see that the 3 dB cut-off frequency (when gain=0.7071) is
approximately  0.5  rad/sample or  Fs/4 Hz
 This is the passband frequency
 So, the passband is from 0 to Fs/4 Hz
 And transition band is from Fs/4 to Fs/2

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 17
Increasing the order of sum filter
 For order 1, we had y[n]=x[n]+x[n-1]
 Now assume, this is fed to another same filter in cascade connection
x(n) x(n-1) y(n) y(n) y(n-1) z(n)
z-1 + z-1 +

 Now, we have z[n]=y[n]+y[n-1]

Verify this using


Solving, we have z[n]=y[n]+y[n-1] x[1]=3, x[2]=2,
=x[n]+x[n-1]+x[n-1]+x[n-2] x[3]=5
=x[n]+2x[n-1]+x[n-2] Hint:
Compute y[2] and
2
y[3]
x(n) x(n-1) x(n-2) z(n)
z-1 z-1 + Compute z[3]
using single
cascaded filter and
You will notice that z[n] will be defined only for n=3 two filters and
onwards if x[1] is the starting point, i.e. for every order M, compare
you lose M initial data points in filtering
Likewise y[n] is defined only from y[2] onwards.

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 18
Increasing the order of sum filter (cont.)
 So for order M, we have
M Q Q!
y ( n )   M Cr x[n  r ] where Cr 
r 0 r! (Q  r )!

 The frequency response for M=3 is given =>


What would be y[n] for N=3?

Figure from
S.K.Mitra,
DSP 3e

 The passband is about 0.302  rad or Fs/6


 We can see that with increasing order, the passband is becoming smaller without any
change in stopband
 Also, the curve is becoming closer to the ideal ‘square’
 So, we can increase/decrease M depending on our needs
 The 3-dB cut-off frequency is given by fp= cos-1(2-1/(2*M)) *2/pi

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 19
Simple high pass FIR filter
This is also known as a
difference filter
 Similarly, a HPF can be designed using y[n]=x[n]-x[n-1]
 For hardware design, the block diagram would look like

y(n)
x(n)
z-1 -
+
x(n-1)

Figure from
 The stopband frequency (when gain=0) is at 0 Hz, i.e. there is no stopband S.K.Mitra,
DSP 3e
 The gain at freq=Fs/2 Hz or  rad is 1
 The passband frequency is at 0.5  rad or Fs/4 Hz (using 3 dB cut-off)
 Passband width is from Fs/4 to Fs/2 Hz
 The orders, N can be increased to obtain a smaller passband width and to obtain a
frequency response closer to the ideal ‘square’ filter
 The 3-dB cut-off frequency is given by fp= sin-1(2-1/(2*N)) *2/pi
 For order N, we have
N

y ( n )   ( 1) r N C x[n  r ]
r 0 r

As homework, try y[n] for N=3?

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 20
Simple HPF FIR filter example
 HPF can be used to remove mean values and low frequency polynomial trends, i.e.
to detrend the data

 As an example, we saw the passenger data plot in Lecture 4

 The detrending can be simply done by using, y[n]=x[n]-x[n-1], where x[n] is the
data

Figures from
R.Shiavi,
Introduction to
applied statistical
signal analysis

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 21
Simple band pass FIR filter
 Similarly, a BPF can be designed using a combination of LPF and HPF
Magnitude response
 This is known as sum and difference (SD) filter
1
0.9
Different orders, M and N can be chosen to obtain
M=7, N=2
 0.8 M=28 N=8

the required frequency response 0.7


0.6

Gain
0.5

N
GM , N ( f )  ( 2 cos fT ) M 2 sin fT
0.4
/ Gain
cf
0.3
0.2
0.1
0
0.00 0.25 0.50 0.75 1.00
 Where Gaincf is the gain at centre frequency given
Normalised Frequency (pi rad/sample)
by
f M N
fcentre  s cos1 
2 M N

 Example (As homework, verify these later on your own)


 For filter orders of M=28 and N=8 gives

 The centre frequency is 40 Hz when fs=256 Hz


 Approximate 3 dB bandwidth from 32 to 48 Hz (rounded to the nearest integer)
 The gain amplification at 40 Hz is approximately 47.211

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 22
Simple band pass FIR filter (cont.)
 Let us compute a band pass FIR filter equation:

 For orders, LPF, M=4 and HPF, N=1, obtain the band
pass FIR equation that expresses z[n] in terms of x[n]
and delays of x[n]
x(n) y(n) z(n)
LPF HPF

M
y ( n )   M C r x[ n  r ]
r 0
 Solution (can you get the answer?)
N
 
z ( n )   ( 1) r N C y[n  r ]
r 0 r

 z[n]=x[n]+3x[n-1]+2x[n-2]-2x[n-3]-3x[n-4]-x[n-5]

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 23
IIR filter
 The problem with FIR filter is that you do not get ‘square’
passband like in ideal filters unless you use a very high
order

 To solve this problem, we can use IIR filter

 The disadvantages of IIR filters are


 The are not stable (due to feedback)
 The filter coefficients are not normally integer, so can have
round-off errors
 Hardware design is more complicated
 Most importantly, their phase response is not linear

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 24
Phase response?
 In you refresh your memory, you’ll know 200
that frequency responses have two

Magnitude (dB)
parts: magnitude and phase responses
0

-200

 In the diagrams, the magnitude and -400


0 0.2 0.4 0.6 0.8 1

phase responses of Butterworth and Normalized Frequency (  rad/sample)

Elliptic IIR filters are shown


1000

Phase (degrees)
0

 You can see that the gains are relatively -1000

stable at 1 for the bandpass range of 0.2 -2000


to 0.6 
0 0.2 0.4 0.6 0.8 1
Normalized Frequency (  rad/sample)

Butterworth
 But the phase response is not linear, i.e.
not a straight line 0

Magnitude (dB)
-20

In MATLAB, this problem is solved by


-40

filtering twice, once forward and once
-60

reverse
-80
0 0.2 0.4 0.6 0.8 1
Normalized Frequency (  rad/sample)

500
Phase (degrees)
 By doing so, the magnitude response is
squared while the phase response 0

becomes zero
-500
0 0.2 0.4 0.6 0.8 1
Normalized Frequency (  rad/sample)

Elliptic
Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 25
IIR filter design
 It is not possible to design IIR filters digitally
 So, the approach is to design analogue IIR filters, then use a bilinear method to transform the filter to digital
 This ‘bilinear’ method will not be discussed in this course as it requires z –transofrm knowledge
 So, we will use MATLAB functions directly

 There many types of IIR filters


 Butterworth
 Elliptic (Cauer)
 Chebyshev I
 Chebyshev II
 Bessel

 But we will look at two only: Butterworth and Elliptic filters


 Because Butterworth filter gives flat magnitude responses in the passband and stopband (i.e. no ripples or very little ripple) while Elliptic filter requires the lowest order among all the IIR filters

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 26
Butterworth IIR filter
 Remember the IIR filter equation
M N
y[ n ]   B[k ] * x[n  k ]  A[ j ] * y[n  j ]
k 1 j 1

 We have to determine the orders M and N


and then determine the coefficients A and B
Low pass Butterworth filter
 Very often, we use M=N with different orders Figure from
S.K.Mitra,
DSP 3e

 In MATLAB, we can find the required minimum order for our specification using

 buttord (Wp, Ws, Rp, Rs)

 where Wp is the passband edge frequency, Ws is the stopband edge frequency,


Rp is maximum ripple in passband and Rs is the minimum attenuation in
stopband

 Rp and Rs will be in dB, while Ws and Wp will be in normalised  radian/sample

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 27
Butterworth IIR filter (cont.)
 After finding the order using buttord function, we have to find out the filter
coefficients B and A using

 [B,A]=butter (N,Wp)

 where N is the filter order chosen earlier

 Finally to actually do the filtering, we use filtfilt (B,A,x) where x is the


signal to be filtered

 Filtfilt function filter the signal twice and uses convolution operations

 Example: Design a lowpass filter with Fs=200 Hz


 Passband = 0 to 40 Hz
 Passband ripple = less than 3 dB
 Stopband = 50 Hz to the Fs/2
 Stopband attenuation = at least 30 dB

 Plot the filter's frequency response – use freqz (B,A) function for this purpose.

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 28
Butterworth IIR filter example - solution
 Fs=200 Hz
 Rp=3 and Rs=30
 Wp=40/100
 Ws=50/100
 Use buttord (Wp, Ws, Rp, Rs)

 N=buttord(40/100, 50/100, 3, 30) which gives N=11

 Next obtain the coefficients, B and A using [B,A]=butter (11, 40/100) which gives

 B = 0.0002 0.0026 0.0129 0.0386 0.0772 0.1081 0.1081 0.0772 0.0386 0.0129
0.0026 0.0002

 A =1.0000 -2.1931 3.5467 -3.6414 2.9012 -1.7020 0.7749 -0.2625 0.0658 -


0.0114 0.0012 -0.0001

 Using freqz(B,A), we get

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 29
Butterworth IIR filter example applied to reduce 50 Hz noise from ECG

 Assume we the use the designed Butterworth filter to reduce 50 Hz noise from the
ECG below

plot(ecg);
ecgf=filtfilt(B,A,ecg);
plot(ecgf);

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 30
Elliptic filter
 The same approach could be used for designing an Elliptic filter.

 The functions are

 N=ellipord(Wp, Ws, Rp, Rs)

 [B,A] = ellip(N,Rp,Rs,Wp)

 The advantage of Elliptic filter as compared to Butterworth filter is that for the same specification, we require a
lower order but there are ripples in the passband that is not so evident for Butterworth filter

 For the bandpass filter example, we need only order 3 for Elliptic filter but have to use order 8 for Butterworth
filter

 As a homework, try the other IIR filter functions – chebyshev I, chebyshev II, etc. using MATLAB help, if necessary

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 31
Advantages and disadvantages of FIR/IIR
 Let’s sum up the advantages and disadvantages of FIR/IIR filters

 FIR advantages over IIR


 Stability (as there is no feedback)
 Linear phase response
 Simpler hardware design
 Desirable numerical properties (less round off/finite precision problem)
 Can be designed using fractional arithmetic (coefficients are either integers or less than 1.0)

 FIR disadvantages over IIR:


 Requires higher order (hence more memory, computation time)

 Though there are more advantages in using FIR, very often we use IIR as we have powerful computers and software like MATLAB, which solve most of the disadvantages

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 32
Study guide (Lecture 5)
 From this week’s lecture, you should know how to perform
filtering using

 Direct filtering in frequency domain

 Sum and difference (SD) FIR filtering

 IIR filtering using MATLAB

End of lecture 5

Lecture 5 BME452 Biomedical Signal Processing 2013 (copyright Ali Işın, 2013) 33

You might also like