You are on page 1of 195

Principles of Digital Signal Processing

UNIT 1

DISCRETEFOURIERTRANSFORMS(DFT)
CONTENTS:1. FREQUENCYDOMAINSAMPLING
2.

RECONSTRUCTIONOFDISCRETETIMESIGNALS

3. DFTASALINEARTRANSFORMATION
4. DFTRELATIONSHIPWITHOTHERTRANSFORMS.

DFTRELATIONSHIPWITHFOURIERSERIES

DFTRELATIONSHIPWITHZ-TRANSFORMS

RECOMMENDEDREADINGS
1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&
MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page1

Principles of Digital Signal Processing

UNIT1
Discrete FourierTransform
1.1

Introduction:
BeforeweintroducetheDFTweconsiderthesamplingoftheFouriertransformofan

aperiodicdiscrete-timesequence.ThusweestablishtherelationbetweenthesampledFourier
transformandtheDFT.Adiscretetimesystemmaybedescribedb ytheconvolutionsum,the
Fourierrepresentationandtheztransformasseeninthepreviouschapter.Ifthesignalis
periodicinthetimedomainDTFSrepresentationcanbeused,inthefrequencydomainthe
spectrumisdiscreteandperiodic.Ifthesignalisnon-periodicoroffinitedurationthe
frequencydomainrepresentationisperiodicandcontinuousthisisnotconvenientto
implementonthecomputer.Exploitingtheperiodicitypropert yofDTFSrepresentationthe
finitedurationsequencecanalsoberepresentedinthefrequencydomain,whichisreferredto

as

DiscreteFourier Transform DFT.


DFT is an important mathematical tool which can be used for the software
implementation of certain digital signal processing algorithms .DFT gives a method to
transformagivensequencetofrequencydomainandtorepresentthespectrumofthesequence
usingonl yk frequencyvalues, wherek is an integer that takes N values,K=0, 1, 2,..N-1.
Theadvantages of DFT are:
1. It is computationallyconvenient.
2. TheDFTofafinitelengthsequencemakesthefrequencydomainanalysismuch simplerthan
continuous Fourier transform technique.

1.2

FREQUENCY DOMAIN SAMPLING AND RECONSTRUCTION OF DISCRETE


TIME SIGNALS:

Consideranaperiodicdiscretetimesignalx(n)withFouriertransform,anaperiodicfinite energysignal
hascontinuous spectra.For anaperiodicsignal x[n]the spectrum is:

X>w@ 

f

x>n@e

n f

Department of ECE, SCADEC

jwn

(1.1)
Page2

Principles of Digital Signal Processing


SupposewesampleX[w]periodicallyinfrequencyatasamplingofGwradiansbetween
successivesamples.WeknowthatDTFTisperiodicwith2S,thereforeonlysamplesinthe
fundamental frequency range will be necessary. For convenience we take N equidistant
samplesintheinterval(0<=w<2S ).ThespacingbetweensampleswillbeGw 

2S
 asshown
N

below in Fig.1.1.
X[w]

w
0

2S

Fig 1.1Frequency DomainSampling


Let us first consider selection ofN, orthe numberof samples in thefrequencydomain. If
we evaluateequation(1) atw 
2Sk
X  
 N 

f

x>n@e

2Sk
N
k 0,1,2,.......,(N1).(1.2)

j2Skn/N

n f

Wecandividethesummationin(1)intoinfinitenumberofsummationswhereeachsum contains N
terms.
2Sk

1

X
 ....... x>n@e
N
 
n N

N1

j 2Skn/N

x>n@e
n 0

j 2Skn/N

2N1

 x>n@ej

2S/
kn N

n N

f lNN1

l
x>n@ej2Skn/N
f n lN
Ifwethenchangetheindexinthesummationfromnton-lNandinterchangetheorderof summations
weget:

Department of ECE, SCADEC

Page3

Principles of Digital Signal Processing


2 Sk

N1 f


  x>nlN@ej2Skn/N

 N 

for k 0,1,2,......,(N1).(1.3)

n 0 l f

Denotethequantityinsidethebracketasx p[n].Thisisthesignalthatisarepeatingversionof x[n]everyN


samples. Sinceit is a periodicsignalit can berepresented b ythe Fourierseries.
N1

n 0,1,2,........,(N1)

x>n@ k
ckej2Skn/N
0

With FS coefficients:
N1
ck  1 x p >n@ej2Skn/N
n 0
N

k 0,1,2,.......,(N1)(1.4)

Comparingtheexpressions in equations (1.4) and(1.3) weconclude thefollowing:


c 
k

2S
X k
N  N 

k 0,1,.......,(N1).(1.5)

Thereforeit is possible to writethe expression x p[n]as below:


x>n@  1 N1 2S
X
p
Nk 0  N


k ej2Skn/ N


n 0,1,.....,(N1).(1.6)

Theaboveformulashowsthereconstructionoftheperiodicsignalx p[n]fromthesamplesof

the

spectrum X[w]. But it does not sayifX[w] or x[n]can berecovered from thesamples.
Let us havealookatthat:
Sincexp[n]istheperiodicextensionofx[n]itisclearthatx[n]canberecoveredfromx p[n]if
thereisnoaliasinginthetimedomain.Thatisifx[n]istime-limitedtolessthantheperiodN of xp[n].This
is depicted in Fig. 1.2 below:

Department of ECE, SCADEC

Page4

Principles of Digital Signal Processing


x[n]

n
0

L
xp[n]

N>=L
No aliasing
n

L
xp[n]

N
N<L
Aliasing
n

N
Fig. 1.2 Signal Reconstruction

Henceweconclude:
The spectrum of an aperiodic discrete-time signal with finite duration Lcan be exactly
recovered from its samples at frequencies w  2Sk if N>=L.
k
N
We computexp[n]for n=0, 1,....., N-1 using equation (1.6) Then
X[w] can be computed usingequation (1.1).

1.3

Discrete Fourier Transform:

TheDTFT representationforafinite duration sequenceis

-jn
X (j) =x(n)
n= -
jn
X (n) =1/2 X (j)e
d, Where 2k/n2
Department of ECE, SCADEC

Page5

Principles of Digital Signal Processing


Wherex(n)isafinitedurationsequence,X(j)isperiodicwithperiod2.Itis
convenientsampleX(j)withasamplingfrequencyequalanintegermultipleofitsperiod=m that is
takingN uniforml yspaced samples between 0 and 2.
Let k=2k/n, 0kN-1

-j2kn/N
ThereforeX(j) = x(n)
n=
SinceX(j)issampledforoneperiodandthereareNsamplesX(j)canbeexpressed as
N-1
-j2kn/N
X(k)=X(j) =2kn/N
x(n)
0kN-1
n=0

1.4

Matrixrelationof DFT

TheDFTexpression canbe expressed as


[X] =[x(n)][WN]
Where[X] =[X(0), X(1),..]

[x]is thetranspose oftheinput sequence. WN is aN xN matrix


WN = 1

1
1
1 1
1
wn1wn2 wn3...wn n-1
1
wn2 wn4 wn6 wn2(n-1)
.
.
1..wN(N-1)(N-1)

ex;
4 pt DFT ofthe sequence 0,1,2,3
X(0)
X(1)
X(2)
X(3)

1
1
1
1

1
-j
-1
j

1
-1
1
-1

1
j
-1
-j

Solvingthe matrixX(K)=6 , -2+2j, -2 , -2-2j

1.5 Relationshipof Fourier Transformswithothertransforms

Department of ECE, SCADEC

Page6

Principles of Digital Signal Processing


1.5.1 RelationshipofFouriertransformwith continuous timesignal:
Supposethatxa(t)isacontinuous-timeperiodicsignalwithfundamentalperiodTp=1/F0.The signal can
be expressed in Fourier seriesas

Where{ck}aretheFouriercoefficients.Ifwesamplexa(t)atauniformrateFs=N/Tp=1/T, weobtain
discretetime sequence

Thus {ck} is the aliasing version of{ck}


1.5.2 RelationshipofFouriertransformwithz-transform
Let usconsider asequencex(n)havingthe z-transform

WithROCthatincludesunitcircle.IfX(z)issampledattheNequallyspacedpointsonthe unit
circleZk=ej2k/N forK=0,1,2,..N-1weobtain

TheaboveexpressionisidenticaltoFouriertransformX()evaluatedatNequallyspaced frequencies
k=2k/N for K=0,1,2,..N-1.
Ifthesequencex(n)hasafinitedurationoflengthNorless.Thesequencecanberecovered from its Npoint DFT. ConsequentlyX(z) can beexpressed as afunction ofDFTas
Department of ECE, SCADEC

Page7

Principles of Digital Signal Processing

Fourier transform of acontinuous timesignal canbeobtained from DFT as

Department of ECE, SCADEC

Page8

Principles of Digital Signal Processing

RecommendedQuestionswithsolutions

Department of ECE, SCADEC

Page9

Principles of Digital Signal Processing

Question 1
Thefirstfivepointsofthe8-pointDFTofarealvaluedsequenceare{0.25,0.125-j0.318,0,
0.125-j0.0518, 0}. Determinethe remainingthreepoints
Ans: Sincex(n)isreal,therealpartoftheDFTiseven,imaginarypartodd.Thusthe remainingpoints
are{0.125+j0.0518,0,0,0.125+j0.318}.
Question 2
Computethe eight-pointDFT circular convolution forthe followingsequences.
x2(n)=sin 3n/8
Ans:

Question 3
Computethe eight-pointDFT circular convolution forthe followingsequence
X3(n)=cos 3n/8

Question 4
Department of ECE, SCADEC

Page10

Principles of Digital Signal Processing


DefineDFT. Establish arelation between the Fourier series coefficients ofa continuous time
signal andDFT
Solution
TheDTFT representationforafinite duration sequenceis

X (j) =x(n)-jn n=
-
X (j)e jnd,
Where 2k/n
2
Wherex(n)isafinitedurationsequence,X(j)isperiodicwithperiod2.Itis
convenientsampleX(j)withasamplingfrequencyequalanintegermultipleofitsperiod=m that is
takingN uniformlyspaced samples between 0 and 2.
Let k=2k/n, 0kN

ThereforeX(j) = x(n)-j2kn/N
n=
SinceX(j)issampledforoneperiodandthereareNsamplesX(j)canbeexpressed as
N-1
X(k) =X(j) =2kn/N x(n)-j2kn/N
0kN-1
n=0
Question5
X (n) =1/2

Solution:-

Department of ECE, SCADEC

Page11

Principles of Digital Signal Processing


Question6
Find the4-point DFT ofsequencex(n) =6+sin(2n/N),n=0,1,N-1
Solution :-

Question 7

Solution

Department of ECE, SCADEC

Page12

Principles of Digital Signal Processing

Question 8

Solution

Department of ECE, SCADEC

Page13

Principles of Digital Signal Processing

PROPERTIESOFDISCRETEFOURIERTRANSFORMS(DFT)
CONTENTS:1.

MULTIPLICATIONOFTWODFTS-THECIRCULARCONVOLU TION,

2.

ADDITIONALDFTPROPERTIES

3.

USEOFDFTINLINEAR FILTERING

4.

OVERLAP-SAVEANDOVERLAP-ADDMETHOD.

RECOMMENDEDREADINGS
1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&
MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page14

Principles of Digital Signal Processing

PropertiesofDFT
Properties:TheDFT andIDFTforan N-point sequencex(n)are given as

InthissectionwediscussabouttheimportantpropertiesoftheDFT.Thesepropertiesare helpful in the


applicationof theDFT to practical problems.

Periodicity:-

1.2 Linearity:

If

Then Ax1 (n)+b x2 (n)mo aX1(k)+b X2(k)


Department of ECE, SCADEC

Page15

Principles of Digital Signal Processing

1.3 Circular shift:


Inlinearshift,whenasequenceisshiftedthesequencegetsextended.Incircularshiftthe
numberofelementsinasequenceremainsthesame.Givenasequencex(n)theshifted

versionx(n-

m)indicatesashift ofm. With DFTs the sequences aredefined for0 to N-1.


Ifx(n) =x(0),x(1),x(2),x(3)
X (n-1)= x(3),x(0), x (1).x(2)
X (n-2)= x(2),x(3),x (0),x(1)

1.4 Time shift:


Ifx(n)moX (k)
Then x(n-m)moWN

mk

X (k)

1.5 Frequencyshift
Ifx(n)moX(k)
+nok
Wn
x(n)moX(k+no)
N-1
kn
Consider x(k)= x(n)Wn
n=0
N-1

(k+no)n

X(k+no)=\ x(n)WN
n=0
kn
non
=x(n)WN
WN
?X(k+no)mox(n)WN

non

1.6 Symmetry:

Forareal sequence, if x(n)moX(k)

Department of ECE, SCADEC

Page16

Principles of Digital Signal Processing


X(N-K) = X* (k)

Department of ECE, SCADEC

Page17

Principles of Digital Signal Processing

For a complexsequence
DFT(x*(n))= X*(N-K)
Ifx(n)

then

Real and even


Real and odd
Odd and imaginary
Even and imaginary

X(k)





real andeven
imaginaryand odd
real odd
imaginaryand even

Convolutiontheorem;
Circularconvolution in time domain corresponds to multiplication ofthe DFTs
Ify(n) =x(n)h(n) thenY(k) =X(k)H(k)
Exletx(n)=1,2,2,1 and h(n) =1,2,2,1
Theny(n)=x(n)h(n)
Y(n) =9,10,9,8
N pt DFTs of2 real sequences can befoundusing asingleDFT
Ifg(n) &h(n) aretwo sequences then let x(n)=g(n)+j h(n) G(k)
=(X(k) +X*(k))
H(k) =1/2j (X(K)+X*(k))
2N pt DFT ofareal sequenceusingasingle NptDFT
Let x(n)beareal sequenceof length 2Nwithy(n)and g(n) denotingits NptDFT Lety(n)
=x(2n)andg(2n+1)

k
X (k) =Y(k) +WN G(k)
UsingDFT to findIDFT

TheDFTexpression canbeused to findIDFT X(n)


=1/N [DFT(X*(k)]*

Department of ECE, SCADEC

Page18

Principles of Digital Signal Processing

DigitalfilteringusingDFT
InaLTIsystemthesystemresponseisgotbyconvolutingtheinputwiththeimpulse
response.Inthefrequencydomaintheirrespectivespectraaremultiplied.Thesespectraare
continuousandhencecannotbeusedforcomputations.Theproductof2DFTsisequivalent
tothecircularconvolutionofthecorrespondingtimedomainsequences.Circularconvolution cannot
be used to determine theoutput of alinearfilterto agiven input sequence.Inthis casea
frequencydomainmethodologyequivalenttolinearconvolutionisrequired.Linear
convolutioncanbeimplementedusingcircularconvolutionbytakingthelengthofthe convolution as
N>=n1+n2-1 wheren1 and n2 are the lengths of the2 sequences.

Overlapandadd
Inordertoconvolveashortdurationsequencewithalongdurationsequencex(n)

,x(n)

issplitintoblocksoflengthNx(n)andh(n)arezeropaddedtolengthL+M-1.circular
convolutionisperformedtoeachblockthentheresultsareadded.Thesedatablocksmaybe represented
as

TheIDFTyieldsdatablocksoflengthNthatarefreeofaliasingsincethesizeofthe
DFTsandIDFTisN=L+M-1andthesequencesareincreasedtoN-pointsbyappending
zerostoeachblock.SinceeachblockisterminatedwithM-1zeros,thelastM-1pointsfrom
eachoutputblockmustbeoverlappedandaddedtothefirstM-1pointsofthesucceeding
block.Hencethismethodiscalledtheoverlapmethod.Thisoverlappingandaddingyieldsthe

output

sequencesgiven below.

Department of ECE, SCADEC

Page19

Principles of Digital Signal Processing

Overlapandsave method
Inthismethodx(n)isdividedintoblocksoflengthNwithanoverlapofk-1samples.
Thefirstblockiszeropaddedwithk-1zerosatthebeginning.H(n)isalsozeropaddedto
lengthN.CircularconvolutionofeachblockisperformedusingtheNlengthDFT.Theoutput
signalisobtainedafterdiscardingthefirstk-1samplesthefinalresultisobtainedbyadding

the

intermediate results.
InthismethodthesizeoftheI/PdatablocksisN=L+M-1andthesizeofthe

DFtsand

IDFTsareoflengthN.EachdatablockconsistsofthelastM-1datapointsoftheprevious
datablockfollowedb yLnewdatapointstoformadatasequenceoflengthN=L+M-1.AnNDepartment of ECE, SCADEC

Page20

Principles of Digital Signal Processing


pointDFTiscomputedfromeachdatablock.TheimpulseresponseoftheFIRfilteris
increasedinlengthbyappendingL-1zerosandanN-pointDFTofthesequenceiscomputed once and
stored.
Themultiplication oftwo N-point DFTs {H(k)}and {Xm(k)} for themthblock ofdatayields

SincethedatarecordisofthelengthN,thefirstM-1pointsofYm(n)arecorruptedby
aliasingandmustbediscarded.ThelastLpointsofYm(n)areexactlythesameastheresult from linear
convolution and as a consequencewe get

Department of ECE, SCADEC

Page21

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page22

Principles of Digital Signal Processing

RecommendedQuestionswithsolutions
Question 1
State and Provethe TimeshiftingPropert yofDFT
Solution
TheDFTandIDFT for an N-point sequencex(n)are givenas

Time shift:
Ifx(n)moX (k)
Then x(n-m)moWN

mk

X (k)

Question 2
StateandProvethe:(i)CircularconvolutionpropertyofDFT;(ii)DFTofRealandeven sequence.
Solution
(i) Convolution theorem
Circularconvolution in time domain corresponds to multiplication ofthe DFTs
Ify(n) =x(n)h(n) thenY(k) =X(k)H(k)
Exletx(n)=1,2,2,1 and h(n) =1,2,2,1 Theny(n) =x(n) h(n)
Y(n) =9,10,9,8
N pt DFTs of2 real sequences can befoundusing asingleDFT
Ifg(n) &h(n) aretwo sequences then let x(n)=g(n)+j h(n) G(k)
=(X(k) +X*(k))
H(k) =1/2j (X(K)+X*(k))

Department of ECE, SCADEC

Page23

Principles of Digital Signal Processing


2N pt DFT ofareal sequenceusingasingle NptDFT
Let x(n)beareal sequenceof length 2Nwithy(n)and g(n) denotingits Npt DFT Lety(n)
=x(2n)andg(2n+1)
k
X (k) =Y(k)+WN G (k)
UsingDFT to findIDFT
TheDFTexpression canbeused to findIDFT X(n)
=1/N [DFT(X*(k)]*
(ii)DFT ofReal and even sequence.
For a real sequence, if x(n)moX(k)
X (N-K) = X* (k)
For a complexsequence
DFT(x*(n))=X*(N-K)
Ifx(n)
then
X(k)
Real and even

real andeven
Real and odd

imaginaryand odd
Odd and imaginary

real odd
Even and imaginary

imaginaryand even
Question 3
Distinguish betweencircularand linear convolution
Solution
1) Circularconvolutionisusedforperiodicandfinitesignalswhilelinearconvolutionis used
foraperiodic and infinite signals.
2) In linear convolution weconvolved onesignal with anothersignal whereasin circular
convolution thesame convolutionis donebut in circularpattern depending upon the
samples of thesignal
3) Shifts are linear in linear in linear convolution, whereas it is circular in circular
convolution.

Department of ECE, SCADEC

Page24

Principles of Digital Signal Processing


Question4

Solution(a)

Solution(b)

Solution(c)

Solution(d)

Department of ECE, SCADEC

Page25

Principles of Digital Signal Processing

Question5

Solution

Question6

Solution

Department of ECE, SCADEC

Page26

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page27

Principles of Digital Signal Processing

FASTFOURIERTRANSFORMS(FFT)ALOGORITHMS
CONTENTS:1. FAST-FOURIER-TRANSFORM(FFT)ALGORITHMS
2. DIRECTCOMPUTATIONOFDFT,
3.

NEEDFOREFFICIENTCOMPUTATIONOFTHEDFT(FFTALGORITHMS).

RECOMMENDEDREADINGS
1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&
MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page28

Principles of Digital Signal Processing

FAST-FOURIER-TRANSFORM (FFT)ALGORITHMS
3.1 DirectComputationof DFT
Theproblem:
Given signal samples: x[0],...,x[N -1](someof which maybezero),develop aprocedure tocompute

for k=0,..., N-1where

Wewouldliketheproceduretobefast,simple,andaccurate.Fastisthemostimportant,sowewill
sacrificesimplicityfor speed, hopefullywithminimal lossof accuracy

3.2 Needfor efficientcomputationof DFT(FFT Algorithms)


Letusstartwiththesimpleway.Assumethat
tablefortheNofinterest.Howbigshouldthetablebe?

hasbeenprecompiledandstoredina
isperiodicinmwithperiodN, so wejust

need to tabulatethe Nvalues:

(PossiblyevenlesssinceSinisjust Cosshiftedbyaquarterperiods,sowecouldsavejust Cos


when N is amultiple of4.)
Whytabulate?ToavoidrepeatedfunctioncallstoCosandsinwhencomputingtheDFT.Now
wecancomputeeach X[k]directlyform theformula as follows

Foreachvalueofk,thereareNcomplexmultiplications,and(N-1)complexadditions.There areN
values ofk, so thetotalnumberof complexoperations is

Department of ECE, SCADEC

Page29

Principles of Digital Signal Processing

Complexmultipliesrequire4realmultipliesand2realadditions,whereascomplexadditions
requirejust 2 real additions N2complexmultipliesarethe primaryconcern.
N2increasesrapidlywithN,sohowcanwereducetheamountofcomputation?Byexploiting the
followingpropertiesof W:

ThefirstandthirdpropertiesholdforevenN,i.e.,when2isoneoftheprimefactorsofN. There are


related properties forother primefactorsof N.

Divide andconquer approach


WehaveseenintheprecedingsectionsthattheDFTisaverycomputationall y
intensiveoperation.In1965,CooleyandTukeypublishedanalgorithmthatcouldbeusedto
computetheDFTmuchmoreefficiently.Variousformsoftheiralgorithm,whichcametobe
knownastheFastFourierTransform(FFT),hadactuall ybeendevelopedmuchearlierb y
othermathematicians(evendatingbacktoGauss).Itwastheirpaper,however,which

stimulated

arevolution in the field ofsignal processing.


ItisimportanttokeepinmindattheoutsetthattheFFTisnotanewtransform.Itis
simplyaveryefficientwaytocomputeanexistingtransform,namel ytheDFT.Aswesaw,a
straightforwardimplementationoftheDFTcanbecomputationallyexpensivebecausethe
numberofmultipliesgrowsasthesquareoftheinputlength(i.e.N2foranNpointDFT).The
FFTreducesthiscomputationusingtwosimplebutimportantconcepts.Thefirstconcept,
divide-and-conquer,splits

theproblem

intotwosmallerproblems.

knownas
Thesecond

concept,knownasrecursion,appliesthisdivide-and-conquermethodrepeatedlyuntilthe problem is
solved.

Department of ECE, SCADEC

Page30

Principles of Digital Signal Processing

RecommendedQuestionswithsolutions
Question1

Solution:-

Question 2

Solution:-

Department of ECE, SCADEC

Page31

Principles of Digital Signal Processing

Question 3

Solution:-

Question 4

Department of ECE, SCADEC

Page32

Principles of Digital Signal Processing


Solution:-(a)

(b)

Department of ECE, SCADEC

Page33

Principles of Digital Signal Processing

FASTFOURIERTRANSFORMS(FFT)ALOGORITHMS
CONTENTS:1. RADIX-2FFTALGORITHMFOR THECOMPUTATIONOFDFTANDIDFT
2.

DECIMATION-IN-TIMEANDDECIMATION-IN- FREQUENCYALGORITHMS.

3. GOERTZELALGORITHM,
4. CHIRP-ZTRANSFORM

RECOMMENDEDREADINGS
1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&
MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page34

Principles of Digital Signal Processing

RADIX-2FFTALGORITHM FOR THE


COMPUTATIONOFDFTANDIDFT
4.1 Introduction:
Standardfrequencyanalysisrequirestransformingtime-domainsignaltofrequency
domainandstudyingSpectrumofthesignal.ThisisdonethroughDFTcomputation.N-point
DFTcomputationresultsinNfrequencycomponents.WeknowthatDFTcomputation
throughFFTrequiresN/2log2NcomplexmultiplicationsandNlog2Nadditions.Incertain
applicationsnotallNfrequencycomponentsneedtobecomputed(anapplicationwillbe
discussed).IfthedesirednumberofvaluesoftheDFTislessthan2log2Nthandirect computation ofthe
desired values is moreefficientthat FFT based computation.

4.2 Radix-2FFT
Useful whenN is apower of2:N = rvfor integers randv. ris called theradix, which
comes from theLatin word meaning.aroot,and has the same origins as theword radish.
WhenNisapowerofr=2,thisiscalledradix-2,andthenatural.divideandconquer
approach.istosplitthesequenceintotwosequencesoflengthN=2.Thisisaveryclevertrick that goes
back manyyears.

4.2.1 Decimationintime

Fig 4.1Firststep inDecimation-in-timedomainAlgorithm


Department of ECE, SCADEC

Page35

Principles of Digital Signal Processing

N=8-pointdecimation-in-timeFFfalgorithm
Stage1

Stage2

Stage3

X[O]

X[l]

X[2]

X [ 3]

X[4]

X[5]

X[6]

X [ 7]

Eachdotrepreentsacomplexa dditi on.


Each arrow representsaco mplexmultiplication.
Department of ECE, SCADEC

Page36

Principles of Digital Signal Processing

4.2.2 Decimation-in-frequencyDomain
Anotherimportantradix-2FFTalgorithm,calleddecimation-in-frequencyalgorithmis
obtainedb yusingdivide-and-conquerapproachwiththechoiceofM=2andL=N/2.This
choiceofdataimpliesacolumn-wisestorageoftheinput

datasequence.Toderivethe

algorithm,webeginbysplittingtheDFTformulaintotwosummatio ns,oneofwhichinvolves
thesumoverthefirstN/2datapointsandthesecondsuminvolvesthelastN/2datapoints.

Thus

weobtain

Now, let us split X(k) into the even and odd-numbered samples. Thusweobtain

Department of ECE, SCADEC

Page37

Principles of Digital Signal Processing

Fig 4.2 Shuffling ofData and Bit reversal


Thecomputationofthesequencesg1(n)andg2(n)andsubsequentuseofthese
sequencestocomputetheN/2-pointDFTsdepictedinfigweobservethatthebasic computation in this
figureinvolves the butterflyoperation.
Department of ECE, SCADEC

Page38

Principles of Digital Signal Processing


The

computationprocedure

canberepeatedthroughdecimationoftheN/2-pointDFTs,

X(2k)andX(2k+1).Theentireprocessinvolvesv=log2Nofdecimation,whereeachstage

involves

N/2 butterflies of thetypeshown in figure4.3.

Fig 4.3Firststep inDecimation-in-timedomainAlgorithm

Department of ECE, SCADEC

Page39

Principles of Digital Signal Processing

Fig4.4N=8 point Decimation-in-frequencydomain Algorithm

4.2 Example:DTMF DualTone Multifrequency

Thisisknownastouch-tone/speed/electronicdialing,pressingofeachbuttongeneratesa
uniquesetoftwo-tonesignals,calledDTMFsignals.Thesesignalsareprocessedatexchange
toidentifythenumberpressedbydeterminingthetwoassociatedtonefrequencies.Seven frequencies
areused to codethe 10 decimal digits and two special characters (4x3 array)

Department of ECE, SCADEC

Page40

Principles of Digital Signal Processing


Inthisapplicationfrequencyanalysisrequiresdeterminationofpossibleseven(eight)
DTMFfundamentaltonesandtheirrespectivesecondharmonics.Foran8kHzsamplingfreq,
thebestvalueoftheDFTlengthNtodetecttheeightfundamentalDTMFt oneshasbeen
foundtobe205.Notall205freqcomponentsareneededhere,insteadonlythose
correspondingtokeyfrequenciesarerequired.FFTalgorithmisnoteffectiveandefficientin
thisapplication.ThedirectcomputationoftheDFTwhichismoreeffectiveinthisapplication

is

formulated as alinear filteringoperation on the input datasequence.


This algorithmis known asGoertzel Algorithm
This algorithm exploits periodicitypropert yof thephasefactor. ConsidertheDFT definition
N1

X(k ) x(n)WnNk

(1)

n 0

Since

WN kN

is equal to 1, multiplyingboth sides of theequation b ythis results in;

() 
kN N1
( )
Xk
WN xmWN

mk

m 0

N1 ( )

xmWN

k(Nm)

(2)

m 0

yk(n) x(n) hk(n)

This is in theform of aconvolution


N1

k(nm)
y(n
k )  x(m)W N

(3)

m 0

h(n) Wknu(n)
k

(4)

Where yk(n) is the out put of afilter which has impulse response of hk(n) and input x(n).
Theoutput of thefilter at n = Nyields thevalue of theDFTat thefreqk=2k/N
Thefilter has frequencyresponsegiven by
H k(z) 

1
1WNkz 1

(6)

Theaboveformoffilterresponseshowsithasapoleontheunitcircleatthefrequencyk= 2k/N.
EntireDFTcanbecomputedbypassingtheblockofinputdataintoaparallelbankofN single-polefilters
(resonators)

Department of ECE, SCADEC

Page41

Principles of Digital Signal Processing


Theaboveformoffilterresponseshowsithasapoleontheunitcircleatthefrequencyk= 2k/N.
EntireDFTcanbecomputedbypassingtheblockofinputdataintoaparallelbankofN single-polefilters
(resonators)
1.3 DifferenceEquationimplementationof filter:
Fromthefrequencyresponseofthefilter(eq6)wecanwritethefollowingdifference equation
relatinginput and output;
Y (z)
1
H (z)  k

k
1WNkz1
X(z)
y k(n) WkNy

(n1)x(n)

y k(1) 0

(7)

Thedesired output isX(k) =yk(n) fork=0,1,N-1.


Thephasefactorappearingin thedifferenceequation can be computed once and stored.
Theformshownineq(7)requirescomplexmultiplicationswhichcanbeavoideddoing
suitablemodifications(divideandmultiplyb y
1WkNz1).Thenfrequencyresponseofthe
filter can be alternativelyexpressed as
H (z) 
k

1WkNz 1
12cos(2Sk/N)z 1z 2

(8)

Thisissecondorderrealizationofthefilter(observethedenominatornowisasecond-order
expression). Thedirect form realization ofthe aboveis given by
vk(n) 2cos(2Sk/N)vk(n1)vk(n2)x(n)
k

yk(n) vk(n)WNvk(n1)

Department of ECE, SCADEC

vk(1) vk(2) 0

(9)
(10)

Page42

Principles of Digital Signal Processing

The

recursive

relationin(9)isiteratedforn=0,1,N,buttheequationin(10)iscomputedonlyonceat
timen=N.Eachiterationrequiresonerealmultiplicationandtwoadditions.Thus,forareal
inputsequencex(n)thisalgorithmrequires(N+1)realmultiplicationstoyieldX(k)andX(Nk)(thisisdueto

symmetry).GoingthroughtheGoertzelalgorithmitisclearthatthis

algorithmisusefulonl ywhenMout

ofNDFTvaluesneedtobecomputedwhereM2log2N,

Otherwise, theFFTalgorithm is more efficient method. Theutilityof the algorithm completel y


depends on the application and numberoffrequencycomponents we arelookingfor.

4.2. Chirpz-Transform
4.2.1 Introduction:
ComputationofDFTisequivalenttosamplesofthez-transformofafinite-length
sequenceatequallyspacedpointsaroundtheunitcircle.Thespacingbetweenthesamplesis
givenby2/N.TheefficientcomputationofDFTthroughFFTrequiresNtobeahighl y
compositenumberwhichisaconstraint.Manyatimeswemayneedsamplesofz-transform
oncontoursotherthanunitcircleorwemyrequiredensesetoffrequencysamplesovera small region of
unit circle.To understand theselet us look in to the followingsituations:

1. Obtain samples of z-transform on a circle ofradius a which is concentricto unit circle


Thepossible solution is to multiplythe inputsequencebya-n
2. 128 samples needed between frequencies =-/8 to +/8 from a 128 point sequence
Fromthegivenspecificationswe

seethatthespacing

betweenthefrequencysamplesis

/512or2/1024.Inordertoachievethisfreqresolutionwetake1024-pointFFTof
Department of ECE, SCADEC

Page43

Principles of Digital Signal Processing


thegiven128-pointseqbyappendingthe sequencewith896zeros.Sinceweneed

Department of ECE, SCADEC

Page44

Principles of Digital Signal Processing


only128frequenciesoutof1024there willbebigwastageofcomputationsinthis scheme.

For theabovetwo problems Chirp z-transform is the alternative. Chirp


z-transform is defined as:
N1

X(zk ) x(n)z nk

k 0,1,......L1

(11)

n 0

Wherezkisageneralizedcontour.Zkisthesetofpointsinthez-planefallingonanarcwhich
beginsatsomepointz0andspiralseitherintowardtheoriginoroutawayfromtheoriginsuch

that

th e

points {zk}aredefined as,


z rejT 0( RejI0) k
k

Department of ECE, SCADEC

k 0,1,....L1

(12)

Page45

Principles of Digital Signal Processing


Notethat,
a. if R0<1 the points fall ona contour that spirals toward theorigin
b. If R0>1 the contour spirals awayfrom the origin
c. If R0=1 the contour isa circular arcof radius
d.Ifr0=1 and R0=1 the contour is an arcof theunit circle.
(Additionallythiscontourallowsonetocomputethefreqcontentofthesequencex(n)at
densesetofLfrequenciesintherangecoveredb ythearcwithouthavingtocomputealarge
DFT(i.e.,aDFTofthesequencex(n)paddedwithmanyzerostoobtainthedesiredresolution in freq.))
e. Ifr0=R0=1and0=00=2/NandL=Nthecontouristheentireunitcirclesimilartothe standard
DFT. These conditions areshown in thefollowingdiagram.

Department of ECE, SCADEC

Page46

Principles of Digital Signal Processing

Substituting the valueof zkinthe expression of X(zk)


X(zk) 

N1

x(n)z nk
n 0

where

N1

x(n)(r0e

jT 0

) nW n k

(13)

n 0

W Re0jI0

(14)

4.2.2 Expressing computation ofX(zk) as linear filtering operation:


Bysubstitution of
1
nk  (n 2k2(k n)2)2
wecanexpress X(zk) as

(15)

X(zk ) W k /2y(k) y(k )/h(k)

k 0,1,..........L1

(16)

Where
2

h(n) Wn /2

g(n) x(n)(re0 jT )0n W n /2

N1

(17)
y(k) g(n)h(kn)
n 0
both g(n) and h(n)are complexvalued sequences
4.2.3 Why it is called Chirp z-transform?
IfR0=1,thensequence h(n)hastheformofcomplexexponential withargumentn=
n20/2=(n0/2)n.Thequantit y(n0/2)representsthefreqofthecomplexexponential
Department of ECE, SCADEC

Page47

Principles of Digital Signal Processing


signal,whichincreaseslinearl ywithtime.Suchsignalsareusedinradarsystemsarecalled chirp signals.
Hencethename chirp z-transform.

4.2.4 HowtoEvaluatelinear convolution of eq(17)


1. Can bedoneefficientl ywith FFT
2. Thetwosequencesinvolvedareg(n)andh(n).g(n)isfinitelengthseqoflengthNand h(n) is
ofinfiniteduration,butfortunatelyonl yaportionofh(n)isrequi redtocompute Lvalues of
X(z), henceFFT could be still beused.
3. SinceconvolutionisviaFFT,itiscircularconvolutionoftheN-pointseqg(n)withan M-point
section ofh(n) whereM>N
4. Theconcepts used in overlapsavemethod can beused
5. Whilecircularconvolutionisusedtocomputelinearconvolutionoftwosequenceswe
knowtheinitialN-1pointscontainaliasingandtheremainingpointsareidenticalto
theresultthatwouldbeobtainedfromalinearconvolutionofh(n)andg(n),Inviewof
thistheDFTsizeselectedisM=L+N-1whichwouldyieldLvalidpointsandN-1
pointscorruptedbyaliasing.Thesectionofh(n)consideredisfor(N-1)n(L-1)
yieldingtotal length M as defined
6. Theportion of h(n)canbedefined in manyways, onesuch wayis,
h1(n)=h(n-N+1)
n =0,1,..M-1
7. ComputeH1(k)and G(k)to obtain
Y1(k)=G(K)H1(k)
8. Application ofIDFT will givey1(n), for

Department of ECE, SCADEC

Page48

Principles of Digital Signal Processing


n =0,1,M-1. ThestartingN-1 arediscarded and desired values arey1(n)for N-1
n M-1 which corresponds to the range0 n L-1 i.e.,
y(n)= y1(n+N-1) n=0,1,2,..L-1
9. Alternativelyh2(n)can bedefinedas
h2(n) h(n)
0dndL1
h(n(NL1))
LdndM1
10. ComputeY2(k)=G(K)H2(k), Thedesired valuesofy2(n) arein therange 0
n L-1 i.e.,
y(n) = y2(n) n=0,1,.L-1
11. Finally, the complexvalues X(zk) arecomputed bydividing y(k) b yh(k)
For k =0,1,L-1

4.3 Computationalcomplexity
IngeneralthecomputationalcomplexityofCZTisoftheorderofMlog2Mcomplex
multiplications.ThisshouldbecomparedwithN.Lwhichisrequiredfordirectevaluation.
IfLissmalldirectevaluationismoreefficientotherwiseifLislargethenCZTismore efficient.
4.3.1 Advantages ofCZT
a. Not necessaryto haveN =L
b.Neither NorLneed tobehighlycomposite
c. ThesamplesofZtransformaretakenonamoregeneralcontourthatincludestheunit circle
asaspecial case.
4.4 Example to understand utility ofCZTalgorithmin freq analysis
(ref: DSP b yOppenheim Schaffer)
CZTisusedinthisapplicationtosharpentheresonances

by

evaluatingthez-transform

offtheunitcircle.Signaltobeanalyzedisasyntheticspeechsignalgeneratedbyexcitinga
polesystemwithaperiodicimpulsetrain.Thesystemwassimulatedtocorrespondtoa

five-

samplingfreq.

of10 kHz. Thepolesare located at center freqs of 270,2290,3010,3500 &4500 Hz with


bandwidth of 30, 50, 60,87 &140 Hz respectively.

Department of ECE, SCADEC

Page49

Principles of Digital Signal Processing


Solution:Observethepole-zeroplotsandcorrespondingmagnitudefrequencyresponsefor
differentchoices of|w|.Thefollowingobservations arein order:

Thefirsttwospectracorrespondtospiralcontoursoutsidetheunitcirclewitharesulting
broadeningof the resonancepeaks

|w|=1 corresponds to evaluatingz-transform on theunit circle

Thelasttwochoicescorrespondtospiralcontourswhichspiralsinsidetheunitcircleand close to
thepole locations resultingin a sharpeningofresonancepeaks.

Department of ECE, SCADEC

Page50

Principles of Digital Signal Processing

4.5 Implementationof CZTinhardwaretocompute the DFTsignals


TheblockschematicoftheCZThardwareisshownindownfigure. DFTcomputation requires
r0=R0=1, 0=0 0=2/N andL=N.
The

cosineandsinesequencesinh(n)

neededforpre

multiplicationandpostmultiplicationare

usuallystoredinaROM.Ifonl ymagnitudeofDFTisdesired,thepostmultiplicationsare unnecessary,


In this case|X(zk)|= |y(k)|k=0,1,.N-1

Department of ECE, SCADEC

Page51

Principles of Digital Signal Processing

RecommendedQuestionswithsolutions
Question 1

Solution:-

Department of ECE, SCADEC

Page52

Principles of Digital Signal Processing

Question2

Solution :-Thereare20real , non trial multiplications

Figure4.1DIFAlgorithmforN=16
Department of ECE, SCADEC

Page53

Principles of Digital Signal Processing


Question 3

Solution:-

Question4

Solution:-

Department of ECE, SCADEC

Page54

Principles of Digital Signal Processing


Question5

Solution:-

Question6

Solution:-

This can be viewed as the convolution of the N-length sequence x(n) with implulse
responseofa linearfilter

Department of ECE, SCADEC

Page55

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page56

Principles of Digital Signal Processing

UNIT II
DESIGNOFIIRDIGITALFILTERS
CONTENTS:1. IIRFILTERDESIGN:
2. CHARACTERISTICSOFCOMMONLYUSEDANALOGFILTERS
3. BUTTERWORTHANDCHEBYSHEVEFILTERS,
4.

ANALOGTOANALOGFREQUENCYTRANSFORMATIONS.

RECOMMENDEDREADINGS
1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&
MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page57

Principles of Digital Signal Processing

DesignofIIRDigital Filters
5.1 Introduction
A digital filter is alinearshift-invariant discrete-timesystem that is realized usingfinite precision
arithmetic. The design of digital filters involves threebasic steps:
Thespecification ofthe desired properties of thesystem.
The approximation ofthesespecifications usingacausal discrete-time system.
Therealization of thesespecifications usingfiniteprecision arithmetic.
Thesethreestepsareindependent;herewefocusourattentiononthesecondstep.The
desireddigitalfilteristobeusedtofilteradigitalsignalthatisderivedfromananalogsignal
bymeansofperiodicsampling.Thespecificationsforbothanaloganddigitalfiltersareoften
giveninthefrequencydomain,asforexampleinthedesignoflowpass,highpass,bandpass and band
elimination filters.
Giventhesamplingrate,itisstraightforwardtoconvertfromfrequency

specifications

onananalogfiltertofrequencyspecificationsonthecorrespondingdigitalfilter,theanalog
frequenciesbeingintermsofHertzanddigitalfrequenciesbeingintermsofradianfrequency
oranglearoundtheunitcirclewiththepointZ=-1correspondingtohalfthesampling
Theleastconfusingpoint

ofviewtoward

digitalfilter

designis

to

frequency.

considerthe

filter

asbeingspecifiedintermsofanglearoundtheunitcircleratherthanintermsofanalog frequencies.

Department of ECE, SCADEC

Page58

Principles of Digital Signal Processing

Figure5.1: Tolerancelimits forapproximation ofideal low-pass filter


Aseparateproblemisthatofdetermininganappropriatesetofspecificationsonthe
digitalfilter.Inthecaseofalowpassfilter,for

example,thespecificationsoftentaketheform

of

atolerancescheme, asshown in Fig. 5.1.

Manyofthefiltersusedinpracticearespecifiedbysuchatolerancescheme,withno
constraintsonthephaseresponseotherthanthoseimposedbystabilityandcausality
requirements;i.e.,thepolesofthesystemfunctionmustlieinsidetheunitcircle.Givenaset
ofspecificationsintheformofFig.5.1,thenextstepistoandadiscretetimelinearsystem
whosefrequencyresponsefallswithintheprescribedtolerances.Atthispointthefilterdesign
problembecomesaprobleminapproximation.Inthecaseofinfiniteimpulseresponse(IIR)

filters,

wemust approximate thedesiredfrequencyresponse b yarationalfunction, while in the finite


impulse response (FIR) filterscaseweareconcernedwith polynomial approximation.

5.1 DesignofIIRFiltersfromAnalogFilters:

Department of ECE, SCADEC

Page59

Principles of Digital Signal Processing


ThetraditionalapproachtothedesignofIIRdigitalfiltersinvolvesthetransformation
ofananalogfilterintoadigitalfiltermeetingprescribedspecifications.Thisisareasonable

approach

because:
Theartofanalogfilterdesignishighlyadvancedandsinceusefulresultscanbe
achieved,itisadvantageoustoutilizethedesignproceduresalread ydevelopedfor
analogfilters.
Manyusefulanalogdesignmethodshaverelativelysimpleclosed-formdesign formulas.
Therefore,digitalfilterdesignmethodsbasedonanalogdesignformulasarerathersimpleto implement.
An analogsystem can bedescribed b ythe differential equation

And the correspondingrational function is

Thecorrespondingdescription fordigital filters has the form

and the rational function

IntransformingananalogfiltertoadigitalfilterwemustthereforeobtaineitherH(z)
orh(n)(inverseZ-transformofH(z)i.e.,impulseresponse)fromtheanalogfilterdesign.In
suchtransformations,wewanttheimaginaryaxisoftheS-planetomapintothenitcircleof

theZ-

plane,astableanalogfiltershouldbetransformedtoastabledigitalfilter.Thatis,ifthe
analogfilterhaspolesonlyintheleft-halfofS-plane,thenthedigitalfiltermusthavepoles
onlyinsidethe unit circle. These constraints arebasic to all thetechniques discussed here.

Department of ECE, SCADEC

Page60

Principles of Digital Signal Processing

5.2 CharacteristicsofCommonlyUsedAnalogFilters:
Fromthepreviousdiscussionitisclearthat,IITdigitalfilterscanbeobtainedby
beginningwithananalogfilter.Thusthedesignofadigitalfilterisreducedtodesigningan
appropriateanalogfilterandthenperformingtheconversionfromHa(s)toH(z).Analogfilter design is
a well - developed field, man y approximation techniques, viz., Butterworth,
Chebyshev,Elliptic, etc., havebeen developed for the design of analoglow
passfilters.Ourdiscussionislimitedtolowpassfilters,since,frequencytransformationcan
beappliedtotransformadesignedlowpassfilterintoadesiredhighpass,bandpassandband stop filters.

5.2.1 ButterworthFilters:
LowpassButterworthfiltersareall-polefilterswithmonotonicfrequencyresponsein

both

pass band and stopband, characterized bythemagnitude-squared frequencyresponse

Where,Nistheorderofthefilter,cisthe-3dBfrequency,i.e.,cutofffrequency,pisthe
passbandedgefrequencyand1=(1/1+2)isthebandedgevalueofHa()2.Sincethe

product

Ha(s)Ha(-s) andevaluatedat s = jis simplyequal to Ha()2, it follows that

Thepoles ofHa(s)Ha(-s)occur onacircleof radiusc at equallyspaced points. From Eq. (5.29),


wefind the pole positions as the solution of

Andhence, theN poles in the left half ofthe s-plane are

Department of ECE, SCADEC

Page61

Principles of Digital Signal Processing


Notethat,therearenopolesontheimaginaryaxisofs-plane,andforNoddtherewill
beapoleonrealaxisofs-plane,forNeventherearenopolesevenonrealaxisofs-plane.
Alsonotethatallthepolesarehavingconjugatesymmetry.Thusthedesignmethodologyto

design

aButterworth lowpassfilter with 2 attenuationat a specified frequencys is Find N,

Wherebydefinition,2=1/1+2.ThustheButterworthfilteriscompletely
characterizedb ytheparametersN,2,andtheratios/porc.Then,fromEq.(5.31)find

the

polepositions Sk; k =0,1, 2,..(N-1).Finallythe analogfilter isgiven by

5.2.2 ChebyshevFilters:
TherearetwotypesofChebyshevfilters.TypeIChebyshevfiltersareall-polefilters
thatexhibitequiripplebehaviorinthepassbandandamonotoniccharacteristici nthestop
band.Ontheotherhand,typeIIChebyshevfilterscontainbothpolesandzerosandexhibita
monotonicbehaviorinthepassbandandanequiripplebehaviorinthestopband.Thezerosof
thisclassoffilterslieontheimaginaryaxisinthes-plane.Themagnitudesquaredofthe
frequencyresponse characteristic oftypeIChebyshevfilter is given as

Where is a parameter of thefilter related to theripplein thepass band asshown in Fig. (5.7),
and TNis theNth order Chebyshev polynomialdefined as

TheChebyshev polynomials can begenerated bytherecursive equation

Department of ECE, SCADEC

Page62

Principles of Digital Signal Processing

WhereT0(x) =1 and T1(x) =x.


At the band edgefrequency=p,wehave

Figure5.2: TypeIChebysehev filter characteristic


Or equivalently

Where1is thevalue of thepass band ripple.


Thepoles ofTypeIChebyshevfilter lieon an ellipse in thes-planewithmajor axis

Andminor axis

Where is related to accordingto theequation


Department of ECE, SCADEC

Page63

Principles of Digital Signal Processing

Theangularpositions ofthe left half s-planepolesare given by

Then the positions of theleft halfs-planepoles aregiven by

Wherek=r2Cos k and k=r1Sink. Theorder ofthefilter is obtainedfrom

Where, bydefinition2=1/1+2.
Finally, theTypeIChebyshevfilter is given by

ATypeIIChebyshevfiltercontainszeroaswellaspoles.Themagnitudesquaredresponseis givenas

WhereTN(x)istheN-orderChebyshevpolynomial.Thezerosarelocatedontheimaginary axis at the


points

and the left-half s-plane poles are given

Where
Department of ECE, SCADEC

Page64

Principles of Digital Signal Processing

and

Finally, theTypeIIChebyshevfilter is given by

Theotherapproximationtechniquesareelliptic(equirippleinbothpassbandand

stopband)

andBessel (monotonicin both passband and stopband).

5.3 AnalogtoAnalogFrequencyTransforms
Frequency

transformsareusedtotransformlowpassprototypefiltertootherfilterslike

highpassorbandpassorbandstopfilters.Onepossibilityistoperformfrequencytransformin
theanalogdomainandthenconverttheanalogfilterintoacorrespondingdigitalfilterb ya
mappingofthes-planeintoz-plane.Analternativeapproachistoconverttheanaloglowpass
filterintoalowpassdigitalfilterandthentotransformthelowpassdigitalfilterintothe desired digital
filterb yadigital transformation.
SupposewehavealowpassfilterwithpassedgePandifwewantconvertthatinto
anotherlowpass filterwith pass band edgePthen the transformation usedis

To convert low passfilterinto highpass filter thetransformation used is


Department of ECE, SCADEC

Page65

Principles of Digital Signal Processing

Thus weobtain

Thefilter function is

Department of ECE, SCADEC

Page66

Principles of Digital Signal Processing

RecommendedQuestionswithanswers
Question 1
IDesign adigital filter tosatisfythefollowing characteristics.
-3dBcutofffrequencyof0:5_ rad.
Magnitudedown at least15dBat 0:75_ rad.
Monotonic stop band and pass band Using
Impulseinvariant technique
Approximation ofderivatives
Bilinear transformation technique

Figure5.8:Frequency responseplot ofthe example

Solution:a)ImpulseInvariant Technique

From thegiven digital domain frequency, _nd thecorresponding analogdomain frequencies.

WhereTisthesamplingperiodand1/Tisthesamplingfrequencyanditalwayscorresponds to
2radians in thedigital domain.In this problem, let us assumeT =1sec.
Thenc=0:5and s=0:75
Department of ECE, SCADEC

Page67

Principles of Digital Signal Processing


Let us find theorder of thedesired filter using

Where2is thegain at thestop band edgefrequencys.

Order of filter N =5.


Then the 5 poles on theButterworth circle of radiusc=0:5 are givenby

Then the filter transferfunction in the analogdomain is

Department of ECE, SCADEC

Page68

Principles of Digital Signal Processing

where Ak's arepartial fractions coefficients of Ha(s).


Finally, thetransfer function ofthe digital filter is

b)

c)For thebilinear transformation technique, weneed to pre-warp thedigitalfrequencies into


correspondinganalogfrequencies.

Then the order ofthe filter

Thepole locations on theButterworth circlewith radiusc=2are

Then the filter transferfunction in the analogdomain is

Department of ECE, SCADEC

Page69

Principles of Digital Signal Processing

Finally, thetransfer function ofthe digital filter is

Question 2
Design a digital filter using impulse invariant technique to satisfy following
characteristics
(i) Equiripplein pass band and monotonic in stop band
(ii) -3dB ripplewith pass band edgefrequencyat0:5radians.
(iii) Magnitudedownat least 15dB at 0:75radians.
Solution: AssumingT=1, =0:5 and s =0:75
Theorder of desired filter is

Department of ECE, SCADEC

Page70

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page71

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page72

Principles of Digital Signal Processing


Question3

Solution:Forthedesignspecifications wehave

Department of ECE, SCADEC

Page73

Principles of Digital Signal Processing

Question4

Solution:-

Department of ECE, SCADEC

Page74

Principles of Digital Signal Processing

Design ofIIR FiltersfromAnalogFilters


CONTENTS:1. DESIGNOFIIRFILTERSFROMANALOGFILTERS(BUTTERWORTHANDCHEBYSHEV)
2.

IMPULSEINVARIANCEMETHOD

3. MAPPINGOFTRANSFERFUNCTIONS
4. APPROXIMATION

OF

DERIVATIVE

(BACKWARD

DIFFERENCE

AND

BILINEARTRANSFORMATION)METHOD,MATCHEDZTRANSFORMS

5. VERIFICATIONFORSTABILITYANDLINEARITYDURINGMAPPING

RECOMMENDEDREADINGS:1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&


MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page75

Principles of Digital Signal Processing

DESIGNOFIIRFILTERSFROM ANALOGFILTERS
(BUTTERWORTH ANDCHEBYSHEV)
6 . 1 I n tr o d u c ti o n

A digital filteris a linearshift-invariant discrete-time system that is realized usingfinite Precision


arithmetic. The design of digital filters involves threebasic steps:
Thespecification ofthe desired properties of thesystem.
Theapproximation ofthesespecifications usingacausal discrete-time system.
Therealization ofthesespecifications using_niteprecision arithmetic.
Thesethreesteps areindependent; herewe focusour attention on the second step.
Thedesireddigitalfilteristobeusedtofilteradigitalsignalthatisderivedfromananalog
signalby
meansofperiodicsampling.Thespeci_cationsforbothanaloganddigitalfiltersare often given in
thefrequencydomain, as forexamplein thedesign of low
pass,highpass,bandpassandbandeliminationfilters.Giventhesamplingrate,itisstraight forward to
convertfrom frequencyspecifications on an analogfilterto frequency speci_cations on the
correspondingdigital filter, the analogfrequencies beingin terms ofHertz
anddigitalfrequenciesbeingintermsofradianfrequencyoranglearoundtheunitcirclewith
thepointZ=-1correspondingtohalfthesamplingfrequency.Theleastconfusingpointof
viewtowarddigitalfilterdesignistoconsiderthefilterasbeingspecifiedintermsofangle
aroundthe
unit circlerather than in terms ofanalogfrequencies.

Figure6.1: Tolerancelimits for approximationofideal low-passfilter

Department of ECE, SCADEC

Page76

Principles of Digital Signal Processing


Aseparateproblemisthatofdetermininganappropriatesetofspecificationsonthedigital filter. In the
caseof alowpass filter, for example,thespecificationsoftentakethe
formofatolerancescheme,asshownin Fig. 4.1

Manyof the filters used in practice are specified bysuch a tolerance scheme, with no
constraintsonthephaseresponseotherthanthoseimposedbystabilityandcausality
requirements;i.e.,thepolesofthesystemfunctionmustlieinsidetheunitcircle.Givenaset
ofspecificationsintheformofFig.7.1,thenextstepistoandadiscretetimelinearsystem
whosefrequencyresponsefallswithintheprescribedtolerances.Atthispointthefilterdesign
problembecomesaprobleminapproximation.Inthecaseofinfiniteimpulseresponse(IIR)
filters,
wemust approximate thedesiredfrequencyresponse b yarationalfunction, while in the finite
impulse response (FIR) filterscaseweareconcernedwith polynomial approximation.

6.2 Designof IIRFiltersfromAnalogFilters:


ThetraditionalapproachtothedesignofIIRdigitalfiltersinvolvesthetransformationofan
analogfilterintoadigitalfiltermeetingprescribedspecifications.Thisisareasonable
because:

approach

Theartofanalogfilterdesignishighlyadvancedandsinceusefulresultscanbe
achieved,itisadvantageoustoutilizethedesignproceduresalread ydevelopedfor
analogfilters.
Manyusefulanalogdesignmethodshaverelativelysimpleclosed-formdesign formulas.
Therefore,digitalfilterdesignmethodsbasedonanalogdesignformulasarerathersimpleto
implement.
An analogsystem can bedescribed b ythe differential equation

------------------------------------------------------------6.1
And the correspondingrational function is

Department of ECE, SCADEC

Page77

Principles of Digital Signal Processing

---------------------------------------------------------6.2
Thecorrespondingdescription fordigital filters has the form

and the rational function

--------------------------------------------------6.3

--------------------------------------------------------6.4
IntransformingananalogfiltertoadigitalfilterwemustthereforeobtaineitherH(z)orh(n) (inverseZtransformofH(z)i.e.,impulseresponse)fromtheanalogfilterdesign.Insuch
transformations,wewanttheimaginaryaxisoftheS-planetomapintothefinitecircleofthe
Zplane,astableanalogfiltershouldbetransformedtoastabledigitalfilter.Thatis,ifthe
analogfilterhaspolesonl yintheleft-halfofS-plane,thenthedigitalfiltermusthavepoles
onlyinsidethe unit circle. These constraints arebasic to all the techniques discussed

7.3 IIRFilterDesignbyImpulseInvariance:
Thistechniqueoftransformingananalogfilterdesigntoadigitalfilterdesigncorrespondsto choosing
the unit-sampleresponseof thedigital filter asequall yspacedsamples of theimpulse response
oftheanalogfilter. That is,
-------------------------------------------------------------------------6.5
WhereT is thesampling period. Becauseof uniform sampling, wehave

---------------------------------------------6.6
Or

---------------------------------------------6.7
Department of ECE, SCADEC

Page78

Principles of Digital Signal Processing

Figure6.2: Mappingof s-planeinto z-plane


Wheres=jand=/T,isthefrequencyinanalogdomainandisthefrequencyindigital domain.
FromtherelationshipZ=eSTitisseenthatstripsofwidth2/TintheS-planemapintothe
entireZplaneasshowninFig.7.2.ThelefthalfofeachS-planestripmapsintointeriorofthe
unitcircle,therighthalfofeachS-planestripmapsintotheexterioroftheunitcircle,andthe
imaginaryaxisoflength2/TofS-planemapsontoonceroundtheunitcircleofZ-plane.
EachhorizontalstripoftheS-planeisoverlaidontotheZ-planetoformthedigitalfilter
functionfromanalogfilterfunction.Thefrequencyresponseofthedigitalfilterisrelatedto
the frequencyresponse of the

Figure6.3:Illustration ofthe effects of aliasinginthe impulseinvariancetechnique


analogfilteras
Department of ECE, SCADEC

Page79

Principles of Digital Signal Processing

------------------------------------------------6.8
From the discussion ofthesamplingtheorem it is clear that ifand onl yif

Then

Unfortunately,anypracticalanalogfilterwillnotbebandlimited,andconsequentlythereis
interferencebetweensuccessivetermsinEq.(7.8)asillustratedinFig.7.3.Becauseofthe
aliasingthatoccursinthesamplingprocess,thefrequencyresponseoftheresultingdigital
filterwillnotbeidenticaltotheoriginalanalogfrequencyresponse.Togetthefilterdesign
procedure,letusconsiderthesystemfunctionoftheanalogfilterexpressedintermsofa partial-fraction
expansion

-----------------------------------------------------------------------6.9
Thecorrespondingimpulse response is

---------------------------------------------------------------6.10
And theunit-sampleresponseof thedigital filter is then

--------------6.11
Thesystemfunction ofthedigital filter H(z) is given by

------------------------------------------------------------ 6.12
IncomparingEqs.(7.9)and(7.12)weobservethatapoleats=skintheS-planetransformsto
apoleatexpskTintheZ-plane.Itisimportanttorecognizethattheimpulseinvariantdesign
proceduredoes not correspond to amappingof theS-planeto theZ-plane.
Department of ECE, SCADEC

Page80

Principles of Digital Signal Processing

7.4 IIRFilterDesignByApproximationOfDerivatives:
AsecondapproachtodesignofadigitalfilteristoapproximatethederivativesinEq.(4.1)b y
finitedifferences.Ifthesamplesareclosertogether,theapproximationtothederivativewould
beincreasinglyaccurate.Forexample,supposethatthefirstderivativeisapproximatedbythe
backward difference

first

--------------------------6.13
Where y(n)=y(nT). Approximationto higher-order derivatives areobtained byrepeated
application ofEq. (7.13);i.e.,

--------------------------6.14

For conveniencewedefine

-------------------------------------------------------------------6.15
ApplyingEqs. (7.13),(7.14) and (7.15) to (7.1), weobtain

---------------------------------------------6.16
Wherey(n)= ya(nT)andx(n)=xa(nT).Wenotethattheoperation(1)[]isalinearshiftinvariantoperatorandthat(k)[]canbeviewedasacascadeof(k)operators(1)[].In particular

And

Department of ECE, SCADEC

Page81

Principles of Digital Signal Processing


Thus takingtheZ-transform of each sidein Eq. (7.16), weobtain

------------------------------------------------------------6.17
ComparingEq.(7.17)to(7.2),weobservethatthedigitaltransferfunctioncanbeobtained
directlyfrom the analogtransfer function b ymeans of asubstitution ofvariables

---------------------------------------------------------------------------------6.18
Sothat,thistechniquedoesindeedtrulycorrespondtoamappingoftheS-planetotheZplane,accordingtoEq.(7.18).Toinvestigatethepropertiesofthismapping,wemustexpress
afunction ofs, obtaining

zas

Substitutings =j, i.e., imaginaryaxis in S-plane

------------------------------------------------------6.19
Whichcorrespondstoacirclewhosecenterisatz=1/2andradiusis1/2,asshowninFig.6.4.
Itiseasil yverifiedthatthelefthalfoftheS-planemapsintotheinsideofthesmallcircleand
therighthalfoftheS-planemapsontotheoutsideofthesmallcircle.Therefore,althoughthe
requirementofmappingthej-axistotheunitcircleisnotsatisfied,thismappingdoessatisfy
stabilitycondition.

Department of ECE, SCADEC

th e

Page82

Principles of Digital Signal Processing

Figure6.4: Mappingof s-planeto z-planecorrespondingto first backward-difference


approximation to thederivative
Incontrast to theimpulse invariancetechnique,decreasing the samplingperiod T,theoreticall y
producesabetterfiltersincethespectrumtendstobeconcentratedinaverysmallregionof
theunitcircle.Thesetwoproceduresarehighlyunsatisfactoryforanythingbutlowpass
filters.Analternativeapproximationtothederivativeisaforwarddifferenceanditprovidesa
mappinginto the unstabledigital filters.

6.5 IIRFilterDesignByTheBilinearTransformation:
Intheprevioussectionadigitalfilterwasderivedby
approximatingderivativesbydifferences.
Analternativeprocedureisbasedonintegratingthedifferentialequationandthenusinga
numerical
approximationto theintegral. Considerthe first -order equation
-----------------------------------------------------------6.20
Where ya(t)is thefirst derivativeofya(t). The correspondinganalogsystem function is

We can writeya(t) asanintegral ofya(t), as in

Department of ECE, SCADEC

Page83

Principles of Digital Signal Processing


In particular, if t =nT and t0=(n-1)T,

Ifthis integral is approximated byatrapezoidal rule, wecan write

----------------------6.21
However, from Eq. (7.20),

Substitutinginto Eq. (4.21)weobtain

Where y(n) = y(nT)and x(n)=x(nT). TakingtheZ-transformand solving forH(z)gives

--------------------------------------------6.22
From Eq. (7.22)it is clear that H(z) is obtained from Ha(s)b ythe substitution

-------------------------------------------------------------------6.23
That is,

--------------------------------------------------------------6.24
This can beshown to hold in general since an Nth-order differential equation ofthe form of
Eq. (6.1) canbewritten as aset of Nfirst-orderequations of theform of Eq.(6.20). Solving Eq.
(6.23) for zgives
Department of ECE, SCADEC

Page84

Principles of Digital Signal Processing

----------------------------------------------------------------------------6.25
TheinvertibletransformationofEq.(7.23)isrecognizedasabilineartransformation.Tosee
thatthismappinghasthepropert ythattheimaginaryaxisinthes-planemapsontotheunit circle in the
z-plane,considerz=ej, then from Eq. (7.23),s is given by

Figure6.5: Mappingof analogfrequencyaxis onto theunit circle usingthebilinear


Transformation
Thus for z on the unit circle, =0 and and arerelated by
T/2 =tan (/2)
or
=2 tan-1(T/2)
ThisrelationshipisplottedinFig.(6.5),anditisreferredasfrequencywarping.Fromthe
_gureitisclearthatthepositiveandnegativeimaginaryaxisofthes-planearemapped,
Department of ECE, SCADEC

Page85

Principles of Digital Signal Processing


respectively,intotheupperandlowerhalvesoftheunitcircleinthez-plane.Inadditiontothe
factthattheimaginaryaxisinthes-planemapsintotheunitcircleinthez-plane,thelefthalf
ofthesplanemapstotheinsideoftheunitcircleandtherighthalfofthes-planemapstothe
outsideoftheunitcircle,asshowninFig.(6.6).Thusweseethattheuseofthebilinear
transformationyieldsstabledigitalfilterfromanalog
filter.Alsothistransformationavoidsthe
problemofaliasingencounteredwiththeuseofimpulseinvariance,becauseitmapstheentire
imaginaryaxisinthes-planeontotheunitcircleinthez-plane.Thepricepaidforthis, however, is the
introduction of adistortion in the frequencyaxis.

Figure6.6: Mappingof thes-planeinto the z-planeusingthe bilinear transformation

6.6 TheMatched-ZTransform:
Another method forconverting an analogfilterinto an equivalentdigital filter is to map the
poles and zeros ofHa(s)directl yinto poles andzeros in the z-plane. Foranalogfilter

-----------------------------------------------------------------6.26
the correspondingdigitalfilter is

---------------------------------------------------------6.27
WhereT is thesampling interval. Thus each factorof theform (s-a) in Ha(s) is mapped into
Department of ECE, SCADEC

Page86

Principles of Digital Signal Processing


the factor (1- eaTz-1).

Department of ECE, SCADEC

Page87

Principles of Digital Signal Processing

Recommendedquestions with solution


Question 1

Department of ECE, SCADEC

Page88

Principles of Digital Signal Processing

Question 2

Question 3

Department of ECE, SCADEC

Page89

Principles of Digital Signal Processing


Question 4

Question 5

Department of ECE, SCADEC

Page90

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page91

Principles of Digital Signal Processing


Question 6

Department of ECE, SCADEC

Page92

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page91

Principles of Digital Signal Processing

Question 7

Department of ECE, SCADEC

Page92

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page93

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page94

Principles of Digital Signal Processing

UNIT III
FIRFILTERDESIGN
CONTENTS:1. INTRODUCTIONTOFIRFILTERS,
2.

DESIGNOFFIRFILTERSUSING

RECTANGULAR
HAMMING
BARTLET
KAISERWINDOWS,
3. FIRFILTERDESIGNUSINGFREQUENCYSAMPLINGTECHNIQUE

RECOMMENDEDREADINGS
4. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&
MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
5. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
6. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page95

Principles of Digital Signal Processing

DesignofFIR Filters
7.1 Introduction:
Two important classes ofdigital filters based on impulse response typeare
FiniteImpulseResponse(FIR)
InfiniteImpulse Response (IIR)

Thefilter can be expressed in two important forms as:


1 ) System function representation;
M

H(z) 

bz
1 az
k 0
N

k k

k 1

(1)
k

2) DifferenceEquation representation;
N

a y(nk)  b x(nk)
k 0

k
k 0

(2)

Eachofthisformallowsvariousmethodsofimplementation.Theeq(2)canbeviewed
asacomputationalprocedure(analgorithm)fordeterminingtheoutputsequencey(n)ofthe
systemfromtheinputsequencex(n).Differentrealizationsarepossiblewithdifferent arrangements
of eq(2)
Themajorissues considered while designingadigital filters are:

Realiability(causal or non causal)


Stability(filteroutput will not saturate)
Sharp CutoffCharacteristics
Order of thefilter need to beminimum (this leads to less delay)
Generalized procedure(havingsingle procedurefor all kinds of filters)
Linear phase characteristics

Department of ECE, SCADEC

Page96

Principles of Digital Signal Processing


Thefactors considered with filter implementation are,
a. It must beasimple design
b. There must bemodularityin theimplementation so that an yorder filtercan beobtained with
lower order modules.
c. Designsmustbeasgeneralaspossible.Havingdifferentdesignproceduresfordifferent types
offilters( high pass, low pass,) is cumbersome and complex.
d. Cost of implementation must be as low as possible
e. ThechoiceofSoftware/Hardware realization

7.2 Featuresof IIR:


Theimportant features of this class offilters can belisted as:

Out put is afunction ofpast o/p, present and past i/ps


It is recursivein nature
It has at least one Pole(in general poles and zeros)
Sharp cutoffchas. is achievable with minimum order
Difficult to havelinear phase chas over full rangeof freq.
Typical design procedureis analogdesign then conversion fromanalogto digital
7.3 Features of FIR :Themain features ofFIR filterare,
Theyareinherentl ystable
Filters with linear phasecharacteristics can bedesigned
Simple implementationboth recursiveand nonrecursivestructures possible
Freeof limit cycle oscillations when implemented on afinite-word length digital system

7.3.1 Disadvantages:
Sharp cutoff at thecost of higher order
Higher order leadingtomoredelay, morememoryand higher cost of implementation

Department of ECE, SCADEC

Page97

Principles of Digital Signal Processing

7.4 Importance of Linear Phase:


Thegroup delayis defined as
dT(Z)
Wg 
dZ
which is negativedifferential of phasefunction.
Nonlinearphaseresultsindifferentfrequenciesexperiencingdifferentdelayandarriving
atdifferenttimeatthereceiver.Thiscreatesproblemswithspeechprocessinganddata
communicationapplications.Havinglinearphaseensuresconstantgroupdela yforall frequencies.
Thefurther discussions arefocused on FIRfilter.
7.5 Examples of simpleFIR filteringoperations: 1.UnityGain Filter
y(n)=x(n)
2. Constant gain filter
y(n)=Kx(n)
3. Unit delayfilter
y(n)=x(n-1)
4.Two -termDifferencefilter
y(n) =x(n)-x(n-1)
5. Two-term averagefilter
y(n) =0.5(x(n)+x(n-1))
6. Three-term averagefilter (3-point moving averagefilter)
y(n) =1/3[x(n)+x(n-1)+x(n-2)]
7. Central Differencefilter
y(n)=1/2[x(n) x(n-2)]
WhenwesayOrderofthefilteritisthenumberofpreviousinputsusedtocomputethe
currentoutputandFiltercoefficientsarethenumbersassociatedwitheachofthetermsx(n),
etc
Thetablebelow shows order andfilter coefficients of abovesimple filtertypes:

Department of ECE, SCADEC

x(n-1),..

Page98

Principles of Digital Signal Processing

Ex.

order

a0

a1

a2

4(HP) 1

-1

5(LP) 1

1/2

1/2

6(LP) 2

1/3

1/3

1/3

7(HP) 2

1/2

-1/2

7.6 Designof FIRfilters:


ThesectiontofollowwilldiscussondesignofFIRfilter.Sincelinearphasecanbe achievedwith
FIR filterwewill discuss the conditions required to achievethis.
7.6.1 Symmetric and AntisymmetricFIR filtersgivingoutLinear Phasecharacteristics:
Symmetr yin filterimpulse response will ensurelinearphase
An FIR filter of length M with i/px(n)&o/py(n) is described b ythe differenceequation:
y(n)=b0x(n)+b1x(n-1)+.+b M-1x(n-(M-1))=

M1

b x(nk)
k 0

-(1)

Alternatively. it can be expressed in convolution form


M1

y(n)  h(k)x(nk)

-(2)

k 0

i.e bk=h(k), k=0,1,..M-1


Filteris also characterizedby

Department of ECE, SCADEC

Page99

Principles of Digital Signal Processing


M1

-(3)polynomialofdegreeM-1inthevariablez-1.Therootsofthis

H(z)  h(k)zk
k 0

polynomial constitutezeros ofthe filter.


An FIR filter has linear phaseif its unit sampleresponsesatisfies the condition
h(n)= h(M-1-n) n=0,1,.M-1
-(4)
Incorporatingthissymmetry&antisymmetryconditionin eq3wecanshowlinearphase chas ofFIR
filters
H(z) h(0)h(1)z1h(2)z2 ...........h(M2)z(M2) h(M1)z(M1)
IfM is odd
H(z) h(0)h(1)z1 ..........h(

M1

h(M2)z(M2 ) h(M1)z(M1)

z )
2

M1
(
)
2

M1
h( 2 )z

M1
(
)
2

M3 2
M
(
)
h( 3 )z
...........
2

M1
M3
1
1
3

(
)
(
)
M
M
M
1
2
............h(
)h(
)z h(
z
)z 2 .....h(M1)z
h(0) z 2 h(1) z
2
2
2

Applyingsymmetryconditions forM odd
M1
(
)
2

h(0) rh(M 1)


h(1) rh(M 2)
.
.

M 1)
2
M 1)
h(
2
.
.
h(

rh(

rh(

1
2 )
3
2 )

h(M 1) rh(0)

Department of EEE, SJBIT

Page100

M1
(
)
2





Principles of Digital Signal Processing


M1
(

M3

2
M1
(M12n )/2
2
h(
)
h(n){z
rz(M12n )/2}

2
n 0

similarly forMeven

H(z) z

H(z) z

M1
2
 h(n){z(M12n )/2 rz(M12n )/2}





M1
)
( 2




n 0

7.6.2 Frequency response:


If thesystem impulseresponse has symmetrypropert y(i.e.,h(n)=h(M-1-n))and M is odd
H(e ) ejT(Z ) |H r (ejZ)|where
jZ

jZ

( )
Hr e

 M1
(
)

M3
2

( )cosZ (

M1

)

2
 n
hn
h
n
0
2
2


M1
T(Z ) (
)Z
if|Hr (ejZ )|t0
2
M1
(
)ZS if|Hr (ejZ )|d0
2
Incaseof M even thephaseresponseremains thesame with magnituderesponse expressed as

 M1

2

1  n)
Hr(e jZ) 2 h(n)cos Z( M

2 

n 
0

Ifthe impulseresponse satisfies anti symmetryproperty(i.e., h(n)=-h(M-1-n))then for M


odd wewill have
M1
M1
M1
h(
) h(
)i.e.,h(
) 0
2
2
2
M3
 2


jZ
1  n) 
Hr (e ) 2 h(n)sinZ( M
2  

n 
0

IfM is even then,


Department of EEE, SJBIT

Page101

Principles of Digital Signal Processing


 M1

2
M1

jZ
Hr(e )  2 h(n )sinZ( 2  n)




n0

In both cases the phaseresponse is given by

T(Z) (
(

M1
2
M1
2

)ZS/2

if|Hr(e

jZ

)Z3S/2

if|Hr(e

jZ

)|t0

)|d0

Which clearl yshows presenceofLinearPhase characteristics.


7.6.3 Comments on filter coefficients:

Thenumberoffiltercoefficientsthatspecifythefrequencyresponseis(M+1)/2whenisM odd and


M/2 when M is even in caseof symmetric conditions
Incaseofimpulseresponseantisymmetricwehaveh(M-1/2)=0sothatthereare
filter coefficients whenM is odd and M/2 coefficients when M is even

(M-1/2)

7.6.5 ChoiceofSymmetric andantisymmetricunit sample response


Whenwehaveachoicebetweendifferentsymmetricproperties,t heparticularoneis
pickedupbasedonapplicationforwhichthefilterisused.Thefollowingpointsgivean insight to this
issue.
Ifh(n)=-h(M-1-n)andMisodd,Hr(w)impliesthatHr(0)=0&Hr()=0,consequentl ynot suited
forlowpass and highpassfilter. This condition is suited in Band Pass filter design.
Similarlyif M is even Hr(0)=0 hencenot usedfor low pass filter
Symmetryconditionh(n)=h(M-1-n)yieldsalinear-phaseFIRfilterwithnonzeroresponse at w =0
if desired.
Lookingat thesepoints, anti symmetricpropertiesarenotgenerall ypreferred.

Department of EEE, SJBIT

Page102

Principles of Digital Signal Processing


7.6.6 Zeros ofLinearPhaseFIRFilters:
Consider thefilter system function
M1

H(z)  h(n)z n
n o

Expandingthis equation
H(z) h(0)h(1)z 1h(2)z 2
since forLinear phaseweneed
i.e.,
h(n) h(M1n)

h(M2)z (M2)h(M1)z (M1)

h(0) h(M1);h(1) h(M2);......h(M1) h(0);


then
H(z) h(M1)h(M2)z 1........h(1)z (M2)h(0)z (M1)
H(z) z (M1)[h(M1)z (M1)h(M2)z (M2).....h(1)zh(0)]
M1

H(z) z

[ h(n)(z 1) n] z (M1)H(z 1)

(M1)

n 0

This shows that if z =z1is azero then z=z1-1is also azero


Thedifferent possibilities:
1. If z1=1 then z1=z1-1=1 is also a zero implyingitis one zero
2. Ifthe zero is real and|z|<1 then wehavepair of zeros
3. If zero is complexand|z|=1then and weagain havepair ofcomplexzeros.
4. If zero is complexand|z|1 then andwehavetwo pairs of complexzeros

Department of EEE, SJBIT

Page103

Principles of Digital Signal Processing


Theplotaboveshowsdistributionofzeros foraLinearphaseFIRfilter.Asitcanbeseen thereis pattern
in distribution ofthesezeros.
7.7 Methods ofdesigning FIR filters:
Thestandard methods ofdesigningFIR filter canbelisted as:
1. Fourier series based method
2. Window based method
3. Frequencysamplingmethod
7.7.1 DesignofLinearPhaseFIR filterbased on FourierSeriesmethod:
Motivation:SincethedesiredfreqresponseHd(ej)isaperiodicfunctioninwith period 2, it can
be expressed as Fourier series expansion
f

H d(ejZ )  hd( n)e jZn



n  f

where hd(n)
hd(n) 

are

S

H

2S S

fourierseries coefficients

(ejZ)ejZndZ

Thisexpansionresultsinimpulseresponsecoefficientswhichareinfiniteindurationandnon
causal.Itcanbemadefinitedurationb ytruncatingtheinfinitelength.Thelinearphase
obtainedbyintroducingsymmetricpropert yinthefilterimpulseresponse,i.e.,h(n)=h(-n).It
bemadecausal b yintroducingsufficient delay(depends on filter length)
7.7.2 Stepwise procedure:
1. From the desired freq responseusinginverseFT relation obtain hd(n)
2. Truncatetheinfinitelengthoftheimpulseresponsetofinitelengthwith
M odd)

canbe
can

(assuming

h(n) hd(n) for(M1)/2dnd(M1)/2


0 otherwise
3. Introduceh(n) =h(-n) forlinear phasecharacteristics
4. Writethe expression for H(z);this is non-causal realization
5. To obtain causal realization H(z) =z-(M-1)/2H(z)

Department of EEE, SJBIT

Page104

Principles of Digital Signal Processing

ExerciseProblems
Problem1 :Designan ideal bandpassfilterwith a frequency response:

S
3S
for  d Z d 
4
4
0
otherwise
Find thevalues ofh(n)for M =11 and plot the frequencyresponse.
H d(ejZ) 1

S

jZ jZn
Hd (e )e dZ
2S S
S/4
3S/4

1 
jZn
  e dZ ejZndZ 
2S 3S/4

SS/4
1 3S
 sin
nsin n fdndf
Sn 4
4 

tr uncatingto11sampleswehaveh(n) hd(n)for|n|d5
0 otherwise

hd(n) 

For n =0 thevalue ofh(n) is separatelyevaluatedfrom thebasic integration


h(0)=0.5
Other values of h(n)are evaluated from h(n)expression h(1)=h(-1)=0
h(2)=h(-2)=-0.3183
h(3)=h(-3)=0
h(4)=h(-4)=0
h(5)=h(-5)=0
Thetransfer function ofthe filteris

Department of EEE, SJBIT

Page105

Principles of Digital Signal Processing

H(z) h(0)

(N1)/2

[h(n){z z
n

n

n 1

}]

0.50.3183(z2 z2)
thetr ansfer functionof therealiz able filteris
H'(z) z5[0.50.3183(z2 z2)]
0.3183z30.5z50.3183z7
the filter coeff are
h '(0) h'(10) h' (1) h'(9) h'(2) h' (8) h'(4) h'(6) 0
h'(3) h'(7) 0.3183
h'(5) 0.5

Themagnituderesponsecan beexpressed as
(N1)/2

a(n)cosZn

jZ

|H(e )| 

n 1

comparingthisexpwith
5

|H(e )| |z [h(0)2 h(n)cosZn]|


jZ

5

n 1

Wehave
a(0)=h(0)
a(1)=2h(1)=0 a(2)=2h(2)=0.6366 a(3)=2h(3)=0
a(4)=2h(4)=0
a(5)=2h(5)=0
Themagnituderesponsefunction is
|H(ej)|=0.5 0.6366cos2 which can plotted forvarious values of in
degrees =[0 20 30 45 60 75 90 105 120 135 150 160 180];
|H(ej)|indBs=[-17.3-38.17-14.8-6.02-1.740.43461.110.4346-1.74-6.02-14.8-38.1717.3];

Department of EEE, SJBIT

Page106

Principles of Digital Signal Processing

Problem2:Design an ideal lowpassfilterwith afreq response


H d(ejZ ) 1
0

S
S
for  dZd 
2
2
S
for d Z dS
2

Find thevalues ofh(n)for N=11.Find H(z). Plot themagnituderesponse


From the freq responsewecan determinehd(n),
Sn
sin
S /2
1
jZn
hd(n) 
e dZ  2 fdndf and
2S S /2
Sn
Truncatinghd(n)to 11 samples

nz0

h(0)=1/2
h(1)=h(-1)=0.3183
h(2)=h(-2)=0
h(3)=h(-3)=-0.106
h(4)=h(-4)=0
h(5)=h(-5)=0.06366
Therealizable filtercanbeobtained b yshiftingh(n)by5 samples to right h(n)=h(n-5)
Department of EEE, SJBIT

Page107

Principles of Digital Signal Processing

h(n)=[0.06366, 0, -0.106, 0, 0.3183, 0.5, 0.3183, 0, -0.106, 0, 0.06366];


H'(z) 0.063660.106z20.3183z40.5z50.3183z60.106z80.06366z10
Usingthe result of magnitude response for M oddand symmetry
M3

2
M 1
M1
H (e ) [h(
) h(n)cosZ(
n)]
r
2
2
n 0
jZ
|H r (e )| |[0.50.6366cosw0.212cos3w0.127cos5w]|
jZ

Problem3 :
Designan ideal bandrejectfilter with afrequencyresponse:
H (ejZ) 1
d

0

S
2S
forZ d andZ t 
3
3
otherwise

Find thevalues ofh(n)for M =11 and plot the frequencyresponse


Ans:h(n)=[0 -0.1378 0 0.2757 0 0.667 0 0.2757 0

-0.1378 0];

7.8 Windowbased LinearPhaseFIR filterdesign


TheotherimportantmethodofdesigningFIRfilterisbymakinguseofwindows.The
arbitrarytruncationofimpulseresponseobtainedthroughinverseFourierrelationcanleadto
distortionsinthefinalfrequencyresponse.Thearbitrarytruncationisequivalenttomultiplying
infinite length function with finite length rectangular window, i.e.,
h(n) =hd(n)w(n)wherew(n)=1 forn=(M-1)/2
Theabovemultiplication in timedomain corresponds to convolution in freq domain, i.e.,
H(ej ) =Hd(ej) * W(ej ) whereW(ej ) is the FT ofwindow function w(n).
The FT of w(n)isgivenby
W(ejZ) 

sin(ZM/2)
sin(Z/2)

Department of EEE, SJBIT

Page108

Principles of Digital Signal Processing


Thewholeprocessofmultiplyingh(n)b yawindowfunctionanditseffectinfreqdomainare shown in
below set of figures.

Department of EEE, SJBIT

Page109

Principles of Digital Signal Processing

SupposethefiltertobedesignedisLowpassfilterthentheconvolutionofidealfilterfreq
responseandwindowfunctionfreqresponseresultsindistortionintheresultantfilterfreq
response.
Theideal sharpcutoffchars arelost andpresenceof ringingeffect is seen at theband edges whichis
referredto Gibbs Phenomena. This is dueto main lobewidth and sidelobes of
thewindowfunctionfreqresponse.Themainlobewidthintroducestransitionbandandside
lobesresultsinripplingcharactersinpassbandandstopband.Smallerthemainlobewidth
smallerwillbethetransitionband.Therippleswillbeoflowamplitudeifthepeakofthefirst side lobeis
far below themain lobe peak.
7.8.1 Howto reducethe distortions?
1. Increaselength of thewindow
-asMincreasesthemainlobwidthbecomesnarrower,hencethetransitionbandwidthis decreased
-Withincreaseinlengththesidelobewidthisdecreasedbutheightofeachsidelobe
increasesinsuchamannerthattheareaundereachsideloberemainsinvarianttochangesin
M. Thus ripples and ringingeffect in pass-bandand stop-band arenot changed.
2. Choosewindowswhichtapersoffslowlyratherthanendingabruptly-Slowtapering
reducesringingandripplesbutgenerall yincreasestransitionwidthsincemainlobewidth
thesekind of windowsarelarger.

of

7.8.2 What is idealwindowcharacteristics?


Windowhavingverysmallmainlobewidthwithmostoftheenergycontainedwithit
(i.e.,idealwindowfreqresponsemustbeimpulsive).Windowdesignisamathematical
problem,morecomplexthewindowlesserarethedistortions.Rectangularwindowisoneof
thesimplestwindowintermsofcomputationalcomplexity.Windowsbetterthanrectangular
windoware,Hamming,Hanning,Blackman,Bartlett,Traingular,Kaiser.Thedifferent
window
functions arediscussed in thefollowingsention.
7.8.3 Rectangular window: Themathematical description is given by,
wr(n) 1for0dndM1

Department of EEE, SJBIT

Page110

Principles of Digital Signal Processing

7.8.4 Hanning windows:


It is defined mathematicallyby,
w (n) 0.5(1cos 2Sn )for0dndM1
han
M1

7.8.5 Hamming windows:


This window function is given by,

ham

(n) 0.540.46cos

2Sn for0dndM1
M1

Department of ECE, SCADEC

Page111

Principles of Digital Signal Processing

7.8.6 Blackman windows:


This windowfunction is given by,
2Sn
4Sn
wb lk (n) 0.420.5cos
0.08cos
for0dndM1
M1
M1

7.8.7 Bartlett (Triangular) windows:


Themathematical description is given by,
2|n
wb a rt(n) 1

M1

2
M1

Department of ECE, SCADEC

|
for0dndM1

Page112

Principles of Digital Signal Processing

7.8.8 Kaiserwindows:Themathematical description is given by,




2
M
M

2 
1
n 1 
I0 D 
 2 
2 
 

 for0dndM1
w(n)

k
 M1 
I 0D

2




Type of window

Appr.Transition

Pe a k

width of the main lobe

sidelobe(dB)

Rectangular

4 / M

-13

Bartlett

8 / M

-27

Hanning

8 / M

-32

Hamming

8 / M

-43

Blackman

1 2 / M

-58

Lookingattheabovetableweobservefilterswhicharemathematicallysimpledonot
offerbestcharacteristics.AmongthewindowfunctionsdiscussedKaiseristhemostcomplex
Department of ECE, SCADEC

Page113

Principles of Digital Signal Processing


oneintermsoffunctionaldescriptionwhereasitistheonewhichoffersmaximumflexibility in
thedesign.
7.8.9 Procedurefordesigning linear-phaseFIR filters usingwindows:
1. Obtain hd(n)from thedesired freqresponse usinginverseFT relation
2. Truncate theinfinite length of theimpulse response to finitelength with
( assumingM odd)choosingproper window

h(n) hd(n)w(n) where


w(n)isthewindowfunctiondefined

for(M1)/2dnd(M1)/2

3.

Introduceh(n)=h(-n) for linear phase characteristics

4.

Writethe expression for H(z); this is non-causal realization

5.

To obtain causal realization H(z) =z-(M-1)/2H(z)

ExerciseProblems
Prob 1:Designan idealhighpassfilterwith afrequency response:
H d(ejZ) 1
0

S
for  d Z dS
4
S
|Z| 
4

usingahanning window with M =11 and plot the frequencyresponse.

Department of ECE, SCADEC

Page114

Principles of Digital Signal Processing


S /4
hd(n)  1 [ ejZndZ
2S S

h (n) 
d

[sinSnsin
Sn

Sn

]
4

for

fdndf

S

e

jZn

dZ ]

S /4

and

nz0

S
S /4
3
hd(0)  1 [  dZ  dZ]  0.75

2S S
4
S /4

hd(1)=hd(-1)=-0.225
hd(2)=hd(-2)=-0.159
hd(3)=hd(-3)=-0.075
hd(4)=hd(-4)=0
hd(5)=hd(-5) =0.045
Thehammingwindowfunction is given by
2Sn
M1
otherwise

w (n) 0.50.5cos
hn

0
for

N 11

wh n (n) 0.50.5cos

Sn
5

M1
M1
(
)dnd(
)
2
2

5dnd5

whn(0)=1
whn(1)= whn(-1)=0.9045
whn(2)= whn(-2)=0.655
whn(3)= whn(-3)=0.345
whn(4)= whn(-4)=0.0945
whn(5)= whn(-5)=0
h(n)=whn(n)hd(n)

Department of ECE, SCADEC

Page115

Principles of Digital Signal Processing


h(n)=[0 0 -0.026 -0.104 -0.204 0.75 -0.204 -0.104 -0.026 0 0]

h'(n) h(n5)
H'(z) 0.026z 2 0.104z3 0.204z 4 0.75z5 0.204z6 0.104z7 0.026z8
Usingtheequation
M1
H (e ) [h(
)2
r
2

M3
2

jw

H (ejw) 0.75)2


4

h(n)cosZ(

M1

n 0

n)

h(n)cosZ(5n)

n 0

Themagnitude responseis given by,


|Hr(ej)|=|0.75-0.408cos -0.208 cos2 -0.052cos3|

in degrees =[0 15 30 45 60 75 90 105 120 135 150 165 180]


|H(ej)|in dBs =[-21.72 -17.14 -10.67 -6.05 -3.07 -1.297 -0.3726
-0.0087 0.052 0.015 0 0 0.017]

Department of ECE, SCADEC

Page116

Principles of Digital Signal Processing

Prob2:Designafilterwithafrequencyresponse:
H d(ejZ) e j3Z
0

S
S
for  dZd 
4
4

 |Z|dS
4

usingaHanningwindow withM =7
Soln:
Thefreqresp is havingaterm ej(M-1)/2which gives h(n)symmetricalabout
n =M-1/2 = 3 i.ewegeta causal sequence.
hd(n) 

1 S/4
e j3ZejZndZ
2S S
/4

S
sin (n3)
4
S(n3)
thisgiveshd(0) hd(6) 0.075
hd(1) hd(5) 0.159
hd(2) hd(4) 0.22
hd(3) 0.25
TheHanningwindow function values aregiven by
whn(0)= whn(6)=0
whn(1)= whn(5)=0.25
whn(2)= whn(4)=0.75
whn(3)=1
h(n)=hd(n)whn(n)
h(n)=[0 0.03975 0.165 0.25 0.165 0.3975 0]

Department of ECE, SCADEC

Page117

Principles of Digital Signal Processing

6.9 DesignofLinearPhaseFIR filters using Frequency Sampling method:

6.9.1Motivation:WeknowthatDFTofafinitedurationDTsequenceisobtainedby
FTofthesequencethenDFTsamplescanbeusedinreconstructingoriginaltimedomain
samplesiffrequencydomainsamplingwasdonecorrectly.ThesamplesofFTofh(n)i.e.,H(k)
aresufficient to recoverh(n).

sampling

Sincethedesignedfilterhas
to
berealizablethenh(n)has
tobereal,
henceeven
symmetrypropertiesformagresponse|H(k)|andoddsymmetrypropertiesforphaseresponse
can
beapplied. Also, symmetryfor h(n) is applied toobtain linear phasechas.
Fro DFT relationship wehave
1 N1
h(n) 
H(k)ej2Skn/N
Nk 
0
N1

H(k)  h(n)e j2Skn/N

for
for

n 0,1,......N1
k 0,1,.........N1

n 0

Also weknow H(k) =H(z)|z=ej2kn/N


Thesystemfunction H(z) is given by
N1

H(z)  h(n)zn
n 0

Substitutingforh(n) fromIDFT relationship


H(z) 

1zN
N

N1

1e
k 0

H(k)
z

j2Skn/N 1

Department of ECE, SCADEC

Page118

Principles of Digital Signal Processing


SinceH(k)isobtainedbysamplingH(ej)hencethemethodiscalledFrequencySampling Technique.
Sincetheimpulseresponsesamplesorcoefficientsofthefilterhastoberealforfiltertobe
realizablewithsimplearithmeticoperations,propertiesofDFTofrealsequencecanbeused.
Thefollowingpropertiesof DFTforreal sequences areuseful:
H*(k) =H(N-k)
|H(k)|=|H(N-k)|-magnituderesponse is even
(k)=-(N-k) Phaseresponse is odd
h(n) 

1 N1
H(k)ej2Skn/N
Nk 
0
1

H(0)
N 

1
h(n)  H(0)
N 
h(n) 

can berewrittenas (forN odd)

N1

H(k)e

j2Skn/N

k 1
N1 /2

 H(k)e





j2Skn/N

k 1



N1

H(k)e

k N1 /2

j2Skn/N





Usingsubstitution k =N r orr = N-k in thesecond substitution with r


goingfrom now(N-1)/2to 1 as kgoes from 1 to (N-1)/2
h(n) 
h(n) 
h(n) 
h(n) 
h(n) 

(N1)/2
(N1)/2
1
j2Skn/N
j2Skn/N 
H(k)e

k)e
H(0)


H(N

N 
k 1
k 1

(N1)/2
(N1)/2
1
j2Skn/N
j2Skn/N 
 H *(k)e
H(0)  H(k)e


N 
k 1
k 1

(N1)/2
(N1)/2
1
j2Skn/N *
j2Skn/N 
H(k)e

) 
H(0)

(H(k)e

N 
k 1
k 1


(N1)/2

1
H(0) (H(k)ej2Skn/N (H(k)ej2Skn/N) *
k 1
N

(N1)/2
1
j2Skn/N
H(0)

2
R
e(H(k)e

N 
k 1



SimilarlyforN even we have


1
h(n)  H(0)2 (N1)/2

j2Skn/N
Re(H(k)e


N
k 1

Usingthesymmetr ypropertyh(n)=h(N-1-n)wecanobtainLinearphaseFIRfiltersusingthe
frequencysamplingtechnique.
Department of ECE, SCADEC

Page119

Principles of Digital Signal Processing

Exercise problems
Prob1:DesignaLPFIRfilterusingFreqsamplingtechniquehavingcutofffreqof/2 rad/sample.
Thefiltershouldhavelinearphaseand length of17.
Thedesiredresponsecanbe expressed as
jZ(

jZ

H d(e ) e

M1
2

for |Z|dZc

otherwise
M 17 and Zc S/2
0

with

H d(ejZ ) e jZ8

for

0

for S/2dZ dS

SelectingZ

H(k) Hd(e

H(k) e

jZ

)| Z

16Sk
17

0

for

for

k 0,1,. ...... 16

2Sk

17

2Sk S
d
17
2
2Sk
S/2d dS
17
17
for 0dkd
4
for

for

0
H(k) e

2Sk 2Sk

M
17

j2Sk8
17



0dZ dS/2

0d

17
17
dkd
4
2

Therangefor kcan beadjusted to be an integersuch as


0dkd4
and 5dkd8
Thefreqresponse isgiven by

Department of ECE, SCADEC

Page120

Principles of Digital Signal Processing


H(k) e
0

2Sk
j 8
17

for

for

0dkd4

5dkd8

Usingthesevalue of H(k) weobtain h(n) from the equation


1

(M1)/2

(H(0)2
Re(H(k)ej2Skn/ M))

M
k 1
4
i.e.,h(n)  1 (12 Re(e j16Sk/17 ej2Skn/17))

17
k 1
4
1
2Sk(8n)
)
h(n)  (H(0)2 cos(
for
17
17
k 1
h(n) 

x
x

n 0,1,. ........16

Eventhoughkvariesfrom0to16sinceweconsideredvaryingbetween0and/2 onlyk
valuesfrom 0 to 8 areconsidered
Whilefindingh(n)weobservesymmetr yinh(n)suchthatnvarying0to7and9to16 havesame
set of h(n)

7.10 DesignofFIR Differentiator


Differentiatorsarewidel yusedinDigitalandAnalogsystemswheneveraderivative
ofthesignalisneeded.Idealdifferentiatorhaspurelinearmagnituderesponseinthefreq rangeto +.
Thetypical frequencyresponse characteristics is as shown in thebelow figure.

Problem2:DesignanIdealDifferentiatorusinga)rectangularwindowandb)Hamming
windowwith length ofthe system= 7.
Department of ECE, SCADEC

Page121

Principles of Digital Signal Processing

Solution:
As seen from differentiator frequencychars.It is defined as
H(ej) =j
hd(n) 

between to +
S

jZe

jZn

dZ 

cosSn

fdndf

and

2S S
n
Thehd(n)is an add function with hd(n)=-hd(-n) andhd(0)=0

nz0

a) rectangular window
h(n)=hd(n)wr(n)
h(1)=-h(-1)=hd(1)=-1
h(2)=-h(-2)=hd(2)=0.5
h(3)=-h(-3)=hd(3)=-0.33
h(n)=h(n-3)forcausal system thus,
H'(z) 0.330.5z1z2z40.5z50.33z6
Also from the equation
H r(ejZ ) 2

(M3)/2

h(n)sinZ(

M1

n 0

n)

For M=7and h(n) as found aboveweobtain this as


H r(ejZ ) 0.66sin3Zsin2Z2sin Z
H(ejZ )  jHr (ejZ )  j(0.66sin3Zsin2Z2sinZ)

b) Hamming window
h(n)=hd(n)wh(n)
where wh(n)is given by
wh(n) 0.540.46cos

2Sn
(M1)

(M1)/2dnd(M1)/2

0 otherwise

Department of ECE, SCADEC

Page122

Principles of Digital Signal Processing


For thepresent problem
Sn
w(n) 0.540.46cos
3dnd3
h
3
Thewindow function coefficients are given byfor n=-3 to +3
Wh(n)=[0.08 0.31 0.77 1 0.77 0.31 0.08]
Thus h(n)=h(n-5)=[0.0267,-0.155, 0.77, 0, -0.77, 0.155, -0.0267]
Similar to the earlier case of rectangular window we can
differentiator as
H(ejZ )  jHr (ejZ )  j(0.0534sin3Z0.31sin2Z1.54sinZ)

write the freq response of

Weobserve
x Withrectangularwindow,theeffectofrippleismoreandtransitionbandwidthis small
compared with hammingwindow
x With hammingwindow, effect of rippleis less whereas transition band is more

Department of ECE, SCADEC

Page123

Principles of Digital Signal Processing


7.11 DesignofFIR Hilbert transformer:
Hilberttransformersare
usedto
obtainphaseshift
of90degree.Theyare
also
calledj
operators.Theyaretypicallyrequiredinquadraturesignalprocessing.TheHilberttransformer
isveryusefulwhenoutofphasecomponent(orimaginarypart)needtobegeneratedfrom available real
componentof thesignal.

Problem3:DesignanidealHilberttransformerusinga)rectangularwindowandb)
Windowwith M= 11

Blackman

Solution:
As seen fromfreqcharsit is defined as
H d(ejZ )  j

S dZd0
0dZdS

j

Theimpulse response isgiven by


S

(1cosSn)
[je dZ jejZndZ] 
2S S
Sn
0
At n =0 it is hd(0)=0 and hd(n) is an odd function
hd(n) 

jZn

fdndf except

n 0

a) Rectangular window
h(n)= hd(n)wr(n)=hd(n) for -5 n 5
h(n)=h(n-5)

Department of ECE, SCADEC

Page124

Principles of Digital Signal Processing


h(n)=[-0.127, 0, -0.212,0, -0.636, 0, 0.636, 0, 0.212, 0, 0.127]
4

H r(e ) 2 h(n)sinZ(5n)
jZ

n 0

jZ

H(e )  j|Hr (ejZ )|  j{0.254sin5Z0.424sin3Z1.272sinZ}


b) Blackman Window
window function is defined as
Sn
2Sn
w(n) 0.420.5cos 0.08cos
b
5
5
0
otherwise

5dnd5

Wb(n)=[0, 0.04, 0.2, 0.509,0.849,1,0.849, 0.509, 0.2, 0.04,0] for -5n5


h(n) =h(n-5)=[0, 0,-0.0424, 0, -0.5405, 0, 0.5405, 0, 0.0424, 0, 0]
H(ejZ) j[0.0848sin3Z1.0810sinZ]

Department of ECE, SCADEC

Page125

Principles of Digital Signal Processing

Recommendedquestions with solution


Question1

Solution:-

(b) Magnitudeplot

Department of ECE, SCADEC

Page126

Principles of Digital Signal Processing


Phaseplot

(c) Hamming window

(d) Bartlett window

Department of ECE, SCADEC

Page127

Principles of Digital Signal Processing

Question2

Solution:-

Department of ECE, SCADEC

Page128

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page129

Principles of Digital Signal Processing


Question3

Solution:-

Magnitudeand phase response

Department of ECE, SCADEC

Page130

Principles of Digital Signal Processing


Question4

Solu
tion:-

Department of ECE, SCADEC

Page131

Principles of Digital Signal Processing

UNIT 8
Realization ofDigital Filters
CONTENTS:1. IMPLEMENTATIONOFDISCRETE-TIMESYSTEMS
2. STRUCTURES FORIIRANDFIRSYSTEMS
3.

DIRECTFORMIANDDIRECTFORMIISYSTEMS,

4. CASCADE,LATTICEANDPARALLELREALIZATION.

RECOMMENDEDREADINGS:1. DIGITALSIGNALPROCESSING PRINCIPLESALGORITHMS& APPLICATIONS,PROAKIS&


MONALAKIS,PEARSONEDUCATION,4THEDITION,NEWDELHI,2007.
2. DISCRETETIMESIGNALPROCESSING,OPPENHEIM&SCHAFFER,PHI,2003.
3. DIGITALSIGNALPROCESSING,S.K.MITRA,TATAMC-GRAWHILL,2NDEDITION,2004.

Department of ECE, SCADEC

Page132

Principles of Digital Signal Processing

UNIT8REALIZATION
OFDIGITALFILTERS
8.1 Introduction

ThetwoimportantformsofexpressingsystemleadingtodifferentrealizationsofFIR&IIR filters are


a) Differenceequation form
N

k 1

k 1

y(n)  a ky(nk) bkx(nk)


b) Ration ofpolynomials
M

H(Z) 

bZ
k 0
N

k k

1 a k Z

k

k 1

Thefollowing factors influence choiceofaspecificrealization,


x Computational complexity
x Memoryrequirements
x Finite-word-length
x Pipeline / parallel processing

8.1.1 ComputationComplexity

Thisisdowithnumberofarithmeticoperationsi.e.multiplication,addition& divisions.If the


realization can have less of thesethen it will be less complexcomputationally.
Intherecentprocessorsthefetchtimefrommemory&
number
oftimesacomparisonbetween
twonumbersisperformedperoutputsampleisalsoconsideredandfoundtobeimportant
from
thepoint of view of computational complexity.

8.1.2 Memoryrequirements

Thisisbasicallynumberofmemorylocationsrequiredtostorethesystemparameters,
pastinputs,pastoutputs,andan yintermediatecomputedvalues.Anyrealizationrequiringless
theseis preferred.

of

8.1.3 Finite-word-lengtheffects

Theseeffects
referto
thequantizationeffects
thatareinherent
in
anydigital
implementationofthesystem,eitherinhardwareorinsoftware.Nocomputingsystemhas
infiniteprecision.Withfiniteprecisionthereisboundtobeerrors.Theseeffectsarebasicall y
todowithtruncation&rounding-offofsamples.Theextentofthiseffectvarieswithtypeof
arithmeticused(fixedorfloating).Theseriousissueisthattheeffectshaveinfluenceon
system
characteristics. Astructurewhich is less sensitive to this effect needto be chosen.

8.1.4 Pipeline/ParallelProcessing
Department of ECE, SCADEC

Page133

Principles of Digital Signal Processing


Thisistodowithsuitabilityofthestructureforpipelining&parallelprocessing.The
parallelprocessingcanbeinsoftwareorhardware.Longerpipeliningmakethesystemmore efficient.
8.2 StructureforFIR Systems:
FIR system is described by,
M1

y(n)  bkx(nk)
k 0

Orequivalently, the system function


M1

H(Z)  bZkk
k 0

Wherewecanidentifyh(n) 

0dndn1

0 otherwise
Different FIR Structuresused in practice are,
1. Direct form
2. Cascadeform
3. Frequency-samplingrealization
4. Latticerealization
8.2.1 DirectFormStructure
Convolution formulais used to express FIR system given by,
M1

y(n)  h(k) x(nk)


k 0

It is Non recursivein structure

AscanbeseenfromtheaboveimplementationitrequiresM-1memorylocationsfor storingthe
M-1 previousinputs
It requirescomputationallyM multiplications and M-1 additions per output point
It is morepopularl yreferred to as tapped delaylineor transversal system
Efficient structure with
linear phase characteristics are
possible where
h(n) rh(M1n)

x
x
x

Department of ECE, SCADEC

Page134

Principles of Digital Signal Processing

Prob:
Realizethe following systemfunction using minimumnumberofmultiplication
1 1 1 2 1 3 1 4 5
(1) H(Z) 1 Z  Z  Z  Z Z
3
4
4
3
11 11

1
1
Werecognizeh(n)  , , , , , 
3443
M is even =6, and weobserveh(n) =h(M-1-n) h(n)=h(5-n) i.e h(0)
=h(5)
h(1)=h(4)
h(2)=h(3)
Direct form structureforLinear phaseFIRcan berealized

Exercise: Realize the following using system function using minimum number of
multiplication.
1
1
1
1
1
1
H(Z) 1 Z1 Z2  Z3  Z5  Z6  Z7 Z8
4
3
2
2
3
4
1 1 1
111

1
1
m=9
h(n)  , , , , , , ,
 4 3 2 2 3 4
odd symmetry
h(n)=-h(M-1-n);
h(n)= -h(8-n);
h(m-1/2) =h(4) =0
h(0)=-h(8);
h(1)= -h(7); h(2)= -h(6); h(3)= -h(5)

Department of ECE, SCADEC

Page135

Principles of Digital Signal Processing

8.2.2Cascade FormStructure
Thesystemfunction H(Z)is factored into productof second orderFIR system
K

H(Z) Hk(Z)
k 1

Where Hk(Z) bk0 bk1 Z1b k2 Z2


k =1, 2, .. K
and K =integer part of (M+1) / 2
Thefilterparameterb0maybeequall ydistributedamongtheKfiltersection,suchthatb0
=b10b20.bk0 oritmaybeassignedtoasinglefiltersection.The zerosof H(z) aregrouped
inpairstoproducethesecondorderFIRsystem.Pairsofcomplex-conjugaterootsare
formed so that the coefficients {bki} arereal valued.

Department of ECE, SCADEC

Page136

Principles of Digital Signal Processing


IncaseoflinearphaseFIRfilter,thesymmetryinh(n)impliesthatthezerosofH(z)
alsoexhibitaformofsymmetry.Ifzkandzk*arepairofcomplexconjugatezerosthen
1/zkand1/zk*arealsoapaircomplexconjugatezeros.Thussimplifiedfourthorder sections are
formed. Thisis shown below,
Hk(z) C k0(1z kz

1

)(1z k *z

1

C k0 C k1 z C

k2

2

1

z C

)(1z1 /z k)(1z

k1

z z
3

1

/z k*)

4

Problem: Realizethe difference equation


y(n) x(n)0.25x(n1)0.5x(n2)0.75x(n3)x(n4)
in cascadeform.
Y(z) X(z){10.25z1 0.5z2 0.75z3 z4)
Soln:

H(z) 10.25z10.5z 2 0.75z_3 z4


H(z) (11.1219z11.2181z2)(11.3719z10.821z2)
H(z) H 1(z)H2(z)

8.3 Frequencysamplingrealization:
We can express system function H(z) in terms ofDFT samples H(k)whichis given by
N1
H(z) (1zN) 1  H(k)


Nk 0 1WN k 1
z
ThisformcanberealizedwithcascadeofFIRandIIRstructures.Theterm(1-z-N)isrealized
1N1 H(k)
as FIR and theterm
 k 1 asIIR structure.
N
k 0 1WN z
Department of ECE, SCADEC

Page137

Principles of Digital Signal Processing

Therealization ofthe abovefreq samplingform shows necessit yof complexarithmetic.


Incorporating symmetry in h(n) and symmetry properties of DFT of real sequences the
realization can bemodified to haveonl yreal coefficients.

8.4 Latticestructures
Latticestructures offer manyinterestingfeatures:
1. Upgradingfilterordersissimple.Onlyadditionalstagesneedtobeaddedinsteadof
redesigningthe whole filterand recalculatingthe filtercoefficients.
2. Thesefiltersarecomputationallyveryefficientthanotherfilterstructuresinafilter bank
applications (eg. Wavelet Transform)
3. Latticefilters areless sensitive to finite word length effects.
Consider
H(z) 

Y(z)

1 a m(i)z

i

X(z )
i 1
m is the order oftheFIRfilter and am(0)=1
when m = 1 Y(z)/ X(z) =1+a1(1)z-1
y(n)=x(n)+ a1(1)x(n-1)
f1(n) is known as upper channel output and r1(n)as lower channel output.

Department of ECE, SCADEC

Page138

Principles of Digital Signal Processing


f0(n)= r0(n)=x(n)

Theoutputs are
f1(n)  f 0(n)k1 r0(n1)
1a
r1(n) k1f 0(n)r0(n1)
1b
if k1 a1(1),then
f1(n)  y(n)
Ifm=2
Y(z)
1a 2 (1) z1a 2 (2)z2
X(z)
y(n) x(n)a 2(1)x(n1)a 2(2)x(n2)
y(n)  f 1(n)k 2r1(n1)
(2)
Substituting1a and 1b in(2)

y(n)  f 0(n)k1r0(n1)k 2[k1f 0(n1)r0(n2)]f 0(n)


 k1r0(n1)k 2k1f 0(n1)k 2r0(n2)]f 0(n) r0(n)
x(n)
since
y(n) x(n)k1x(n1)k 2k1x(n1)k 2x(n2) ]
x(n)(k1k1k 2)x(n1)k 2x(n2)
Werecognize
a 2(1) k1
k1 k 2a 2 (1) k 2
Solvingthe aboveequation we get
Department of ECE, SCADEC

Page139

Principles of Digital Signal Processing

a 2(1)
1a 2 (2)

k1

and

a (2)
2

(4)

Equation(3)meansthat,thelatticestructureforasecond-orderfilterissimplyacascadeof two firstorderfilters with k1 and k2 as defined in eq (4)

Similar to above, an Mth orderFIR filter can beimplemented bylatticestructures with


M stages

8.4.1DirectFormI tolattice structure


For m =M, M-1, ..2, 1 do
k m a m(m)
a m1

a m(m)a m (mi)


1k2m

1didm1

(i)
a

m

(i)
Department of ECE, SCADEC

Page140

Principles of Digital Signal Processing


x

Theaboveexpressionfailsifkm=1.Thisisanindicationthatthereisazeroontheunit
circle.Ifkm=1,factoroutthisrootfromA(z)andtherecursiveformulacanbeapplied
forreduced order system.

Department of ECE, SCADEC

Page141

Principles of Digital Signal Processing


form 2andm 1
k 2 a 2(2)

& k1 a1(1)

form 2&i 1
a1(1) 

a 2(1)a 2(2)a 2(1) a 2(1)[1a 2(2)] 



1k22
1a22(2)

Thus k1 

a 2(1)
1a 2(2)

a 2(1)
1a 2(2)

8.4.2Latticeto direct formI


For m =1,2,.M-1
a m(0) 1
a m(m) k m
a m(i) a m1(i)a m(m)a m1(mi)

1didm1

Problem:
Given FIR filter H(Z) 12Z11Z23
Givena1(1) 2,a2(2)  13Usingthe
recursive equation for m = M,
M-1, , 2, 1
hereM=2
thereforem = 2, 1
if m=2 k 2 a2(2)  13
ifm=1k1 a1(1)
also, when m=2 and i=1
2
a1(1)
a 2(1)1 
31 132
a 2(2)

Hencek1 a1(1) 32

Department of ECE, SCADEC

obtain latticestructure forthe same

Page142

Principles of Digital Signal Processing

Recommendedquestions with solution


Problem:1
ConsideranFIRlatticefilterwithco-efficients
filter
(H(Z) 

co-efficient
for
1
2
a(0)a(1)Z
a(2)Z
a
3
3

a3(0) 1

1
k  ,

the
3
3 (3)Z )

a3(3) k 3  1 4

1
1
k  , k  .DeterminetheFIR
3
4
2
2
3
direct
form
structure
a 2(2) k 2 
a(1) k 
1

form=2, i=1

1
3
1
2

a2(1) a1(1)a2(2)a1(1)
1 1 

 1
=a1(1)[1 a 2(2)]
2 3 
4 2
= 
6 3

form=3, i=1

a3(1) a2(1)a3(3)a2(2)
2 11
=  .
3 43
2 1 81
=  =
3 12 12
9 3
= 
12 4

form=3&i=2
a3(2) a2(2)a3(3)a2(1)
1 12
=  .
3 43
1 1 21
=  
3 6
6

Department of ECE, SCADEC

Page143

Principles of Digital Signal Processing


3 1
= 
6 2

a3(0) 1,

a3(1)

3
4

a3(2)

1
2

a3(3) 

1
4

8.5 StructuresforIIRFilters
The IIR filters arerepresented bysystem function;
M

H(Z) =

b z

k k

k 
0
N

1a k

zk

k 1

and correspondingdifferenceequationgiven by,


N

k 1

k 0

y(n)  a ky(nk) bkx(nk)


Differentrealizations for IIRfilters are,
1. Direct form-I
2. Direct form-II
3. Cascadeform
4. Parallel form
5. Latticeform

8.5.1Directform-I

Thisisastraightforwardimplementationofdifferenceequationwhichisverysimple.
TypicalDirectformIrealizationisshownbelow.Theupperbranchisforwardpathand
lowerbranchisfeedbackpath.Thenumberofdelaysdependsonpresenceofmostprevious input and
output samples in thedifferenceequation.

Department of ECE, SCADEC

Page144

Principles of Digital Signal Processing

8.5.2 Direct form-II


Thegiven transfer function H(z) can beexpressedas,
Y(z)
V(z) Y(z)

.
X(z) X(z) V(z)
where V(z) is an intermediate term. Weidentify,
H(z) 

V(z)
X(z)

1a kz

-------------------allpoles
k

k 1

Y(z)


1 bk zk
-------------------all zeros

V(z)  k 1
Thecorrespondingdifferenceequations are,
N

v(n) x(n) a kv(nk)


k 1
M

y(n) v(n) bkv(n1)


k 1

Department of ECE, SCADEC

Page145

Principles of Digital Signal Processing

ThisrealizationrequiresM+N+!multiplications,M+Nadditionandthemaximumof
{M, N} memorylocation

8.5.3 Cascade Form


Thetransfer function ofasystem can be expressedas,
H(z) H1(z)H2(z)....Hk(z)
Department of ECE, SCADEC

Page146

Principles of Digital Signal Processing

Where Hk(Z) couldbefirstorderorsecondordersectionrealizedinDirectformIIform


i.e.,
b b Z1b Z2
k0
k1
k2
H k(Z) 
1
1a k1 Z a k2 Z2
where K is theinteger part of(N+1)/2
SimilartoFIRcascaderealization,theparameterb0canbedistributedequally
amongthe
kfiltersectionB0thatb0=b10b20..bk0.Thesecondordersectionsarerequiredtorealize
sectionwhichhascomplex-conjugatepoleswithrealco-efficients.Pairingthetwocomplexconjugatepoleswithapairofcomplex-conjugatezerosorreal-valuedzerostoforma
subsystemofthetypeshownaboveisdonearbitrarily.Thereisnospecificruleusedinthe
combination.Althoughallcascaderealizationsareequivalentforinfiniteprecisionarithmetic,
the various realizations may differ significantly when implemented with finite precision
arithmetic.

8.5.4 Parallelformstructure
In theexpression oftransfer function, if NtMwe canexpress systemfunction
N
N
Akp

C

Hk (Z)
H(Z) C
1

k 11 kZ
k 1
Where{pk}arethepoles,{Ak}arethecoefficientsinthepartialfractionexpansion,andthe
constantCisdefinedasC bN a N ,Thesystemrealizationofabove formisshownbelow.

WhereH

(Z) 

bk0 bk1 Z1


1a k1 Z1a k2 Z2

Department of ECE, SCADEC

Page147

Principles of Digital Signal Processing


Onceagainchoiceofusingfirst-orderorsecond-ordersectionsdependsonpolesofthe denominator
polynomial.If there are complexset of poles whichare conjugativein naturethen asecond order
section is amust to havereal coefficients.
Problem2
Determinethe
(i)Directform-I
(ii) Direct form-II
(iii) Cascade&
(iv)Parallel formrealization ofthe system function
1 1
10 1
Z 1 32 Z1 12Z1 
2
1
1 Z 11Z 1 1  j1 Z1 1 1  j1 Z1 

H(Z) 

3 1

10 1 7 Z1  1 Z2 12Z1 


17Z16 3 Z2 3 1Z1  1 Z2 
8

H(Z) 

32

10 1 5 Z1 2Z2  2 Z3 


115Z147Z6 2 17Z3  3 3 Z4 
8

32

1

32

64

(14.7512.90z ) (24.5026.82z )
H(z) 

7
1
(1 z1 3z2)
(1z1 z2)
8
32
2

Department of ECE, SCADEC

1

Page148

Principles of Digital Signal Processing

CascadeForm
H(z) =H1(z) H2(z)
Where
7
1
1 z1  z2
6
3
H 1(z) 
17z1 3z2
8
32

H 1(z) 

10(12z1)
1
1z1  z2
2

Department of ECE, SCADEC

Page149

Principles of Digital Signal Processing


Parallel Form
H(z) =H1(z) +H2(z)
1

(14.7512.90z ) (24.5026.82z )
H(z) 

7
1
(1 z1 3z2)
(1z1 z2)
32
8
2

1

Problem:3
Obtain thedirect form I, direct form-II
Cascadeand parallel form realization for thefollowingsystem, y(n)=0.1y(n-1)+0.2y(n-2)+3x(n)+3.6 x(n-1)+0.6 x(n-2)
Solution:
TheDirectformrealizationisdonedirectl yfromthegiveni/po/pequation,showinbelow diagram

Direct form IIrealization


Taking ZT on both sidesand finding H(z)
Y(z)
H(z) 
X(z)

33.6z1 0.6z2
10.1z10.2z2

Department of ECE, SCADEC

Page150

Principles of Digital Signal Processing

Cascadeform realization
Thetransformer functioncan beexpressed as:
1

H(z) 

(30.6z )(1z )

1

(10.5z1)(10.4z1)
which can berewritten as
where H 1(z) 

30.6z1
1z1
a
n
d
H2(z) 
10.5z1
10.4z1

ParallelFormrealization
Thetransfer function canbe expressed as
H(z) =C + H1(z) +H2(z) where H1(z) &H2(z)is given by,
H(z) 3

7
1
10.4z1 10.5z1

Department of ECE, SCADEC

Page151

Principles of Digital Signal Processing

8.6 Lattice StructureforIIR System:


Consider an All-pole system with system function.
1

H(Z) 

1 a N (k)Z

k

1
AN(Z)

k 1

Thecorrespondingdifferenceequation for thisIIR system is,


N

y(n)  a N(k)y(nk)x(n)
OR

k 1

x(n)  y(n) a N(k)y(nk)


k 1

For N=1
x(n) y(n)a1(1)y(n1)
Which can realized as,

Weobserve

For N=2, then

x(n)  f1(n)
y(n)  f 0(n)  f1(n)k1g 0(n1)
x(n)k1y(n1)
g1(n) k1f 0(n)g 0(n1) k1y(n)y(n1)

k1 a1(1)

y(n) x(n)a2(1)y(n1)a2(2)y(n2)

Department of ECE, SCADEC

Page152

Principles of Digital Signal Processing


This output can beobtained from a two-stagelatticefilter as shown in below fig

f 2(n) x(n)
f1(n)  f 2(n)k 2g1(n1)
g 2(n) k 2f1(n)g1(n1)
f 0(n)  f1(n)k1g 0(n1)
g1(n) k1f 0(n)g 0(n1)
y(n)  f 0(n) g 0 (n)  f1(n)k1g 0(n1)

Similarly
Weobserve

 f2(n)k 2g1(n1)k1g 0(n1)


 f 2(n)k 2>k1f 0(n1)g 0(n2)@ k1g 0(n1)
x(n)k 2>k1y(n1)y(n2)@ k1y(n1)
x(n)k1(1k 2)y(n1)k 2y(n2)
g 2(n) k 2 y(n)k1(1k 2)y(n1)y(n2)

a2(0) 1;a2(1) k1(1k 2);a2(2) k 2


N-stageIIRfilterrealized in latticestructureis,

fN(n) x(n)
f m1(n)  f m(n)k mg m1(n1)
g m(n) k mf m1(n)g m1(n1)

Department of ECE, SCADEC

m=N, N-1,---1
m=N, N-1,---1
Page153

Principles of Digital Signal Processing


y(n)  f 0(n) g 0(n)
8.6.1 Conversion from latticestructureto direct form:
am(m) k m;
am(0) 1
am(k) am1(k)am(m)am1(mk)
Conversion from direct form to latticestructure
am1(0) 1

k m a m(m)

m(mk)
a m1 (k)  a m(k)a m(m)a
2
1a (m)
m

8.6.2 Lattice LadderStructure:


AgeneralIIRfiltercontainingbothpolesandzeroscanberealizedusinganallpole lattice as the
basic buildingblock.

If,

(k)Zk

H(Z)  BM(Z)  k 0N
k
AN(Z)
1 a N (k)Z
k 1

Where NtM
A lattice structure can be constructed b y first realizing an all-pole lattice co-efficients
k m, 1dmdN forthedenominatorAN(Z),andthenaddingaladderpartforM=N.The
output of theladder part can beexpressed as aweighted linear combination of {gm(n)}.
Nowthe output is givenby
M

y(n)  C mg m(n)
m 0

Where{Cm}arecalledtheladderco-efficientandcanbeobtainedusing therecursiverelation,
M

C m bm 

C a (im);

i m1

i i

Department of ECE, SCADEC

m=M, M-1, .0

Page154

Principles of Digital Signal Processing

Problem:4
Convert thefollowingpole-zeroIIR filter into alatticeladder structure,
12Z12Z2 Z3
H(Z)  1 13Z1 5Z 2 1Z3
24

24
13
24

Solution:
GivenbM (Z) 12Z12Z2Z3
And A (Z) 113Z15Z21Z3
N

a3(0) 1; a3(1)  ; a3(2)  8;


k 3 a3(3)  3 1
Usingtheequation

form=3,k=1

form=3,&k=2

a(1)a (3)a (2) 131 .5


3
3
a(21)  3
 2 4 3 28  3 8
2
1a 3(3)
1 13

a(1) k
1

a3(3)  3 1

m (mk)
a m1 (k )  a m(k)a m(m)a
1a2m(m)

a 2 (2) k 2

form=2,&k=1

3 12.143

119
1

a3(2)a3(3)a3(1)1
a2(3)
3

451 3

  7 2 8  1

a 2(1)a 2 (2)a 2 (1)


1a22(2)

Department of ECE, SCADEC

Page155

Principles of Digital Signal Processing


8

2 18.3

1(21) 2

8

for latticestructurek1  4,
For ladder structure

 31 6

114

 14

k 2  21,

k3  31

C m bm 

C .a (1m)

i m1

C3 b3 1;

M=3

i 2

>

C 2 b2 C3a3(1)

21.(24) 1.4583

C1 b1  c1 a1(im)

m=M, M-1,1,0

13

b13(2)

m=1

@

ca

(1)

c3
a
2> 1.4583 ( 3)5@ 0.8281
8

c0 b0  c1 a1(im)
i 1

b0 >c1 a1(1)c2a 2(2)c3a3(3)@


1>08281(1)1.4583(1)1@ 02695
4

To convert alattice-ladder form into adirect form, wefind an equation to obtain


a N(k) fromk m (m=1,2,N)thenequationforc m
is recursivel yusedtocomputebm
(m=0,1,2,M).

Department of ECE, SCADEC

Page156

Principles of Digital Signal Processing

Problem5

Department of ECE, SCADEC

Page157

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page158

Principles of Digital Signal Processing

Question 6

Consider aFIR filterwithsystemfunction:


H(z)= 1+2.82Z-1+3.4048z-2+1.74z- 3.Sketchthedirectformandlattice
realizationsofthe filter.

Department of ECE, SCADEC

Page159

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page160

Principles of Digital Signal Processing

Department of ECE, SCADEC

Page161

UNIT4FINITEWORDLENGTHEFFECTS
x

Thedigitalsignalprocessingalgorithmsisrealizedeitherwithspecialpurposehardwareorasprogram
sforgeneralpurposedigitalcomputer.
Inbothcases,thenumbersandcoefficientsarestoredinfinitelengthregisters.
Coefficients and numbers are quantized by truncation and rounding off when they arestored.
Errorsduetoquantization
o Inputquantizationerror(inA/Dconversionprocess)
o Productquantizationerror(inmultiplier)
o Coefficientquantizationerror(infilterdesign)

x
x
x

Numberrepresentation:
AnumberNisrepresentedbyfiniteseriesas
n2

i
N  cir
i n1

r=10fordecimalrepresentation
1

i
30.285  c10
i
i 3

-1

-2

=3x10 +0x10 +2x10 +8x10 +5x10

-3

r=2forbinaryrepresentation
110.010=1x22+1x21+0x20+0x2-1+1x2-2+0x2-3
=(6.25)10
1. Convertthedecimalnumber30.275tobinaryform.
Integer part

30
15
7
3
1

/
/
/
/
/

2
2
2
2
2

=
=
=
=
=

Remainder

15
7
3
1
0

0
1
1
1
1

Binary
number

Fractionalpart

0.275
0.55
0.1
0.2
0.4
0.8
0.6
0.2

x
x
x
x
x
x
x
x

(30.275)10= (11110.01000110)10

2
2
2
2
2
2
2
2

=
=
=
=
=
=
=
=

0.550
1.10
0.2
0.4
0.8
1.6
1.2
0.4

Integ
erpar
t
0
1
0
0
0
1
1
0

Binary
number

x
x
x

Fixedpointrepresentation
Floatingpointrepresentation
Blockfloatingpointrepresentation

Fixedpointrepresentation:
x Thepositionofthebinarypointisfixed
x Thenegativenumbersarerepresentedin
o Signmagnitudeform
o Onescomplementform
o Twoscomplementform
Signmagnitudeform:
Sign

x
x
x
x

Magnitude

MSBissetto1torepresentthenegativesign
Zerohastworepresentations
Withbbitsonly2b-1numberscanberepresented
Eg.
(1.75)10
=
(01.110000)2
(-1.75)10
=
(11.110000)2

Onescomplementform:
x Positivenumbersarerepresentedasinsignmagnitudeform
x Negativenumberisrepresentedbycomplementingallthebitsofthepositivenumber
=
x Eg.
(0.875)10
(0.111000)2
=
(-0.875)10
(1.000111)2onescomplementform
x Thesameisobtainedbysubtractingthemagnitudefrom2-2
b
,bisthenumberofbits(withoutsignbit)
-6
x Intheaboveexampleb=6therefore2-2 =10.0000000.000001=1.111111
x Nowfor(-0.875)10
1.111111
-0.111000
=1.000111(onescomplement)
x Alsothemagnitudeforthenegativenumberisgivenby
b

b
i
1 ci 2  2
i 1

For(-0.875)10 =(1.000111)2
=1(0x2-1+0x2-2+0x2-3+1x2-4+1x2-5+1x2-6) 2-6
=1(2-4+2-5+2-6)2-6
=(0.875)10

x Positivenumbersarerepresentedasinsignmagnitudeform
x Negativenumberisrepresentedintwoscomplementformofthepositivenumber
=
x Eg.
(0.875)10
(0.111000)2
=
(-0.875)10
(1.000111)2onescomplementform
=
+0.000001
+1
=
(1.001000)2twoscomplementform
x Thesameisobtainedbysubtractingthemagnitudefrom2
x Now for(-0.875)10
10.000000(2)
-0.111000(+0.875)
=1.001000(-0.875intwoscomplementform)
x Themagnitudeforthenegativenumberisgivenby
b

1ci2

i

i 1

For(-0.875)10 =(1.001000)2
=1(0x2-1+0x2-2+1x2-3+0x2-4+0x2-5+ 0x2-6)
=12-3
=(0.875)10

Additionoftwofixedpointnumbers:
x
x

x
x

Thetwonumbersareaddedbitbybitstartingfromright,withcarrybeingaddedtothenextbit.
Eg.,
(0.5)10 + (0.125)10
=
0.100
(0.5)10
=
+
0.001
+(0.125)10
=
0.101
=
(0.625)10
Whentwonumberofbbitsareaddedandthesumcannotberepresentedbybbitsanoverflowiss
aidtooccur.
Eg.,
(0.5)10 + (0.625)10
=
0.100
(0.5)10
=
+0.101
+(0.625)10
=1.125
=
1.001Butwhichis(-0.125)10insignmagnitude
Ingeneral,theadditionoffixedpointnumberscausesanoverflow

Subtractionoftwofixedpointnumbers:
x

(0.5)10 -(0.25)10
(0.5)10
=
-(0.25)10
=

0.100
0.010 =1.101(1S)+0.001 = +1.110(2S)
= 10.010
= 0.010(neglectcarry)=(0.25)10

(0.25)10 -(0.5)10
=
(0.25)10
=
-(0.5)10

0.010
0.100 =1.011(1S)+0.001 = +1.100(2S)
= 1.110(Nocarry,resultisnegative
take2scomplement)
= 0.001(1scomplement)
= +0.001(+1)
= 0.010(-0.25)10

Multiplicationinfixedpoint:
x Signandmagnitudecomponentsareseparated
x Themagnitudeofthenumbersaremultipliedthensignoftheproductisdeterminedandappliedtoresu
lt
x Withbbitmultiplicandandbbitmultipliertheproductmaycontain2bbits
x Ifb=bi +bf,wherebi representsintegerpartandbf
representsthefractionpartthentheproductmaycontain2bi+2bfbits
x Multiplicationofthetwofractionresultsin afractionandoverflowcanneveroccur
Floatingpointrepresentation:
x
x

ThenumberisrepresentedasF=2cM. whereMcalledmantissaisafractionsuchthat
dMd1andccalledexponentcanbeeitherpositiveornegative
=
=
Eg.,
2011x0.1001
(4.5)10
(100.1)2
001
=
=
2 x0.1100
(1.5)10
(1.1)2
=
=
2011x0.1101
(6.5)10
(110.1)2
04.625)10
=
(0.1010)2
=
2000x0.1010
Fornegativenumbersthesignofthefloatingpointnumberisobtainedfromthefirstbitofmantissa

Multiplication:
x

IfF1=2c1M1andF2=2c2M2thenF3=F1xF2=(M1xM2)2(c1+c2)

=
2001x0.1100
=
2001x0.1010
=
2001x0.1100x2001x0.1010
=
2(001+001)x(0.1100x0.1010)
=
2010x0.01111
Additionandsubtractionoftwofloatingpoint
numbersaremoredifficultthanadditionandsubtractionoftwofixedpointnumbers
Tocarryoutaddition,firstadjusttheexponentofthesmallernumberuntilitmatcheswiththeexponent
ofthelargernumber
Themantissaarethenaddedorsubtracted

x
x
x

Eg.,

(1.5)10
(1.25)10
(1.5)10x(1.25)10

Eg.,

(3)10 + (0.125)10
(3)10
=
(0.125)10
=

(3)10+(0.125)10

=
=

2010x0.110000
2000x0.001000

=2010x0.000010(adjusttheexponent
ofsmallernumber)
010
2 (0.110000+0.000010)
2010x0.110010

Comparisonoffixedpointandfloatingpointarithmetic:
Fixedpointarithmetic
Fastoperation
Relativelyeconomical
Smalldynamicrange
Roundofferrorsoccuronlyforad
dition
Overflowoccursinaddition
Usedinsmallcomputers

Floatingpointarithmetic
Slowoperation
Moreexpensivebecauseofhardware
Increaseddynamicrange
Roundofferrorscanoccurwithbothadd
itionandmultiplication
Overflowdostnotarise
Usedinlarger,generalpurposeco
mputers

Blockfloatingpointnumbers:
x
x
x
x
x

A compromise between fixed and floating point systems is the block floating pointarithmetic
Thesetofsignalstobehandledisdividedintoblocks
Eachblockhavethesamevalueofexponent
The arithmetic operations within the block uses fixed point arithmetic and only
oneexponentperblockisstored,thussavingmemory
SuitableforFFTflowgraphsanddigitalaudioapplications

x
x

Formostoftheengineeringapplicationstheinputsignaliscontinuousintimeoranalogwaveform.
ThissignalistobeconvertedintodigitalbyusingADC

X(t)

Sampler

X(n)

Quantizer

Xq(n)

ProcessofA/DConversion
x
x
x
x
x
x
x

First the signal x(t) is sampled at regular intervals t=nTwhere n=0,1,2.. to


createasequencex(n). Thisisdonebysampler.
Thennumericequivalentofeachsampleisexpressedbyafinitenumberofbitsgivingthesequencexq(n
).
Thedifferencesignale(n)=xq(n)-x(n)iscalledquantizationerrororA/Dconversionnoise
Assumeasinusoidalsignalvaryingbetween+1and-1havingdynamicrange2.
IfADCisusedtoconvertthesinusoidalsignalitemploys(b+1)bitsincludingsignbit.
Thenthenumberoflevelsavailableforquantizingx(n)is2b+1.
b
2
Thus the interval between successive levels
q  2 2 where qis known as
b1
isquantizationstepsize.
Thecommonmethodsofquantizationare
o Truncation
o Rounding

Truncation:
ItisaprocessofdiscardingallbitslesssignificantthanLSBthatisretained.
e.g.

0.00110011
1.01001001

=
=

0.0011(8bitsto4bits)
1.0100

Rounding:
Roundingofanumberofbbitsisaccomplishedbychoosingtheroundedresultasthebbitnumberclosest
totheoriginalnumberunrounded.
e.g.

0.11010
=
0.110111111 =
x

0.110or0.111
0.11011111or0.11100000

Roundingupordownwillhavenegligibleeffectonaccuracyofcomputation

Ifthequantizationmethodistruncation,thenumberisappropriatedbythenearestlevelthatdoesnote
xceedit.Inthiscase,theerrorxT-xisnegativeorzerowherexTistruncationvalueofx.
Theerrormadebytruncatinganumbertobbitsfollowingthebinarypointsatisfiestheinequality
0t xT-x>-2-b ---------------- 1
(0.12890625)10
=
(0.00100001)2

e.g.

Truncateto4bits

xT=(0.0010)2=(0.125)10

Nowtheerror(xT-x)=-0.00390625whichis>-2-b=-2-4=-0.0625satisfytheinequality
x

Equation1holdsgoodforsignmagnitude,onescomplementandtwoscomplementifx>0Byconsid

eringtwoscomplementrepresentationthemagnitudeofthenegativenumberis
b

i

x 1 ci2

 
i 1

IfwetruncatetoNbitsthen
xT ci2

1- 

i

i 1

Thechangeinmagnitude
b

xTx 1 c2 ii


i N

t0
x

Therefore,duetotruncationthechangeinthemagnitudeispositive,whichimpliedthaterrorisnegativ
eandsatisfytheinequality0txT-x>-2-b

For ones complement representation the magnitude of the negative number with b bits isgivenby
b

x 1  ci2 i  2 b
i 1

WhenthenumberistruncatedtoNbits,then
1-



xT ci2

N
i

 2 
N

i 1

Thechangeinmagnitudeduetotruncationis
N

xTx 1c2 ii (2 N 2 b)


i 1

0

T h e magnitudedecreaseswithtruncationwhichimpliestheerrorispositiveandsatisfytheinequality0dxT-x<2-b
x Theaboveequationholdsforsignmagnituderepresentationalso
c
InfloatingpointsystemstheeffectoftruncationisvisibleonlyinthemantissaIfx=2 Mt
c

henxT=2 MT
Errore=xT-x=2c(MT-M)
x

Withtwoscomplementrepresentationofmantissawehave
0tMT X!2

b

0te!2b2 c -----------------2

x x e
LetsdefinerelativeerrorH  T

x
x
x Theequation2becomes
0tHx!2 b2c
Or
0tH2 cM!2 b2 c
Or
0tHM!2 b
x IfM=1/2therelativeerrorismaximum. Therefore,0tH !22 b
x IfM=-1/2therelativeerrorrangeis0dH 22 b
x

Inonescomplementrepresentation,theerrorfortruncationofthevaluesofthemantissais
b

0tMT X!2
0te!2 b2 c
Withe=Hx=H2cMandM=1/2wegetthemaximumrangeoftherelativeerrorforpositivemantissais
0tH !22 b
Fornegativemantissa,valb
ueoferroris
Or

0dMT X2
0de2 c2 b

WithM=-1/2themaximumrangeoftherelativeerrornegativemantissais
0tH !22 b,whichissameaspositivemantissa.

tT h e p r o b a b i l i t y densityfunctionforp(e)fortruncationoffixedpointandfloatingpointnumbersare
FixedPoint
P(e)

P(e)

2b
2b/2

-2-b

-2-b

2scomplement

2-b

1scomplement&S
ignmagnitude
FloatingPoint

P(H)

P(H)
2b/2

2b/4

-2x2-b

2x2-b

H

-2x2-b

2scomplement

H

1scomplement&S
ignmagnitude

Infixedpointarithmetictheerrorduetoroundinganumbertobbitsproducesanerrore=xRxwhichsatisfiestheinequality
2 b
2 b
dx R xd
----------3
2
2
This is because with rounding, if the value lies half way between two levels, it can be
approximatedeithernearesthigherlevelornearestlowerlevel.Theaboveequationsatisfiedregardlessofwh
ether signmagnitude, 1scomplementor2scomplementisusedfornegativenumbers.
Infloatingpointarithmetic,onlymantissaisaffectedbyquantization
Ifx=2cMandxR=2cMRthenerrore=xR-x=2c(MR-M). Butforrounding
 2  dM Md 2
R
2
b2 b
b
c2
c 2
dx R  xd2
2
2
2
b

b

dHxd2
2
2
b
b
 2 c 2 dH2cMd2 c 2
2
2
b
b
2
 2 dHMd
2
2
2

Themantissasatisfy<M<1.IfM=1/2wegetthemaximumrangeofrelativeerror
2 b dH d2 b
Theprobabilitydensityfunctionforroundingisasfollows
P(e)

P(H)

2b
2b/2

-2-b/2

2-b/2

-2-b

Floatingpoint

Fixedpoint

2-b

H

Inputquantizationerror:
x

Thequantizationerrorariseswhenacontinuoussignalisconvertedintodigitalvalue.

Thequantizationerrorisgivenby
e(n)=xq(n)x(n)
wherexq(n)
=sampledquantizedvaluex(n)=sam
pledunquantizedvalue

Dependinguponthewayinwhichx(n)isquantizedthedistributionsofquantizationnoisewilldiffer.Ifr
oundingofanumberisusedtogetxq(n)thentheerrorsignalsatisfiestherelation
q/2 de(n)dq/2

x
x

Becausethequantizedsignalmaybegreaterorlessthanactualsignal
Eg.,
letx(n)=(0.7)10=(0.10110011)2
Afterroundingx(n)to3bits
xq(n)=(0.110)2=(0.75)10
Nowtheerrore(n)=0.750.7=0.05whichsatisfiestheinequality

P(e)

xq(n
)

1/q

2q
q
-q/2
q/2

3q/2 5q/2

x(n
)

-q/2

q/2

Probabilitydensityfunction(roundoff
error)

Quantizercharacter istics(rounding)

Theothertypeofquantizationcanbeobtainedbytruncation.
Intruncation,thesignalisrepresentedbythehighestquantizationlevelthatisnotgreaterthanthesign
al
In twos complement truncation, the error e(n) is always negative and satisfied theinequality
-qde(n)0
P(H)

xq(n)

1/q
2q
q
-q
q

2q

3q

x(n
)

-q

H

Probabilitydensityfunction(truncation
error)

Quantizercharacteristics(2scomplementtruncation)

The quantization error mean value is zero for rounding and q/2 for 2s complementtruncation

I.ncodmig1it2alofpr1o9c.essingof analog signals the quantization error is commonly viewed as anadditivenoisesignal


i.e.
xq(n) x(n)e(n)
Quantizationnoisemodel
x(t)

Sampler

x(t)

Sampler

x(n)=x(nT)

x(n)=x(nT)

Quantizer

xq(n)

xq(n)= x(n)+e(n)

e(n)

Therefore,theA/Dconverteroutputisthesumoftheinputsignalx(n)andtheerrorsignale(n)

Iftheroundingisusedforquantizationthenthequantizationerrore(n)=xq(n)x(n)isboundedby
q/2de(n)dq/2.Inmostcases,assumethatA/Dconversionerrore(n)has thefollowingproperties
x Theerrorsequencee(n)isasamplesequenceofastationaryrandomprocess
x Theerrorsequenceisuncorrelatedwithx(n)andothersignalsinthesystem
x Theerrorisawhitenoiseprocesswithuniformamplitudeprobabilitydistributionovertherangeof
quantizationerror
Incaseofroundingthee(n)liesbetween
q/2andq/2withequalprobability.Thevarianceofe(n)isgivenby

Ve2 E[e 2(n)]E2[e(n)]


2

Where E[e 2(n)]istheaverageofe (n)


E[e(n)]ismeanvalueofe(n)
f

V  e 2(n)p(e)de(0) 2
2
e

f
q

2
Ve2  e 2(n) 1 de
q
q

2

Ve2 

12

e

qq

(n)de


2
q

3
V2  1e (n)2
e


q 3 q
2

Ve2

1q 3 q 3
 
q 24 24 

.3

Ve
subq 2

24q

b

12

b 2

Ve 2 
Ve 2 

12

2
12

2b

Incaseoftwoscomplementtruncationthee(n)liesbetween0andqhavingmeanvalueofq/2.
Thevarianceorpoweroftheerrorsignale(n)isgivenby
0

Ve2  e 2(n)p(e)de(  q) 2
2
q
0
1
 q 2
  
Ve 2  e 2(n) de 

q

2

1e3(n)
q2


q 33 q 4
1

V

2
e

V2  q  q
e
Ve2

4
q 3
2
2
2
4
3
q q  q
12
12

subq 2 b

Ve2 

12
2b
2
Ve2 
12
x

Inbothcasesthevalueof V2 
duetoinputquantization.

2
e

2b

12

,whichisalsoknownasthesteadystatenoisepower

Iftheinputsignalisx(n)anditsvarianceisV2thentheratioo
fsignalpowertonoisepowerwhichisknown
x
assignaltonoiseratioforroundingis

Vx2
Vx2

12(2 2b Vx2)
Ve2 2 2b / 12

inalogscaleSNRindB
=10 log

10

V2
Ve2

=10log 12(22bV2)
x

10

=10log101210log10 2 2b 10log 10 Vx2)


=10.7310x2bxlog10

210log10 Vx2)

2
=10.796.02b10log V
10

x
x

FromtheaboveequationitisknownthattheSNRincreasesapproximately6dBforeachbitaddedtothe
registerlength
IftheinputsignalisAx(n)insteadofx(n)where0A1,thenthevarianceis
A2Vx2.Hence
2

SNR

=10log10

AVx

Ve2

=10.86b10log10Vx 20log10 A
1
If A 
then
4Vx
SNR

=10.86b10log10Vx 20log10 A
=10.86b10log V120 1x 0log A2 10
2
10.86b10log V 10log
=
10 x
10

=10.86b10log V120 x10log 2 10


2
=
10.86b10log10Vx 10log102
=6b1.24dB
x ThustoobtainSNRt80dBrequiredb=14bits.

1
16V2x
4
4

V2x
10log10Vx

2

.
LIMITCYCLEOSCILLATIONS
Zeroinputlimitcycleoscillations:
WhenastableIIRfilterisexcitedbyafiniteinputsequence,thatisconstant,theoutputwillideallydecay
tozero.However,thenon-linearitiesduetothefiniteprecisionarithmeticoperationsoftencauseperiodicoscillationsintherecursivesystemsarecalledzeroinputli
mitcycleoscillations.
ConsiderafirstorderIIRfilterwithdifferenceequation
y(n) x(n)Dy(n1)
LetsassumeD=andthedataregisterlengthis3bitsplusasignbit.Iftheinputis
0.875 forn 0,
x(n)  
androundingisappliedafterthearithmeticoperation. HereQ[]
.
otherwise
0
representstheroundingoperations.
n

x(n)

y(n-1)

Dy(n-1)

Q[Dy(n-1)]

y(n) x(n)Q[Dy(n1)]

0.875

0.000

7/8

7/8

7/16

0.100

1/2

1/2

1/4

0.010

1/4

1/4

1/8

0.001

1/8

1/8

1/16

0.001

1/8

1/8

1/16

0.001

1/8

7/8

1/2
1/4
1/8

1/8

1/8

Fromtheabovetableitisfoundthatfornt 3theoutputremainsconstantandgives1/8assteadyoutputc
ausinglimitcyclebehavior.
Roundavalueintheabovetable:7/1
6

0.4375x
0.875 x

0.4375
2
2

=
=

0.875
1.75

0. 7 5 x 2

=
x
2
=
=
(0.4375)10
Afterroundingto3bits
=
(0.100)2
=
(0.5)10

1.5
1.1
(0.0111)2

0.5

LetsassumeD=-1/2
n

x(n)

y(n-1)

Dy(n-1)

Q[Dy(n-1)]

y(n) x(n)Q[Dy(n1)]

0.875

0.000

7/8

7/8

-7/16

1.100

-1/2

-1/2

1/4

0.010

1/4

1/4

-1/8

1.001

-1/8

-1/8

1/16

0.001

1/8

1/8

-1/16

1.001

-1/8

-1/8

1/16

0.001

1/8

WhenD=-1/2theoutputoscillatesbetween0.125to-0.125
Deadband:
x Thelimitcycleoccurasaresultofquantizationeffectsinthemultiplications
x Theamplitudesoftheoutputduringalimitcycleareconfinedtoarangeofvaluesthatiscalledthedeadb
andofthefilter
LetsconsiderasinglepoleIIRsystemwhosedifferenceequationisgivenby

y(n) Dy(n1)x(n)

n!0

Afterroundingtheproductterm
yq(n) Q[Dy(n1)]x(n)
Duringthelimitcycleoscillations
 y(n1)
Q[Dy(n1)]
y(n1)
Bydefinitionofrounding
|Q[Dy(n1)]Dy(n1)|d
|y(n1)Dy(n1)|d

forD !0
forD 0
2 b
2

2 b
2

b
|y(n1)[1D]|d 2
2
b
2
/2
y(n1)d
1|D |
Theaboveequationdefinesthedeadbandforthegivenfirstorderfilter.

Overflowlimitcycleoscillations:
x

x
x

Inadditiontolimitcycleoscillationscausedbyroundingtheresultofmultiplications,thereareseveralt
ypesofoscillationscausedbyaddition,whichmakesthefilteroutputoscillatesbetweenmaximumand
minimumamplitudessuchlimitcycleshavereferredtoasoverflowoscillations.
Anoverflowinadditionoftwoormorebinarynumbersoccurswhenthesumexceedsthe
wordsizeavailableinthedigitalimplementationofthesystem.
Letsconsidertwopositivenumbern1andn2
=
n1
(7/8)10 =
(0.111)2
=
n2
(6/8)10 =
(0.110)2
n1+n2 =
(1.101)2
(5/8insignmagnitude,but
actualtotalis13/8)
In the above example, when two positive numbers are added the sum is
wronglyinterruptedasanegativenumber
f(n)
1

-1

Transfercharacteristicsofanadder

Theoverflowoccursifthetotalinputisoutofrange,thisproblemcanbeeliminatedbymodifyingadderc
haracteristics
f(n)
1

n
-1

Saturationaddertransfercharacteristics

Whenanoverflowisdetected,thesumofadderissetequaltothemaximumvalue

SIGNALSCALING
x
x

Thesaturationarithmeticeliminateslimitcyclesduetooverflow,butitcausesundesirablesignaldistor
tionduetothenonlinearityoftheclipper.
Inordertolimittheamountofnon-lineardistortion,itisimportanttoscaletheinputsignal
andtheunitsampleresponsebetweentheinputandanyinternalsummingnodeinthesystemsuchthat
overflowbecomesarareevent.
LetsconsiderasecondorderIIRfilter. AscalefactorS0isintroducedbetweentheinputx(n)
andtheadder1,topreventoverflowattheoutputofadder1.
H(z)
x(n)

w(n)

S0

b0

y(n)

Z-1
b1

-a1

Z-1
-a2

b2

RealizationofsecondorderIIRfilter

Nowtheoverallinputoutputtransferfunctionis
1
2
0b 1bz bz2
H(z)
S 0
1az1az2
1

N(z)
S 0
D(z)

S0
W(z) 
X(z)
1az1az2

H'(z)
x

S
 0
D(z)

Iftheinstantaneousenergyintheoutputsequencew(n)islessthanthefiniteenergyintheinputsequen
cethen,therewillnotbeanyoverflow


W(z)

S 0X(z)
D(z)

SS(z)D(z)

whereS(z)

Wehave
w(n) 

S0

S(e T )X(e T )(e T )dT2


j

S

jn

Whichgives
w 2(n)

S0
4S2

S(e

jT

)X(ejT )(ejnT )dT

1
D(z)

u s in g S w ar tz i n
e s u ali ty n
2 1
w2(n)dS
0

2S 2S

x(n)

S(e ) dT

ApplyingParsavelstheor
em
f
w2(n)dS

jT

n 0

 1
2S 2S

X(ejT ) d2T 


2

 1
S(e jT) dT ------------------------ 1

2S2S


Weknow
z ejT
DifferentiatewithrespecttoT
dz  jejT

dT
dz  jejTdT
dT 

dz j
ejT

dz
 ------------------------------2
jz

Substituteequation2inequation1
f
1

2
2
S(z) z1dz 
w2(n) dS x 2(n) 

0
n 0
2Sjc

f




1
2
1 1
dS x 2(n) 
S(z)S(z
)z
dz



0
n 0
2Sjc 

f
1
2

w2(n) dx 2(n)whenS 0
S(z)S(z1)z1dz  1
n 0
2Sjc

Therefore,S



1
1

 S(z)S(z
2Sj

1

1
z1dz

1

2Sjc D(z)D( z )

Where I 

1
I

z1dz

2Sjc D(z)D( z )

1

)z1dz

UNIT5MULTIRATESIGNALPROCESSING
Thereisarequirementtoprocessthevarioussignalsatdifferentsamplingratee.g.,Teletype,Facsimile
,speechandvideo,etc.,Thediscretetimesystemsthatprocessdataatmorethanonesamplingrateareknowna
smultiratesystems.
Example:
x Highqualitydataacquisitionandstorage
x Audioandvideosignalprocessing
x
x
x

Speechprocessing
NarrowbandfilteringforECG/EEG
Transmultiplexers

Samplingrateconversioncanbedoneini)analogdomainandii)digitaldomain.
InanalogdomainusingDACthesignalisconvertedintoanalogandthenfilteringisapplied.Thentheanalogsig
nalisconvertedbacktodigitalusingADC.Indigitaldomainallprocessingisdonewithsignalindigitalform.
Inthefirstmethod,thenewsamplingratedoesnthaveanyrelationshipwitholdsamplingrate.Butmaj
ordisadvantageisthesignaldistortion.Sothedigitaldomainsamplingrateconversionispreferredeventhenth
enewsamplingratedependsontheoldsamplingrate.
Thetwobasicoperationsinmultiratesignalprocessingaredecimationandinterpolation.Decimationr
educesthatsamplingrate,whereasinterpolationincreasesthesamplingrate.
Downsampling:
Thesamplingrateofadiscretetimesignalx(n)anbereducedbyafactorMbytakingeveryMthvalueofthe
signal.

x(n)

pM

y(n)=x(Mn)

Adownsampler
Theoutputsignaly(n)isadownsampledsignaloftheinputsignalx(n)andcanberepresent
edby
y(n)=x(Mn)
Example:
x(n)={1,-1, 2,4,0,3,2,1,5,.}
ifM=2
y(n)={1,2, 0,2,5,.}

Department of ECE, SCADEC.

Page|1

Upsampling:
ThesamplingrateofadiscretetimesignalcanbeincreasedbyafactorLbyplacingL1equallyspacedzerosbetweeneachpairofsamples.Mathematically,upsamplingisrepresentedby

x
 n 0,rL,r2L......
n
y(n)  L 
0
otherwise

Example:
x(n)={1,2, 4,-2,3,2,1,..}
ifL=2
y(n)=x(n/2)={1,0, 2,0,4, 0,-2,0,3,0,2, 0,1,..}
Inpractice,thezerovaluedsamplesinsertedbyupsamplerarereplacedwithappropriatenonzerovaluesusingsometypeffilteringprocess. Thisprocessiscalledinterpolation.
PolyphasestructureofDecimator:
ThetransferfunctionH(z)ofthepolyphaseFIRfilterisdecomposedintoMbranchesgivenby
M1

H(z)  zmp
m 0

(zM)

N1
m

Where p m(z)  h(Mnm)zn


n 0

TheZtransformofaninfinitesequenceisgivenby
f

H(z)  h(n)zn
n f

InthiscaseH(z)anbedecomposedintoM-branchesas
M1

H(z)  zmp
m 0

f

(zM)

Where pm(z)  h(rMm)z

r

r f

M1 f

H(z)  zmh(rMm)zrM
m 0r f

Department of ECE, SCADEC

Page|2

M1 f

H(z)  h(rMm)z( rMm)


m 0r f

leth( Mnm) p m(r)


M1 f

H(z )  p m (r)z (rMm)


m 0r f

M1 f

Y(z )  pm (r)X (z)z (rMm)


m 0r f

M1 f

y(n)  pm(r)x[n( rMm)]


m 0r f

letxm(r) x( rMm)


M1 f

y(n)  p m (r)xm(nr)


m 0r f

M1

y(n)  pm(n)*xm(n)
m 0

M1

y(n)  ym(n)
m 0

Where y m(n) pm(n)*xm(n)


The operation

pm(n)*xm(n)is known as polyphaseconvolution, and the overall process is

polyphasefiltering.xm(n)isobtainedfirstdelayingx(n)byMunits thendownsamplingbyafactorM.
Nextym(n)canbeobtainedbyconvolvingxm(n)withpm(n).

x(n)

pM

x0(n)

P0(n)

x1(n)

P1(n)

x2(n)

P2(n)

y(n)

Z-1
pM
Z-1
pM

Polyphasestructureofa3branchdecimator

Department of ECE, SCADEC

Page|3

x(n)

pM

x0(n)

P0(n)

x1(n)

P1(n)

x2(n)

P2(n)

y(n)

Z-1
pM
Z-1
pM

pM

xM-1(n)

PM-1(n)

PolyphasestructureofaMbranchdecimator
Thesplittingofx(n)intothelowratesub
sequence
x0(n),x1(n)..xM-1(n)
is
oftenrepresentedbyacommutator.Theinputvaluesx(n)enterthedelaychainathighrate.ThentheMdownsa
mplersendsthegroupofMinputvaluestoMfiltersattimen=mM.

x0(n)

m=0
RateFx
x(n)

x1(n)

P0(n)

P1(n)

P2(n)

m=1
m=2

x2(n)

m=M-1

xM-1(n)

y(n)
RateFy=Fx/M

PM-1(n)

Polyphasedecimatorwithacommutator

Department of ECE, SCADEC

Page|4

Toproducetheoutputy(0),thecommutatormustrotateincounterclockwisedirectionstartingfromm=M-1m=2,m=1,m=0andgivetheinputvaluesx(-M+1)..x(-2),x(1),x(0)tothefilterspM-1(n).p2(n),p1(n),p0(n).
PolyphasestructureofInterpolator:
Bytransposingthedecimatorstructure,wecanobtainthepolyphasestructureforinterpolator,which
consistsofasetofLsubfiltersconnectedinparallel.

y(n)
0

x(n)

nL

P0(n)

y(n)

Z-1

y1(n)
nL

P1(n)

+
Z-1

y2(n)
nL

P2(n)

+
Z-1

PM-1(n)

yM-1(n)

nL

PolyphasestructureofaMbranchInterpolator
HerethepolyphasecomponentsofimpulseresponsearegivebyPm(n)=
h(nL+m)
m=0,1, 2L1
Whereh(n)istheimpulseresponseofanti-imagingfilter.
TheoutputofLsubfilterscanberepresentedas
y m(n) x(n)p m(n)
m 0,1,2........L1
ByupsamplingwithafactorLandaddingadelayzm

thepolyphasecomponentsareproducedfromym(n).Thesepolyphasecomponentsarealladdedtogetherto
producetheoutputsignaly(n)

Department of ECE, SCADEC

Page|5

Theoutputy(n)alsocanbeobtainedbycombiningthesignalsxm(n)usingacommutatorasshownbelo
w

x(n)

P0(n)

P1(n)

y0(n)

m=0

y1(n)
m=1

P2(n)

y(n)

m=2m=

y2(n)

M-1

PL-1(n)

yL-1(n)

Polyphaseinterpolatorwithacommutator
Multistageimplementationofsamplingrateconversion:
IfthedecimationfactorMand/orinterpolationfactorLare
muchlargerthanunity,theimplementationofsamplingrateconversioninasinglestageiscomputationallyinef
ficient.Thereforeforperformingsamplingrateconversionforeither
M>>1and/orL>>1themultistageimplementationispreferred.
IftheinterpolationfactorL>>1,thenexpressLintoaproductofpositiveintegersas
N

L Li
i 1

TheneachinterpolatorLi isimplementedandcascadedtogetNstagesofinterpolationandfiltering.

x(n)
Fx

L Fx
h(1n) 1

nL1

nL

h(2n)

L1L2Fx

nL

y(n)

hN(n)

Fy=LFx

SimilarlyifthedecimationfactorM>>1thenexpressMintoaproductofpositiveintegersas
N

M  Mi
i 1

Department of ECE, SCADEC

Page|6

EachdecimatorMiisimplementedandcascadedtogetNstagesoffilteringanddecimators.
x(n)
Fx

Fx/M1
h(n)
1

pM1

h(2n)

pM2

Fx/M1M2

h(Nn)

y(n)

pMN

Fy=Fx/M

ImplementationofnarrowbandLPF:
AnarrowbandLPFischaracterizedbyanarrowpassbandandanarrowtransitionband.Itrequiresavery
largenumberofcoefficients.DuetohighvalueofNitissusceptibletofinitewordlengtheffects.Inadditionthen
umberofcomputationsandmemorylocationsrequiredareveryhigh.
SomultirateapproachofdesigningLPFovercomesthisproblem.

x(n)
F

F/M

LPF
h1(n)

pM

nM

LPF
h2(n)

y(n)
F

Intheabovediagram,theinterpolatoranddecimatorareincascade.Thefiltersh1(n)andh2(n)inthedec
imatorandinterpolatorarelowpassfilters.Thesamplingfrequencyoftheinputsequenceisfirstreducedbyafa
ctorMthenlowpassfilteringisperformed.Finallytheoriginalsamplingfrequencyofthefiltereddataisobtaine
dusinginterpolator.
To
meetthedesiredspecificationsofa
narrowband
thefiltersh1(n)andh2(n)areidentical,withpassbandrippleGp/2andstopbandrippleGs.

LPF,

Filterbank:
x Analysisfilterbank
x Synthesisfilterbank
Analysisfilterbank:

X(z)

Department of ECE, SCADEC

H0(z)

pM

U0(z)

H1(z)

pM

U1(z)

H2(z)

pM

U2(z)

HM-1(z)

pM

UM-1(z)
Page|7

x
x
x
x
x
x

ItconsistsofMsub-filters. Theindividualsub-filterHk(z)isknownasanalysisbank.
Allthesub-filtersareequallyspacedinfrequencyandeachhavethesamebandwidth.
jZ
ThespectrumoftheinputsignalX(e )liesintherange0dZdS.
Thefilterbanksplitsthesignalintonumberofsubbandseachhavingabandwidthof
S/M.
ThefilterH0(z)islowpass,H1(z)toHM-2(z)arebandpassandHM-1(z)ishighpass.
AsthespectrumofsignalisbandlimitedtoS/M,thesamplingratecanbereducedbyafactorM.The
downsamplingmovesallthesubbandsignalsintothebasebandrange0dZdS/2.

Analysisfilterbank:

U0(z)

nM

G0(z)

U1(z)

nM

G1(z)

U2(z)

nM

G2(z)

UM-1(z)

nM

GM-1(z)

X(z)

TheMchannelsynthesisfilterbankisdualofMchannelanalysisfilterbank.
InthiscaseUm(z)isfedtoanupsampler. TheupsamplingprocessproducesthesignalUm(zM). Thesesignalsare


X(z).ThefiltersG0(z)to
GM-1(z)havethesamecharacteristicsastheanalysisfiltersH0(z)toHM-1(z).
appliedtofiltersGm(z)andfinallyaddedtogettheoutputsignal

Subbandcodingfilterbank:
IfwecombinetheanalysisfilterbandandsynthesisfilterbandweobtainanMchannelsubbandcodingfilterbank.

Department of ECE, SCADEC

Page|8

X(z)

H0(z)

pM

nM

G0(z)

H1(z)

pM

nM

G1(z)

H2(z)

pM

nM

G2(z)

HM-1(z)

pM

nM

GM-1(z)

X(z)

The analysis filter band splits the broadband input signal x(n) into M non-overlappingfrequency
bandsignals X0(z),X1(z)XM-1(z) of equal bandwidth. These outputs are coded and
transmitted. The synthesisfilter bank is used to reconstruct output signal

X(z)which should

approximatetheoriginalsignal. Ithasapplicationinspeechsignalprocessing.
QuadratureMirrorFilter(QMF)Bank:

H0(z)

V0(z)

p2

U0(z)

n2

V0(z)

G0(z)

X(z)

H1(z)

V1(z)

p2

U1(z)

n2

V1(z)

Y(z)

G1(z)

Itisatwo-channelsubbandcodingfilterbankwithcomplementaryfrequencyresponses.
Itconsistsoftwosections
1. Analysissection
2. Synthesissection

Department of ECE, SCADEC

Page|9

AnalysisSection:
x
x

Theanalysissectionisatwochannelanalysisfilterbank
Thesignalx(n)isfedtoaLPFH0(z)andaHPFH1(z)simultaneously.
Hencetheinputsignalx(n)isdecomposedintohighfrequencycomponentandlowfrequencycompon
ent

SincethenormalizedfrequencyrangeisZ =0andZ=S,thecutofffrequencyofHPFandLPFarechosen
asS/2.

1.0

|H0(ejZ)|

|H1(ejZ)|

S/2

Z

Theoutputoflowpassandhighpassfiltersare
V0(z ) X(Z)H0(z)
and
1
V1(z)  X(Z)H1(z)
DownsamplingwithM=2,yieldsthesubbandsignals
1
1
1
U (z)  [V(z2)V(z2)
and
0

2
1
U(z)  [V(z2)V(z2)
1

.2

2
Substituteequation1inequation2
1

1
(z2)X(z2)H 0
U (z)  [X(z2)H0
0
2
1
1
1
1
U1(z)  [X(z2)H(z2)X(z2)H(z2)
Inmatrixform

1
1


U0 (z)  1 H0(z2)


1
U1(z) 2
H1(z2)

Department of ECE, SCADEC

(z2)and
1

1
1



H0(z2 ) X(z2 ).3
1
1

2
2
H1(z ) X(z )

Page|10

H0(z)

H1(z)

Lowpass

Highpass
Z

S

S/2

V0(z)

S/2

S

S/2

S

S/2

S

Z

U0(z)

Z

V1(z)

Z

U1(z)

S/2

S

Z

Frequencyresponsecharacteristicsofsignals
Department of ECE, SCADEC

Page|11

x(n)isawhitenoiseinputsignal.ThefrequencyspectraofV0(z)havetwocomponentsoneistheoriginals
pectrumthatdepends onX(z1/2)liesinthebasebandandtheotherisperiodicrepetitionthatisfunctionofX(z1/2
).ThehighpasssignalU1(z)dropsintothebaseband0dZd Sandisreversedinfrequency.Sincethefilteredsi
gnalsarenotproperlybandlimitedtoS,aliassignalsappearinbaseband.
Synthesissection:
ThesignalsU0(z)andU1(z)arefedtothesynthesisfilterbank.HerethesignalsU0(z)andU1(z)areupsamp
ledandthenpassedthroughtwofiltersG0(z)andG1(z)respectively.ThefilterG0(z)is
alowpassfilterandeliminates
the
imagespectrumofU0(z)inthe
range
S/2d Z d S.MeanwhilethehighpassfilterG1(z)eliminatesmostoftheimagespectraintherange0dZdS/
2.AsthefrequencyrangeofthetwosignalsU0(z)andU1(z)overlap,theimagespectraisnotcompletelyeliminat
ed.
Thereconstructedoutputofthefilterbankis

Y(z) G0(z)V0(z ) G1(z)V1(z)


Y(z ) G(z)U
0

(z2)G(z)U(z2).4
1

Where

2
V0(z) U0 (z )


V(z) U(z2)
1

Equation4canbewritteninmatrixformas

U ( z 2 
Y(z) >G(z) G(z)@ 0 )
0
1

2 
)
U1(z 
Fromequation3

1 H0(z)
2 H1(z)

U0( z2 ) H0(z)
 X(z)


2 
H
U1(
z
)

1(z)

X(z)

1 H (z) H (z) X(z)


0
Y(z) >G0(z) G1(z)@  0


2 H 1(z) H 1(z ) X(z ) 
1
1
Y(z)  [G(z)H
(z)G(z)H(z)]X(z) [G(z)H
0

2
Y(z) T(z)X(z)A(z)X(z)5

Department of ECE, SCADEC

(z)G(z)H(z)]X(z)
0

Page|12

Where

1
T(z)  [G(z)H

(z)G(z)H(z )]

12
A(z)  [G(z)H
2

(z)G(z)H(z )]
1

ThefunctionT(z)describesthetransferfunctionofthefilterandiscalleddistortiontransferfunction.
ThefunctionA(z)isduetoaliasingcomponents.
Aliasfreefilterbank:
Toobtainanaliasfreefilterbank,wecanchoosethesynthesisfiltersuchthatA(z)=0.
1
i.e., A(z)  [G(z)H
0

(z)G(z)H(z )] 0
0

2
G0(z)H0(z)G1(z)H1(z) 0

Asimplesufficientconditionforaliascancellationis
G0(z)  H1(z)
and
G1(z) H 0(z)
Thenequation5becomes
Y(z) T(z)X(z)
jZ

Substituting z e

yields

jZ

Y(e ) T(ejZ)X(ejZ)
|T(ejZ)|ejT(Z)X(ejZ)
jZ

If|T(e )|isconstantforallZ,thereisnoamplitudedistortion. Thisconditionissatisfiedwhen

T(ejZ)isanallpassfilter.Insameway,if T(ejZ)
conditionissatisfiedwhen T(Z ) DZE

havelinearphasethereisnophasedistortion. This
jZ

forconstantD andE. Therefore T(e )

needtobealinear

phaseallpassfiltertoavoidanymagnitudeorphasedistortion.
If an alias free QMF bank has no amplitude and phase distortion then it is called a
perfectreconstruction(PR)QMFbank.Insuchacase

Y(z) kz lX(z)andtheoutputy(n)=kx(n-l).


i.e.,thereconstructedoutputofaPRQMFbankisascaled,delayedreplicaoftheoutput.

Department of ECE, SCADEC

Page|13

You might also like