数字信号处理答案9.docx
《数字信号处理答案9.docx》由会员分享,可在线阅读,更多相关《数字信号处理答案9.docx(32页珍藏版)》请在冰豆网上搜索。
数字信号处理答案9
Chapter9Solutions
9.1Substitutingh[n]fory[n]andδ[n]forx[n]:
h[n]=0.1δ[n]+0.5δ[n–1]+0.9δ[n–2]+0.5δ[n–3]+0.1δ[n–4]
n
0
1
2
3
4
5
6
7
8
9
h[n]
0.1
0.5
0.9
0.5
0.1
0.0
0.0
0.0
0.0
0.0
Theimpulseresponsehasafinitenumberofnon-zerotermsandisthereforeFIR.Thelengthoftheimpulseresponseis5,whichisonegreaterthanthemaximumdelayinthefilter.Thisisageneralrelationshipforallimpulseresponsesthatstartatn=0:
thelengthoftheimpulseresponseisonesamplelargerthanthemaximumdelayinthefilter.
9.2
(a)
(b)
(c)
(d)
9.3(a)Fromquestion2,
Ω
0
π/8
π/4
3π/8
π/2
5π/8
3π/4
7π/8
π
20log|H(Ω)|
0.0
–2.9
–16.9
–14.5
–16.9
–20.5
–16.9
–31.4
–16.9
θ(Ω)()
0
–68
–135
–12
–90
23
–45
68
0
|H(Ω)|
Ω
θ(Ω)
Ω
(b)Inthepassband,whichlieswithinthefirst“bump”ofthemagnitudespectrum,thephasespectrumfollowsastraightline.Thismeansthephaseislinearinthisregion,whichinturnmeansthatnodistortionwilloccur.
9.4(a)Thedifferenceequationforathree-termmovingaveragefilteris
Thefilterfindstheaverageofeachgroupofthreeinputsamples.Thefirstsixteenoutputsare:
n
0
1
2
3
4
5
6
7
y[n]
3.33
3.67
4.00
1.00
1.00
1.00
1.00
1.00
n
8
9
10
11
12
13
14
15
y[n]
1.00
1.00
1.00
4.00
4.00
4.00
1.00
1.00
y[n]
n
Thefilterhastheeffectofsmoothingoutthelargespikesintheinput.Boundaryeffectsareevidentinthefirstfewsamplesoftheoutput.
(b)Thefrequencyresponseforthethree-termmovingaveragefilteris
Ω
0
π/4
π/2
3π/4
π
|H(Ω)|
1.0000
0.8047
0.3333
0.1381
0.3333
Themagnituderesponseforthefiltershowsacut-offfrequencyatapproximately1radian.Thispointdefinesthepassbandedgeforthissimplefilter.
|H(Ω)|
Ω
(c)Toexaminethephaseresponseinthepassband,phasesbetween0and1radianarecalculatedinsmallsteps.
Ω
0
0.1
0.2
0.3
0.4
0.5
0.6
0.7
0.8
0.9
1.0
θ(Ω)
0.0
–0.1
–0.2
–0.3
–0.4
–0.5
–0.6
–0.7
–0.8
–0.9
–1.0
Thevaluesinthetablecertainlyappeartodescribeastraightline.Thetruephaseresponse,plottedbelow,confirmsthatphaseislinearinthepassband.
θ(Ω)
Ω
9.5Forthispassbandedgefrequencytheimpulseresponseforanideallowpassfilteris
Thesamplevaluesaregiveninthetable.Notethatatn=0,itiseasiesttoevaluateh1[n]ifitisre-expressedas
Atn=0,thesincfunctionhasthevalue1,soh1[0]=0.5/π.
n
h1[n]
–8
–0.0301
–7
–0.0160
–6
0.0075
–5
0.0381
–4
0.0724
–3
0.1058
–2
0.1339
–1
0.1526
0
0.1592
1
0.1526
2
0.1339
3
0.1058
4
0.0724
5
0.0381
6
0.0075
7
–0.0160
8
–0.0301
9.6(a)Theimpulseresponsefortheideallowpassfilterisgivenby
Thesamplesoftheimpulseresponsebetweenn=–3andn=3are
n
–3
–2
–1
0
1
2
3
h1[n]
0.0750
0.1592
0.2251
0.2500
0.2251
0.1592
0.0750
Aftertruncation,theimpulseresponseforthenon-deallowpassfilterconsistsofthesevennon-zerosampleslistedinthetableandzerosamplesforothervaluesofn.Thefigurebelowshowsthetruncatedimpulseresponse.
h1[n]
n
(b)Theimpulseresponsemustbeshiftedthreestepstotherighttomakeitcausal.Thecausalimpulseresponseisshowninthefigure.Itsequationis
h[n]=0.0750δ[n]+0.1592δ[n–1]+0.2251δ[n–2]+0.2500δ[n–3]
+0.2251δ[n–4]+0.1592δ[n–5]+0.0750δ[n–6]
h[n]
n
(c)Thefrequencyresponsefortheimpulseresponseis:
Ω
0
π/4
π/2
3π/4
π
|H(Ω)|
1.1685
0.4622
0.0683
0.0378
0.0319
|H(Ω)|
Ω
Anideallowpassfilterwithacut-offfrequencyofπ/4radiansandapassbandgainidenticaltothenon-idealfilterissuperimposedontheplot.
9.7(a)Thepassbandrippleisthemaximumdeviationfromunitygaininthepassband.Theminimumgainthepassbandis0.962;themaximumis1.078.Thus,thepassbandrippleisδp=0.078.
(b)Thegainatthetopofthefirstsbumpinthestopbandis0.1005.Thisisthestopbandrippleδs.
(c)Sincethepassbandrippleis0.078,thegainattheedgeofthepassbandis1–0.078=0.922,or–0.705dB.
(d)Thegainattheedgeofthestopbandis0.1005,or–19.96dB.
(e)Thestopbandattenuationisthedifferencebetweenthegainattheedgeofthepassbandandthegainattheedgeofthestopband,indB.Thestopbandattenuationis–0.705–(–19.96)=19.26dB.
(f)Thepassbandrippledefinestheedgeofthepassband.Itoccursatthefrequency0.672rads.Theedgeofthestopbandisthefirstfrequencyatwhichthefiltergaindropsbelowthestopbandripple.Thisfrequencyis0.892radians.Thetransitionwidthisthedifferencebetweenthestopbandedgeandthepassbandedge,or0.22radians.
(Themagnituderesponseshownusesa27-termrectangularwindowtocreatealowpassfilterwithitspassbandedgeatπ/4radians.)
9.8(a)Thepassbandrippleispracticallyzero.Theexactvalueofthegainattheedgeofthepassbandis20log(1–δp)=–0.019dB,forapassbandrippleofδp=0.002.
(b)Thestopbandrippleisdeterminedbythegainattheedgeofthestopband,setbythehighestsidelobe.Fromthegraphitappearstobeabout–52dB.Theexactvalueis
–51.5dB.Therefore20logδs=–51.5,whichgivesδs=0.0027.
(c)Thebandwidthissetbythe–3dBfrequencies.Theirexactvaluesare1.608and2.478radians,thoughtheycannotbeidentifiedwiththismuchprecisionfromthegraph.UsingfS=22000,theseconverttoanalogfrequencies5630and8677Hz,forabandwidthof3047Hz.
(d)Thestopbandattenuationisthenegativeofthegainattheedgeofthestopband,or–51.5dB.
(e)Thecenterfrequencyis2.04radians,or7143Hz.
(f)Theupperedgeofthepassband,wherethegainis20log(1–δp)=–0.019dB,occursat2.365radians.Thefrequencyattheedgeofthestopbandoccursat2.661radians.Thus,theupperpassbandandstopbandedgeslieat8281and9317Hz,foratransitionwidthof1036Hz.
(Themagnituderesponseshownusesa71-termhammingwindowtocreateabandpassfilterwithpassbandedgesat0.5πand0.8πradians.)
9.9(a)
|H(f)|
f
(b)Gainattheedgeofpassband=–0.72dBmeans1–δp=0.92,orδp=0.08,whichisalsotherequiredpassbandripple.Stopbandattenuationof25dBisthesameasstopbandgainof–25dB,whichequals0.0562
|H(f)|
f
9.10
w[n]
(a)
n
(b)
w[n]
n
(c)
w[n]
n
(d)
w[n]
n
9.11(a)
Ω
0
π/4
π/2
3π/4
π
|W(Ω)|
9.0
1.0
1.0
1.0
1.0
(b)
Ω
0
π/4
π/2
3π/4
π
|W(Ω)|
4.0
2.0
0.0
0.0
0.0
|W(Ω)|
Ω
(c)
Ω
0
π/4
π/2
3π/4
π
|W(Ω)|
4.4
1.76
0.08
0.08
0.08
|W(Ω)|
Ω
(d)
Ω
0
π/4
π/2
3π/4
π
|W(Ω)|
3.36
2.0
0.32
0.0
0.0
|W(Ω)|
Ω
9.12(a)Arectangularwindowgivestherequiredstopbandattenuation.SinceN=0.91(12000)/1000=10.92,N=11isthebestchoice.
(b)AHammingwindowisthebestchoice.SinceN=3.44(5000)/2000=8.6,N=9isthebestchoice.
(c)Asin(b),aHammingwindowisthebestchoice.SinceN=3.44(5000)/500=34.4,N=35termsareneeded.
(d)Thestopbandattenuationisthedifferencebetweenthepassbandandstopbandgains,or40dB.AHanningwindowgivestherequiredattenuation.Thetransitionwidthisthedistanceinfrequencybetweenthestopbandandpassbandedges,or1.5kHz.Fromthetable,N=3.32(22000)/1500=48.7.Sincethenumberoftermsmustbeodd,N=49isthebestchoice.
9.13(a)(i)Somepassbandrippleisaddedtothesketchtoshowitexists.
|H(f)|
f
(ii)AHanningwindowcanbeusedtomeetthespecifications.Thetransitionwidthis2.5–1=1.5kHz.N=3.32(12000)/1500=26.6,or27termsmustbeincluded.
(iii)Thepassbandedgefrequencyusedinthedesignshouldbe(desiredpassbandedge)+(transitionwidth/2)=1000+(1500/2)=1750Hz.
(b)(i)Somepassbandrippleisaddedtothesketchtoshowitexists.
|H(f)|
f
(ii)Arectangularwindowcanmeetthespecifications.N=0.91(2000)/330=5.52.Tobesurethespecificationsaremet,chooseN=7.
(iii)Toobtainapassbandedgeat500Hz,thedesignmustproceedwiththepassbandedgefrequency500+330/2=665Hz.
9.14(a)50zeros,50poles,51coefficients
(b)100zeros,100poles,101coefficients
9.15Thetransitionwidthis500Hz.Togetthepassbandedgeintherightplace,thepassbandedgefrequencyforthedesignshouldbepassbandedge+transitionwidth/2=3000+500/2=3250Hz.ThematchingdigitalfrequencyisΩ1=2πf/fS=2π(3250)/12000=0.5417πrads.Thus,theequationfortheideallowpassfilterwiththecorrectpassbandedgeish1[n]=sin(nΩ1)/(nπ)=sin(0.5417πn)/(nπ).Thisfunctionisstraightforwardtoevaluate,exceptatn=0,whereh1[0]=(Ω1/π)sinc(nΩ1)=0.5417.
Therequiredstopbandattenuationof20log(0.01)=–40dBpointstotheHanningwindow.Thiswindow’sstopbandattenuationleadstoastopbandrippleof10(–43/20)=0.0071whichsatisfiesthestopbandripplerequirements.Thepassbandrippleforthiswindowis–0.06dBor0.007,whichalsosatisfiesthespecifications.Thetransitionwidthforthefilteris500Hz.Thenumberoftermsrequiredis3.32(12000)/500=79.7.Using79termswillproduceafilterslightlypoorerthantheonespecified.Using81termswillproduceafilterthatexceedsthespecifications.Forthiscase,select79terms.Thewindowfunctionisw[n]=0.5+0.5cos(2πn/N–1)=0.5+0.5cos(2πn/78),definedforn=–39ton=39.