Sie sind auf Seite 1von 43

AG

C
DS
P

Digital Filter Specifications


Only the magnitude approximation problem
Four basic types of ideal filters with magnitude
responses as shown below (Piecewise flat)
HLP (e j )

HHP (e j )

c 0

HBP (e j )

c
0
HBS (e j )

c2 c1

c1 c2

c2 c1

c1 c2
Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


These filters are unealisable because
(one of the following is sufficient)
their impulse responses infinitely long
non-causal
Their amplitude responses cannot be
equal to a constant over a band of
frequencies
Another perspective that provides some
understanding can be obtained by
looking at the ideal amplitude squared.
Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


Consider the ideal LP response squared
(same as actual LP response)
j
HLP (e

c 0

Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


The realisable squared amplitude
response transfer function (and its
differential) iscontinuous in
Such functions
if IIR can be infinite at point but
around that point cannot be zero.
if FIR cannot be infinite anywhere.
Hence previous defferential of ideal
response is unrealisable
Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


A realisable response would
effectively need to have an
approximation of the delta
functions in the differential
This is a necessary condition

Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


For example the magnitude response
of a digital lowpass filter may be
given as indicated below

Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


In the passband0 p
we
require G
that
with a
( e j ) 1
deviation
j

1 p G (e ) 1 p , p

j
G
(
e
) 0
In the stopband

require that
j

G (e ) s ,

we s
with a deviation

Professor A G Constantinides

AG
C
DS
P

Digital Filter Specifications


Filter specification parameters

p - passband edge frequency

s - stopband edge frequency



- peak ripple value in the
p
passband

s - peak ripple value in the


stopband
Professor A G Constantinides

AG
C

Digital Filter Specifications

DS
P

Practical specifications are often given


in terms of loss function (in dB)

G ( ) 20 log10 G (e j )

Peak passband ripple

p 20 log10 (1 p )

dB
Minimum stopband attenuation
s 20 log10 ( s )
dB
Professor A G Constantinides

Digital Filter Specifications

AG
C

DS
P

In practice, passband edge frequency


Fp
and stopband edge frequency
are
Fs
specified in Hz
For digital filter design, normalized
bandedge frequencies need to be
computed from specifications in Hz
p 2 Fp
using

2 FpT

FT
FT
s 2 Fs
s

2 Fs T
FT
FT

Professor A G Constantinides

10

AG
C

Digital Filter Specifications

DS
P

Example - LetFp 7
kHz,Fs 3
kHz, and FT 25
kHz
Then
2 (7 103 )
p
0.56
3
25 10
2 (3 103 )
s
0.24
3
25 10
Professor A G Constantinides

11

Selection of Filter Type

AG
C

DS
P

The transfer function H(z) meeting the


specifications must be a causal transfer
function
For IIR real digital filter the transfer
1
function is a real rational function
of
z

p0 p1 z 1 p2 z 2 pM z M
H ( z)
d 0 d1 z 1 d 2 z 2 d N z N

H(z) must be stable and of lowest order N


or M for reduced computational
complexity

Professor A G Constantinides

12

AG
C
DS
P

Selection of Filter Type


FIR real digital filter transfer function is a
polynomial in
(order N) with real

1
z
coefficients
N

H ( z ) h[n] z

n 0

For reduced computational complexity,


degree N of H(z) must be as small as possible
If a linear phase is desired then we must
have:
(More on thish[later)
n] h[ N n]
Professor A G Constantinides
13

AG
C
DS
P

Selection of Filter Type


Advantages in using an FIR filter (1) Can be designed with exact linear
phase
(2) Filter structure always stable with
quantised coefficients
Disadvantages in using an FIR filter - Order
of an FIR filter is considerably higher than
that of an equivalent IIR filter meeting the
same specifications; this leads to higher
computational complexity for FIR
Professor A G Constantinides

14

AG
C
DS
P

FIR Design
FIR Digital Filter Design
Three commonly used approaches
to FIR filter design (1) Windowed Fourier series
approach
(2) Frequency sampling approach
(3) Computer-based optimization
methods
Professor A G Constantinides

15

Finite Impulse Response


Filters

AG
C
DS
P

The transfer function is given by


N 1

H ( z ) h(n).z

n 0

The length of Impulse Response is


N
z0
All poles are at
.
Zeros can be placed anywhere on
the z-plane
Professor A G Constantinides

16

AG
C
DS
P

FIR: Linear phase


For phase linearity the FIR
transfer function must have
zeros outside the unit circle

Professor A G Constantinides

17

AG
C

FIR: Linear phase

DS
P

To develop expression for phase


response set transfer function (order n)

H ( z ) h0 h1 z 1 h2 z 2 ... hn z n
In factored form
n1

n2

H ( z ) K (1 i z ). (1 i z )

i 1

i 1

Where
,

1, i 1 K
i
& zeros occur in conjugates

is real

Professor A G Constantinides

18

AG
C

FIR: Linear phase

DS
P

Let H ( z ) KN1 ( z ) N 2 ( z )
where
n1

N1 ( z ) (1 i z )
i 1

Thus

n1

n2

N 2 ( z ) (1 i z 1 )
i 1

n2

ln( H ( z )) ln( K ) ln(1 i z ) ln(1 i z )


i 1

i 1

Professor A G Constantinides

19

AG
C

FIR: Linear phase

DS
P

Expand in a Laurent Series


convergent within the unit
circle
To do so modify the second
n2
n2
n2
1
1
1
i z ) ln( i z ) ln(1 z )
ln(1 as
sum

i 1
i 1
i 1

Professor A G Constantinides

20

AG
C

FIR: Linear phase

DS
P

So that

1
ln( H ( z )) ln( K ) n2 ln( z ) ln(1 i z ) ln(1 z )

i 1
i 1
i

n1

n2

Thus

N1
sm

m 1

ln( H ( z )) ln( K ) n2 ln( z )

where
smN1

n1

i
i 1

sNm2

N2
s m

n1

im
i 1

Professor A G Constantinides

21

AG
C
DS
P

FIR: Linear phase


N1
sm

are the root moments of the


minimum phase component
N2
s m

are the inverse root moments


of the maximum phase component
z e j
Now on thej unit circle
j ( ) we have
H (e ) A( )e
and
Professor A G Constantinides

22

AG
C

Fundamental Relationships

DS
P

N1
N2
s
s
ln( H (e j )) ln( K ) jn2 m e jm m e jm
m
m 1 m

ln( H (e j )) ln( A( )e j ( ) ) ln( A( )) j ( )

hence (note Fourier form)


smN1 sNm2
ln( A( )) ln( K ) (

) cos m
m
m 1 m

smN1 sNm2
( ) n2 (

) sin m
m
m 1 m

Professor A G Constantinides

23

AG
C
DS
P

FIR: Linear phase

Thus for linear phase the second term in


the fundamental phase relationship must
be identically zero for all index values.
Hence
1) the maximum phase factor has zeros
which are the inverses of the those of
the minimum phase factor
2) the phase response is linear with
group delay (normalised) equal to the
number of zeros outside the unit circle
Professor A G Constantinides

24

AG
C

FIR: Linear phase

DS
P

It follows that zeros of linear phase


FIR trasfer functions not on the
circumference of the unit circle
occur in the form
ji 1
i e

Professor A G Constantinides

25

AG
C

FIR: Linear phase

DS
P

For Linear Phase t.f. (order N-1)

h( n) h( N 1 n)

so that
for
N
even:
N
2

H ( z ) h( n).z
n 0

N 1

h( n).z n
n N

N 1
2

N 1
2

n 0

n 0

h( n).z n h( N 1 n).z ( N 1 n )
N 1
2

h( n) z n z m
n 0

m NProfessor
1AG nConstantinides

26

AG
C

FIR: Linear phase

DS
P

for N odd:
N 1
1
2

H ( z ) h(n). z
n 0

N 1

h
z
2

N 1

I) On C : z 1 we have for N
even, and +ve sign
H (e

jT

)e

N 1 N 1

2
2

jT

N 1

. 2h(n). cos T n

2
n 0

Professor A G Constantinides

27

AG
C
DS
P

FIR: Linear phase


II) While for ve sign
H ( e j T ) e

N 1 N 1

2
2

jT

N 1

. j 2h(n).sin T n

2
n 0

/2
[Note: antisymmetric case adds
0 at
rads to phase, with discontinuity
]
N 1
jT with
III) For
N
odd
+ve
sign
1
N
jT
2

H (e

)e

N 3
2

N 1

2h( n). cos T n



2
n 0

Professor A G Constantinides
28

AG
C
DS
P

FIR: Linear phase

IV) While with a ve sign

H (e

j T

)e

N 1
jT
2

N 3
2

N 1

2 j.h( n).sin T n
2

n 0

[Notice that for the antisymmetric case


to have linear phase we require
N 1
0.
2

The phase discontinuity is as for N even]


Professor A G Constantinides

29

AG
C

FIR: Linear phase

DS
P

The cases most commonly used in


filter design are (I) and (III), for
which the amplitude characteristic
can be written as a polynomial in
T
cos

Professor A G Constantinides

30

AG
C
DS
P

Design of FIR filters: Windows


h(n)
(i) Start with ideal infinite duration
(ii) Truncate to finite length. (This
produces unwanted ripples
increasing in height near
~
discontinuity.)
h (n) h(n).w(n)
(iii) Modify to
Weight w(n) is the window
Professor A G Constantinides

31

AG
C

Windows

DS
P

Commonly used windows


2n
1

N 1
Rectangular
n
N
2
2n

Bartlett
1 cos

N
Hann
2n

Hamming 0.54 0.46 cos N

2n 0.08 cos 4n
0
.
42

0
.
5
cos

Blackman
N
N

Kaiser

J 0 1

2n

N 1

J 0 ( )

Professor A G Constantinides

32

AG
C

Kaiser window

DS
P

Kaiser window

Transition Min. stop


width
attn dB
(Hz)

2.12

1.5/N

30

4.54

2.9/N

50

6.76

4.3/N

70

8.96

5.7/N

90
Professor A G Constantinides

33

AG
C

Example

DS
P

Lowpass filter of length 51 and

LowpassFilterDesignedUsingHammingwindow
0

G ain,dB

50

100

100
0

0.2

0.4

0.6

0.8

0.2

0.4

LowpassFilterDesignedUsingBlackmanwindow
0

Gain,dB

G ain,dB

LowpassFilterDesignedUsingHannwindow
0

50

c / 2

0.6

0.8

50

100
0

0.2

0.4

0.6

0.8

Professor A G Constantinides

34

AG
C
DS
P

Frequency Sampling Method

In this approach we are given H (k ) and


need to find H (z )
This is an interpolation problem and the
solution is given in the DFT part of the
course
N
1 N 1
1 z
H ( z ) H ( k ).
2
N k 0
j k
1 e N .z 1

It has similar problems to the windowing


Professor A G Constantinides
approach
35

Linear-Phase FIR Filter


Design by Optimisation

AG
C
DS
P

Amplitude response for all 4 types


of linear-phase FIR filters can be

expressed as H ( ) Q( ) A( )
where

Q( )

1,
for Type 1
cos(/2), for Type 2
sin( ), for Type 3
sin( / 2), for Type 4
Professor A G Constantinides

36

AG
C
DS
P

Linear-Phase FIR Filter


Design by Optimisation

Modified form of weighted error


function
E ( ) W ( )[Q( ) A( ) D ( )]
D ( )
W ( )Q( )[ A( ) Q ( ) ]
~
~
W ( )[ A( ) D( )]
where

~
W ( ) W ( )Q( )
~
D( ) D ( ) / Q ( )
Professor A G Constantinides

37

AG
C
DS
P

Linear-Phase FIR Filter


Design by Optimisation ~

a [k ]
Optimisation Problem - Determine
which minimise the peak
L
~
~
absolute
value
of
~
E ( ) W ( )[ a [k ] cos( k) D ( )]
k 0

R
over the specified frequency bands
~[k ]
a
After
has been determined,
j
A(e )
construct the original
and
hence h[n]
Professor A G Constantinides

38

AG
C
DS
P

Linear-Phase FIR Filter


Design
Optimisation
Solutionby
is obtained
via the

Alternation Theorem
The optimal solution has equiripple
behaviour consistent with the total
number of available parameters.
Parks and McClellan used the Remez
algorithm to develop a procedure
for designing linear FIR digital
filters.

Professor A G Constantinides

39

AG
C
DS
P

FIR Digital Filter Order


Estimation

Kaisers Formula:
N

20 log10 ( p s )
14.6( s p ) / 2

ie N is inversely proportional to
transition band width and not on
transition band location

Professor A G Constantinides

40

FIR Digital Filter Order


Estimation
Hermann-Rabiner-Chans Formula:

AG
C
DS
P

D ( p , s ) F ( p , s )[( s p ) / 2 ]2
N
( s p ) / 2
where

D ( p , s ) [a1 (log10 p ) 2 a2 (log10 p ) a3 ] log10 s


[a4 (log10 p ) 2 a5 (log10 p ) a6 ]
F ( p , s ) b1 b2 [log10 p log10 s ]
with a1 0.005309, a2 0.07114, a3 0.4761
a4 0.00266, a5 0.5941, a6 0.4278
b1 11.01217, b2 0.51244
Professor A G Constantinides

41

AG
C
DS
P

FIR Digital Filter Order


Estimation

p s
Formula valid for
For p s , formula to be used is
obtained by interchanging
and
p
s
Both formulae provide only an
estimate of the required filter order N
If specifications are not met, increase
filter order until they are met
Professor A G Constantinides

42

AG
C
DS
P

FIR Digital Filter Order


Estimation

Fred Harris guide:

A
N
20(s p ) / 2

where A is the attenuation in dB


Then add about 10% to it

Professor A G Constantinides

43

Das könnte Ihnen auch gefallen