DSP Lecture Notes
DSP Lecture Notes
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.
Page1
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
1.2
Consideranaperiodicdiscretetimesignalx(n)withFouriertransform,anaperiodicfinite energysignal
hascontinuous spectra.For anaperiodicsignal x[n]the spectrum is:
X>w@
f
x>n@e
n f
jwn
(1.1)
Page2
2S
asshown
N
below in Fig.1.1.
X[w]
w
0
2S
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:
Page3
N1 f
x>nlN@ej2Skn/N
N
for k 0,1,2,......,(N1).(1.3)
n 0 l f
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)
2S
X k
N N
k 0,1,.......,(N1).(1.5)
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:
Page4
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
-jn
X (j) =x(n)
n= -
jn
X (n) =1/2 X (j)e
d, Where 2k/n2
Department of ECE, SCADEC
Page5
-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
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
Page6
Where{ck}aretheFouriercoefficients.Ifwesamplexa(t)atauniformrateFs=N/Tp=1/T, weobtain
discretetime sequence
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
Page8
RecommendedQuestionswithsolutions
Page9
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
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:-
Page11
Question 7
Solution
Page12
Question 8
Solution
Page13
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.
Page14
PropertiesofDFT
Properties:TheDFT andIDFTforan N-point sequencex(n)are given as
Periodicity:-
1.2 Linearity:
If
Page15
versionx(n-
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:
Page16
Page17
For a complexsequence
DFT(x*(n))= X*(N-K)
Ifx(n)
then
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
Page18
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.
Page19
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
SincethedatarecordisofthelengthN,thefirstM-1pointsofYm(n)arecorruptedby
aliasingandmustbediscarded.ThelastLpointsofYm(n)areexactlythesameastheresult from linear
convolution and as a consequencewe get
Page21
Page22
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))
Page23
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.
Page24
Solution(a)
Solution(b)
Solution(c)
Solution(d)
Page25
Question5
Solution
Question6
Solution
Page26
Page27
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.
Page28
FAST-FOURIER-TRANSFORM (FFT)ALGORITHMS
3.1 DirectComputationof DFT
Theproblem:
Given signal samples: x[0],...,x[N -1](someof which maybezero),develop aprocedure tocompute
Wewouldliketheproceduretobefast,simple,andaccurate.Fastisthemostimportant,sowewill
sacrificesimplicityfor speed, hopefullywithminimal lossof accuracy
hasbeenprecompiledandstoredina
isperiodicinmwithperiodN, so wejust
Foreachvalueofk,thereareNcomplexmultiplications,and(N-1)complexadditions.There areN
values ofk, so thetotalnumberof complexoperations is
Page29
Complexmultipliesrequire4realmultipliesand2realadditions,whereascomplexadditions
requirejust 2 real additions N2complexmultipliesarethe primaryconcern.
N2increasesrapidlywithN,sohowcanwereducetheamountofcomputation?Byexploiting the
followingpropertiesof W:
stimulated
theproblem
intotwosmallerproblems.
knownas
Thesecond
concept,knownasrecursion,appliesthisdivide-and-conquermethodrepeatedlyuntilthe problem is
solved.
Page30
RecommendedQuestionswithsolutions
Question1
Solution:-
Question 2
Solution:-
Page31
Question 3
Solution:-
Question 4
Page32
(b)
Page33
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.
Page34
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
Page35
N=8-pointdecimation-in-timeFFfalgorithm
Stage1
Stage2
Stage3
X[O]
X[l]
X[2]
X [ 3]
X[4]
X[5]
X[6]
X [ 7]
Page36
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
Page37
Page38
computationprocedure
canberepeatedthroughdecimationoftheN/2-pointDFTs,
X(2k)andX(2k+1).Theentireprocessinvolvesv=log2Nofdecimation,whereeachstage
involves
Page39
Thisisknownastouch-tone/speed/electronicdialing,pressingofeachbuttongeneratesa
uniquesetoftwo-tonesignals,calledDTMFsignals.Thesesignalsareprocessedatexchange
toidentifythenumberpressedbydeterminingthetwoassociatedtonefrequencies.Seven frequencies
areused to codethe 10 decimal digits and two special characters (4x3 array)
Page40
is
X(k ) x(n)WnNk
(1)
n 0
Since
WN kN
()
kN N1
( )
Xk
WN xmWN
mk
m 0
N1 ( )
xmWN
k(Nm)
(2)
m 0
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)
Page41
(n1)x(n)
y k(1) 0
(7)
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)
vk(1) vk(2) 0
(9)
(10)
Page42
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,
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:
seethatthespacing
betweenthefrequencysamplesis
/512or2/1024.Inordertoachievethisfreqresolutionwetake1024-pointFFTof
Department of ECE, SCADEC
Page43
Page44
k 0,1,......L1
(11)
n 0
Wherezkisageneralizedcontour.Zkisthesetofpointsinthez-planefallingonanarcwhich
beginsatsomepointz0andspiralseitherintowardtheoriginoroutawayfromtheoriginsuch
that
th e
k 0,1,....L1
(12)
Page45
Page46
N1
x(n)z nk
n 0
where
N1
x(n)(r0e
jT 0
) nW n k
(13)
n 0
W Re0jI0
(14)
(15)
k 0,1,..........L1
(16)
Where
2
h(n) Wn /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
Page48
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.
Page49
Thefirsttwospectracorrespondtospiralcontoursoutsidetheunitcirclewitharesulting
broadeningof the resonancepeaks
Thelasttwochoicescorrespondtospiralcontourswhichspiralsinsidetheunitcircleand close to
thepole locations resultingin a sharpeningofresonancepeaks.
Page50
cosineandsinesequencesinh(n)
neededforpre
multiplicationandpostmultiplicationare
Page51
RecommendedQuestionswithsolutions
Question 1
Solution:-
Page52
Question2
Figure4.1DIFAlgorithmforN=16
Department of ECE, SCADEC
Page53
Solution:-
Question4
Solution:-
Page54
Solution:-
Question6
Solution:-
This can be viewed as the convolution of the N-length sequence x(n) with implulse
responseofa linearfilter
Page55
Page56
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.
Page57
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.
Page58
example,thespecificationsoftentaketheform
of
Manyofthefiltersusedinpracticearespecifiedbysuchatolerancescheme,withno
constraintsonthephaseresponseotherthanthoseimposedbystabilityandcausality
requirements;i.e.,thepolesofthesystemfunctionmustlieinsidetheunitcircle.Givenaset
ofspecificationsintheformofFig.5.1,thenextstepistoandadiscretetimelinearsystem
whosefrequencyresponsefallswithintheprescribedtolerances.Atthispointthefilterdesign
problembecomesaprobleminapproximation.Inthecaseofinfiniteimpulseresponse(IIR)
filters,
5.1 DesignofIIRFiltersfromAnalogFilters:
Page59
approach
because:
Theartofanalogfilterdesignishighlyadvancedandsinceusefulresultscanbe
achieved,itisadvantageoustoutilizethedesignproceduresalread ydevelopedfor
analogfilters.
Manyusefulanalogdesignmethodshaverelativelysimpleclosed-formdesign formulas.
Therefore,digitalfilterdesignmethodsbasedonanalogdesignformulasarerathersimpleto implement.
An analogsystem can bedescribed b ythe differential equation
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.
Page60
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
Where,Nistheorderofthefilter,cisthe-3dBfrequency,i.e.,cutofffrequency,pisthe
passbandedgefrequencyand1=(1/1+2)isthebandedgevalueofHa()2.Sincethe
product
Page61
design
Wherebydefinition,2=1/1+2.ThustheButterworthfilteriscompletely
characterizedb ytheparametersN,2,andtheratios/porc.Then,fromEq.(5.31)find
the
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
Page62
Andminor axis
Page63
Where, bydefinition2=1/1+2.
Finally, theTypeIChebyshevfilter is given by
ATypeIIChebyshevfiltercontainszeroaswellaspoles.Themagnitudesquaredresponseis givenas
Where
Department of ECE, SCADEC
Page64
and
Theotherapproximationtechniquesareelliptic(equirippleinbothpassbandand
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
Page65
Thus weobtain
Thefilter function is
Page66
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
Solution:a)ImpulseInvariant Technique
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
Page68
b)
Page69
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
Page70
Page71
Page72
Solution:Forthedesignspecifications wehave
Page73
Question4
Solution:-
Page74
IMPULSEINVARIANCEMETHOD
3. MAPPINGOFTRANSFERFUNCTIONS
4. APPROXIMATION
OF
DERIVATIVE
(BACKWARD
DIFFERENCE
AND
BILINEARTRANSFORMATION)METHOD,MATCHEDZTRANSFORMS
5. VERIFICATIONFORSTABILITYANDLINEARITYDURINGMAPPING
Page75
DESIGNOFIIRFILTERSFROM ANALOGFILTERS
(BUTTERWORTH ANDCHEBYSHEV)
6 . 1 I n tr o d u c ti o n
Page76
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.
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
Page77
---------------------------------------------------------6.2
Thecorrespondingdescription fordigital filters has the form
--------------------------------------------------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
Page79
------------------------------------------------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
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
Page81
------------------------------------------------------------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
------------------------------------------------------6.19
Whichcorrespondstoacirclewhosecenterisatz=1/2andradiusis1/2,asshowninFig.6.4.
Itiseasil yverifiedthatthelefthalfoftheS-planemapsintotheinsideofthesmallcircleand
therighthalfoftheS-planemapsontotheoutsideofthesmallcircle.Therefore,althoughthe
requirementofmappingthej-axistotheunitcircleisnotsatisfied,thismappingdoessatisfy
stabilitycondition.
th e
Page82
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
Page83
----------------------6.21
However, from Eq. (7.20),
--------------------------------------------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
----------------------------------------------------------------------------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
Page85
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
Page87
Page88
Question 2
Question 3
Page89
Question 5
Page90
Page91
Page92
Page91
Question 7
Page92
Page93
Page94
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.
Page95
DesignofFIR Filters
7.1 Introduction:
Two important classes ofdigital filters based on impulse response typeare
FiniteImpulseResponse(FIR)
InfiniteImpulse Response (IIR)
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:
Page96
7.3.1 Disadvantages:
Sharp cutoff at thecost of higher order
Higher order leadingtomoredelay, morememoryand higher cost of implementation
Page97
x(n-1),..
Page98
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
M1
b x(nk)
k 0
-(1)
y(n) h(k)x(nk)
-(2)
k 0
Page99
-(3)polynomialofdegreeM-1inthevariablez-1.Therootsofthis
H(z) h(k)zk
k 0
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
M 1)
2
M 1)
h(
2
.
.
h(
rh(
rh(
1
2 )
3
2 )
Page100
M1
(
)
2
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
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
jZ
1 n)
Hr (e ) 2 h(n)sinZ( M
2
n
0
Page101
jZ
Hr(e ) 2 h(n )sinZ( 2 n)
n0
T(Z) (
(
M1
2
M1
2
)ZS/2
if|Hr(e
jZ
)Z3S/2
if|Hr(e
jZ
)|t0
)|d0
(M-1/2)
Page102
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(z) z
(M1)
n 0
Page103
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
Page104
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)
Page105
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
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];
Page106
S
S
for dZd
2
2
S
for d Z dS
2
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
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
-0.1378 0];
sin(ZM/2)
sin(Z/2)
Page108
Page109
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
Page110
ham
(n) 0.540.46cos
2Sn for0dndM1
M1
Page111
M1
2
M1
|
for0dndM1
Page112
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
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
for(M1)/2dnd(M1)/2
3.
4.
5.
ExerciseProblems
Prob 1:Designan idealhighpassfilterwith afrequency response:
H d(ejZ) 1
0
S
for d Z dS
4
S
|Z|
4
Page114
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)
Page115
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
Page116
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]
Page117
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
for
for
n 0,1,......N1
k 0,1,.........N1
n 0
H(z) h(n)zn
n 0
1zN
N
N1
1e
k 0
H(k)
z
j2Skn/N 1
Page118
1 N1
H(k)ej2Skn/N
Nk
0
1
H(0)
N
1
h(n) H(0)
N
h(n)
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
(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
N
k 1
Usingthesymmetr ypropertyh(n)=h(N-1-n)wecanobtainLinearphaseFIRfiltersusingthe
frequencysamplingtechnique.
Department of ECE, SCADEC
Page119
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
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
Page120
2Sk
j 8
17
for
for
0dkd4
5dkd8
(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)
Problem2:DesignanIdealDifferentiatorusinga)rectangularwindowandb)Hamming
windowwith length ofthe system= 7.
Department of ECE, SCADEC
Page121
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)
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
Page122
Weobserve
x Withrectangularwindow,theeffectofrippleismoreandtransitionbandwidthis small
compared with hammingwindow
x With hammingwindow, effect of rippleis less whereas transition band is more
Page123
Problem3:DesignanidealHilberttransformerusinga)rectangularwindowandb)
Windowwith M= 11
Blackman
Solution:
As seen fromfreqcharsit is defined as
H d(ejZ ) j
S dZd0
0dZdS
j
(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)
Page124
H r(e ) 2 h(n)sinZ(5n)
jZ
n 0
jZ
5dnd5
Page125
Solution:-
(b) Magnitudeplot
Page126
Page127
Question2
Solution:-
Page128
Page129
Solution:-
Page130
Solu
tion:-
Page131
UNIT 8
Realization ofDigital Filters
CONTENTS:1. IMPLEMENTATIONOFDISCRETE-TIMESYSTEMS
2. STRUCTURES FORIIRANDFIRSYSTEMS
3.
DIRECTFORMIANDDIRECTFORMIISYSTEMS,
4. CASCADE,LATTICEANDPARALLELREALIZATION.
Page132
UNIT8REALIZATION
OFDIGITALFILTERS
8.1 Introduction
k 1
k 1
H(Z)
bZ
k 0
N
k k
1 a k Z
k
k 1
8.1.1 ComputationComplexity
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
y(n) bkx(nk)
k 0
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
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
Page134
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)
Page135
8.2.2Cascade FormStructure
Thesystemfunction H(Z)is factored into productof second orderFIR system
K
H(Z) Hk(Z)
k 1
Page136
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
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
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.
Page138
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)
Page139
a 2(1)
1a 2 (2)
k1
and
a (2)
2
(4)
1didm1
(i)
a
m
(i)
Department of ECE, SCADEC
Page140
Theaboveexpressionfailsifkm=1.Thisisanindicationthatthereisazeroontheunit
circle.Ifkm=1,factoroutthisrootfromA(z)andtherecursiveformulacanbeapplied
forreduced order system.
Page141
& k1 a1(1)
form 2&i 1
a1(1)
Thus k1
a 2(1)
1a 2(2)
a 2(1)
1a 2(2)
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
Page142
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
Page143
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
k 1
k 0
8.5.1Directform-I
Thisisastraightforwardimplementationofdifferenceequationwhichisverysimple.
TypicalDirectformIrealizationisshownbelow.Theupperbranchisforwardpathand
lowerbranchisfeedbackpath.Thenumberofdelaysdependsonpresenceofmostprevious input and
output samples in thedifferenceequation.
Page144
V(z)
X(z)
1a kz
-------------------allpoles
k
k 1
Y(z)
1 bk zk
-------------------all zeros
V(z) k 1
Thecorrespondingdifferenceequations are,
N
Page145
ThisrealizationrequiresM+N+!multiplications,M+Nadditionandthemaximumof
{M, N} memorylocation
Page146
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)
Page147
H(Z)
3 1
H(Z)
32
32
1
32
64
(14.7512.90z ) (24.5026.82z )
H(z)
7
1
(1 z1 3z2)
(1z1 z2)
8
32
2
1
Page148
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
Page149
(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
33.6z1 0.6z2
10.1z10.2z2
Page150
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
Page151
H(Z)
1 a N (k)Z
k
1
AN(Z)
k 1
y(n) a N(k)y(nk)x(n)
OR
k 1
For N=1
x(n) y(n)a1(1)y(n1)
Which can realized as,
Weobserve
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)
Page152
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
fN(n) x(n)
f m1(n) f m(n)k mg m1(n1)
g m(n) k mf m1(n)g m1(n1)
m=N, N-1,---1
m=N, N-1,---1
Page153
k m a m(m)
m(mk)
a m1 (k) a m(k)a m(m)a
2
1a (m)
m
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
m=M, M-1, .0
Page154
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
form=3,k=1
form=3,&k=2
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
Page155
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
Page156
Problem5
Page157
Page158
Question 6
Page159
Page160
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
-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
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
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
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
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
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
(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
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
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
jn
Whichgives
w 2(n)
S0
4S2
S(e
jT
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,.}
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
TheZtransformofaninfinitesequenceisgivenby
f
H(z) h(n)zn
n f
InthiscaseH(z)anbedecomposedintoM-branchesas
M1
H(z) zmp
m 0
f
(zM)
r
r f
M1 f
H(z) zmh(rMm)zrM
m 0r f
Page|2
M1 f
M1 f
M1 f
M1
y(n) pm(n)*xm(n)
m 0
M1
y(n) ym(n)
m 0
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
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
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)
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
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)
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.
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
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)
(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
(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)
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
(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
T(ejZ)isanallpassfilter.Insameway,if T(ejZ)
conditionissatisfiedwhen T(Z ) DZE
havelinearphasethereisnophasedistortion. This
jZ
needtobealinear
phaseallpassfiltertoavoidanymagnitudeorphasedistortion.
If an alias free QMF bank has no amplitude and phase distortion then it is called a
perfectreconstruction(PR)QMFbank.Insuchacase
Page|13