Sunteți pe pagina 1din 28

1

Copyright 2005, S. K. Mitra


Least Integral-Squared Error
Design of FIR Filters
Let denote the desired frequency
response
Since is a periodic function of
with a period , it can be expressed as a
Fourier series

where
) (
e j
d
e H
) (
e j
d
e H e
t 2
}
s s e
t
=
t
t
e e
n d e e H n h
n j j
d d
, ) (
2
1
] [

=

=
e e
n
n j
d
j
d
e n h e H ] [ ) (
2
Copyright 2005, S. K. Mitra
Least Integral-Squared Error
Design of FIR Filters
In general, is piecewise constant
with sharp transitions between bands
In which case, is of infinite length
and noncausal
Objective - Find a finite-duration
of length 2M+1 whose DTFT
approximates the desired DTFT in
some sense
) (
e j
d
e H
) (
e j
d
e H
) (
e j
t
e H
{ } ] [n h
t
{ } ] [n h
d
3
Copyright 2005, S. K. Mitra
Least Integral-Squared Error
Design of FIR Filters
Commonly used approximation criterion -
Minimize the integral-squared error


where
e
}

t
= u
t
t
e e
d e H e H
j
d
j
t
2
) ( ) (
2
1

=
=
e e
M
M n
n j
t
j
t
e n h e H ] [ ) (
4
Copyright 2005, S. K. Mitra
Least Integral-Squared Error
Design of FIR Filters
Using Parsevals relation we can write



It follows from the above that is
minimum when for
Best finite-length approximation to ideal
infinite-length impulse response in the
mean-square sense is obtained by truncation

= u

= n
d t
n h n h
2
] [ ] [

+ +

=

=

+ = =
1
1
2 2
2
] [ ] [ ] [ ] [
M
n M n
d d
M
M n
d t
n h n h n h n h
u
] [ ] [ n h n h
d t
= M n M s s

5
Copyright 2005, S. K. Mitra
Least Integral-Squared Error
Design of FIR Filters
A causal FIR filter with an impulse response
h[n] can be derived from by delaying:

The causal FIR filter h[n] has the same
magnitude response as and its phase
response has a linear phase shift of
radians with respect to that of
] [n h
t
] [n h
t
] [n h
t
] [ ] [ M n h n h
t
=
M e
6
Copyright 2005, S. K. Mitra
Impulse Responses of Ideal
Filters
Ideal lowpass filter -



Ideal highpass filter -



s s
t
e
= n
n
n
n h
c
LP
,
sin
] [

=
t
e

=
t
e

=
0 ,
) sin(
0 , 1
] [
n
n
n
n
n h
c
c
HP
7
Copyright 2005, S. K. Mitra
Impulse Responses of Ideal
Filters
Ideal bandpass filter -

=
t
e

t
e
=
t
e

t
e
=
0 ,
0 ,
) sin( ) sin(
] [
1 2
1 2
n
n
n
n
n
n
n h
c c
c c
BP
8
Copyright 2005, S. K. Mitra
Impulse Responses of Ideal
Filters
Ideal bandstop filter -

=
t
e

t
e
=
t
e e

=
0 ,
) sin( ) sin(
0 ,
) (
1
] [
2 1
1 2
n
n
n
n
n
n
n h
c c
c c
BS
9
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
Gibbs phenomenon - Oscillatory behavior in
the magnitude responses of causal FIR filters
obtained by truncating the impulse response
coefficients of ideal filters





0 0.2 0.4 0.6 0.8 1
0
0.5
1
1.5
e/t
M
a
g
n
i
t
u
d
e
N = 20
N = 60
10
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
As can be seen, as the length of the lowpass
filter is increased, the number of ripples in
both passband and stopband increases, with
a corresponding decrease in the ripple
widths
Height of the largest ripples remain the
same independent of length
Similar oscillatory behavior observed in the
magnitude responses of the truncated
versions of other types of ideal filters
11
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
Gibbs phenomenon can be explained by
treating the truncation operation as an
windowing operation:

In the frequency domain


where and are the DTFTs
of and , respectively
] [ ] [ ] [ n w n h n h
d t
=
}
+ =
t
t
e
t
e
d e e H e H
j j
d
j
t
) ( ) ( ) (
) (
2
1
) (
e j
t
e H ) (
e
+
j
e
] [n h
t
] [n w
12
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
Thus is obtained by a periodic
continuous convolution of with
) (
e j
t
e H
) (
e
+
j
e
) (
e j
d
e H
13
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
If is a very narrow pulse centered at
(ideally a delta function) compared to
variations in , then will
approximate very closely
Length 2M+1 of w[n] should be very large
On the other hand, length 2M+1 of
should be as small as possible to reduce
computational complexity
) (
e
+
j
e
) (
e j
d
e H
) (
e j
d
e H
) (
e j
t
e H
] [n h
t
0 = e
14
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
A rectangular window is used to achieve
simple truncation:


Presence of oscillatory behavior in
is basically due to:
1) is infinitely long and not absolutely
summable, and hence filter is unstable
2) Rectangular window has an abrupt transition
to zero

s s
=
otherwise , 0
0 , 1
] [
M n
n w
R
) (
e j
t
e H
] [n h
d
15
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
Oscillatory behavior can be explained by
examining the DTFT of :





has a main lobe centered at
Other ripples are called sidelobes
] [n w
R
) (
e
+
j
R
e
) (
e
+
j
R
e
0 = e
-1 -0.5 0 0.5 1
-10
0
10
20
30
e/t
A
m
p
l
i
t
u
d
e
Rectangular window
M = 4
M = 10
main lobe
side lobe
16
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
Main lobe of characterized by its
width defined by first zero
crossings on both sides of
As M increases, width of main lobe
decreases as desired
Area under each lobe remains constant
while width of each lobe decreases with an
increase in M
Ripples in around the point of
discontinuity occur more closely but with
no decrease in amplitude as M increases
) (
e
+
j
R
e
0 = e
) 1 2 /( 4 + t M
) (
e j
t
e H
17
Copyright 2005, S. K. Mitra
Gibbs Phenomenon
Rectangular window has an abrupt transition
to zero outside the range , which
results in Gibbs phenomenon in
Gibbs phenomenon can be reduced either:
(1) Using a window that tapers smoothly to
zero at each end, or
(2) Providing a smooth transition from
passband to stopband in the magnitude
specifications
M n M s s
) (
e j
t
e H
18
Copyright 2005, S. K. Mitra
Fixed Window Functions
Using a tapered window causes the height
of the sidelobes to diminish, with a
corresponding increase in the main lobe
width resulting in a wider transition at the
discontinuity
Hann:

Hamming:

Blackman:
)
1 2
4
cos( 08 . 0 )
1 2
2
cos( 5 . 0 42 . 0 ] [
+
t
+
+
t
+ =
M
n
M
n
n w
),
1 2
2
cos( 46 . 0 54 . 0 ] [
+
+ =
M
n
n w
t
),
1 2
2
cos( 5 . 0 5 . 0 ] [
+
+ =
M
n
n w
t
M n M s s
M n M s s
19
Copyright 2005, S. K. Mitra
Fixed Window Functions
Plots of magnitudes of the DTFTs of these
windows for M = 25 are shown below:
0 0.2 0.4 0.6 0.8 1
-100
-80
-60
-40
-20
0
e/t
G
a
i
n
,

d
B
Rectangular window
0 0.2 0.4 0.6 0.8 1
-100
-80
-60
-40
-20
0
e/t
G
a
i
n
,

d
B
Hanning window
0 0.2 0.4 0.6 0.8 1
-100
-80
-60
-40
-20
0
e/t
G
a
i
n
,

d
B
Hamming window
0 0.2 0.4 0.6 0.8 1
-100
-80
-60
-40
-20
0
e/t
G
a
i
n
,

d
B
Blackman window
Hann window
G
a
i
n
,

d
B

G
a
i
n
,

d
B

G
a
i
n
,

d
B

G
a
i
n
,

d
B

Rectangular window
Hamming window Blackman window
20
Copyright 2005, S. K. Mitra
Fixed Window Functions
Magnitude spectrum of each window
characterized by a main lobe centered at
e = 0 followed by a series of sidelobes with
decreasing amplitudes
Parameters predicting the performance of a
window in filter design are:
Main lobe width
Relative sidelobe level
21
Copyright 2005, S. K. Mitra
Fixed Window Functions
Main lobe width - given by the
distance between zero crossings on both
sides of main lobe
Relative sidelobe level - given by the
difference in dB between amplitudes of
largest sidelobe and main lobe
ML
A
s
A
22
Copyright 2005, S. K. Mitra
Fixed Window Functions





Observe
Thus,
Passband and stopband ripples are the same
1 ) ( ) (
) ( ) (
~ +
e A e e A + e
c c
j
t
j
t
e H e H
5 . 0 ) ( ~
c
j
t
e H
e
23
Copyright 2005, S. K. Mitra
Fixed Window Functions
Distance between the locations of the
maximum passband deviation and minimum
stopband value


Width of transition band
ML
A ~
ML p s
A < = A e e e
24
Copyright 2005, S. K. Mitra
Fixed Window Functions
To ensure a fast transition from passband to
stopband, window should have a very small
main lobe width
To reduce the passband and stopband ripple
o, the area under the sidelobes should be
very small
Unfortunately, these two requirements are
contradictory
25
Copyright 2005, S. K. Mitra
Fixed Window Functions
In the case of rectangular, Hann, Hamming,
and Blackman windows, the value of ripple
does not depend on filter length or cutoff
frequency , and is essentially constant
In addition,

where c is a constant for most practical
purposes
M
c
~ e A
c
e
26
Copyright 2005, S. K. Mitra
Fixed Window Functions
Rectangular window -
dB, dB,
Hann window -
dB, dB,
Hamming window -
dB, dB,
Blackman window -
dB, dB,
) 1 2 /( 4 + t = A M
ML
) 1 2 /( 8 + t = A M
ML
) 1 2 /( 8 + t = A M
ML
) 1 2 /( 12 + t = A M
ML
3 . 13 =
s
A
5 . 31 =
s
A
7 . 42 =
s
A
1 . 58 =
s
A
9 . 20 = o
s
9 . 43 = o
s
5 . 54 = o
s
3 . 75 = o
s
M / 92 . 0 t = e A
M / 11 . 3 t = e A
M / 32 . 3 t = e A
M / 56 . 5 t = e A
27
Copyright 2005, S. K. Mitra
FIR Filter Design Example
Lowpass filter of length 51 and
2 / t = e
c
0 0.2 0.4 0.6 0.8 1
-100
-50
0
e/t
G
a
i
n
,

d
B
Lowpass Filter Designed Using Blackman window
0 0.2 0.4 0.6 0.8 1
-100
-50
0
e/t
G
a
i
n
,

d
B
Lowpass Filter Designed Using Hann window
0 0.2 0.4 0.6 0.8 1
-100
-50
0
e/t
G
a
i
n
,

d
B
Lowpass Filter Designed Using Hamming window
28
Copyright 2005, S. K. Mitra
FIR Filter Design Example
An increase in the main lobe width is
associated with an increase in the width of
the transition band
A decrease in the sidelobe amplitude results
in an increase in the stopband attenuation

S-ar putea să vă placă și