Sei sulla pagina 1di 89

DIGITAL SIGNAL PROCESSING

DIGITAL SIGNAL PROCESSING

ASSISTANT PROFESSOR
MYTHILI P

PART I

DISCRETE FOURIER
TRANSFORM AND FAST
FOURIER TRANSFORM

Discrete fourier transform

Like z transform, fourier transform is one of the tools used for analysis
of LTI systems.
These transform basically involve the decomposition of a signal in terms
of sinusoidal component(complex exponential).
Fourier series continuous periodic signals.
Fourier Transform continuous aperiodic signals
FOURIER SERIES

Any signal x(t) can be decomposed into sinusoids

x(t) =

ak ej2kF0 t

(0.1)

k=

1
TP
TP = P eriod of the signal
F0 =

ak = f ourier coef f icient


Z
1
ak =
x(t)ej2kF0 t dt
TP TP

(0.2)

(0.3)

The signals should satisfy Dirichlets Conditions


Dirichlets Conditions
Signals x(t)has finite number of discontinuous in a period.
X(t) has finite number of maxima and minima during a period.
The signal x(t) is absolutely integrable in any period.
Z
|x(t)| <
TP

Power Density Spectrum


Power of the signal Vs frequency
Power of x(t)
1
Px =
TP

|x(t)|2 dt

(0.4)

TP

If the signal has a Fourier series


Px = |ak |2

(0.5)

Since the ck s are complex valued


k = 6 ak
The magnitude spectrum : Magnitude of ak Vs frequency
Phase spectrum : Phase VS frequency

(0.6)

Tp

x(t)

/2

/2

Tp

Example : Determine the FS and power density spectrum of the rectangular


pulse train
Z
1
ak =
x(t)ej2kF0 t dt
(0.7)
TP TP
Z /2
A
1
Adt =
(0.8)
a0 =
TP /2
TP
Z /2
1
ak =
Aej2kF0 t dt
(0.9)
TP /2
A ej2kF0 t /2
]
[
TP j2kF0 t /2

(0.10)

A ej2kF0 /2 ej2kF0 /2
]
[
TP
j2kF0 t

(0.11)

A
sin(kF0 )
TP kF0

(0.12)

ak =
ak =

ak =
ak =

A sin(kF0 )
, k = 1, 2, ......
TP
kF0
|ak |

(0.13)

6 7 8 9 10
0 1 2 3 4 5

Power Density Spectrum

|ak|2 V s

Note: Continuous periodic signal has a discrete spectra(line spectra)


Fourier Transform (aperiodic signals)
1
x(t) =
2

x()ejt d

(0.14)

x(t)ejt d

(0.15)

x(f )ej2f t df

(0.16)

x() =

Z
x(t) =

Provided the signal should satisfy the Dirichlets condition


Since aperiodic signals are energy signals, we can plot spectrum and Energy
density
Z
Ex =
|x(t)|2 dt
(0.17)

|X()|2 d

Ex =

(0.18)

() = 6 X()

(0.19)

Magnitude of x(w): magnitude spectrum


Phase of x(w) : phase spectrum
Example: Determine the FT and energy density spectrum of a rectangular
pulse defined by
(
A |t| /2
x(t) =
(0.20)
0 |t| > /2

x(t)
A

/2

/2

/2

Aejt dt

X() =

(0.21)

/2
/2

ejt
j /2

(0.22)

ejt ejt
j

(0.23)

=A
=A

2Asin( /2)

A sin( /2)
=
/2
=

(0.24)
(0.25)

Fourier Series of discrete time periodic sequences

x(n) = x(n + N )

x(t) =

ak ej2kF0 t

(0.26)
(0.27)

k=

k samples in the spectrum


t = n f or discrete signals
x(t) =

N
1
X
k=0

ak e

j2kn
N

(0.28)

ak =

N 1
j2kn
1 X
x(n)e N
N n=0

ak = ak+N

(0.29)
(0.30)

Ak is a periodic sequence with period N


Spectrum is also periodic with period N(Fourier series of DT signals)
Spectrum of an aperiodic continuous time signal is continuous
Example : Determine the spectra of the signals

a) x(n) = cos 2n
For a signal to be periodic F should be a rational number. Hence FS does
not exist
b) x(n) = cosn/3

(0.31)

= 2f = /3
f = 1/6 = k/N , N = 6

ak =

n=5
1X
x(n)ej2kn/6
6 n=0

(0.32)

k = 0, 1, ....5
a0 =
= 1 + cos

n=5
1X
n
cos
6 n=0
3

2
4
5

+ cos
1 + cos
+ cos
3
3
3
3
=0

(0.33)
(0.34)
(0.35)

a0 = a2 = a3 = a4 =
a1 = 1/2 a5 = 1/2

c) x(n) = 1 , 1 , 0 , 0 is a periodic signal with period N = 4


ak =

n=3
1X
x(n)ej2kn/4
4 n=0

k = 1, ....4

(0.36)
(0.37)

1
2

1
2

1
2

5 4 3 2 1

ak =

1
2

i
1h
1 + ejk/2
4

1
2

(0.38)

c0 = 1/2, c1 = 1/4(1 j), c2 = 0, c3 = 1/4(1 + j)

|c0 | = 1/2, |c1 | = 2/4, |c2 | = 0, |c3 | = 2/4


6

c0 = 0,

c1 = /4,
6

c2 = 0,

1
2

2
4

c3 = /4

2
4

4 3 2 1

1
2

3
4

2
2

3 2 1

1
2

FOURIER TRANSFORM FOR DISCRETE TIME SIGNALS


Z
1
x(t) =
X()ejt d
2
Z
X() =
x(t)ejt dt

1
2

(0.39)
(0.40)

1
2

10

11

put t = nT , T = 1

x() =

x(n)ejn

(0.41)

x(n)ejn ej2n

(0.42)

x( + 2) =

x(n)ejn

(0.43)

= X()
Z

1
x(n) =
2
x() =

(0.44)

X()ejn d

(0.45)

x(n)ejn

(0.46)

multiplying both sides by ejn

X()ejm d =

x(n)ejn ejm d

(0.47)

ej(mn) d

(0.48)

x(n)

ej(mn) d = 2 f or n = m

(0.49)

= 0 otherwise
Z

X()ejm d = x(m)2

(0.50)

x(m) =
x(n) =

1
2

1
2

X()ejm d

(0.51)

X()ejn d

(0.52)

Dirichlets conditions must be satisfied


In nature all the signals are aperiodic and there is no possibility of periodic
signals

Example
Determine the FT and spectrum of the sequence
(
A 0nL1
x(n) =
0 otherwise

(0.53)

Check whether FT exists

|A| =

n=

L1
X

|A| = L|A| <

(0.54)

n=0

X() =

x(n)ejn

(0.55)

Aejn

(0.56)

Aejn

(0.57)

L1
X
n=0

L1
X
n=0

= [A + Aej + Ae2j + ...........Aej(L1) ]


2

(L1)

= A[1 + x + x + ...........x

=[

(0.59)

1 xL
]
1x

(0.60)

1 ejL
]
1 ej

(0.61)

= A[
= A[

(0.58)

AejL/2 [ejL/2 ejL/2 ]


]
Aej/2 [ej/2 ej/2 ]

X() = Aej(1L)/2

sinL/2
sin/2

(0.62)
(0.63)

M agnitude response is |X()| V s


|X()| = |A| |

sinL/2
|
sin/2

(0.64)

as0 , |X()| = |A|L


|X()| = 6 A + 6

sinL/2
+ 6 /2(1 L)
sin/2

A = 1 ,L = 5

(0.65)

10

|A|L

..
.

..
.

PROPERTIES OF DTFT
1.Linearity
F

x1 (n) X1 ()
F

x2 (n) X2 ()
F

a1 x1 (n) + a2 x2 (n) a1 X1 () + a2 X2 ()

(0.66)
(0.67)
(0.68)

2.Time shifting
F

x(n) X()
F

x(n k) ejk X()

(0.69)
(0.70)

3.Relationship between FT and ZT

X() =

x(n)ejn

(0.71)

X(z) =

x(n)z n

(0.72)

z = rej

(0.73)

11

X(z) =

x(n)rn ejn

(0.74)

T hese two expressions are same only at |r| = 1.


Since the unit circle ie, r = 1 circle is included in the ROC
Fourier Transform exist only for stable system
4.Time Reversal

x(n) X()
F

x(n) X()

(0.75)
(0.76)

5.Differentiation in frequency
F

x(n) X()
F

nx(n) j

X() =

dX()
d

x(n)ejn

(0.77)
(0.78)

(0.79)

dX() X
=
x(n)(jn)ejn
d

(0.80)

dX() X
=
nx(n)ejn
d

dX()
= F {nx(n)}
d
6.Multiplication by exponent
j

ej0 n x(n) X( 0 )

ej0 n x(n)ejn =

x(n)ej(0 n

(0.81)
(0.82)

(0.83)
(0.84)

= X( 0 )

(0.85)

7.Convolution
F

x(n) y(n) X()Y ()

(0.86)

12

Example: Evaluate the frequency response of the system H(z)=...........,


ROC z0.8

H(z) =

1
R.O.C , |Z| > .8
1 .8z 1

Since it indicates unit circle. Fourier Transform exist

Z = E J

H() = H(z)|z=ej =

H() =

H() =

1
1 .8ej

1
1 .8cos + j.8sin

(1 .8cos) (j.8sin)
(1 .8cos)2 + (.8sin)2

p
|H()| =

H() =

1+

(1 .8cos)2 + (j.8sin)2
(1 .8cos)2 + (.8sin)2

.64cos2

H() =

1
1.68cos + .64sin2

1
1.64 1.6cos

13

Magnitude Response
Magnitude Response

H()

.56

.6
3/4

.781
/2

1.4
/4

5
0

14

1.4

..
.

..
..
..
..
..
..

..
..
..

.. .. .56
. .
3
4

Phase Responses

H() = tan1 [

.8sin
]
1 .8cos

(0.87)

when = 2

.8sin
1
=
1 .8cos
0

(0.88)

1 .8cos = 0

(0.89)

cos =

1
.8

(0.90)

15
Phase Response

.3467
3/4

.6747
/2

.916
/4

0
0

H()

16

Discrete Fourier transform


When both the FT and IFT are made discrete or when both the sequence
as well as its spectrum is discrete. The Fourier transform is called discrete
Fourier transform .
DTFT is continuous in its spectrum STEPS TO GET A DISCRETE FOURIER
TRANSFORM:

X() =

x(n)ejn

(0.91)

Let us sample X(w) with N sample and the sample numbers are defined
by k
= 2f =

2k
N

(0.92)

X(

X
2kn
2k
)=
x(n)ej N
N

k = 0 , 1 , ...N 1

(0.93)

Let this summation be subdivided into a set of summations where each summation has N terms.

17

1
X

x(n)ej

2kn
N

N
1
X

x(n)ej

2kn
N

n=0

n=N

2N
1
X

x(n)ej

2kn
N

(0.94)

n=N

lN X
+N 1
X

x(n)e1j

2kn
N

(0.95)

n=lN

change the index of inner summation


n = n lN
X(

N
1
X
X
2kn
2k
)=
x(n lN )ej N
N
0

X(

(0.96)
k = 0 , 1 , ...N 1

N
1 X

X
2kn
2k
)=
[
x(n lN )]ej N
N

(0.97)

(0.98)

The inner summation is


.... + x(n N ) + x(n) + x(n + N ) + x(n + 2N ) + ..............

(0.99)

Aperiodic sequence gets repeated and becomes a periodic sequence


xp (n) =

x(n lN )

(0.100)

xp(n) can be represented using DFS (only one period)


xp (n) =

N
1
X

ck e

j2nk
N

n = 0 , 1 , 2 , .....N 1

(0.101)

k=0

ck =

N 1
j2nk
1 X
xp (n)e N
k = 0 , 1 , 2 ....N 1
N n=0

(0.102)

1
2k
X(
) k = 0 , 1 , 2 , ...N 1
N
N

(0.103)

N 1
1 X
2k j2nk
X(
)e N
N
N

(0.104)

ck =
xp (n) =

<n<

k=0

To get the actual periodic sequence


x(n) =

N 1
1 X
2k j2nk
X(
)e N
n = 0 , 1 , 2 ....N 1
N
N
k=0

(0.105)

18

X(

N
1
X
j2kn
2k
k = 0 , 1 , 2 ....N 1
)=
xp (n)e N
N
n=0

put WN = e

x(n) =

(0.106)

j2
N

N 1
1 X
X(K)WNnK n = 0 , 1 , 2 ....N 1
N

(0.107)

k=0

X(K) =

N
1
X

x(n)WNnK k = 0 , 1 , 2 ....N 1

(0.108)

n=0

N point DFT
If the aperiodic sequence length L is less than N, DFT can be obtained
If the sequence length LN then aliasing occurs.
Choose the value of N to be greater than L
Example
Compute the 4 point DFT of the sequence
x(n) = o , 1 , 2 , 3

(0.109)

X(0), X(1), X(2), X(3) has to be f ound


(No. of samples in the spectrum will be the same as the sequence)
X(0) = X(0)W40 + X(1)W40 + X(2)W40 X + (3)W40 ; N = 4
X(0) = X(0)W40 + X(1)W41 + X(2)W42 X + (3)W43

(0.112)

X(0) = X(0)W40 + X(1)W43 + X(2)W46 X + (3)W49

(0.113)

X(1)W42


X(0)
W40

0
X(1) W4


X(2) = W 0

4
X(3)
W40

X(2)W44 X

(0.111)

(3)W46

X(0) =

X(0)W40

(0.110)

W40

W40

W41

W42

W42

W44

W43

W46

WNnk = e

x(0)

W43
x(1)

W46 x(2)

W49
x(3)
W40

j2.nk
N

W40 = e

j2.0
4

W41 = e

j2
4

(0.114)

=1

(0.115)

= j

(0.116)

19

W42 = e

W43 = e

j2.3
4

W44 = e

j2.4
4

W40
X(0)
0

X(1) W4

X(2) = W 0
4

W40
X(3)

1
X(0)

X(1) 1

X(2) = 1

1
X(3)

j2.2
4

= 1

(0.117)

=j

(0.118)

=1

(0.119)

W40

W40

W41

W42

W42
W43

W44

x(0)

W43
x(1)
6
W4 x(2)

x(3)
W49
W40

W46


6
0


j
1 = 2 + 2j

1 2 2

2 2j
3
j
1

M agnitude spectrum is k V s |X(k)|


P hase spectrum is k V s 6 |X(k)|
6

6
8

2
4 3 2 1

6
8

2
0
0

3
2

4
2

Properties of discrete Fourier Transform


1. Periodicity
T
x(n) DF
N X(k)

(0.120)

x(n + N ) = x(n)

(0.121)

x(k + N ) = x(k)

(0.122)

T
x1 (n) DF
N X1 (k)

(0.123)

2. Linearity

20
T
x2 (n) DF
N X2 (k)

(0.124)

T
a1 x1 (n) + a2 x2 (n) DF
N a1 X1 (k) + a2 X2 (k)

(0.125)

3. Circular Symmetry
N point DFT of a finite sequence x(n) with length LN is equivalent to N
point DFT of a periodic sequence xp(n) of period N which is obtained by
periodically extending x(n).
xp (n) =

x(n lN )

(0.126)

If the sequence is shifted by k samples to the right, it is equivalent to


shifting the original sequence circularly by k samples

3
2

1
0

3
2

1
1

xp (n)

x(n)

2
1

xp (n 2)

Multiplication of two DFTs/Circular convolutions

x(n m) = xp (n m)

= x((n m))N
F

x(m) X()
F

x(m n) X()ejn

x(m n) = xp (m n)

(0.127)

= x((m n))N

(0.128)

x(n) X()

x(n k) X()ejk

(0.129)
(0.130)

21
F

x(n) x(k)

(0.131)

T
x(m n) DF
N X(k)e

x(k) =

N
1
X

x(m)e

j2nk
N

j2mk
N

(0.132)
(0.133)

m=0

x(M ) =

N 1
j2mk
1 X
X(k)e N
N

(0.134)

k=0

Multiplication of 2 NPT DFTs


T
x(n) DF
N X(k)

x(k) =

N
1
X

x(n)e

j2nk
N

(0.135)
(0.136)

n=0
T
h(n) DF
N H(k)

(0.137)

letY (k) = X(k).H(k)


=

N
1
X

x(n)e

j2nk
N

.H(k)

(0.138)

n=0
N 1 N 1
j2nk
j2mk
1 X X
x(n)e N ]e N .H(k)
[
N
k=0 n=0
)
( N 1
N
1
X
j2nk
j2mk
1 X
[H(k)e N ]e N
=
x(n)
N
n=0

y(m) =

(0.139)

(0.140)

k=0

N
1
X

x(n)h((m n))N

(0.141)

n=0

N h(n)
= x(n)
y(n) =

N
1
X

x(k)h((n k))N

(0.142)
(0.143)

k=0

Example
perform circular convolution of
x1 (n) = {2 , 1 , 2 , 1 }

(0.144)

x2 (n) = {1 , 2 , 3 , 4 }

(0.145)

N x2 (n)
x3 (n) = x1 (n)

(0.146)

22

N
1
X

x1 (k).x2 ((n k))N

(0.147)

k=0

x3 (n) =

N
1
X

x1 (k).x2 ((n k))N

(0.148)

k=0

N x2 (0)
x3 (0) = x1 (0)
=

N
1
X

x1 (k).x2 ((k))N

k=0

1
u
x1 (1)

u
2 x1 (2)

x1 (0)

x1 (3)
u
1
2
u
x2 (1)

u
3 x2 (2)

x2 (0)

x2 (3)
u
4

x3 (0) = 2 + 4 + 6 + 2 = 14
x3 (0) = 8 + 3 + 4 + 1 = 16
x3 (0) = 6 + 2 + 2 + 4 = 14
x3 (0) = 4 + 1 + 8 + 3 = 16

(0.149)
(0.150)

23

T
x((n))N DF
N X((n))N

(0.151)

N x2 (n)
x3 (n) = x1 (n)
Difference between circular convolution and linear convolution
If linear convolution is performed, the output has m+n-1samples, but for
circular convolution only m=n samples will be present
Example
Determine the sequence x3 (n)= x1 (n)*x2 (n) corresponding to the circular convolution of X1 (n)= 2,1,2,1 and x2 (n)=1,2,3,4 By performing DFT
and IDFT
x1 (n) = {2 , 1 , 2 , 1 }

(0.152)

x2 (n) = {1 , 2 , 3 , 4 }

(0.153)


1
X1 (0)


X1 (1) 1


X (2) = 1
1
1
X1 (3)


X2 (0)
1


X2 (1) 1


X (2) = 1
2
X2 (3)
1


6
2

j 1 0

=
1
2 2
0
1
j
1

1
10

j
2 = 2 + 2j

1 3 2

j
4
2 2j
1


60
X3 (0)


X3 (1) 0


X (2) = 4
3
X3 (3)
0

1
X3 (0)

X3 (1) 1 1

X (2) = 4 1

3
1
X3 (3)


14


j
0 = 16


1
4 14
j
0
16
1

60

24

Example:
Perform linear convolution x1(n)*x2(n) using DFT.
x1 (n) = {1 , 2 }

(0.154)

x2 (n) = {2 , 2 }

(0.155)

Solution
Since the length of sequence after convolution = m+n = 3.
Therefore the given sequence has to be padded with zeros to have a length=3
or greater.
x1 (n) = {1 , 2 , 0}

(0.156)

x2 (n) = {2 , 2 , 0}

(0.157)

x1 (n) = {1 , 2 , 0 , 0}

(0.158)

x2 (n) = {2 , 2 , 0 , 0}

(0.159)

or


X1 (0)
1


X1 (1) 1


X (2) = 1
1
X1 (3)
1

1
X2 (0)


X2 (1) 1


X (2) = 1
2
1
X2 (3)

1
3

j
2 = 1 2j

1 0 1

j
0
1 + 2j
1


4
2


j
2 = 2 2j

1 0 0

2 + 2j
0
j
1


12
3.4
X3 (0)



X3 (1) (1 2j).(2 2j) 2 6j

=
X (2)
0
0

3

(1 + 2j).(2 + 2j)
2 + 6j
X3 (3)

1
X3 (0)

X3 (1) 1 1

X (2) = 4 1

3
1
X3 (3)


j
2 2j = 6


1 0
4
j
2 + 6j
0
1

12

25

x3 (n) = {2 , 6 , 4 , 0}

(0.160)

x(n)WNnk , k = 0 , 1 , 2 , ....N 1

(0.161)

Fast Fourier Transform

X(k) =

N
1
X
n=0

x(n) =

N 1
1 X
X(k)WNnk , n = 0 , 1 , 2 , ....N 1
N n=0

(0.162)

If x(n) is real, we need N2 complex multiplication and N-1 complex addition for the computations of DFT.
In order to make the computations simpler a set of algorithms to perform
DFT have been developed. They are called FFT.
There are 2 sets of algorithms 1. Decimation in time algorithm 2. Decimation in frequency
If the length of the sequence whose DFT has to be found is N and if N=2a ,
Then the FFT is a called Radix -2 FFT algorithm.
Radix 2 Decimation in Time FFT algorithm

let x1 (n) = even members of the sequence x(n)


x2 (n) = odd members of the sequence x(n)
DF T (x(n)) = DF T (x1 (n)) + DF T (x2 (n))
X(k) =

N
1
X

x(n)WNnk

(0.163)
(0.164)

n=0

X(k) =

x(n)WNnk +

n=even

x(n)WNnk

(0.165)

n=odd

x1 (n) = x(2n) f or n = 0 , (N/2) 1


x2 (n) = x(2n + 1) f or n = 0 , (N/2) 1
N/21

X(k) =

X
n=0

N/21

x(2n)WN2nk

X
n=0

(2n+1)k

x(2n + 1)WN

(0.166)

26
N/21

N/21

nk
+
x1 (n)WN/2

(0.167)

(n)k

(0.168)

N/21

N/21

.WNk

n=0

n=0

(2n)k

x2 (n)WN

nk
+ WNk
x1 (n)WN/2

x2 (n)WN/2

n=0

n=0

X(k) = X1 (k) + WNk X2 (k)

(0.169)

X1 (k) = DF T of the even member of x(n)


X2 (k) = DF T of the odd member of x(n)
now the number of multiplications is (
= 2(

N 2
N
) + ( )2 + N
2
2

N 2
) +N
2

now the number of additions is

N N
( )x2 + N
2 2

N
1) + N
2
In a similar manner this N/2 point DFTs can be furthur divided into 2
N/4 point DFTs.
= N(

X(k) = X1 (k) + WNk X2 (k) (N/2 point DF T )

(0.170)

k
X1 (k) = A(k) + WN/2
B(k)

(0.171)

= A(k) + WN2k B(k)


X2 (k) = C(k) +

WN2k D(k)

(0.172)
(0.173)

This process goes on until it becomes 2 point DFTs


The DFT of any sequence Xn with period N equals 2 power a can be written
as a sum of two N divided by 2 point DFT of sequence X1n and X2n
Example
Consider an 8 point sequence
x(n) = x(0) , x(1) , x(2) , x(3) , x(4) , x(5) , x(6) , x(7)

(0.174)

x1 (n) = x(0) , x(2) , x(4) , x(6)

(0.175)

x1 (n) = x(1) , x(3) , x(5) , x(7)

(0.176)

First decimation pictorial representation


X(0) = X1 (0) + WN0 X2 (0)

(0.177)

27

x(0)
x(0)

x(0)
x(1)

x(2)
x(4)

4P T DF T x(2)
x(3)

x(6)
x2 (0)
x(1)
x2 (1)
x(3)
x(5)

4P T DF T x2 (2)
x2 (3)

x(7)


A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
A
- AAA W80  AA A 1
A
-   A A W81   A A 1
A
A- 
A 1
W82 
A
-
1
W83

x(1)
x(2)
x(3)

x(4)
x(5)
x(6)
x(7)

X(1) = X1 (1) + WN1 X2 (1)

(0.178)

WN2 X2 (2)

(0.179)

X(3) = X1 (3) + WN3 X2 (3)

(0.180)

WN4 X2 (4)

(0.181)

X(4) = X1 (4) + W84 X2 (4)

(0.182)

X(2) = X1 (2) +
X(4) = X1 (4) +

= X1 (0) + W80 X2 (0)

(0.183)

Second decimation: Divide the sequences into odd and even sequences.

!
F (0)
F (1)

a(n) = x(0) , x(4)

(0.184)

b(n) = x(2) , x(6)

(0.185)

f (n) = x(0) , x(4)

(0.186)

W20

W20

W20

W21

!
x(0)
x(4)

WN0

WN0

WN0

WN1

!
x(0)
x(4)

F (0) = x(0) + x(4)

(0.187)

F (1) = x(0) x(4)

(0.188)

28

x(0)

A(0)

x(0)

2P T DF T

x(2)

A(1)
B(0)

x(4)
2P T DF T

x(6)

B(1)

x(0)
A 
A
AA
A
-AW80A1
A
- W81 1

x(1)
x(2)
x(3)

x2 (0)
x(1)
2P T DF T

x(3)
x(5)

2P T DF T

x(7)

A 
A
AA
A
-AW80A1
A
- W82 1

x2 (1)
x2 (2)
x2 (3)

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
A
- AAA W80  AA A 1
A
-  A A W81   A A 1
A
A- 
A 1
W82 
A
-
1
W83

x(4)
x(6)

W80

A
A
1

W80

A
A
1

W80

A
A
1

W80

A
A
1

A 
A
AA
A
-AW80A1
A
- W82 1

x(1)
x(3)
x(5)
x(7)

x(2)
x(3)

x(4)
x(5)
x(6)
x(7)

x(0)

x(0)
x(2)

x(1)

A 
A
AA
A
-AW80A1
A
- W82 1

Butterfly

no of additions is N log2 N

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
A
- AAA W80  AA A 1
A
-  A A W81   A A 1
A
A- 
A 1
W82 
A
-
W83
1

x(1)
x(2)
x(3)

x(4)
x(5)
x(6)
x(7)

29

WNk

@
@
-@
1

no of M ultiplications is N/2log2 N
Compute the 8 point DFT using Radix - 2 DIT FFT algorithm for
x(n) = 1/2 , 1/2 , 1/2 , 1/2 , 0 , 0 , 0 , 0

1
2

x(0) = 1/2
x(4) = 0

A
A
1

1
2

A
A
1

1
2

x(2) = 1/2
x(6) = 0

A
A
1

1
2

A
A
1

1
2

x(3) = 1/2
x(7) = 0

1
A
1
j
-


A
AA
A
AA1
A
 1

1
2

x(1) = 1/2
x(5) = 0

1
2

1
2

(0.189)

1
2 (1

x(0)
j)

j
1
2 (1

+ j)

1
j
-

A 
A
AA
A
AA1
A
 1

1
2 (1

j)

j
1
2 (1

+ j)

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
1
A
 AAA A
A
A
1



1
(1 j)
A
2  A A   A A 1
j
A
A 
A
1

1
2 (1 + j)
A

1

Decimation in Frequency
Divide the sequence into two halves of length N divided by 2 samples

x(1)
x(2)
x(3)

x(4)
x(5)
x(6)
x(7)

30

x1 (n) = x(n) , n = 0 , 1 .... N/2 1

(0.190)

x2 (n) = x(n) , n = N/2 .... N/2 1

(0.191)

.... N/2 1

= x(n + N/2) , n = 0 1,
x(n) = x(0) x(1),
X(k) =

N
1
X

(0.192)

.... x(N 1)

(0.193)

x(n)WNnk

(0.194)

n=0
N/21

N/21

x(n)WNnk +

n=0

(n+N/2)k

x(n + N/2)WN

(0.195)

n=0
N/21

N/21

x1 (n)WNnk +

n=0

N k/2

x2 (n)WNnk .WN

(0.196)

n=0

We can now consider odd and even values of spectrum


X(2k) and X(2k + 1)
N/21

N/21

X(2k) =

(0.197)

x1 (n)WN2nk +

x2 (n)WN2nk .WNN k

(0.198)

n=0

n=0
N/21

X(2k) =

[x1 (n) + x2 (n)] WN2nk

(0.199)

n=0
N/21

N/21

X(2k + 1) =

(2k+1)n
x1 (n)WN

(2k+1)n

x2 (n)WN

N/2(2k+1)

.WN

n=0

n=0

(0.200)
X(2k + 1) =

N/21

N/21

x1 (n)WN2kn .WNn +

n=0

N/2

x2 (n)WN2kn .WNn .WNN k .WN

n=0
N/2

WN

= 1 , WNN k = 1

(0.201)
(0.202)

N/21

X(2k + 1) =

[x1 (n) x2 (n)] .WN2nk WNn

(0.203)

n=0
N/21

[x1 (n) x2 (n) WN2nk ]WNn

(0.204)

n=0
N/21

X(2k) =

X
n=0

kn
f (n)WN/2
, f (n) = x1 (n) + x2 (n)

(0.205)

31
N/21

X(2k + 1) =

kn
, f (n) = [x1 (n) + x2 (n)].WNn
g(n)WN/2

(0.206)

n=0

Consider an 8 PT sequence:

x(n) = x(0), x(1), x(2), x(3), x(4), x(5), x(6), x(7)


x1 (n) = x(0), x(1), x(2), x(3),

(0.208)

x2 (n) = x(4), x(5), x(6), x(7)

(0.209)

f (0)

x(0)
x(1)
x(2)
x(3)

x(4)
x(5)
x(6)
x(7)

(0.207)

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
0
A -W 8
 AAA  AA A 1 W 1
A - 8
  A A   A A 1 W 2
A - 8
A 
A 1

3
A -W 8

1

f (1)
f (2)4P T DF T
f (3)

g(0)
g(1)
g(2) 4P T DF T
g(3)

x(0)
x(2)
x(4)
x(6)

x(1)
x(3)
x(5)
x(7)

Now the process can be furthur extended to furthur divide the sequences
in two
Computation of IDFT by doing direct DFT (i.e. the same FFT scheme)

N 1
1 X
x(n) =
X(k)WNnk
N

(0.210)

k=0

taking complex conjugate


x (n) =

N 1
1 X
X (k)WNnk
N
k=0

(0.211)

x(0)
32

x(1)
x(2)
x(3)

x(4)
x(5)
x(6)
x(7)

x(0)
A 
A
AA
A
AA1
A
 1

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
A
 AAA  AA A 1
A
  A A   A A 1
A
A 
A 1

A

1

W80
W82

A
A 1 W80

x(4)

A
A 1 W80

x(6)

W80
-

x(1)

W81
-

A 
A
AA
A
AA1
A
 1

W82
W83
-

N x (n) =

N
1
X

W80
W82

X (k)WNnk

A
A 1 W80

x(5)

A
A 1 W80

x(7)

(0.212)

k=0

This is an N point DFT of teh sequence X*(k) taking complex conjugate


again.
N 1

x(n) =

1 X
X (k)WNnk ]
[
N

(0.213)

k=0

1
[DF T of X (k)]
N

(0.214)

Therefore to find the inverse DFT first find the DFT of X*(k). Then
multiply by 1 by N and once again take the complex conjugate.
Regular Radix -2 DIT FFT algorithm

Input sequence in order


Example
Compute the DFT of an 8 PT sequence

(
x(n) =

x(2)

0n7

otherwise

(0.215)

x(3)

33

x(0)

x(0)

x(2)
x(4)
x(6)

W80

A
A
1

W80

A
A
1

W80

A
A
1

W80

A
A
1

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
A
- AAA W80  AA A 1
A
-  A A W81   A A 1
A
A- 
A 1
W82 
A
-
1
W83

A 
A
AA
A
-AW80A1
A
- W82 1

x(1)
x(3)
x(5)
x(7)

A 
A
AA
A
-AW80A1
A
- W82 1

x(1)
x(2)
x(3)

x(4)
x(5)
x(6)
x(7)
x(0)

x(0)
x(1)
x(2)
x(3)
W80

x(4)

x(5)

W0
- 8

x(6)

W0
- 8

x(7)

W0
- 8

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
A
 AAA  AA A 1
A
  A A   A A 1
A
A 
A 1

A

1

W80
W80

A 
A
AA
A
AA1
A
 1

W80

A
A
1

W81

A
A
1

W82

A
A
1

W83

A
A
1

x(4)
x(2)
x(6)

x(1)

W82
W82

A 
A
AA
A
AA1
A
 1

x(5)
x(3)
x(7)

Example 2
Perform circular convolution of the two sequences 2,1,2,1 , 1,2,3,4 using FFT

x(n) = {8, 0, 0, 0, 0, 0, 0, 0}

(0.216)

34

1
1

1
1

A
A 0
1
2
A
A 0
1

A
1
j
-


A
AA
A
AA1
A
 1

A
A 0
1
2
A
A 0
1

A

A

A A
 
A A  
A A A  
A AA 
A AAA 
AAAA
AAAA
1
A
 AAA A
A
A
1



1
(1 j)
A
2  A A   A A 1
j
A
A 
A
1

1
2 (1 + j)
A

1

0
0

1
1

1
j
-

2
2
1
1

A 
A
AA
A
AA1
A
 1

0
0
0

4
A
A 0
1
2

1
-

A
A 0
1

j
-

A 
A
AA
A
AA1
A
 1


60
X3 (0)
X3 (0)

X3 (1) 0 X3 (1)

= =
X (2) 4 X (2)
3 3
X3 (3)
X3 (3)
0

0
2
0

X1 (0)
X1 (1)
X1 (2)
X1 (3)

0
0
0)

0
0
0
0

35

1
2
3
4

A
A 2
1
6

0
0

1
-

A
A 2 j
1

A 
A
AA
A
AA1
A
 1

56

60
4

10

2
2 j2

56

A
A 64
1
0

1
-

A
A 0
1

2 + j2

j
-

A 
A
AA
A
AA1
A
 1

64
56
64

X2 (0)
X2 (1)
X2 (2)
X2 (3)

X1 (0)
X1 (1)
X1 (2)
X1 (3)


X3 (0)
14
56


X3 (1) 1 64
16


X (2) = 4 54 = 14
3


X3 (3)
16
64
Example
Find the IDFT of the sequence
n

o
x(n) = 4, 1 j(1 + 2), 0, 1 + j(1 2), 0, 1 j(1 2), 0, 1 + j(1 + 2)
(0.217)
using both DIT and DIF algorithms.

x(n) = {1, 1, 1, 1, 0, 0, 0, 0}

(0.218)

36

4
0

A
A 4
1
0

0
-

1 + j(1 +
1 + j(1
1 j(1
1 j(1 +

2)
2)

2)
2)

A

4
A

A A
 
4
A A  
A
A A A  
4
A 0
A AA 
A AAA 
1
AAAA
AAAA
2(1 + j)
4
1
A
 AAA

A
A
A
A
A 
1



1
(1 j)
2 2(1 + j)
A
2A j2 2
A
  A A A A
1
  A A 1
2(1 j) 1 
j
A
AA 4j
- A 

A
A1
A
1


1
(1 + j)
A
A 2 2(1 j) 2 A j2 2 j
-  
1
1
1


A
A A
1  
A
- AA1

j
A
-  1

Radix n FFT
Radix 3 F F T , N = 3a
x(n) = {x1 (n) , x2 (n) , x3 (n) , }

(0.219)

x1 (n) = x(3n)

(0.220)

x2 (n) = x(3n + 1)

(0.221)

x3 (n) = x(3n + 2)

(0.222)

N/31

X(k) =

N/31

N/31

x(3n)WN3nk +

n=0

(3n+1)k

x(3n+1)WN

(3n+2)k

x(3n+2)WN

n=0

n=0

(0.223)
N/31

X(k) =

N/31
nk
x1 (n)WN/3
+

n=0

X
n=0

N/31
nk
x2 (n)WN/3
WNk +

nk
x3 (n)WN/3
WN2k

n=0

(0.224)
Comparison of Speed

8
8
8)

0
0
0
0

37
Magnitude Response

N o of mult N 2 F F T

N log2 N F F T

speed

16

64

24

2.7

32

256

64

Inplace computation : bit reversal


Block convolution:
1. Overlap add method
2. Overlap save method
When one of the sequence is very long, the linear convolution using DFT becomes very difficult.

The long sequence is segmented in to blocks of finite length


Since DFT operation is linear, successive blocks can be processed simultaneously and the output blocks (DFT) can be combined to get the overall
DFT of the entire output.
1. Overlap add method
h(n) - length is M
x(n) - divided into blocks of length L
LM
To perform linear convolution
Length of each output block M+L-1 = N
Therefore size of DFT and IDFT is N multiplied by N
Therefore h(n) and x(n) has to be padded with zeros to make it to length
N.
i.e. h(n) should be added with L-1 zeros
x(n) should be added with M-1 zeros
y(0), y(1), ......................... , y(n-1)

38

x1 (n)
L x1 (n)

x2 (n)

x3 (n)

//
M 1zeros
x2 (n)

//
M 1zeros
x3 (n)

y1 (0) y2 (1) y3 (2)


y1 (n)
// add M 1 pts

//
M 1zeros

y1 (2) y2 (3) y3 (4)


//
y2 (n) // add M 1 pts
y1 (4) y2 (5) y3 (6)
//
y3 (n) //

Y (n) = {y1 (0) , y1 (1) , [y1 (2) , y2 (2)] , y2 (3) , (y2 (4) , y3 (4)) , y3 (5) , y3 (6) }
(0.225)
2. Overlap save method
h(n) - length is M x(n) - divided into blocks of length L plus M minus
1
FFT algorithms for a composite number N
N=L.M ( it has L blocks of length M)
The sequence x(n) can be represented as a 2 D array of size L*M.
Ex:
N=6=2*3 or 3*2
x(n) = x(0) , x(1) , x(2) , x(3) , x(4) , x(5) ,
x(0), x(1), x(2) or 2*3
the array can be indexed by l and m.
Where l= 0,1,2....L-1
M=0,1,2.......M-1
There fore the sequence can be stored in many ways in array, depending upon
the mapping of index n to land m

x1 (n)
L -

// x1 (n)
M 1 zeros

x2 (n)

x3 (n)
39

//

// x2 (n)
M 1 points
of x1 (n)

//
y1 (n)
discard M 1 pts

//
//
x3 (n)
M 1 points
of x2 (n)

//
y2 (n)
discard M 1 pts
//
y3 (n)
discard M 1 pts

0
0
x(0)
x(M )
1

.
..

l ..

..
..

.
.
L1
x(L 1)M

1
x(1)
x(M + 1)
..
.
..
.
0

2
x(2)
x(M + 2)
...
...
...

... ...
M 1

. . . . . . x(M 1)
. . . . . . x(2M 1)

..
.. ..

.
.

..
.. ..

.
.
.
. . . . . . x(LM 1)

n = Ml + m
2
... ...
M 1

0
x(2L) . . . . . . x(M 1)L

..
..

x(1)
1
x(L + 1)
.
... ...
.

.
.
.
.
.
.
l ..
.
.
..
..
.

.
.
.
...

..
..
..
..

.. ..

.
.
.
.
.
.
...
L1
x(L 1) x(2L 1)
...
. . . . . . x(LM 1)
m

0
x(0)

1
x(L)

n = l + mL
A similar arrangement can be done to store the corresponding Dfts.
X(k) in an array with similar index p,q ,where
where
K = Mp + q
If x(n) is mapped to a rectangular array x(l,m)..............
n = l + mL

40

X(p, q) =

M
1 L1
X
X

(l+mL)(M p+q

x(l, m)WN

(0.226)

m=0 l=0

X(k) =

N
1
X

x(n)WNnk

(0.227)

l=0
(l+mL)(M p+q

WN

X(p, q) =

= WNM lp WNM Lmp WNlmq WNlq

(0.228)

WNM Lmp = WNN mp = 1

(0.229)

mq
=1
WNLmq = WN/L

(0.230)

lp
= WLlp
WNM lp = WN/M

(0.231)

L1
X

(
WNlq

"M 1
X

#)
mq
x(l, m).WM

WLlp

(0.232)

m=0

l=0

this involves computation of DFTs of length M and L


This computation is performed in 3 steps
1.Compute the M point DFTs
F (l, q) =

M
1
X

mq
x(l, m).WM

(0.233)

m=0

f or each row l = 0 , 1, .... L 1


q = 0 , 1, .... M 1
2. Compute
mq
WM
.F (l, q) = G(l, q)

(0.234)

in a new array
3. Compute L point DFTs
X(p, q) =

L1
X

G(l, q).WLlp

l=0

p = 0 , 1, .... L 1
q = 0 , 1, .... M 1

(0.235)

41

e.g:
Consider a sequence of length N = 15 = 3 by 3, 5 by 3
0

x(0, 0) = x(0)

x(0, 1) = x(5)

x(0, 2) = x(10)

x(1, 0) = x(1)

x(6)

x(11)

x(2)

x(7)

x(12)

x(3)

x(8)

x(13)

x(4)

x(9)

x(14)

Compute 3 point DFTs with each row


The result F(l,q) is another array

F (0, 0)

F (1, 0)
.
.
.
F (4, 0)

F (0, 1)

F (0, 2)

F (1, 1)
..
.

F (1, 2)
..
.

F (4, 1) F (4, 2)

Multiply each of the terms F(l,q) by Wn to the power lq where n = 13


0
G(0, 0) = F (0, 0).W15
....

G(0, 0) G(0, 1) G(0, 2)

G(1, 0) G(1, 1) G(1, 2)


.

..
..
.

.
.
G(4, 0) G(4, 1) G(4, 2)

42

All numbers except prime numbers are composite. Composite numbers


which can be written as a product of 2 numbers other than 1 and itself.
Compute 5 point DFts on the 5 columns

X(0, 0) X(0, 1) X(0, 2)

..
..
X(1, 0)
.
.

.
..

..
.
X(2, 0)

..
..

X(3, 0)
.
.

..
X(4, 0)
.
X(4, 2)

= X(p, q)

K = Mp + q

X(0)

X(1)

..
X(3)
.

..

.
X(6)

..

X(9)
.

..
X(12)
.

X(2)
..
.
..
.
..
.

X(14)

Design of LTI system


1. Specifications 2. Find impulse response 3. Find h(z) 4. Obtain the
coefficients 5. Realise the system.
y(n) =

N
1
X

(0.236)

bk x(n k) causalsystem

(0.237)

k=1

y(n) =

M
1
X

M
1
X

bk x(n k)

ak ynk +

k=0

k=0
N
1
X

M
1
X

bk x(z)z k

(0.238)

PM 1
k
Y (z)
k=0 bk z
=
= H(z)
PN 1
X(z)
1 k=1 az z k

(0.239)

Y (z) =

k=1

az z

k=0

Dr = 0 the o/p of the system depends on present and past inputs


FIR REALISATION
Direct form

43

Cascade form
Lattice form
Frequency sampling structure
Any system should be an LTI causal system
FIR digital filters :
Any system can be realised as an filter

y(n) = h(n) x(n) =

h(k)x(n k)

(0.240)

h(n)z n if h(n) is known

(0.241)

k=

If h(n) is finite we call it as FIR filter


If H(n) is infinite we call it as IIR filter
H(z) =

M
1
X
n=0

For a causal system the output of this system depends on the present and
past input.
y(n) =

M
1
X

bk x(n k) if i/p0 s are known

(0.242)

n=0

Y (z) =

M
1
X

bk z k ,

(0.243)

n=0

h(n) =

(
bn
0

H(z) =

0nL1
otherwise
M
1
X

bk z k ,

(0.244)

(0.245)

K=0

DIRECT FORM OF REALISATION


Example :
Realize the following system using direct form
H(z) = 1 + 2z 1 + 3z 2 + 2z 3 + 3z 4 + z 5

(0.246)

CASCADE FORM
In cascade form H(z) which is an Nth order FIR filter is factorized to K second

44

x(n)
z 1

z 1

b0 = h(0)

b1 = h(1)
?
k

b2 = h(2)
?
k

bM 1 = h(M 1)
?
k
-

?
k

y(n)

x(n)
z 1
1

z 1

2
?

z 1

3
?
k

z 1

2
?
k

z 1

3
?
k

?
k

?
k
y(n)

order FIR sections.


H(z) = H1 (z).H1 (z).......Hk (z)
H(z) =

K
Y

(0.247)

Hk (z)

(0.248)

k=1

Hk (z) = bk0 + bk1 z 1 + bk2 z 2


Hk (z) = b00 + b01 z 1 + b02 z 2



b10 + b11 z 1 + b12 z 2 (....) bk0 + bk1 z 1 + bk2 z 2
(0.250)

Eg : 1+2z 1 +3z 2 +2z 3 +z 4 = 1 + z 1 + z 2


Lattice Structures

(0.249)

1 + z 1 + z 2

(0.251)

45

H1 (z)

H2 (z)

. . . ........

z 1

z 1

Hk (z)

x(n)

b00

b01
?

b02
?
k

b10
?
k

H(z) = 1 +

bk z

= h(0) +

k=1

N
1
X

h(n)z n

(0.252)

n=1

Step 1
H(z) = Am (z)

(0.253)

Where m indicates the highest negative power and km : the coefficient of


highest negative power.
Step 2
Find Bm(z)=Reverse polynomial of A(z).
Step 3

b11

These structure is possible only if the system function is of the form

N
1
X

z 1

z 1

b12

?
k

?
k
-

46

x(n)

b00 = 1

b10 = 1

- k

- k

z 1

z 1
b01 = 2

b11 = 0

- k
6

z 1

- k
6

z 1
b12 = 1

b02 = 1
-

f0 (n)

f1 (n)
k
@
k1

x(n)
z 1
g0 (n)

@ 
k1
@
R
@
k

z 1

k
@
@ 
k2 @ k2
R
@
k

- y(n)
M 1 stages
- g(n)

g1 (n)

Find Am-1(Z) using the equation


Am1 (z) =

Am (z) km Bm (z)
2
1 km

(0.254)

Step 4
Continue finding Ams until it becomes a first order equation and k1 from it.
Example 1
Given

13 1 5 2 1 3
z + z + z
24
8
3
13 1 5 2 1 3
A3 (z) = 1 + z + z + z
24
8
3
H(z) = 1 +

K3 = 1/3
B3 (z) =

1 5 1 13 2
+ z + z + z 3
3 8
24

(0.255)
(0.256)
(0.257)
(0.258)

47

A3 (z) K3 B3 (z)
1 k32

A2 (z) =
=

1+

13 1
24 z

+ 58 z 2 + 13 z 3

1
9

5 1
24 z

(0.259)

13 2
72 z

+ 13 z 3

(0.260)

1
3

8
9

+ 13 z 1 +

32 2
72 z

(0.261)

8
9

3
1
= 1 + z 1 + z 2
8
2
k2 =

(0.262)

1
2

(0.263)

1 3 1
+ z + z 2
2 8
A2 (z) K2 B2 (z)
A1 (z) =
1 k32
B2 (z) =

1 + 38 z 1 + 12 z 2 14
1 14

3 1
16 z

(0.264)
(0.265)
12 z 2

(0.266)

1
= 1 + z 1 , k1 = 1/4
4

k
@
x(n)
z 1

@ 
1/4 @ 1/4
R
@
k

z 1

k
@
@ 
1/2 @ 1/2
R
@
k

(0.267)

k
@
z 1

@ 
1/3 @ 1/3
R
@
k

Example 2
Given
H(z) = 1 .9z 1 + .64z 2 .576z 3

(0.268)

realize using lattice form.

A3 (z) = H(z) , k3 = .576

(0.269)

y(n)

48

B3 (z) = .576 .64z 2 .9z 3 + z 3


A3 (z) =

(0.270)

1 .9z 1 + .64z 2 .576z 3 .3318 + .37z 1 .5184z 2 + .576z 3


.66822
(0.271)
1
2
A3 (z) = 1 .795z + .182z
, k2 = .182
(0.272)
B3 (z) = .182 .795z 1 + z 2

A3 (z) =

(0.273)

1 .898z 1 + .182z 2 .033 + .163z 1 .182z 2


1 .033
=

.967 .735z 1
.967

(0.275)

A1 (z) = 1 .672z 1 , k1 = .672

k
@
x(n)
z 1

@ 
.76 @.76
R
@
k

z 1

k
@
@ 
.182 @
R
@
k

(0.274)

(0.276)

k
@
@ 
.576 @
R
@
k
z 1

FIR filter design :


Methods
1. Fourier series truncation method
2. Windowing method
3. Frequency sampling techniques
i.e the system modifies the shape of the spectrum hence it is a filter
Ideal Filter Characteristics
These filters can be realized as FIR or IIR filters

y(n) =

M
1
X
k=0

bk x(n k)

(0.277)

y(n)

49

x(n)

h(n)

y(n)

X()

H()

Y ()

LP F

HP F
|H()|

s
2

s
2

..
.
..
.
..
.

|H()|

s
2

Allpass

s
2

s
2

..
.
..
.
..
.

s
2

2 1

h(n)z n , h(0) = b0 , h(1) = b1 ......

(0.278)
(0.279)

n=0

if y(n) =

bk x(n k)

..
.
..
.
..
.

|H()|

Y (z)
= b0 + b1 z 1 + .......bM 1 z M +1
X(z)
H(z) =

s
2

BP F
|H()|

M
1
X

..
.
..
.
..
.

(0.280)

s
2

50

H(z) =

h(n)z n

(0.281)

Hence y (n) is expressed in terms of y (n-k) and x (n-k)


y(n) =

N
1
X

ak y(n k) +

k=1

bk x(n k)

(0.282)

k=0

P
H(z) =

M
1
X

b(k)z
kP
k

(0.283)

ak z k

Aim:
If aks and bks are found out, the filters can be realized.
FIR filters
Design means realisation of fir filter and finding the filter coefficients.
and finding the filter coefficicients

x(n)
z 1
b0
?

b1
?
k

z 1
b2 ......
?
k

Any desired filter response can be obtained using this filter only the filter
coefficients are different
Advantages of FIR filter
1. Linear phase can be obtained if h(n) is exhibiting symmetry They have exactly linear phase characteristics i.e, impulse response will exhibit symmetry
property which can be exploited to obtain efficient realisation.
2. They are always stable because their poles will be in the origin Stability:
All the poles should lie in within the unit circle.

b0 = h(0) , b1 = h(1)......

(0.284)

H(z) = b0 + b1 z 1 + b2 z 2

(0.285)

51

H(z) =

b0 z 2 + b1 z + b2
z2

(0.286)

3. Easily reslisable
4. Any system with arbitrary magnitude response can be designed .Since
any
|H()| =

M
1
X

h(n)ejn

(0.287)

n=0

5. Finite register length affect are less in FIR For a linear phase filter,
phase response is linear with frequency.

() = 6 H() =

6 H()
..PPP
PP
.
PP
.
PP

(0.288)

..
.
PP
P.

Phase delay:

p =

()

(0.289)

Group Delay
d()
d
FOURIER SERIES TRUNCATION METHOD
g =

T =

1
eg : T = 1 msec, fs = 1kHz
fs

(0.290)

(0.291)

An FIR causal filter has a system function


H(z) =

N
1
X
n=0

h (nT ) z n

(0.292)

52
N
1
X

H(ejT ) =

h (nT ) ejnT

(0.293)

n=0

N
1
X

bk z n

(0.294)

n=0

Steps in designing an FIR filter using fourier series truncation method:


1. Select the desired response
2. Find the corresponding impulse response using inverse fourier transform
Z s/2
1
H(ejT )ejnT d
(0.295)
h(nT ) =
s s/2
3. Find H(z) using this h(nT)
H(z) =

h(nT )z n

(0.296)

n=

4. Truncate this series by assigning zeros.


ie h(nT ) = 0 f or |n| > (N 1)/2

(0.297)

N 1
2

ie H(z) =

h(nT )z n

(0.298)

n= N 21
N 1
2

H(z) =

X

h(nT )z n + h(nT )z n h(0)

(0.299)

n=0

5. Compute the value of N using the equation


N = fs

(0.300)

If T is not given, then the value of N will the given or can be assumed
6. The above system is a non causal system. Hence obtain a causal system
H 1 (z) = H(z).z

(N 1)
2

which is a new transfer function


8. Realise the system using any one of the standard forms
Example:
Design a filter with a frequency response

(0.301)

53

s
2

s
2

1.
(
H(e

jT

)=

2.
h(nT ) =

1
s

c c

c || s/2



H(ejT ) ejnT d

(0.303)

1
h(nT ) =
s

ejnT d

(0.304)



1 ejnT d c
s
jnT
c

(0.305)


1  jc nT
e
ejc nT
js nT

(0.306)

2jsin(c nT )
js nT

(0.307)

h(nT ) =
h(nT ) =

(0.302)

h(nT ) =
=

sin(c nT )
n

h(nT ) =

sin(c nT )
n

(0.308)
(0.309)

3.
(N 1)
2

H(z) =

h(nT )z n

(0.310)

(N 1)
n= 2

H(z) =

4
X

h(nT )z n

(0.311)

n=4

H(z) = h(0) +

4
X
n=1

[h(nT )] z n + [h(nT )] z +n

(0.312)

54

H(z) = h(0) +

4
X



h(nT ) z n + z n

(0.313)

n=1

h(nT ) = h(nT )

(0.314)

H 1 (z) = H(z)z 4
( 4
)
X
1
4
4
n
n
H (z) = h(0)z + z
h(nT )[z + z ]

(0.315)

4.

(0.316)

n=1


h(0) =

sinc nT
2fc nT


.2fc T = 2fc T = .4 = b0

(0.317)

c = 1256.64

(0.318)

sinc T
= .303 = h(1)

(0.319)

h(2T ) =

sin2c T
= .0935 = h(2)
2

(0.320)

h(3T ) =

sin3c T
= .062 = h(2)
3

(0.321)

h(4T ) =

sin4c T
= .076 = h(2)
4

(0.322)

h(1T ) =



H(z) = .4z 4 +z 4 .303(z 1 + z 1 ) + .0935(z 2 + z 2 ) .062(z 3 + z 3 ) .076(z 4 + z 4
(0.323)
H(z) = .076.062z 1 +.0935z 2 +.303z 3 +.4z 4 +.303z 5 )+.0935z 6 .062z 7 .076z 8
(0.324)
b0 = .076, b1 = .062, b2 = .0935, b3 = .303, b4 = .4, b5 = b3 , b6 = b2 , b7 = b1 , b8 = b0
(0.325)

x(n)
z 1
.076
?

- z 1
.062
?
k

- z 1
.0935
?
k

- z 1
.303
?
k

- z 1
.4
?
k

.303
?
k

55

z 1

- z 1

- z 1

.0935

.062
?
k

.076

?
k

?
k
y(n)

Linear phase realization

Example
A LP FIR digital filter is to be designed using the Fourier series method.
The desired amplitude response is

Ad(f ) = 1f or0 <= f <= 125hz = 0elsewhere

Fs= 1khz , impulse response is to be limited to 20 delays. Determine the


system function

x(n)

z 1




@
@
.076
 ?

z 1


z 1





@
@
.062
?

z 1

z 1

@
@
.0935
?

z 1





z 1





@
@
.303
?

z 1
h(4)
?

56

Hd (ejT )

Ad (f ) =

(
1
0

0 f 125Hz
otherwise

(0.326)

Hd (ejT )

these oscillations are called as Gibbs Oscillations

57

Windowing technique
In order to reduce gibbs oscillation. h(nT) can be altered using a set of time
domain function called as window function.

Different types of window function


1.Rectangular window
(
1 N 21 n
WR (nT ) =
0 otherwise

N 1
2

(0.327)

Multiplying a rectangular window is the truncation of FS


2.Hann and Hamming window
(
N 1
+ (1 )cos( N2n
n
1 ) 2
WH (nT ) =
0
otherwise

N 1
2

(0.328)

= .5 f orhanning
= .54 f orhamming
The additional cosine terms are to reduce gibbs oscillations.
3.Blackman window
(
4n
N 1
n
.42 + .5cos( N2n
1 ) + .08cos( N 1 ) 2
WB (nT ) =
0
otherwise

N 1
2

Steps to design an FIR filter using windows


1.Select the desired response for which a filter has to be designed
2.Find h(nT) using IFT
3.Choose a window function w(nT)
4.f indhw (nT ) = h(nT ).W (nT )
5. Find H(Z)
6.Find H(z)
Example :
Design a LPF with the following specifications
fc = 200Hz
fs = 1KHz, N = 9

(0.329)

58

using Blackman window and rectangular window.


h(nT ) =

sin(c nT )
, Wc T = 400x103 = .4
n

h(nT )

(0.330)

WB (nT )

hw (nT ) = h.WB

.4

.4

.303

.774

.2345

.093

.34

.0316

-.063

.066

-.0042

-.075

WB (nT ) = .42 + .5cos(


H 1 (z) = hw (0)z 4 +

2n
4n
) + .08cos(
)
N 1
N 1

4
X



hw (nT ) z n + z n z 4

(0.331)
(0.332)

n=1






 

H 1 (z) = .4z 4 +.2345 z 3 + z 5 +.0316 z 2 + z 6 .0042 z 1 + z 7 +0 z 0 + z 8
(0.333)
H 1 (z) = .0042z 1 +.0316z 2 +.2345z 3 +.4z 4 +.2345z 5 +.0316z 6 .0042z 7
(0.334)
Comparison of required and designed responses
H ( ejT )

(0.335)

|H ( ejT )| = HR (z)|z=ejT
(0.336)

 2

 3



1
1
2
3
HR (z) = z
.4 + .3 z + z
+ .09 z + z
.063 z + z
.075 z 4 + z 4
(0.337)
HR (ejT ) = e4jT {.4 + .3X2XcosT + .09X2Xcos2T .063X2Xcos3T .075X2Xcos4T }
(0.338)

4

|HR (ejT )| = {.6cosT + .18cos2T .126cos3T .15cos4T }

(0.339)

Ripple ratio equals Maximum side lobe amplitude divided by Maximum


main lobe amplitude

59

Comparison of window parameters


=

T ypeof window

M ax side lobe amplitude


X100
M ax main lobe amplitude

M ainlobewidth

(0.340)

N = 11

N = 21

N = 31

22.34

21.89

21.8

2.62

2.67

2.67

1.47

.93

.82

.08

.12

.12

2Ws
N

Rectangular

4Ws
N

Hanning

4Ws
N

Hamming

6Ws
N

Blackman

1.Main lobe width must be large


2.Ripple Ration must be smaller.
3.Even if N is increased ripple ratio remains constant.
Hence a window which can vary main lobe width as well as ripple ratio independently is necessary
Kaiser Window

(I
Wk (nT ) =

0 ()
I0 ()

N 21 n
otherwise

independent parameter

N 1
2

(0.341)

60

s
=

2n
N 1

2
(0.342)

I0 () zeroth order bessel f unction


2

X
1 x k
I0 (x) = 1 +
( )
k! 2

(0.343)

k=1

In order to use this window we have to specify more specifications.


passband ripple in dB = Ap = 20log

1+
1

stopband ripple in dB = Ap = 20log

transitionband Bt = Wa Wp
Steps for designing using Kaiser window
1.determine h(nT) using IFT assuming ideal frequency response.
Wc =

Wa + Wp
2

(0.344)

2.Compute 1 and 2 f rom Ap and


Aa. Choose the smallest value of 1 and 2 as

3.Calculate new Ap and Aa using this


= min(1 , 2 )

(0.345)

4.Choose the parameter as f ollows

0
.4

.5842(Aa 21) + .07886(Aa 21)


.1102(Aa 8.7)

Aa 21
21 < Aa 51
Aa > 21

(0.346)

61

5. Choose D as follows.
(
=

.9222

Aa 21

Aa 7.95
14.36

Aa > 21

(0.347)

6. Select the lowest odd value of N satisfyimg the inequality.


N

Ws D
+1
Bt

(0.348)

7.F ind Wk (nT )


8.F ind H(z)
0

9.F ind H (z) = H(z).z

(N 1)
2

Example
design a LPF satisfying the following specifications.
Pass band ripple in the frequency range : 0 to 1.5 r/s = 0
Minimum stop band attenuation range: 2.5 to 5.0 r/s = 40
Sampling frequency: 10 r/s
Ap .1dB
Aa 40dB
sin(Wc nT )
n
1+
Ap .1dB ; Ap = 20log
1
h(nT ) =

1 = 5.756X103
Aa = 20log

1
2

(0.349)
(0.350)
(0.351)
(0.352)

2 = .01 , is chosen = 5.756X103

(0.353)

Ap = .1dB

(0.354)

Aa = 44.797dB (new value) using 20log2

(0.355)

this 21 < Aa 50

(0.356)

62

= .5842 [Aa 21] + .07886 [Aa 21]

.4

(0.357)

= 3.952
Aa 7.95
D=
f or Aa 21
14.36
D = 2.566
Ws D
+ 1 , Bt = 2.5r/s 1.5r/s = r/sec
N
Bt
10X2.566
N
+ 1 = 26.66
1
choose the next odd value. N = 27
I0 ()
f or 13 n 13
Wk (nT ) =
I0 ()
2

X
1 k
I0 () = 1 +
( )
k! 2
k=1

2

X
1 k
I0 () = 1 +
( )
k! 2

(0.358)
(0.359)
(0.360)
(0.361)
(0.362)

(0.363)
(0.364)
(0.365)

k=1

1
1
I0 () = 1 + ( )2 + ( )4 + ( )6
2
4
2
36
2
r
2n 2
= 1(
)
N 1

1
1
I0 () = 1 + ( )2 + ( )4 + ( )6
2
4 2
36 2

(0.366)
(0.367)
(0.368)

= 3.9524 (f ixed) , I0 () = 10.3729

(0.369)

varies with n

(0.370)

h(nT )

I0 ()

Wk (nT )

hk (nT )

.4

3.9524

10.3729

.4

.3027

3.9407

10.2757

.9906

.2997

9.3549X102

3.9053

9.987

.9628

9X102

63

FREQUENCY SAMPLING TECHNIQUE


Steps for design
1. Select the desired frequency response
2. Sample the frequency response and get the sampled values (N)

H(ejT )|= 2k = H(ej2kT /N ) = H(k)


N

1
1
1
= H(ej2 N (k+ 2 )T ) = H(k + )
or H(ejT )|= 2
N (k+ 2 )
2

= H(ej2 N (k+)T ) = H(k + )


H(ejT )|= 2
N (k+)

(0.371)
(0.372)
(0.373)

3. F ind h(nT ) f rom H(k + )


N 1

1 X
H(k + ).ej2 N (k+)T
N

h(nT ) =

(0.374)

k=0

4. F ind H(Z) f rom h(nT )


H(z) =

N
1
X
n=0

N 1
H(k + ) X h j2(k+)T 1 in
N
z
e
N

(0.375)

k=0

Simplifying this equation by changing the order of summation

H(z) =

N
1
X
n=0

"
#
j2(k+)T
N
H(k + ) 1 e
z N
j2(k+)T
N
N
1e
z 1

(0.376)

if T = 1

N 1 
1 ej2 z N X
H(k + )
H(z) =
j2(k+)
N
N
z 1
k=0 1 e
1 + 2z 1
1 + 2z 1
=
(1 4z 1 + 4z 2 )
(1 2z 1 )2

(0.378)

z(z + 2) H(z)
A
B
=
+
2,
z
(z 2) (z 2)2
(z 2)

(0.379)

H(z) =
H(z) =

(0.377)

A(Z 2) + B = z + 2
B = 4,

64

H(z)
1
4
=
+
z
z 2 (z 2)2

(0.380)

1
+
1 2z 1

(0.381)

H(z) =

H(z) =

4
z 2 4z+4
z

1
4z 1
+
1
1 2z
1 4z 1 + 4z 2

(0.382)

If H(k + ) and its conjugate are present


then the system will be simplif ied as a cascade of second order system
DESIGN OF IIR FILTERS
The difference equation
y(n) =

N
1
X

ak y(n k) +

N
1
X

bk x(n k)

(0.383)

bk x(n k)

(0.384)

k=0

k=1

y(n)

M
1
X

ak y(n k) =

k=1

M
1
X
k=0

PM 1
k
Y (z)
k=0 bk z
=
PN 1
X(z)
1 k=1 ak z k

(0.385)

Realisation of IIR filters are of four types:


1. Direct form 1 2. Direct form 2 (canonical form) 3. Cascade 4. Parallel
H(z) =

b0 + b1 z 1 + b2 z 2
1 a1 z1 a2 z 2

y(n) = a1 y(n 1) + a2 y(n 2) + b0 + b1 x(n 1) + b2 x(n 2)

(0.386)

(0.387)

Cascaded Form

H(z) = H1 (z).H2 (z)

(0.388)

H(z) = H1 (z) + H2 (z) + ...

(0.389)

Parallel Form

65

Example
Realize the system
H(z) =

0.7(z 2 0.36)
z 2 + 0.1z 0.72

(0.390)

using (i) direct form 1, (ii) direct form 2


(iii) cascaded form, (iv) parallel form
Solution
Convert H(z) to negative powers of z

H(z) =

0.7(1 0.36z 2 )
1 + 0.1z 1 0.72z 2

(0.391)

H(z) =

0.7(1 0.36z 2 )
1 [0.1z 1 + 0.72z 2 ]

(0.392)

0.7(1 + 0.6z 1 )(1 0.6z 1 )


(1 + 0.9z 1 )(1 0.8z 1 )

(0.393)

H(z) =

k = 0.7, H1 (z) =

1 + 0.6z 1
1 (0.9z 1 )

(0.394)

1 0.6z 1
1 0.8z 1

(0.395)

0.7(z 2 0.36)
(z + 0.9)(z 0.8)

(0.396)

H2 (z) =
Parallel Form

H(z) =

H(z)
0.7(z 2 0.36)
=
z
z(z + 0.9)(z 0.8)
=

A
B
C
+
+
z
z + 0.9 z 0.8

H(z) = 0.35 +
H2 (z) =

0.206
0.144
+
0.205
1 + 0.9z 1
1 0.8z 1

0.206
0.144
, H3 (z) =
1 + 0.9z 1
1 0.8z 1
H1 (z) = 0.35

Design of IIR filters

(0.397)
(0.398)
(0.399)
(0.400)
(0.401)

66

k
X
k=0 bk z
=
h(nT )z n
PN 1
1 k=0 ak z k
n=

PM 1

H(z) =

(0.402)

Design of analog filters


1. Butterworth filter (LPF)
These filters have a maximally flat response in both pass band and stop band
The frequency response of the Nth order low pass filter is given by
|H(s)| = |H(j)| = q

1
1+

j 2N
( j
)
c

=q

1
1 + ( js c )2N

|H(j)|2 = H(j).H (j)


= H(s).H (s)

(0.403)
(0.404)
(0.405)

For an Nth order filter, the poles can be obtained by equating the Dr to zero
1+(

s 2N
) =0
jc

(0.406)

On solving this there are 2N poles given by

sk = c e

j(2k+N 1)
2N

, k = 0, 1, .....2N 1

(0.407)

These poles are uniformly spaced on a circle of radius in the s plane


If N= odd, a pole will lie on the real axis
If N= even, no poles will lie on the real axis
Example : 1
Design a LP butterworth analog filter of order 3

|H(s)| = q
1+(

1 + ( js c )6

s 6
) =0
jc

sk = c e
s1 = c e

s1 = c e

(0.409)

j(2k+N 1)
2N

j(2k+N 1)
2N
j(4)
6

,N = 3

= c e

s2 = c e
s3 = c e
s4 = c e

j4
3

j5
3

(0.408)

j2
3

(0.410)
(0.411)
(0.412)
(0.413)
(0.414)
(0.415)

67

s5 = c ej2
s6 = c e

(0.417)

3c
(s s1 )(s s2 )(s s3 )

H(s) =
H(s) =

(0.416)

j7
3

(0.418)

3c
(s c e

H(s) =

j2
3

)(s c ej )(s c e

j4
3

(0.419)
)

2c
(s c e

j3
4

)(s c e

j5
4

(0.420)
)

Choose the poles on the left side of the s plane


Order of the filter N from the given specification

log10
N=

1
22

i
1
(0.421)

s
2log10 (
c )

Example :
Determine the order of a Butterworth filter that has a -3dB BW of 500HZ
and an attenuation of 4 dB at 1000HZ

c = 500HzX2

(0.422)

c = 1000HzX2

(0.423)

1
1
|H(j)| = q
, |H(j)|2 =
s 2N
1 + ( js c )2N
1 + ( jc )

(0.424)

|H(j)|dB at 500Hz = 3dB

(0.425)

3dB = 20log10 |H(j)| = .707

(0.426)

|H(j)|dB at 1000Hz = 40dB

(0.427)

40dB = 20log10 |H(j)| = .01

(0.428)

(.001)2 =

1
1+

2N
( 1000
500 )

1
1 + 22N

(0.429)

104 = 1 + 22N

(0.430)

2N log10 2 = 4

(0.431)

N = 6.643

(0.432)

68

N =7

(0.433)

CHEBYSHEV ANALOG FILTER

|H(j)| = q

(type 1)

(0.434)

TN (x) = cos(N cos1 x) f or |x| 1

(0.435)

(0.436)

1 + 2 TN2 ( p

= cosh(N cos

x) f or |x| 1

There are two types of chebyshev filters


Type 1 is ripple in pass band and monotonic in stop band Type 2 is monotonic pass band and ripple in stop band
The angles at which poles are present
k =

(2k + N 1)
2N

(0.437)

Order of the filter


h
i
p
r
log10 g + g 2 1
A2a 1
p
, g=
N=
2
log10 (a + 2a 1

(0.438)

The poles of the Chebyshev filter lie on an ellipse in the s plane defined
by
k2
Wk2
+
=1
sinh2 u cosh2 u
The length of major axis of the ellipse is given by
p 1/N
(
+ 1/N )
2
r
1
1
= + 1+ 2


and the length of minor axis is given by
a=

(0.439)

(0.440)
(0.441)

p 1/N
(
1/N )
(0.442)
2
Pole location will be similar to a butterworth filter
The pole is initially located on the circle and then projected on an ellipse
The resultant poles on the ellipse are given by
b=

69

pk = b cosk + j a sink

(0.443)

Theta k Angle at which the Kth pole is placed on the circle after finding
all the poles
H(s) =

H(s) =

|p1 ||p2 ||p3 |. . . .


if n is odd
(s p1 )(s p2 )(s p3 ). . . .
1
|p ||p2 ||p3 |.
1+2 1

(0.444)

...

(s p1 )(s p2 )(s p3 ). . . .

if n is even

(0.445)

Example :
Determine the order and poles of the type 1 low pass Chebyshev filter that
has 1dB ripple in the pass band
p = 1000 , a = 2000 , Aa = 40dB
Ap = 1dB = 20log|H(j)|
at = p |H(j)|2 = (.89125)2 =

1
1 + 2 TN2 ( p )

= p |H(j)|2 = (.89125)2 =

1
1 + 2 TN2 (1

TN (1) = cos0 = 1
at = p H(j) = .89125 =

1
1 + 2

 = .5088
at = a
Aa = 40dB = 20log|H(j)|
|H(j)| = 102
104 =

1
1 + 2 cosh2 (N cosh1 2)
 = 0.5088

N = 4.28 choose n = 5
a = 3270.58 b = 909.43
Example
Design a type 1 Chebyshev LP filter with a max pass band ripple of 2dB at
20r/s. The stop band attenuation should atleast 30dB at 50r/sec.

70

given p = 20r/s 2dB


given s = 50r/s 30dB
|H(j) = q

1
1+

2 TN2 ( p )

if = p
1
(TN2 (1) = 1)
1 + 2
 = 0.7648

(0.79432)2 =

if = s
(0.031623)2 =

1
1 + 2 cosh2 (N.cosh1 2.5)

cosh(N.cosh1 2.5) = 41.3268


N.cosh1 2.5 = 4.4145
N = 2.8 3
1
= +


r
1+

1
2

= 2.95366
1
1
1
1
p
p
a=
.( 3 + 3 ), b =
.( 3 3 )
2
2
a = 21.317
b = 7.378
2
1 =
3
s1 = b.cos(

2
2
) + j.a.sin( )
3
3

= 3.689 + j18.46
s2 = b.cos + j.a.sin
= 7.378
s3 = 3.689 j18.46
H(s) = (354.38)(7.378) =

2614.6
(s + 7.378)(s + 3.689 j18.46)(s + 3.689 + j18.46)

71

Example : 2
F orthesamespecif ications, designabutterworthf ilter
|H(j)| = q

1
1 + ( c )2N

r
p 20 0.79432
s
r
a 50 0.031623
s
1
(0.79432)2 =
1 + ( 20c )2N
0.58493 = (

20 2N
)
eq(1)
c

(0.031623)2 =
998.98 = (

1
1 + ( 50c )2N

50 2N
)
eq(2)
c

50
eq(2)
1707.86 = ( )2N = (2.5)2N
eq(1)
20
2N log2.5 = log1707.86 = 8.123 N = 4.06 5
2dB ripple
Ap = 2dB
0.79433
 = 0.76478
s1 = 25e
s2 = 25e

j3
5
j4
5

= 7.725 + j23.776
= 20.22 + j14.694

s3 = 25ej = 25
s4 = 20.22 j14.694
s5 = 7.725 j23.776
H(s) =

(25)5
(s + 7.725 j23.776)(s + 20.22 j14.694)(s + 25)(s + 7.725 + j23.776)(s + 20.22 + j14.694)
Example 2 :

72

Design a chebychev filter with the following specifications


r
1|H(j)|dB 0f or0 1404 (p )
s
r
|H(j)|dB 60f or 8268 (a )
s
(i) F ind  and N f rom the given specif ication
1dB = 20log10 H(j) = 0.89125
60dB = 20log10 H(j) = 1x103
at = p :
1
= 0.89125
1 + 2
 = 0.5088

|H(jp )|2 =

at = a ,
(1x103 )2 =

1
1+

a
2 cosh2 (N cosh1
p )

, N = 3.365

N =4
step 2: find the dimensions a and b of the ellipse
r
1
1
= + 1 + 2 = 4.1706


1
p 1
( N N ) = 1612.14
2
1
p 1
a=
( N + N ) = 4695.11
2

b=

The poles are placed on the circle with radius a


pk = b cosk + j a sink
s1 = 1612.4cos(112.5o + j4695.11sin(112.5o
o

= 617 + j4337.72 = 4381.4ej97.5

s1 = 1612.4cos(157.5o + j4695.11sin(157.5o
o

= 1489.66 + j17996.74 = 2333.96ej129.66


s3 = s2
s4 = s1

73

H(s) =

1.046X1014
(s + 617 j4337.72)(s + 617 + j4337.72)(s + 1489.66j 1796.74)(. . .

Example
For the same example, design a butterworth filter
= p
(.89125)2 =

1
1+

2N
( 1000
c )

1
2N
1 + ( 2000
c )

(.01)2 =

F indN andc
Conversion of Analog to Digital Filters
1. Impulse invariance transformation
2. Bilinear transformation
3. Matched Z transform
4. Method of mapping differentials
Impulse Invariance Technique
Consider an analog causal filter defined by
A
s p1
The impulse response corresponding to this
H(s) =

h(t) = Aep1 t

(0.446)

(0.447)

Sample this impulse response

h(nt) = Aep1 nt

(0.448)

Applying Z transform

h(z) =

h(nT )z n

(0.449)

n=

h(z) = A

ep1 nt z n

(0.450)

n=

=A

(ep1 t z 1 )n

n=

(0.451)

74

H(z) =

A
1 ep1 T z 1

(0.452)

comparing 1 and 2
H(s) =

N
X

Ak
s pk

(0.453)

Ak
1 epk T z 1

(0.454)

k=1

H(z) =

N
X
k=1

pk epk T
Example :
Convert the given analog filter to a digital filter

H(s) =

H(s) =

1
(s 2)(s 3)

B
A
+
(s 2) (s 3)

A(s 3) + B(s 2) = 1
B = 1, A = 1
H(s) =

1
1
+
(s 2) (s 3)

1
1
+
1 e2T z 1
1 e3T z 1
Stability of Transformed filter :
A pole at S = Pi is transformed to a digital pole at
H(s) =

z = esT s = + j
z = eT ejT
|z| = eT
if = 0 , |z| = |ejT | = 1
i.e. the entire j axis maps to the circumf erence a circle
|z| = eT

(0.455)

75

if = 0 , z = 1

, z = 1
T
2
if =
, z=1
T

if =

the entire j gets mapped again and again on the unit circle
if < 0 , |z| < 1 ie|eT | < 1
the entire left plane gets transferred to the interior of unit circle
if > 0 , |z| < 1 ie|eT | > 1
the right half of s plane gets mapped to the exterior of the circle with unit
radius.
Therefore all analog stable filters will be transferred to stable digital filters.
Bilinear Transformation method
This is based on the trapezoidal rule for numerical integration
let

dy(t)
= x(t)
dt

(0.456)

Integrating both sides


Z

nT

(n1)T

dy(t)
dt =
dt

y[nT ] y[(n 1)T ] =

nT

x(t)dt

(0.457)

(n1)T

T
[x(nT ) + x((n 1)T )]
2

(0.458)

Taking z transforms

y(z)[1 z 1 ] =

T
X(z)[1 + z 1 ]
2

2 [1 z 1 ]
Y (z) = X(z)
T [1 + z 1 ]

(0.459)
(0.460)

Also on taking the laplace transform


sY (s) = X(s)
sY (s)

2 [1 z 1 ]
Y (z)
T [1 + z 1 ]

(0.461)
(0.462)

76

ie s =

2 [1 z 1 ]
Y (z)
T [1 + z 1 ]

(0.463)

Example:

H(s) =

H(z) =

1
[1z 1 ]

2
T [1+z 1 ]

1
s2

1 + z 1
2
1 ) 2(1 + z 1 )
T (1 z

Stability of a transformed filter

s = + j
1 + T2 s
(1 + T2 ) + j T2
=
T
1 2s
(1 T2 s) j T2
q
(1 + T2 )2 + ( T2 )2
|z| = q
(1 T2 )2 + ( T2 )2

z=

(0.464)
(0.465)

(0.466)

if = 0, |z| = 1

j axis maps on to the circumf erence of unit circle


if < 0, Dr > Nr |z| < 1
left half of s plane transfers to the interior of a circle
if > 0, Dr < Nr |z| > 1
All the left hand poles are transferred to the interior of a circle and hence
stable analog filters are stable digital filters.
Non linearity between analog and digital frequency

s = j

(0.467)

z = ejT

(0.468)

77

2
T
tan
T
2
2
T
= tan
T
2
This effect is called warping
=

(0.469)
(0.470)

Prewarping :
To avoid this non linearity all the analog frequencies must be prewarped using
the relationship
2
T
tan
T
2
2
T
= tan
T
2

(0.471)
(0.472)

T
2
tan1 tan
T
2
=

(0.473)
(0.474)

Matched Z Transform method


Both poles and zeros are mapped directly to poles and zeros on the Z plane.
Using impulse invariance transformation technique
s + a 1 eT z 1
eg H(s) =

(0.475)

s+1
(s + 2)(s + 3)

(0.476)

if T = 1/10 or fs = 10Hz, T = .1
s + 1 1 eT z 1 = 1 .905z 1

(0.477)

s + 1 1 e2T z 1 = 1 .819z 1

(0.478)

3T 1

(0.479)

s + 1 1 e

= 1 .741z

H(s) =

1 .905z
(1 .819z 1 )(1 .741z 1 )

(0.480)

Example

H(s) =

A
B
C
+
+
(0.481)
(s + 7.378) (s + 3.689 j18.46) (s + 3.689 + j18.46)

78

A(s+3.689j18.46)(s+3.689+j18.46)+B(s+7.378)(s+3.689+j18.46)+C(s+7.378)(s+3.689j18.46) = 2614.6
(0.482)
s = 7.378
(0.483)
A(3.689 j18.46)(3.689 + j18.46) = 2614.6
2614.6
= 7.3779
354.38
s = 3.689 j18.46

A=

C(3.689 j18.46 + 7.378)(j36.92) = 2614.6

(0.485)
(0.486)
(0.487)

2614.6
681.543 j136.19788

(0.488)

C = 3.69 + .738j

(0.489)

s = 3.689 + j18.46

(0.490)

B(3.689 + j18.46)(j36.92) = 2614.6

(0.491)

B(j136.19788 681.543) = 2614.6

(0.492)

B = 3.69 j.7383

(0.493)

C=

H(s) =

(0.484)

3.69 j.7383
3.69 + j7383
7.3779
+
+
(0.494)
(s + 7.378) (s + 3.689 j18.46) (s + 3.689 + j18.46)
s = p1 ep1 T
7.3779
1
1 .629z 1
3.69 + j.7383
H2 (z) =
1 e(3.689j18.46)T z 1
3.69 + j.7383
H2 (z) =
1 .793ej1.159T z 1
3.69 + j.7383
H2 (z) =
1 e(3.689+j18.46)T z 1
3.69 + j.7383
H2 (z) =
1 .793ej1.159T z 1

H1 (z) =

7.3779

e7.3779T z 1

H(z) = H1 (z) + H2 (z) + H3 (z)

(0.495)
(0.496)
(0.497)
(0.498)
(0.499)
(0.500)
(0.501)

Linear Transformation
2
p T
tan
= 22.5 , T = .05712
T
2
2
a T
a = tan
= 243.53r/s , T = .05712
T
2
if = p
p =

(0.502)
(0.503)

79

1
,  = .7648
1 + 2
if = s

(.031623)2 =

(.79432)2 =

(0.504)

1
,  = .7648
1 + 2 (N cosh1 (10.823))

(0.505)

= 2.95366
a = 25.88
b = 12.788
Bilinear transformation

s
=

2 1 z 1
=
T 1 + z 1

1
+ 30.12

2 1z 1
T 1+z 1

(0.506)

1 z 1
32.206(1
+ 30.12(1 + z 1 )

(0.507)

1 z 1
62.326 2.086z 1

(0.508)

.016(1 z 1 )
(1 .0335z 1 )

(0.509)

z 1 )

H(z) =

Method of mapping differentials


A differential equation is approximated to a difference equation (backward
difference)
1. First derivative
dx(t)
x(n) x(n 1)
|t=nT =
= y(n)
dt
T
This differentiator has a system function
While taking Z transform
y(t) =

H(s) = s
X(z) z 1 X(z)
T
1 z 1
H(z) =
T
1 z 1
s=
T

Y (z) =

2. Second derivative

(0.510)

(0.511)
(0.512)
(0.513)
(0.514)

80

d dx(t)
d2 x(t)
= (
)
dt2
dt dt
d x(nT ) x((n 1)T )
= (
)
dt
T

y(t) =
d2 x(t)
|t=nT
dt2
=

)
)
] [ x((n1)T )x((n2)T
]
[ x(nT )x((n1)T
T
T
T
(1 z 1 )2
1 2z 1 + z 2
=
s2 =
2
T
T2
........

........
(1 z 1 )k
sk =
Tk
H(z) = H(s)|s= 1z1

(0.515)
(0.516)
(0.517)
(0.518)

(0.519)
(0.520)

1
1 sT
1
z=
1 T jT
z=

z=

1 T jT
(1 T )2 + 2 T 2

if = 0 z =

jT
1
+
(1 + 2 T 2 ) (1 + 2 T 2 )

|z| =

1
(1 + 2 T 2 )

= 0, |z| = 1
= , |z| = 0
= , |z| = 0
Disadvantages : only low pass filters can be obtained
1. Determine the system function H(Z) of the lowest order of Chebyshev
digital filter that meets the following specifications
1dB ripple 0 || .3
atleast 60 dB ripple in stop band .35 ||
Use bilinear transformation
p = .3

81

a = .35
p T
2
tan
= .324 = 1.01905
T
2
a T
2
a = tan
= .39 = 1.2256
T
2
1dB = .9125
1
(.9125)2 =
,  = .5088
1 + 2

p =

60dB = 103
1
(103 )2 =
2
2
1 +  cosh (N cosh1 1.2037)
106 = 1 + (.5088)2 cosh2 (N cosh1 1.2037)
1965.4 = cosh(N cosh1 1.2037)
N = 13.18 , N = 14
H(z) =

|p1 ||p2 |......|p14 |


(s p1 )(s p2 )(s p3 ).....(s p14 )
1 = 1.68r/s
2 = 1.9074r/s
3 = 2.1318r/s
4 = 2.3562r/s
5 = 2.5806r/s
6 = 2.805r/s
7 = 3.0294r/s
.324 1/14
(
+ 1/14 )
2
r
1
1
= + 1 + 2 = 4.1706


a = 1.02317 b = .104
a=

sk = b cosk + ja sink
s1 = b cos1 + ja sin1 = .0113 + j1.0171
s2 = 0343 + j.9657
s3 = 0553 + j.8663
s4 = .0735 + j.7235
s5 = .0881 + j.5444

82

s6 = .0982 + j.33
s7 = .1033 + j.114
s8 = s7
s9 = s6
s10 = s5
s11 = s4
s12 = s3
s13 = s2
s14 = s1
|s1 | = 1.01716 = |s14 |
|s2 | = .9663 = |s13 |
|s3 | = .8681 = |s12 |
|s4 | = .7272 = |s11 |
|s5 | = .5515 = |s10 |
|s6 | = .35198 = |s9 |
|s7 | = .1545 = |s8 |
H(s) =

3.463X104
(s s1 )(s s2 )........(s s14 )

2.Determine the system f unction H(z) of the lowest order Chebyshev


digital f ilter that meets the f ollowing specif ications
H(s) =
H(z) =

200
s + 200

200
1 .5335z 1

Bilinear
c = 649.84
H(s) =
H(s) =
H(s) =

649.84
s + 649.84

.65(1 + z 1 )
2(1 + z 1 ) + .65(1 + z 1 )

.65(1 + z 1 )
.24(1 + z 1 )
=
2.65 1.35z 1
1 .51z 1

83

p
s
0p

Hp (s) prototype LP f ilter


HL (s) = Hp (

p
s)
0p
0

p p
s
s
0

p p
Hh (s) = Hp (
)
s
s

s2 + l u
s(u l )

s p

s2 + l u
s(u l )

l = lower bound edge


u = upper bound edge
Hb (s) = Hp (p

s p

s2 + l u
)
s(u l )

s(u l )
s2 + l u

Hbs (s) = Hp (p s(u l )s2 + l u )


H(s) =
H(s) =

s2

p
s + p
1

s2 +l u
s(u l )

+1

s(u l )
+ l u + s(u l )

Frequency transformation in the Digital domain


LP to LP : z 1

z 1 a
1 az 1

84
0

a=

p p
]
2
p +p0
sin[ 2 ]

sin[

LP to HP : z 1

z 1 + a
1 + az 1
0

a=

p +p
]
2

p p0
cos[ 2 ]

cos[

LP to BP : z 1
=
a1 =

l
cos[ u +
]
2
u +l
cos[ 2 ]

2k
k+1

a2 =

Bstop : z 1
=
a1 =

z 2 a1 z 1 + a2
a2 z 2 a1 z 1 + 1

k1
k+1

z 2 a1 z 1 + a2
a2 z 2 a1 z 1 + 1

l
cos[ u +
]
2
u +l
cos[ 2 ]

2
k+1

H(s) =

a2 =

1k
1+k

649.84
s + 649.84

c s
2X104
=
s
s
649.84
649.84s
H(s) = 2X104
=
2X104 + 649.84
+ 649.84
s
s

H(s) =

s
s + 30.776

2 1 z 1
] , T = 1X103
[
T 1 + z 1
1

[ 1z
1 z 1
1+z 1 ]
s 2000[
]
,
H(z)
=
1
1
1z
1+z
[ 1+z1 ] + 30.776
=

1 z 1
1 z 1 + .0154 + .0154z 1

85

1.015(1 z 1 )
1 .999z 1
Q Convert the single pole LP Butterworth filter with system function
=

H(z) =

.245(1 + z 1 )
3
2
into a BP with Wu =
and Wl =
1 .509z 1
5
5

as upper and lower band edges , 3dBbandwidthWp = .2


z 1
H(z) =

z 2 a1 z 1 + a2
a2 z 2 a1 z 1 + 1

.245(1 a2 )(1 z 2 )
(1 + .509a2 ) 1.509a1 z 1 + (a2 + .509)z 2

k=
tan.1
10
=1
a2 = 0

= cos = 0
2
a1 = 0
H(z) =

.245(1 z 2 )
1 + .509z 2

Potrebbero piacerti anche