Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

LINEAR-PHASE FIR FILTERS

1. The amplitude response

2. Why linear-phase?

3. The four types of linear-phase FIR filter

4. Amplitude response characteristics

5. Evaluating the amplitude response

6. Zero locations of linear-phase filters

7. Automatic zeros

8. Design by DFT-based interpolation

9. Design by general interpolation

Linear Phase Filter EE-384 Digital Signal Processing 1


THE AMPLITUDE RESPONSE

If the real and imaginary parts of H f (ω) are given by

H f (ω) = R(ω) + j · I(ω)

the magnitude and phase are defined as

|H f (ω)| =R2 (ω) + I 2 (ω)


 
I(ω)
p(ω) = arctan
R(ω)
so that

H f (ω) = |H f (ω)| · ejp(ω) .

With this definition, |H f (ω)| is never negative and p(ω) is usually


discontinuous, but it can be very helpful to write H f (ω) as

H f (ω) = A(ω) · ejθ(ω)

where A(ω) can be positive and negative, and θ(ω) continuous.


A(ω) is called the amplitude response. The figure illustrates the
difference between |H f (ω)| and A(ω).

Linear Phase Filter EE-384 Digital Signal Processing 2


THE AMPLITUDE RESPONSE (2)

|H(ω)| = |A(ω)| Phase{H(ω)}


1.4 4

1.2
2
1

0.8
0
0.6

0.4
−2
0.2

0 −4
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π ω/π

A(ω) θ(ω)
1.2 0

1
−5
0.8

0.6
−10
0.4

0.2
−15
0

−0.2 −20
0 0.2 0.4 0.6 0.8 1 0 0.2 0.4 0.6 0.8 1
ω/π ω/π

A linear-phase phase filter is one for which the continuous phase


θ(ω) is linear.

H f (ω) = A(ω) ejθ(ω)

with

θ(ω) = −M · ω + B.

We assume in the following that the impulse response h(n) is real-


valued.

Linear Phase Filter EE-384 Digital Signal Processing 3


WHY LINEAR-PHASE?

If a discrete-time cosine signal

x1 (n) = cos(ω1 n + φ1 )

is processed through a discrete-time filter with frequency response

H f (ω) = A(ω) · ejθ(ω)

then the output signal is given by

y1 (n) = A(ω1 ) cos(ω1 n + φ1 + θ(ω1 ))

or
   
θ(ω1 )
y1 (n) = A(ω1 ) cos ω1 n + + φ1 .
ω1
The LTI system has the effect of scaling the cosine signal and de-
laying it by −θ(ω1 )/ω1 .

When does the system delay cosine signals with


different frequencies by the same amount?

θ(ω)
=⇒ = constant
ω

=⇒ θ(ω) = K ω

=⇒ The phase is linear

The function θ(ω)/ω is called the phase delay. A linear phase filter
therefore has constant phase delay.

Linear Phase Filter EE-384 Digital Signal Processing 4


WHY LINEAR-PHASE: EXAMPLE

Consider an discrete-time filter described by the difference equation

y(n) = − 0.1821 x(n) + 0.7865 x(n − 1) − 0.6804 x(n − 2) + x(n − 3)


+ 0.6804 y(n − 1) − 0.7865 y(n − 2) + 0.1821 y(n − 3).

When ω1 = 0.31 π, then the delay is −θ(ω1 )/ω1 = 2.45.


The delay is illustrated in the figure:

1.5
x1(n) (INPUT)

0.5

−0.5

−1

−1.5

−2
20 22 24 26 28 30 32 34 36 38 40

1.5
y1(n) (OUTPUT)

0.5

−0.5

−1

−1.5

−2
20 22 24 26 28 30 32 34 36 38 40

Notice that the delay is fractional — the discrete-time samples are


not exactly reproduced in the output.

The fractional delay can be interpreted in this case as a delay of


the underlying continuous-time cosine signal.

Linear Phase Filter EE-384 Digital Signal Processing 5


WHY LINEAR-PHASE: EXAMPLE (2)

Consider the same system given on the previous slide, but let us
change the frequency of the cosine signal.

When ω2 = 0.47 π, then the delay is −θ(ω2 )/ω2 = 0.14.

1.5
x2(n) (INPUT)

0.5

−0.5

−1

−1.5

−2
20 22 24 26 28 30 32 34 36 38 40

1.5
y2(n) (OUTPUT)

0.5

−0.5

−1

−1.5

−2
20 22 24 26 28 30 32 34 36 38 40

For this example, the delay depends on the


frequency, because this system does not have
linear phase.

Linear Phase Filter EE-384 Digital Signal Processing 6


WHY LINEAR-PHASE: MORE

From the previous slides, we see that a filter will delay different
frequency components of a signal by the same amount if the filter
has linear phase (constant phase delay).

In addition, when a narrow band signal (as in AM modulation) goes


through a filter, the envelop will be delayed by the group delay or
envelop delay of the filter. The amount by which the envelop is
delayed is independent of the carrier frequency only if the filter has
linear phase. (See page 214 in Mitra.)

Also, in applications like image processing, filters with non-linear


phase can introduce artifacts that are visually annoying.

Linear Phase Filter EE-384 Digital Signal Processing 7


FOUR TYPES OF LINEAR-PHASE FIR FILTERS
Sec 4.4.3
in Mitra Linear-phase FIR filter can be divided into four basic types.
Type impulse response
I symmetric length is odd
II symmetric length is even
III anti-symmetric length is odd
IV anti-symmetric length is even

TYPE I IMPULSE RESPONSE TYPE II IMPULSE RESPONSE


0.4 0.4

0.3 0.3

0.2 0.2

0.1 0.1

0 0

−0.1 −0.1
0 2 4 6 8 10 12 0 2 4 6 8 10 12

TYPE III IMPULSE RESPONSE TYPE IV IMPULSE RESPONSE


0.3 0.3

0.2 0.2

0.1 0.1

0 0

−0.1 −0.1

−0.2 −0.2

−0.3 −0.3

0 2 4 6 8 10 12 0 2 4 6 8 10 12

When h(n) is nonzero for 0 ≤ n ≤ N −1 (the length of the impulse


response h(n) is N ), then the symmetry of the impulse response
can be written as
h(n) = h(N − 1 − n)
and the anti-symmetry can be written as
h(n) = −h(N − 1 − n).

Linear Phase Filter EE-384 Digital Signal Processing 8


FOUR TYPES OF LINEAR-PHASE FIR FILTERS

Important note: If the impulse response h(n) is complex-valued,


then to have linear-phase the impulse response should be conjugate-
symmetric or conjugate-anti-symmetry.

Linear Phase Filter EE-384 Digital Signal Processing 9


TYPE I: ODD-LENGTH SYMMETRIC

The frequency response of a length N = 5 FIR Type I filter can be


written as follows.

H f (ω) = h0 + h1 e−jω + h2 e−2jω + h1 e−3jω + h0 e−4ω (1)


= e−2jω h0 e2jω + h1 ejω + h2 + h1 e−jω + h0 e−2jω


(2)
= e−2jω h0 (e2jω + e−2jω ) + h1 (ejω + e−jω ) + h2


(3)
= e−2jω (2h0 cos (2ω) + 2h1 cos (ω) + h2 ) (4)
= A(ω)ejθ(ω) (5)

where

θ(ω) = −2ω, A(ω) = 2h0 cos (2ω) + 2h1 cos (ω) + h2 .

Note that A(ω) is real-valued and can be both positive and negative.
In general, for a Type I FIR filters of length N :

H f (ω) = A(ω)ejθ(ω)
M
X −1
A(ω) = h(M ) + 2 h(n) cos ((M − n)ω).
n=0

θ(ω) = −M ω
N −1
M= .
2

Linear Phase Filter EE-384 Digital Signal Processing 10


TYPE II: EVEN-LENGTH SYMMETRIC

The frequency response of a length N = 4 FIR Type II filter can


be written as follows.

H f (ω) = h0 + h1 e−jω + h1 e−2jω + h0 e−3jω (6)


 3 
− 23 jω jω 1
jω − 12 jω − 32 jω
=e h0 e + h1 e + h1 e
2 2 + h0 e (7)
 
− 32 jω 3
jω − 23 jω 1
jω − 12 jω
=e h0 (e + e
2 ) + h1 (e + e
2 ) (8)
3
= e− 2 jω 2h0 cos 23 ω + 2h1 cos 21 ω
 
(9)
= A(ω)ejθ(ω) (10)

where
3 3
 1

θ(ω) = − ω, A(ω) = 2h0 cos 2ω + 2h1 cos 2ω .
2
In general, for a Type II FIR filters of length N :

H f (ω) = A(ω)ejθ(ω)
N
2 −1
X
A(ω) = 2 h(n) cos ((M − n)ω)
n=0

θ(ω) = −M ω
N −1
M= .
2

Linear Phase Filter EE-384 Digital Signal Processing 11


TYPE III: ODD-LENGTH ANTI-SYMMETRIC

The frequency response of a length N = 5 FIR Type III filter can


be written as follows.

H f (ω) = h0 + h1 e−jω − h1 e−3jω − h0 e−4ω (11)


= e−2jω h0 e2jω + h1 ejω − h1 e−jω − h0 e−2jω

(12)
= e−2jω h0 (e2jω − e−2jω ) + h1 (ejω − e−jω )

(13)
= e−2jω (2jh0 sin (2ω) + 2jh1 sin (ω)) (14)
= e−2jω j (2h0 sin (2ω) + 2h1 sin (ω)) (15)
π
= e−2jω ej 2 (2h0 sin (2ω) + 2h1 sin (ω)) (16)
= A(ω)ejθ(ω) (17)

where
π
θ(ω) = −2ω + , A(ω) = 2h0 sin (2ω) + 2h1 sin (ω).
2
In general, for a Type III FIR filters of length N :

H f (ω) = A(ω)ejθ(ω)
M
X −1
A(ω) = 2 h(n) sin ((M − n)ω)
n=0

π
θ(ω) = −M ω +
2
N −1
M= .
2

Linear Phase Filter EE-384 Digital Signal Processing 12


TYPE IV: EVEN-LENGTH ANTI-SYMMETRIC

The frequency response of a length N = 4 FIR Type IV filter can


be written as follows.

H f (ω) = h0 + h1 e−jω − h1 e−2jω − h0 e−3jω (18)


3
 3 1 1 3

= e− 2 jω h0 e 2 jω + h1 e 2 jω − h1 e− 2 jω − h0 e− 2 jω
(19)
3
 3 3 1 1

= e− 2 jω h0 (e 2 jω − e− 2 jω ) + h1 (e 2 jω − e− 2 jω ) (20)
3
= e− 2 jω 2jh0 sin 23 ω + 2jh1 sin 12 ω
 
(21)
3
= e− 2 jω j 2h0 sin 23 ω + 2h1 sin 12 ω
 
(22)
3 π
= e− 2 jω ej 2 2h0 sin 23 ω + 2h1 sin 21 ω
 
(23)
= A(ω)ejθ(ω) (24)

where
3 π 3
 1

θ(ω) = − ω + , A(ω) = 2h0 sin 2ω + 2h1 sin 2ω .
2 2
In general, for a Type IV FIR filters of length N :

H f (ω) = A(ω) ejθ(ω)


N
2 −1
X
A(ω) = 2 h(n) sin ((M − n)ω)
n=0

π
θ(ω) = −M ω +
2
N −1
M= .
2

Linear Phase Filter EE-384 Digital Signal Processing 13


SUMMARY: AMPLITUDE FORMULAS

Type θ(ω) A(ω)


M
X −1
I −M ω h(M ) + 2 h(n) cos ((M − n)ω)
n=0
N
2 −1
X
II −M ω 2 h(n) cos ((M − n)ω)
n=0
M
X −1
π
III −M ω + 2 2 h(n) sin ((M − n)ω)
n=0
N
2 −1
X
π
IV −M ω + 2 2 h(n) sin ((M − n)ω)
n=0

N −1
M=
2

Linear Phase Filter EE-384 Digital Signal Processing 14


AMPLITUDE RESPONSE CHARACTERISTICS

To analyze or design linear-phase FIR filters, we need to know the


characteristics of the amplitude response A(ω).
Type Properties
A(ω) is even about ω = 0 A(ω) = A(−ω)
I A(ω) is even about ω = π A(π + ω) = A(π − ω)
A(ω) is periodic with 2π A(ω + 2π) = A(ω)
A(ω) is even about ω = 0 A(ω) = A(−ω)
II A(ω) is odd about ω = π A(π + ω) = −A(π − ω)
A(ω) is periodic with 4π A(ω + 4π) = A(ω)
A(ω) is odd about ω = 0 A(ω) = −A(−ω)
III A(ω) is odd about ω = π A(π + ω) = −A(π − ω)
A(ω) is periodic with 2π A(ω + 2π) = A(ω)
A(ω) is odd about ω = 0 A(ω) = −A(−ω)
IV A(ω) is even about ω = π A(π + ω) = A(π − ω)
A(ω) is periodic with 4π A(ω + 4π) = A(ω)

TYPE I A(ω) TYPE II A(ω)


1.2 1

1
0.5
0.8

0.6
0
0.4

0.2
−0.5
0

−0.2 −1
0 0.5 1 1.5 2 0 0.5 1 1.5 2
ω/π ω/π
TYPE III A(ω) TYPE IV A(ω)
1.5 2

1
1.5

0.5
1
0
0.5
−0.5

0
−1

−1.5 −0.5
0 0.5 1 1.5 2 0 0.5 1 1.5 2
ω/π ω/π

Linear Phase Filter EE-384 Digital Signal Processing 15


ZERO LOCATIONS OF LINEAR-PHASE FILTERS
Sec 4.4.4
in Mitra The zeros of the transfer function H(z) of a linear-phase filter lie
in specific configurations.
We can write the symmetry condition
h(n) = h(N − 1 − n)
in the Z domain. Taking the Z-transform of both sides gives
H(z) = z −(N −1) H(1/z). (25)
Recall that we are assuming that h(n) is real-valued. If zo is a zero
of H(z),
H(zo ) = 0,
then
H(zo∗ ) = 0.
(Because the roots of a polynomial with real coefficients exist in
complex-conjugate pairs.)
Using the symmetry condition (25), it follows that
H(zo ) = zo−(N −1) H(1/zo ) = 0
and
H(zo∗ ) = (zo∗ )−(N −1) H(1/zo∗ ) = 0
or
H(1/zo ) = H(1/zo∗ ) = 0.

If zo is a zero of a (real-valued) linear-phase filter, then so are


zo∗ , 1/zo , 1/zo∗ .

Linear Phase Filter EE-384 Digital Signal Processing 16


ZEROS LOCATIONS (2)

It follows that
1. generic zeros of a linear-phase filter exist in sets of 4.

2. zeros on the unit circle (zo = ejωo ) exist in sets of 2. (z0 6= ±1)

3. zeros on the real line (zo = a) exist in sets of 2. (z0 6= ±1)

4. zeros at 1 and −1 do not imply the existence of zeros at other


specific points.
Examples of zero sets:
1.5 1
1
0.5
Imaginary part

Imaginary part

0.5

0 0

−0.5
−0.5
−1

−1.5 −1
−1 0 1 2 −1 −0.5 0 0.5 1
Real part Real part

1 1

0.5 0.5
Imaginary part

Imaginary part

0 0

−0.5 −0.5

−1 −1
−1 −0.5 0 0.5 1 −1 −0.5 0 0.5 1
Real part Real part

1.5

1
Imaginary part

0.5

−0.5

−1

−1.5
−2 −1 0 1
Real part

Linear Phase Filter EE-384 Digital Signal Processing 17


ZERO LOCATIONS: AUTOMATIC ZEROS

The frequency response H f (ω) of a Type II FIR filter always has a


zero at ω = π:

h(n) = [h0 , h1 , h2 , h2 , h1 , h0 ]
H(z) = h0 + h1 z −1 + h2 z −2 + h2 z −3 + h1 z −4 + h0 z −5
H(−1) = h0 − h1 + h2 − h2 + h1 − h0 = 0
H f (π) = H(ejπ ) = H(−1) = 0

H f (π) = 0 always for Type II filters.

Similarly, we can derive the following rules for Type III and Type IV
FIR filters.

H f (0) = H f (π) = 0 always for Type III filters.

H f (0) = 0 always for Type IV filters.

The automatic zeros can also be derived using the characteristics


of the amplitude response A(ω) seen earlier.

Type automatic zeros


I —
II ω=π
III ω = 0, π
IV ω=0

Linear Phase Filter EE-384 Digital Signal Processing 18


ZERO LOCATIONS: EXAMPLES

The zero locations of FIR filters satisfy the properties noted


previously.

TYPE I TYPE II
2
2

1
Imaginary part

Imaginary part
1

0 0

−1 −1

−2
−2

−1 0 1 2 3 4 5 −5 −4 −3 −2 −1 0 1
Real part Real part

TYPE III TYPE IV

2 2
Imaginary part

Imaginary part

1 1

0 0

−1 −1

−2 −2

−1 0 1 2 3 4 5 −1 0 1 2 3 4 5
Real part Real part

Linear Phase Filter EE-384 Digital Signal Processing 19

You might also like