You are on page 1of 14

11/18/2015

Digital Signal Processing

11/18/2015 1

• Reading

• Discrete-Time Signal Processing (2nd edition)


authors: Alan Oppenheim and Ronald Schafer
Publisher: Prentice-hall
http://www.pearsonhighered.com/product?ISBN=0131988425
Chapter 7: section 7.2

• Mitra 2nd edition:


• Section 7.6

• Proakis 4th edition


• Sections: 10.1, 10.2.1, 10.2.2

11/18/2015 2

1
11/18/2015

Design of Digital Filters


In LTI systems, the output 𝑦[𝑛] is related to the input 𝑥[𝑛] by the convolution operation

𝑦 𝑛 =𝑥 𝑛 ⊛𝑦 𝑛 = 𝑥 𝑘 ℎ[𝑛 − 𝑘]
−∞

All ideal filters are non-causal and hence physically unrealizable

“The purpose of digital filter design is to approximate any of the ideal frequency response
characteristics with a causal and stable digital filter that meets a specific frequency response
with low order for efficient computational complexity”
11/18/2015 3

Design of linear phase FIR filters

1. Window technique
2. Frequency-sampling method
3. Optimum equiripple filters (Parks-McClellan)

11/18/2015 4

2
11/18/2015

Design of FIR filters by windowing


example:

• Ideal low-pass filter is a non-causal system

1   c
H d ( e j )  
0 c    
sin c n
hd [n ] 
n

11/18/2015 5

• Design of low-pass filter using rectangular window (truncation)

h[n ]  hd [n ].w[n ]

w[n ] : Rectangular Window


1 0  n  M 1
w[n ]  
0 otherwise

h [ n ] 0  n  M 1
h[n ]   d
0 otherwise
11/18/2015 6

3
11/18/2015

Effect of windowing in the frequency domain

• Multiplication in time domain implies convolution in the frequency domain


• The window spectrum reshapes the filter spectrum


h[n ]  hd [n ].w[n ]  H e    H e W e d
1
j    
j j 

2
d

• The rectangular window has high sidelobes

11/18/2015 7


h[n ]  hd [n ].w[n ]  H e    H e W e d
j1    
j j 

2
d

• the spectrum of the designed filter is the result of the convolution between the
desired spectrum with the window spectrum

• Approximate filter response due to windowing

11/18/2015 8

4
11/18/2015

• In order to improve the frequency response of the designed filter, smooth


windows are used
• All these window functions are
symmetric around 𝑀 2.

• They can be used for FIR linear phase filters

11/18/2015 9

• The rectangular window has the highest sidelobes and the narrowest
transition band

• the Blackman window has the lowest sidelobes and the widest transition band

11/18/2015 10

5
11/18/2015

Windows in the Frequency Domain

11/18/2015 11

• example
• 𝑥 𝑛 = cos 𝜔1 𝑛 + cos 𝜔2 𝑛 , 𝜔1 = 0.2𝜋, 𝜔2 = 0.5𝜋. The output signal 𝑦[𝑛]
is the result of filtering 𝑥[𝑛] with FIR filter ℎ[𝑛] whose cutoff frequency
𝜔𝑐 = 0.3𝜋. Plot the spectrum of 𝑦[𝑛]

11/18/2015 12

6
11/18/2015

Typical realizable low-pass filter


Design specifications:
• Maximum tolerable passband ripple: 𝟐𝟎𝒍𝒐𝒈𝟏𝟎 𝜹𝟏
• Maximum tolerable stopband ripple: 𝟐𝟎𝒍𝒐𝒈𝟏𝟎 𝜹𝟐
• Passband edge frequency: 𝝎𝒑
• Stopband edge frequency: 𝝎𝒔

11/18/2015 13

FIR Filter Design Specifications


How to design FIR filter
with specific transition
band and ripples?
solution: use Kaiser window

11/18/2015 14

7
11/18/2015

The Kaiser window filter design method


• The Kaiser window is an adjustable window with its parameters are related to
the design specs

I 0   1  n  M 2  M / 2  
2
 
w[n ]  0n M
I 0  

• 𝐼0 [. ] is the modified zero-order Bessel function


   s   p
A  20 log10 

0.1102 A  8.7  A  50

  0.5842 A  210.4  0.07886 A  21 21  A  50
0 A  21

A8
M
2.285
11/18/2015 15

• Kaiser window FIR filter design example


• design a linear phase high-pass filter with the following specs:
s  0.5 ,  p  0.35 , 1   2    0.021
 A  20 log10 (0.021)  33.5,
   0.5842 * (33.5  21)0.4  0.07886(33.5 - 21)  2.6,
(33.5  8)
M  23.68  24
2.285 * 0.15

• ideal linear phase high-pass filter impulse response


0 0    c
H hp e j     j M 2
e c    
H hp e j   e  j M 2  H lp e j 
sin  n  M 2  sin c n  M 2 
hhp [n ]   n
 n  M 2   n  M 2 
c  0.35  0.5  2  0.425
11/18/2015 16

8
11/18/2015

This filter is of type-I linear phase FIR filter. cannot be type II


• filter impulse response

11/18/2015 17

• Disadvantages of window technique


– Cannot specify 𝜔𝑠 and 𝜔𝑝 precisely
– Cannot specify 𝛿1 and 𝛿2 ripple factors simultaneously
– The approximation error is not uniformly distributed over the
band intervals. It is higher near the band edges. Distributing the
error uniformly, we can use lower order filter with the same
specs.
11/18/2015 18

9
11/18/2015

2- Design of linear-phase FIR filters using frequency sampling


technique

• We specify the desired the frequency 𝐻𝑑 (𝑒 𝑗𝜔 ) response at a set of equally spaced


frequencies, and solve for the filter impulse response ℎ 𝑛 .

• Since ℎ[𝑛] is real, we have 𝐻 𝑘 + 𝛼 = 𝐻 ∗ (𝑀 − 𝑘 − 𝛼)

• since ℎ 𝑛 is symmetric/ antisymmetric, the equations can be further simplified.

• disadvantage of the frequency sampling method: there is no control over the


frequency response between the specified frequency samples 𝝎𝒌 . Large filter length is
required in order to avoid abrupt change in the frequency response in the vicinity of
𝝎𝒌

11/18/2015 19

• Table for symmetric linear-phase FIR filter design using frequency-sampling method

11/18/2015 20

10
11/18/2015

• Table for antisymmetric linear-phase FIR filter design using frequency-sampling


method

11/18/2015 21

example: design a symmetric linear-phase low-pass filter with the following


frequency response samples

11/18/2015 22

11
11/18/2015

3-Optimum equiripple FIR linear-phase Filters

• A major disadvantage of window and frequency sampling techniques is the lack of


precise control over critical frequencies 𝜔𝑠 and 𝜔𝑝 .

• The proposed method is a Chebychev approximation problem.

• The weighted approximation error between the desired frequency response and the
actual frequency response is spread evenly across the stopband and evenly across the
passband of the filter minimizing the maximum error.

• The designed filter can be written as


𝐻𝑟 𝜔 = 𝑄 𝜔 𝑃(𝜔)

11/18/2015 23

Define the weighting function

The weighted approximation error

The weighted error can be expressed as

The Chebychev approximation problem is to determine the filter parameters 𝛼(𝑘)


that minimizes the maximum absolute value of the weighted error 𝐸(𝜔)

11/18/2015 24

12
11/18/2015

Parks McClellan “Remez-Exchange Algorithm”


“equiripple filter”

11/18/2015 25

• Example: design an equiripple low-pass filter with length 𝑀 = 61 and passband


edge 𝑓𝑝 = 0.1 and stopband edge 𝑓𝑠 = 0.15

h=firpm(61,[0 .1 .15 .5]*2,[1 1 0 0]);

11/18/2015 26

13
11/18/2015

• Study
– Design of FIR differentiators
– Design of Hilbert transformers

11/18/2015 27

14

You might also like