0)if(k1*k1<4-2*k1*k2)c=1-k1*k2;b=-(2-k1*k2-k1*k1);p1=(-b+(sqrt(b*b-4*c)))/2;p2=(-b-(sqrt(b*b-4*c)))/2;if(imag(p1)~=0)if(real(p1)~=0)if(abs(p1)<1)plot(p1,".");endendendif(imag(p2)~=0)if(real(p2)~=0)if(abs(p2)<1)plot(p2,".");endendendendendendendendhold;Runningthisprogramusingthestatementpole_plot_kb(6)yieldsthefollowingplot.10.50-0.5-1-1-0.500.51Realpart406
M9.30-20-40-60unquantizedquantized-8000.20.40.60.81w/pM9.4N=5;wn=0.45;Rp=0.5;Rs=45;[B,A]=ellip(N,Rp,Rs,wn);zplane(B,A);z=cplxpair(roots(B));p=cplxpair(roots(A));disp("Factorsforthenumerator");const=B(1)/A(1);k=1;whilek<=length(z),if(imag(z(k))~=0)factor=[1-2*real(z(k))abs(z(k))^2]k=k+2;elsefactor=[1-z(k)]k=k+1;endenddisp("Factorsforthedenominator");k=1;whilek<=length(p),if(imag(p(k))~=0)factor=[1-2*real(p(k))abs(p(k))^2]k=k+2;elsefactor=[1-p(k)]k=k+1;endendsos=zp2sos(z,p,const)TheaboveprogramyieldsFactorsforthenumeratorfactor=1.0000e+001.0358e+001.0000e+00factor=1.0000e+003.7748e-011.0000e+00factor=1.0000e+001.0000e+00407
Factorsforthedenominatorfactor=1.0000e+00-2.6433e-018.6522e-01factor=1.0000e+00-5.8090e-015.0030e-01factor=1.0000e+00-4.4817e-01æ1+1.0358z-1+z-2öæ1+0.37748z-1+z-2öæ1+z-1öHenceH(z)=ç÷ç÷ç÷.çè1-0.26433z-1+0.86522z-2÷øçè1-0.5809z-1+0.5003z-2÷øçè1-0.44817z-1÷øNotethattheorderinghasnoeffectifL-scalingisused.¥111220.5330-0.5221-11-1-0.500.51Realpartsos=2.7591e-012.7591e-0101.0000e+00-4.4817e-0103.0285e-013.1370e-013.0285e-011.0000e+00-5.8090e-015.0030e-016.7335e-012.5418e-016.7335e-011.0000e+00-2.6433e-018.6522e-01M9.5[B,A]=ellip(5,0.5,45,0.45);p=roots(A);lenp=length(p);[Y,I]=sort(angle(p));fork=1:lenpif(rem(k,2)==1)p1((k+1)/2)=p(I(k));elsep2(k/2)=p(I(k));endendb1=poly(p1);b2=poly(p2);a1=fliplr(b1);a2=fliplr(b2);B1=0.5*(conv(b2,a1)-conv(b1,a2));A1=conv(b1,b2);[H,W]=freqz(B,A,512);[H1,W]=freqz(B1,A1,512);plot(W/pi,abs(H),"-",W/pi,abs(H1),"--");axis([0101.2]);xlabel("omega/pi");ylabel("Magnitude");408
pausea1=1.01*a1;a2=1.01*a2;b1=[b1(1)1.01*b1(2:length(b1))];b2=[b2(1)1.01*b2(2:length(b2))];A3=conv(b1,b2);B3=0.5*conv(a1,b2)+0.5*conv(a2,b1);B4=1.01*B;A4=[A(1)1.01*A(2:length(B))];[H2,W]=freqz(B3,A3,512);[H3,W]=freqz(B4,A4,512);plot(W/pi,abs(H2),"-",W/pi,abs(H3),"--");axis([0101.2]);xlabel("omega/pi");ylabel("Magnitude");110.80.80.60.60.40.40.20.20000.20.40.60.8100.20.40.60.81w/pw/pM9.6num1=input("Thefirstfactorofnumerator=");num2=input("Thesecondfactorofnumerator=");den1=input("Thefirstfactorofdenominator=");den2=input("Thesecondfactorofdenominator=");%Thenumeratoranddenominatorofthescaling%functionsf1andf2aref1num=1;f1den=[den1];f2num=num1;f2den=conv(den1,den2);f3num=conv(num1,num2);f3den=conv(den1,den2);x=[1zeros([1,511])];%Sufficientlengthforimpulseresponse%tohavedecayedtonearlyzerof1=filter(f1num,f1den,x);f2=filter(f2num,f2den,x);f3=filter(f3num,f3den,x);k1=sqrt(sum(f1.*f1));k2=sqrt(sum(f2.*f2));k3=sqrt(sum(f3.*f3));disp("Thefirstscalingfactor=");disp(k1);disp("Thesecondscalingfactor=");disp(k2);disp("Thethirdscalingfactor=");disp(k3);%Thenoisetransferfunctionsg1num=conv(num1,num2)/(k2*k3);g1den=conv(den1,den2)/k3;g2num=num2;g2den=den2;g1=filter(g1num,g1den,x);g2=filter(g2num,g2den,x);var=sum(f1.*f1)*3+sum(g2.*g2)*5+3;disp("Thenormalizednoisevariance");disp(var);%num1andnum2canbeinterchangedtocomeupwiththe%secondrealizationM9.7TheparallelformIstructureandtheparallelformIIstructureusedforsimulationareshownbelow:409
k4k4kk–0.3445k001k5-1-1–0.0188z1.6592kkz15–0.01881.6528k1z-1-1z–0.801–0.8010.2759kk1k–2.29k223k6-1-1–0.777z–5.162k3kz6–0.777–6.9422k-1-13–0.3434z–0.3434z0.7867k3ParallelFormIParallelFormIInum1=input("Thefirstfactorinthenumerator=");num2=input("Thesecondfactorinthenumerator=");den1=input("Thefirstfactorinthedenominator=");den2=input("Thesecondfactorinthedenominator=");num=conv(num1,num2);den=conv(den1,den2);[r1,p1,k11]=residuez(num,den);[r2,p2,k21]=residue(num,den);%SimulationofstructureforEq.9.244R1=[r1(1)r1(2)];P1=[p1(1)p1(2)];R2=[r1(3)r1(4)];P2=[p1(3)p1(4)];R3=[r2(1)r2(2)];P3=[p2(1)p2(2)];R4=[r2(3)r2(4)];P4=[p2(3)p2(4)];[num11,den11]=residuez(R1,P1,0);[num12,den12]=residuez(R2,P2,0);[num21,den21]=residue(R3,P3,0);[num22,den22]=residue(R4,P4,0);disp("ThenumeratorsforParallelFormI");disp(k11);disp(num11);disp(num12);disp("ThedenominatorsforParallelFormI");disp(den11);disp(den12);disp("ThenumeratorsforParallelFormII");disp(k21);disp(num21);disp(num22);disp("ThedenominatorsforParallelFormII");disp(den21);disp(den22);imp=[1zeros([1,2000])];y0=filter([100],den11,imp);y1=filter(num11,den11,imp);y2=filter([100],den12,imp);y3=filter(num12,den12,imp);gamma0=sum(y0.*conj(y0));gamma1=sum(y1.*conj(y1));gamma2=sum(y2.*conj(y2));gamma3=sum(y3.*conj(y3));k0=sqrt(1/gamma0);k1=sqrt(gamma0/gamma1);k2=sqrt(1/gamma2);k3=sqrt(gamma2/gamma3);y=filter(num,den,imp);gamma=sum(y.*conj(y));410
k4=sqrt(1/gamma);k5=k4/(k0*k1);k6=k4/(k2*k3);disp("ForparallelformI");disp("Thescalingconstantsare");disp(k0);disp(k1);disp(k2);disp(k3);disp(k4);disp(k5);disp(k6);disp("Theproductroundoffnoisevariance");noise=3*(k5/k0)^2+3*(k6/k2)^2+2*k5^2+2*k6^2+3;disp(noise);%%%%%%%%%%ForParallelFromII%%%%%%%%%%%%%%%%y0=filter([001],den21,imp);y1=filter(fliplr(num21),den21,imp);y2=filter([001],den22,imp);y3=filter(fliplr(num22),den22,imp);gamma0=sum(y0.*conj(y0));gamma1=sum(y1.*conj(y1));gamma2=sum(y2.*conj(y2));gamma3=sum(y3.*conj(y3));k0=sqrt(1/gamma0);k1=sqrt(gamma0/gamma1);k2=sqrt(1/gamma2);k3=sqrt(gamma2/gamma3);y=filter(num,den,imp);gamma=sum(y.*conj(y));k4=sqrt(1/gamma);k5=k4/(k0*k1);k6=k4/(k2*k3);disp("ForparallelformII");disp("Thescalingconstantsare");disp(k0);disp(k1);disp(k2);disp(k3);disp(k4);disp(k5);disp(k6);disp("Theproductroundoffnoisevariance");noise=3*(k5/k0)^2+3*(k6/k2)^2+2*k5^2+2*k6^2+3;disp(noise);M9.8ThescaledGray-Markelcascadedlatticestructureusedforsimulationisshownbelow:k4W4k3W3k2W2k1W1-d4-d3"-d2"-d1"""d4d3"d2"d1"""1/k1/k31/k21/k14–1–1–1–1zzzzaCa2Ca3Ca4Ca5C1kkkk2k3k4k1k2k3k4k1k2k3k4434%UseProgram_6_3.mpg.384togeneratethelattice%parametersandfeedforwardmultipliersd=[0.191491893489200.759534173651300.443489798462640.27506340000000];alpha=[1.00000000000000-3.502770000000004.61511974525466-1.70693992124303-0.90009664306164];imp=[1zeros([1,499])];qold1=0;fork=1:500w1=imp(k)-d(1)*qold1;y1(k)=w1;qnew1=w1;qold1=qnew1;endk1=sqrt(1/(sum(y1.*conj(y1))));imp=[1zeros([1,499])];qold1=0;qold2=0;fork=1:500w2=imp(k)-d(2)*qold2*1/k1;411
w1=k1*w2-d(1)*qold1;y1(k)=w1;y2(k)=w2;qnew1=w1;qnew2=w1*d(1)+qold1;qold1=qnew1;qold2=qnew2;endk2=sqrt(1/(sum(y2.*conj(y2))));qold1=0;qold2=0;qold3=0;fork=1:500w3=imp(k)-d(3)*qold3*1/k2;w2=k2*w3-d(2)*qold2*1/k1;w1=k1*w2-d(1)*qold1;y3(k)=w3;qnew1=w1;qnew2=w1*d(1)+qold1;qnew3=w2*d(2)+qold2*1/k1;qold1=qnew1;qold2=qnew2;qold3=qnew3;endk3=sqrt(1/sum(y3.*conj(y3)));qold1=0;qold2=0;qold3=0;qold4=0;fork=1:500w4=imp(k)-d(4)*qold4/k3;w3=k3*w4-d(3)*qold3/k2;w2=k2*w3-d(2)*qold2/k1;w1=k1*w2-d(1)*qold1;y4(k)=w4;qnew1=w1;qnew2=w1*d(1)+qold1;qnew3=w2*d(2)+qold2*1/k1;qnew4=w3*d(3)+qold3*1/k2;qold1=qnew1;qold2=qnew2;qold3=qnew3;qold4=qnew4;endk4=sqrt(1/sum(y4.*conj(y4)));const=0.135127668%Obtainedbyscalingtheo/poftheactualTFdisp("Thescalingparametersare");disp(k1);disp(k2);disp(k3);disp(k4);alpha(5)=alpha(5)/(k1*k2*k3*k4);alpha(4)=alpha(4)/(k1*k2*k3*k4);alpha(3)=alpha(3)/(k2*k3*k4);alpha(2)=alpha(2)/(k3*k4);alpha(1)=alpha(1)/k4;alpha=const*alpha;%%%%Computationofnoisevariance%%%%%%%Noisevarianceduetok4andd4=1/k4^2=1.08185285036642%Tocomputenoisevarianceduetok3,d3"=1.33858225imp=[1zeros([1,499])];fork=1:500w4=-d(4)*qold4/k3;w3=k3*w4-d(3)*qold3/k2;w2=k2*w3-d(2)*qold2/k1;w1=k1*w2-d(1)*qold1;qnew1=w1;qnew2=w1*d(1)+qold1;qnew3=w2*d(2)+qold2*1/k1;qnew4=w3*d(3)+qold3*1/k2;y11=w4*d(4)+qold4/k3;412
y0(k)=alpha(1)*y11+alpha(2)*qnew4+alpha(3)*qnew3+alpha(4)*qnew2+alpha(5)*qnew1;qold1=qnew1;qold2=qnew2;qold3=qnew3;qold4=qnew4;endnv=sum(y0.*conj(y0));%fork2,-d2""nv=3.131899935%fork1,-d1"""nv=1.00880596097028%ford1"""nv=0.95806646140013%ford2""nv=2.61615077290574%ford3"nv=0.41493478856386%ford4nv=0.01975407768839%for1/k1nv=0.75359663926391%for1/k2nv=0.58314964498424%for1/k3nv=0.09095345118133%Totalnv=23.55888782866100M9.9a=0.5a=0.50.120.70.60.10.50.080.40.060.30.040.20.020.1000510152005101520TimeindexnTimeindexna=0.5a=0.5120.5100.480.360.240.12000510152005101520TimeindexnTimeindexnInallthreecases,theconditionofEq.(9.186)issatisfiedandhence,thestructureexhibitszero-inputgranularlimitcycles.M9.10413
a=-0.875a=0.875120.40.30.20.10-0.1-0.2-0.3-0.4010203040Timeindexn414
Chapter10(2e)10.1Foraninputx1[n]andx2[n],theoutputsofthefactor-of-Lup-samplerare,respectively,givenbyìx[n/L],n=0,±L,±2L,Kìx[n/L],n=0,±L,±2L,Kx[n]=í1andx[n]=í2u1î0,otherwise,u2î0,otherwise.Letx2[n]=x1[n–no],wherenoisaninteger.Thenx2[n/L]=x1[(n/L)–no].Hence,ìx[(n/L)–n],n=0,±L,±2L,Kx[n]=í1ou2î0,otherwise.ìx[(n–n)/L],n–n=0,±L,±2L,KButx[n–n]=í1ooSincex[n]¹x[n–n],theup-u1oî0,otherwise,u2u1osamplerisatime-varyingsystem.10.2Considerfirsttheup-sampler.Letx1[n]andx2[n]betheinputswithcorrespondingoutputsìx[n/L],n=0,±L,±2L,Kgivenbyy1[n]andy2[n].Now,y[n]=í1and1î0,otherwise,ìx[n/L],n=0,±L,±2L,Ky[n]=í2Letusnowapplytheinputx[n]=ax[n]+bx[n],2î0,otherwise.312withthecorrespondingoutputgivenbyy3[n],whereìax[n/L]+bx[n/L],n=0,±L,±2L,Ky[n]=í123î0,otherwise,ìax[n/L]ìbx[n/L]n=0,±L,±2L,K=í1+í2=ay[n]+by[n].Thus,theup-samplerisaî0î0otherwise,12linearsystem.Now,considerthedown-sampler.Letx1[n]andx2[n]betheinputswithcorrespondingoutputsgivenbyy1[n]andy2[n].Now,y1[n]=x1[Mn],andy2[n]=x2[Mn].Letusnowapplytheinputx3[n]=ax1[n]+bx2[n],withthecorrespondingoutputgivenbyy3[n],wherey[n]=x[Mn]=ax[Mn]+bx[Mn].Thus,thedown-samplerisalinearsystem.331210.3–1/2–1/211/211/2z1/2z1/2Fromthefigure,V(z)=X(z)+X(–z),W(z)=X(z)–X(–z),2222–1–111zzV(z)=X(z)+X(–z),W(z)=X(z)–X(–z).Hence,u22u22–1–1Y(z)=zV(z)+W(z)=zX(z),orinotherwords,y[n]=x[n–1].uu415
M–1æ1–WnMöæö1kn1çM÷1ç1–1÷10.4c[n]=MåWM=Mçn÷.Hence,ifn¹rM,c[n]=Mçn÷=0.Ontheotherk=0è1–WMøè1–WMøM–1M–1M–11kn1krM1hand,ifn=rM,thenc[n]=MåWM=MåWM=Må1=1.Thus,k=0k=0k=01,ifn=rM,c[n]={0,otherwise.10.5M–1L1L/MkLFortheleft-handsidefigure,wehaveV1(z)=X(z),Y1(z)=MåX(zWM).k=0M–1M–111/Mk1L/MkFortheright-handsidefigure,wehaveV2(z)=MåX(zWM),Y2(z)=MåX(zWM).k=0k=0kkLSinceLandMarerelativelyprime,WandWtakethesamesetofvaluesfork=0,1,...,MMM–1.Hence,Y1(z)=Y2(z).10.6M–1M–111/Mk11/MkFortheleft-handsidefigure,wehaveV1(z)=MåX(zWM),Y1(z)=MåH(z)X(zWM),k=0k=0M–1M1kM1/MkFortheright-handsidefigure,wehaveV2(z)=H(z)X(z),Y2(z)=MåH(zWM)X(zWM)k=0M–111/Mk=MåH(z)X(zWM).Hence,Y1(z)=Y2(z).k=0LLLFortheleft-handsidefigure,wehaveV(z)=X(z),Y(z)=H(z)X(z).Fortheright-hand11LLsidefigure,wehaveV(z)=H(z)X(z),Y(z)=H(z)X(z).Hence,Y1(z)=Y2(z).2210.7x[n]5102y[n]ºx1[n]x[n]5522y[n]ºx[n]22y[n]416
ìx1[n/2],forn=2r,ìx[n],forn=2r,Hence,x1[n]=x[2n]andy[n]=í=íTherefore,î0,otherwiseî0,otherwiseìx[n],forn=2r,y[n]=íî0,otherwise.10.8H0(z)y0[n]w[n]u[n]x[n]33H1(z)y1[n]H2(z)y2[n]10.9AsoutlinedinSection6.3,thetransposeofadigitalfilterstructureisobtainedbyreversingallpaths,replacingthepick-offnodewithanadderandvice-versa,andinterchangingtheinputandtheoutputnodes.Moreover,inamultiratestructure,thetransposeofafactor-of-Mdown-samplerisafactor-of-Mup-samplerandvice-versa.Applyingtheseoperationstothefactor-of-Mdecimatorshownontheleft-handside,wearriveatafactor-of-Minterpolatorasindicatedontheright-handsideinthefigurebelow.10.10ApplyingthetransposeoperationtotheM-channelanalysisfilterbankshownbelowontheleft-handside,wearriveattheM-channelsynthesisfilterbankshownbelowontheright-handside.417
x[n]H0(z)Mv0[n]y[n]H0(z)Mv0[n]H1(z)Mv1[n]H1(z)Mv1[n]ºHM-1(z)MvM-1[n]HM-1(z)MvM-1[n]v0[n]MH0(z)y[n]ºv1[n]MH1(z)vM-1[n]MHM-1(z)10.11SpecificationsforH(z)areasfollows:Fp=180Hz,Fs=200Hz,dp=0.002,ds=0.001.H(z)3012kHz12kHz400Hz6WerealizeH(z)asH(z)=G(z)F(z).6F(z)G(z)6512kHz12kHz12kHz2kHz400HzTherefore,specificationsforG(z)areasfollows:120Fp=1080Hz,Fs=1200Hz,dp=0.001,ds=0.001.Here,Df=.Hence,from12000–20log100.001´0.001–1347´12000Eq.(7.15),orderofG(z)isgivenbyN===321.92.G14.6(120/12000)14.6´120Likewise,specificationsforF(z)are:Fp=180Hz,Fs=1800Hz,dp=0.001,ds=0.001.1620Here,Df=.Hence,orderofF(z)isgivenby12000–20log10–6–1347´1200010N===23.846.Thus,wechooseN=322andN=24.F14.6(1620/12000)14.6´1620GF2000RM,G=(322+1)´=129,200muliplications/second(mps),and512000RM,F=(24+1)´=50,000mps6418
Hence,totalno.ofmps=179,200.HencethecomputationalcomplexityofthisparticularIFIRimplementationisslightlyhigherherethanthatinExample10.8.F(z)6G(z)512kHz12kHz2kHz2kHz400Hz510.12WerealizeH(z)asH(z)=G(z)F(z).5F(z)G(z)5612kHz12kHz12kHz2.4kHz400HzSpecificationsforG(z)are:Fp=900Hz,Fs=1000Hz,dp=0.001,ds=0.001.Here,100Df=.Hence,fromEq.(7.15),orderofG(z)isgivenby12000–20log100.001´0.001–1347´12000N===386.3.Likewise,specificationsforF(z)G14.6(100/12000)14.6´1002020are:Fp=180Hz,Fs=2200Hz,dp=0.001,ds=0.001.Here,Df=.Hence,orderof12000–20log10–6–1347´1200010F(z)isgivenbyN===19.124.Thus,wechooseN=387F14.6(2020/12000)14.6´2020GandN=20.FF(z)5G(z)612kHz12kHz2.4kHz2.4kHz400Hz2400RM,G=(387+1)´=155,200muliplications/second(mps),and612000RM,F=(20+1)´=50,400mps5Hence,totalno.ofmps=205,600.HencethecomputationalcomplexityofthisparticularIFIRimplementationisslightlyhigherherethanthatinExample10.8andinProblem10.11.10.13H(z)2060kHz60kHz3kHzSpecificationsforH(z)are:F=1250kHz,F=1500kHz,d=0.02andd=0.01.Hence,pspsfromEq.(7.15),orderNofH(z)isgivenby–20log100.02´0.01–1323.989´60000N===394.34.WethuschooseN=395.14.6(250/60000)14.6´25060,000Computationalcomplexityistherefore=396´=1,188,000.20419
10.14OriginaldecimationfilterH(z)specifications:Fp=1250Hz,Fs=1500,dp=0.02,ds=0.01.5The4possibleIFIRimplementationsofH(z)areasfollows:(A)H(z)=G(z)F(z),4210(B)H(z)=G(z)F(z),(C)H(z)=G(z)F(z),and(D)H(z)=G(z)F(z).CaseA:SpecficationsforG(z):Fp=1250´5=6250Hz,Fs=1500´5=7500Hz,1250dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofG(z)60,000-20log100.01´0.01-13asNG==88.767.14.6(1250/60000)60000-5´1500SpecficationsforF(z):Fp=1250Hz,Fs==10,500Hz,59250dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofF(z)60,000-20log100.01´0.01-13asNF==11.996.WethuschooseNG=89andNF=12.14.6(9250/60000)1200060000Hence,RM,G=(89+1)´=270,000mpsandRM,F=(12+1)´=156,000mps.45Hence,totalcomputationalcomplexity=426,000mps.CaseB:SpecficationsforG(z):Fp=1250´4=5000Hz,Fs=1500´4=9000Hz,1000dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofG(z)60,000-20log100.01´0.01-13NG==110.9614.6(1000/60000)60000-5´1500SpecficationsforF(z):Fp=1250Hz,Fs==10,500Hz,512250dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofF(z)60,000-20log100.01´0.01-13NF==0.0579.WethuschooseNG=111andNF=10.14.6(12250/60000)1500060000Hence,RM,G=(111+1)´=336,000mpsandRM,F=(10+1)´=165,000mps.54Hence,totalcomputationalcomplexity=501,000mps.CaseC:SpecficationsforG(z):Fp=1250´2=2500Hz,Fs=1500´2=3000Hz,500dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofG(z)60,000-20log100.01´0.01-13NG==221.92.14.6(500/60000)420
60000-2´1500SpecficationsforF(z):Fp=1250Hz,Fs==28,500Hz,212250dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofF(z)60,000-20log100.01´0.01-13NF==4.0179.WethuschooseNG=222andNF=5.14.6(27250/60000)3000060000Hence,RM,G=(222+1)´=669,000mpsandRM,F=(5+1)´=180,000mps.102Hence,totalcomputationalcomplexity=849,000mps.CaseD:SpecficationsforG(z):Fp=1250´10=12500Hz,Fs=1500´10=15000Hz,2500dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofG(z)60,000-20log100.01´0.01-13NG==44.384.14.6(2500/60000)60000-10´1500SpecficationsforF(z):Fp=1250Hz,Fs==4,500Hz,103250dp=0.01,ds=0.01.HereDf=.Hence,usingEq.(10.26),weobtaintheorderofF(z)60,000-20log100.01´0.01-13NF==34.141.WethuschooseNG=45andNF=35.14.6(3250/60000)600060000Hence,RM,G=(45+1)´=138,000mpsandRM,F=(35+1)´=216,000mps.210Hence,totalcomputationalcomplexity=354,000mps.Thus,CaseDhasthelowestcomputationalcomplexity.10.15(a)SpecificationsforH(z)are:F=200Hz,F=300Hz,d=0.002andd=0.004.psps15H(z)600Hz9kHz9kHz100Here,Df=.Hence,fromEq.(10.26),orderNofH(z)isgivenby9000–20log100.002´0.004–1337.969´9000N===234.06.WechooseN=235.Hence,14.6(100/9000)14.6´1009000computationalcomplexity=(235+1)´=141,600mps.155(b)WerealizeH(z)=G(z)F(z).3G(z)5F(z)600Hz1.8kHz1.8kHz9kHz9kHz421
SpecificationsforG(z)are:F=200Hz,F=300Hz,d=0.002andd=0.004.Here,psps100Df=.Hence,fromEq.(7.15),orderNofH(z)isgivenby9000p+pz–1p-pz–10110110.16(a)H(z)=.H(zW)=H(-z)=.Thus,11+dz–11211-dz–11111ép+pz–1p-pz–1ùp-pdz-2E(z2)=[H(z)+H(-z)]=ê01+01ú=011,and02112êë1+dz–11-dz–1úû1-d2z-211111ép+pz–1p-pz–1ù(p-pd)z-1z–1E(z2)=[H(z)-H(-z)]=ê01-01ú=101.Hence,atwo-12112êë1+dz–11-dz–1úû1-d2z-2111bandpolyphasedecompositionofH(z)isgivenby1æp-pdz-2öæp-pdöH(z)=ç011÷+z-1ç101÷.1çè1-d2z-2÷øçè1-d2z-2÷ø11–1–2–1–22+3.1z+1.5z12-3.1z+1.5z(b)H(z)=.H(zW)=H(-z)=.Thus,21+0.9z–1+0.8z–22221-0.9z–1+0.8z–211é2+3.1z–1+1.5z–22-3.1z–1+1.5z–2ùE(z2)=[H(z)+H(-z)]=ê+ú02222êë1+0.9z–1+0.8z–21-0.9z–1+0.8z–2úû–2–44+0.62z+2.4z=.1+0.79z–2+0.64z–411é2+3.1z–1+1.5z–22-3.1z–1+1.5z–2ùz-1E(z2)=[H(z)-H(-z)]=ê-ú12222êë1+0.9z–1+0.8z–21-0.9z–1+0.8z–2úû–1–32.6z+2.26z=.Hence,atwo-bandpolyphasedecompositionofH(z)isgivenby1+0.79z–2+0.64z–42æ4+0.62z–2+2.4z–4öæ–2öH(z)=ç÷+z-1ç2.6+2.26z÷.2çè1+0.79z–2+0.64z–4÷øçè1+0.79z–2+0.64z–4÷ø–1–2–3–1–2–32+3.1z+1.5z+4z2+3.1z+1.5z+4z(c)H(z)==.3(1–0.5z–1)(1+0.9z–1+0.8z–2)1+0.4z–1+0.35z–2-0.4z–3–1–2–32-3.1z+1.5z-4zH(-z)=.31-0.4z–1+0.35z–2+0.4z–311é2+3.1z–1+1.5z–2+4z–32-3.1z–1+1.5z–2-4z–3ùE(z2)=[H(z)+H(-z)]=ê+ú02332êë1+0.4z–1+0.35z–2-0.4z–31-0.4z–1+0.35z–2+0.4z–3úû–2–4–64+1.92z+0.33z+3.2z=.1+0.54z–2+0.4425z–4-0.16z–6422
11é2+3.1z–1+1.5z–2+4z–32-3.1z–1+1.5z–2-4z–3ùz-1E(z2)=[H(z)-H(-z)]=ê-ú12332êë1+0.4z–1+0.35z–2-0.4z–31-0.4z–1+0.35z–2+0.4z–3úû–1–3–54.6z+10.57z+4z=.Hence,atwo-bandpolyphasedecompositionofH(z)is1+0.54z–2+0.4425z–4-0.16z–63æ4+1.92z–2+0.33z–4+3.2z–6öæ–2+4z–4ögivenbyH(z)=ç÷+z-1ç4.6+10.57z÷3çè1+0.54z–2+0.4425z–4-0.16z–6÷øçè1+0.54z–2+0.4425z–4-0.16z–6÷øp+pz–1201-k310.17(a)H1(z)=–1=åzEk(z).Thus,1+dz1k=0éH(z)ùéùéE(z3)ùéùéE(z3)ùê1úê111úê0úê111úê0úêH(W1z)ú=ê1W-1W-2úêz-1E(z3)ú=ê1W-1W-2úêz-1E(z3)úorê13úê33úê-213úê33úê-213úêëH(W2z)úûêë1W-2W-4úûêzE(z)úêë1W-2W-1úûêzE(z)ú1333ë2û33ë2û-1éE(z3)ùéùéH(z)ùéùéH(z)ùê0úê111úê1ú1ê111úê1úêz-1E(z3)ú=ê1W-1W-2úêH(W1z)ú=ê1W1W2úêH(W1z)ú.Theefore,ê-213úê33úê13ú3ê33úê13úêzE(z)úêë1W-2W-1úûêëH(W2z)úûêë1W2W1úûêëH(W2z)úûë2û331333133112E(z)=[H(z)+H(zW)+H(zW)]03113131ép+pz-1p+pej2p/3z-1p+pej4p/3z-1ùp+pd2z-3=ê01+01+01ú=011.3êë1+dz-11+dej2p/3z-11+dej4p/3z-1úû1+d3z-31111-1311122zE(z)=[H(z)+WH(zW)+WH(zW)]1313133131ép+pz-1p+pej2p/3z-1p+pej4p/3z-1ùp-pd=ê01+ej2p/301+ej4p/301ú=z-1101.3êë1+dz-11+dej2p/3z-11+dej4p/3z-1úû1+d3z-31111-2312112zE(z)=[H(z)+WH(zW)+WH(zW)]2313133131ép+pz-1p+pej2p/3z-1p+pej4p/3z-1ù-pd+pd2=ê01+ej4p/301+ej2p/301ú=z-21101.3êë1+dz-11+dej2p/3z-11+dej4p/3z-1úû1+d3z-31111p+pd2z-1p-pd-pd+pd20111011101Hence,E(z)=,E(z)=,andE(z)=.01+d3z-111+d3z-121+d3z-1111–1–22+3.1z+1.5z(b)H(z)=.21+0.9z–1+0.8z–2éH(z)ùéùéE(z3)ùéE(z3)ùéùéH(z)ùê2úê111úê0úê0ú1ê111úê2úêH(W1z)ú=ê1W-1W-2úêz-1E(z3)úorêz-1E(z3)ú=ê1W1W2úêH(W1z)ú.ê23úê33úê-213úê-213ú3ê33úê23úêëH(W2z)úûêë1W-2W-1úûêzE(z)úêzE(z)úêë1W2W1úûêëH(W2z)úû2333ë2ûë2û3323423
3112Thus,E(z)=[H(z)+H(zW)+H(zW)]03223231é2+3.1z–1+1.5z–22+3.1ej2p/3z–1+1.5ej4p/3z–22+3.1ej4p/3z–1+1.5ej2p/3z–2ù=ê++ú3êë1+0.9z–1+0.8z–21+0.9ej2p/3z–1+0.8ej4p/3z–21+0.9ej4p/3z–1+0.8ej2p/3z–2úû–3–66-8.277z+2.88z=.1-1.431z–3+0.512z–6-1311122zE(z)=[H(z)+WH(zW)+WH(zW)]132323323–1–2j2p/3–1j4p/3–212+3.1z+1.5zj2p/32+3.1ez+1.5ez=[+e31+0.9z–1+0.8z–21+0.9ej2p/3z–1+0.8ej4p/3z–2j4p/3–1j2p/3–2–3j4p/32+3.1ez+1.5ez-13.9-2.811z+e]=z.1+0.9ej4p/3z–1+0.8ej2p/3z–21-1.431z–3+0.512z–6-2312112zE(z)=[H(z)+WH(zW)+WH(zW)]233333333–1–2j2p/3–1j4p/3–212+3.1z+1.5zj4p/32+3.1ez+1.5ez=[+e31+0.9z–1+0.8z–21+0.9ej2p/3z–1+0.8ej4p/3z–2j4p/3–1j2p/3–2–3j2p/32+3.1ez+1.5ez-2-3.81+2.712z+e]=z.Hence,1+0.9ej4p/3z–1+0.8ej2p/3z–21-1.431z–3+0.512z–6–1–2–16-8.277z+2.88z3.9-2.811zE(z)=,E(z)=,and01-1.431z–1+0.512z–211-1.431z–1+0.512z–2–1-3.81+2.712zE(z)=.21-1.431z–1+0.512z–210.18Acomputationallyefficientrealizationofthefactor-of-4decimatorisobtainedbyapplyinga4-branchpolyphasedecompositiontoH(z):4–14–24–34H(z)=E(z)+zE(z)+zE(z)+zE(z).0123andthenmovingthedown-samplerthroughthepolyphasefiltersresultinginw1[n]4E0(z)y[n]-1zw[n]24E1(z)-1zw[n]34E2(z)-1zw4[n]4E(z)3424
FurtherreductionincomputationalcomplexityisachievedbysharingcomonmultipliersifH(z)isalinear-phaseFIRfilter.Forexample,foralength-16TypeIFIRtransferfunction–1–2–3–4–5–6–7–8H(z)=h[0]+h[1]z+h[2]z+h[3]z+h[4]z+h[5]z+h[6]z+h[7]z+h[7]z–9–10–11–12–13–14–15+h[6]z+h[5]z+h[4]z+h[3]z+h[2]z+h[1]z+h[0]z,–1–2–3–1–2–3forwhichE(z)=h[0]+h[4]z+h[7]z+h[3]z,E(z)=h[1]+h[5]z+h[6]z+h[2]z,01–1–2–3–1–2–3E(z)=h[2]+h[6]z+h[5]z+h[1]z,andE(z)=h[3]+h[7]z+h[4]z+h[0]z.23FromtheabovefigureitfollowsthatY(z)=E(z)W(z)+E(z)W(z)+E(z)W(z)+E(z)W(z)01122334-3-1-2=h[0](W(z)+zW(z))+h[4](zW(z)+zW(z))1414-2-1-3+h[7](zW(z)+zW(z))+h[3](zW(z)+W(z))1414-3-1-2+h[1](W(z)+zW(z))+h[5](zW(z)+zW(z))2323-2-1-3+h[6](zW(z)+zW(z))+h[2](zW(z)+W(z)).2323Acomputationallyefficientfactor-of-4decimatorstructurebasedontheaboveequationisthenasshownbelow:h[0]h[4]h[7]w[n]x[n]41-1-1-1zzzh[3]y[n]-1z-1-1-1zzzw[n]44h[1]h[5]-1zh[6]w2[n]-1-1-14zzzh[2]-1z-1-1-1zzzw[n]3410.19Acomputationallyefficientrealizationofthefactor-of-3interpolatorisobtainedbyapplyinga3-branchTypeIIpolyphasedecompositiontotheinterpolationfilterH(z):3–13–23H(z)=R(z)+zR(z)+zR(z),210andthenmovingtheup-samplerthroughthepolyphasefiltersresultingin425
w[n]1x[n]R30(z)-1zw2[n]R31(z)-1zw[n]3R(z)32Fromtheabovefigureitfollowsthat-1-2-3-4W(z)=h[0]X(z)+h[3]zX(z)+h[6]zX(z)+h[5]zX(z)+h[2]zX(z),3-1-2-3-4W(z)=h[2]X(z)+h[5]zX(z)+h[6]zX(z)+h[3]zX(z)+h[0]zX(z),and1-4-1-3-2W(z)=h[1](X(z)+zX(z))+h[4](zX(z)+zX(z))+h[7]zX(z).2Acomputationallyefficientfactor-of-3interpolatorstructurebasedontheaboveequationsisthenasshownbelow:w1[n]z-1z-1z-1z-13y[n]h[2]h[5]h[6]h[3]h[0]z-1x[n]-1zw3[n]z-1z-1z-1z-13-1-1zzh[7]-1-1zzh[4]3w2[n]h[1]N-1-i-1-2-3-(N-2)-(N-1)10.20H(z)=åz=(1+z)+(z+z)+L+(z+z)i=0(N/2)-1-1-2-4-(N-2)-12-2i=(1+z)(1+z+z+L+z)=(1+z)G(z)whereG(z)=åz.Usingai=0æ(N/4)-1ösimilartechniquewecanshowthatG(z)=(1+z-1)çåz-2i÷.Thereforewecanwriteç÷èi=0øæ(N/4)-1ö(N/4)-1H(z)=(1+z-1)(1+z-2)çåz-2i÷=(1+z-1)(1+z-2)F(z4)whereF(z)=åz-i.Continuingç÷èi=0øi=0426
-1-2-2K-1thisdecompositionprocessfurtherwearriveatH(z)=(1+z)(1+z)L(1+z),whereKN=2.Realizationofafactor-of-16decimatorusingabox-cardecimationfilterisasindicatedbelow:x[n]16z–1y[n]–1z16–1z16–1z1610.21Letu[n]denotetheoutputofthefactor-of-Linterpolator.Then,¥2å(u[n]-u[n-1])n=-¥E=(1)¥2åu[n]n=-¥¥åu[n]u[n-1]n=-¥andC=.(2)¥2åu[n]n=-¥SubstitutingEq.(2)inEq.(1)wegetE=2(1-C).Hence,asC®1,i.e.,asthesignalu[n]becomeshighlycorrelated,E®0.¥p1jwjwjwNow,byParseval"srelation,åu[n]v[n]=òU(e)V*(e)dw,whereU(e)and2pn=-¥-pjwV(e)aretheDTFTsofu[n]andv[n],respectively.Ifweletv[n]=u[n–1]inthenumeratorofEq.(1)andv[n]=u[n]inthedenominatorofEq.(1),thenwecanwritepp1jw2jwjw2òU(e)edwòU(e)cos(w)dw2p-p0E==,pp122jwjwòU(e)dwòU(e)dw2p-p0assumingu[n]tobearealsequence.Ifx[n]isassumedtobeabroadbandsignalwithaflatjwmagnitudespectrum,i.e.,X(e)=1for0£w£p,thenthemagnitudespectrumofu[n]is427
ì1,for0£wws)val=val+abs(H0(k))^2;endendDuetothenon-linearnatureofthefunctiontobeoptimized,differentvaluesofkinitshouldbeusedtooptimizetheanalysisfilter"sgainresponse.Thegainresponsesofthetwoanalysisfiltersisasshownbelow.Fromthegainresponse,theminimumstopbandattenuationoftheanalysisfiltersisobservedtobeabout24dB.Gainresponseoftheanalysisfilters100-10-20-30-40-5000.20.40.60.81w/pM10.16TheMATLABprogramusedtogeneratetheprototypelowpassfilterandtheanalysisfiltersofthe4-channeluniformDFTfilterbankisgivenbelow:L=21;f=[00.20.31];m=[1100];w=[101];N=4;WN=exp(-2*pi*j/N);plottag=["-";"--";"-.";":"];h=zeros(N,L);n=0:L-1;h(1,:)=remez(L-1,f,m,w);fori=1:N-1h(i+1,:)=h(1,:).*(WN.^(-i*n));end;clf;fori=1:N[H,w]=freqz(h(i,:),1,256,"whole");plot(w/pi,abs(H),plottag(i,:));holdon;end;gridon;holdoff;xlabel("Normalizedfrequency");ylabel("Magnitude");title("MagnituderesponsesofuniformDFTanalysisfilterbank");Theplotsgeneratedbytheaboveprogramisgivenbelow:465
M10.17Thefirst8impulseresponsecoefficientsofJohnston"s16AlowpassfilterHL(z)aregivenby0.001050167,–0.005054526,–0.002589756,0.0276414,–0.009666376,–0.09039223,0.09779817,0.4810284Theremaining8coefficientsaregivenbyflippingthecoefficientslefttoright,FromEq.(10.157),thehighpassfilterinthetree-structured3-channelfilterbankisgivenbyH2(z)=z–15HL(z–1).ThetworemainingfiltersaregivenbyH0(z)=HL(z)HL(z2)andH1(z)=HL(z)HH(z2).TheMATLABprogramusedtogeneratethegainplotsofthe3analysisfiltersisgivenby:G1=[0.10501670e-2-0.50545260e-2-0.25897560e-20.27641400e-1-0.96663760e-2-0.90392230e-10.97798170e-10.48102840];G=[G1fliplr(G1)];n=0:15;H0=(-1).^n.*G;Hsqar=zeros(1,31);Gsqar=zeros(1,31);Hsqar(1:2:31)=H0;Gsqar(1:2:31)=G;H1=conv(Hsqar,G);H2=conv(Gsqar,G);[h0,w0]=freqz(H0,[1]);[h1,w1]=freqz(H1,[1]);[h2,w2]=freqz(H2,[1]);plot(w0/pi,20*log10(abs(h0)),"b-",w1/pi,20*log10(abs(h1)),"r-",w2/pi,20*log10(abs(h2)),"g-.");axis([01-12020]);gridon;xlabel("NormalizedFrequency");ylabel("GainindB");Theplotsgeneratedaregivenbelow:466
20H(z)H(z)H(z)0210-20-40-60-8000.20.40.60.81w/p467
Chapter11(2e)750011.1IfR=1250,thenthefrequencyresolution==6Hz.12507500Iffrequencyresolution=4.5Hz,thenR==1667points.4.5800011.2(a)resolution==31.25Hz.2568000(b)Weneedtotakea=500-pointDFT.1680008000(c)resolution=.HencedesiredlengthNoftheDFTisgivenbyN==62.5.N128inceNmustbeanintegerwechooseN=63astheDFTsize.kF200´104kF350´104TT11.3(a)F===2000Hz,F===3500Hz,200R1000350R1000kF824´104TF===8240.824R1000kF195´14´103kF339´14´103TT(b)F===2702.97Hz,F===4699Hz,195R1010339R1010kF917´14´103TF===12710.89.917R1010kF97´104kF187´104TT(c)F===1876.2,F===3617.02,97R517187R517kF301´104TF===5822.05.301R51711.4Letthesamplessequenceberepresentedasg[n]=cos(wn+f).Then,itsDTFTisgivenbyo¥jwjf-jfG(e)=på(ed(w-wo+2pl)+ed(w+wo+2pl)).l=-¥1,0£n£N-1,Thewindowedsequenceisgivenbyg[n]=g[n]×w[n]wherew[n]=The{0,otherwise.DTFTofthewindowedsequenceisthengivenbyjw1jfj(w-w)1-jfj(w+w)jwG(e)=eY(eo)+eY(eo)whereY(e)istheDTFTofw[n]andis2R2RRjw-jw(N-1)/2sin(wN/2)givenbyY(e)=e.Rsin(w/2)jw2pkTheDFTG[k]isasampledversionofG(e)sampledatw=.TopreventleakagekN2plWphenomenonwerequirethatw=forsomeintegerl.Noww=whereWistheoNoFT
2plFTangularfrequencyoftheanalogsignal.IfW=,thentheCTFTG(jW)oftheanalogNasignalcanbedeterminedfromG[k].o11.5g(t)=cos(200pt).IfwerequireG[k]=0forallvaluesofkexceptk=64andk=448,wea2plFTrequireW=200ptobeoftheformW=forl=64.ThereforeooN2p´64´FT200p=orF=800Hz.512T1200011.6(a)F=6kHz.LetF=12.Theresolution=F/R.Hence,R==4616.mTT2.612000(b)R==4000.Theclosestpower-of-2to4000isR=4096.Hence,a4096-pointFFT3shouldbeused.11.7x[n]=Acos(2pfn/64)+Bcos(2pfn/64).SinceX[k]=0forallvaluesofkexceptk=15,122pf12p´152pf12p´2727,37and49,itfollowsthenthateither=or=.Therefore,64646464f=15or27.1Case(i):f=15,A=64,andf=27,B=32.Therefore,12x[n]=64cos(30pn/64)+32cos(54pn/64).Case(ii):f=27,A=32,andf=15,B=64.Therefore,12x[n]=32cos(54pn/64)+64cos(30pn/64).Thus,therearetwopossiblesolutionsasindicatedabove.211.8(a)AdirectDFTevaluation(noFFT)requiresN=250,000complexmultiplicationsandN(N-1)=249,500complexadditions.1(b)Digitalresolution=R==0.002.500100(c)Analogfrequencyresolution===0.2Hz.500FT(d)Thestopbandedgeofthefiltershouldbeat=50Hz.231(e)DigitalfrequencycorrespondingtotheDFTsampleX[31]==0.062andthat500390correspondingtotheDFTsampleX[390]==0.78.50031AnalogfrequencycorrespondingtotheDFTsampleX[31]=2p´´100=12.4prad/sand500390thatcorrespondingtotheDFTsampleX[390]=2p´´100=156prad/s.500
(f)lengthofFFT=512,andtherefore12zer-valuedsamplesshouldbeappended.512(g)TheFFTsampleindexthatisclosesttotheoldDFTsampleX[31]isk=31´=32and500512theFFTsampleindexthatisclosesttotheoldDFTsampleX[390]isk=390´@399.36500andhencek=399istheclosest.11.9Inodertodistinguishtwocloselyspacedsinusoidswerequirethattheseparationbetweenthetwofrequenciesbeatleasthalfofthemain-lobewidthofthewindowbeingused.FromTable7.3,themain-lobewidthsofthe4windowsaregivenby:4p4p2(a)Rectangularwindow:Dw==.Therefore,f>f+=0.283.N6021608p8p4(b)Hammingwindow:Dw==.Therefore,f>f+=0.316.N6021608p8p4(c)Hannwindow:Dw==.Therefore,f>f+=0.316.N60216012p12p6(d)Blackmanwindow:Dw==.Therefore,f>f+=0.35.N60216024411.10(a)f>f+=0.268.(b)f>f+=0.286.(c)f>f+=0.286.2111021110211106(d)f>f+=0.304.2111011.11(a)F³2F.Hence,theminimumsamplingfrequencyisF=2F.TmT,minmFT(b)R=£DF.ThereforeF£N(DF).HencethemaximumsamplingfrequencyisNTF=N(DF).T,max(c)IfF=4kHz,thenF=8kHz.mT,minllIfDF=10HzandN=2,thenF=2(10).T,max¥jw-jwm11.12(a)XSTFT(e,n)=åx[n–m]w[m]e.m=–¥¥¥jw-jwm-jwmGSTFT(e,n)=åg[n–m]w[m]e=å(ax[n–m]+by[n–m])w[m]em=–¥m=–¥¥¥-jwm-jwmjwjw=aåx[n–m]w[m]e+båy[n–m]w[m]e=aXSTFT(e,n)+bYSTFT(e,n).m=–¥m=–¥
¥jw-jwm(b)y[n]=x[n–no].Hence,YSTFT(e,n)=åy[n–m]w[m]em=–¥¥-jwmjw=åx[n–no-m]w[m]e=XSTFT(e,n–no).m=–¥¥jwjw-jwm(c)y[n]=eox[n].Hence,Y(e,n)=åy[n–m]w[m]eSTFTm=–¥¥-j(w-w)mj(w-w)=åx[n-m]w[m]eo=X(eo,n).STFTm=–¥¥jw-jwm11.13XSTFT(e,n)=åx[n–m]w[m]e.Replacingminthisexpressionwithn–mwem=–¥¥¥jw-jwn-jwm-jwn-jwmarriveatXSTFT(e,n)=åx[m]w[n–m]ee=eåx[m]w[n–m]em=–¥m=–¥-jwn-jwjw-jwn-jweX(e,n).Hence,X(e,n)=eX(e,n).Thus,incomputingSTFTSTFTSTFTjwX(e,n)theinputx[n]isshiftedthroughthewindoww[n],whereas,incomputingSTFTjwX(e,n)thewindoww[n]isshiftedthroughtheinputx[n].STFT¥jw-jwm11.14XSTFT(e,n)=åx[m]w[n–m]e.Hence,byinverseDTFTweobtainm=–¥2p1jwjwmx[m]w[n-m]=X(e,n)edw.Therefore,2pòSTFT0¥2p¥1jwjwmåx[m]w[n-m]=2pòåXSTFT(e,n)edw,whichisequivalentton=–¥0n=–¥¥2p¥1jwjwmx[m]åw[n-m]=x[m]W[0]=2pòåXSTFT(e,n)edw,wheren=–¥0n=–¥¥¥2p¥1jwjwmW[0]=åw[n–m]=åw[n]orx[m]=2pW[0]òåXSTFT(e,n)edw.n=–¥n=–¥0n=–¥11.15FromthealternatedefinitionoftheSTFTgiveniProblem11.13wehave¥jw-jwmXSTFT(e,l)=åx[m]w[l-m]e.Therefore,m=-¥
¥¥¥jwjwn-jw(m-n)åXSTFT(e,l)e=ååx[m]w[l-m]e.Hence,l=-¥l=-¥m=-¥2p¥¥¥2pjwjwn-jw(m-n)òåXSTFT(e,l)edw=ååx[m]w[l-m]òedw.0l=-¥l=-¥m=-¥02pjwk2p,ifk=0,Now,òedw={0,ifk¹0.Thus,,0¥¥2p¥jwjwnååx[m]w[l-m]×2pd[m-n]=òåXSTFT(e,l)edw,orl=-¥m=-¥0l=-¥¥2p¥jwjwn2påw[l-n]×x[n]=òåXSTFT(e,l)edw.l=-¥0l=-¥2p¥¥1jwjwnLetW[0]=ån=-¥w[n].Thenx[n]=2pW[0]òåXSTFT(e,l)edw.0l=-¥¥jw-jwm11.16XSTFT(e,n)=åx[n–m]w[m]e.Hence,m=–¥¥-j2pkm/N-j2pkn/NXSTFT[k,n]=åx[n–m]w[m]e=x[n]*w[n]e.Orinotherwords,m=–¥X[k,n]canbeobtainedbyfilteringx[n]byanLTIdystemwithanimpulseresponseSTFT-j2pkn/Nhk[n]=w[n]easindicatedinFigureP11.1.¥jw-jwm11.17XSTFT(e,n)=åx[n–m]w[m]e.Hence,m=–¥¥¥2jw-jwm-jwsXSTFT(e,n)=ååx[n–m]x[n–s]w[m]w[s]ee.Thus,s=–¥m=–¥2p¥¥1jw2jwkr[k,n]=2pòXSTFT(e,n)edw=ååx[n–m]x[n–s]w[m]w[s]d[s+k-m]0s=–¥m=–¥¥=åx[n–m]x[n–m+k]w[m]w[m-k].m=–¥11.18(a)LengthofthewindowN=FtT
NFTt(b)ThenumberofcomplexmultiplicationsisC=logN=log(Ft).AnFFTis2222TperformedaftereveryKamples,i.eaftereveryK/Fseconds.Thus,thenumberofcomplexTCF2tTmultiplicationspersecondis=log(Ft).K/F2K2TT¥11.19jST[k,n]=åx[m]w[n-m]x[m+k]w[n-k-m].m=–¥¥(a)jST[-k,n]=åx[m]w[n-m]x[m-k]w[n+k-m].m=–¥Substituteintheaboveexpressionm–k=s,i.e.m=k+s.Thisyields¥jST[-k,n]=åx[s+k]w[n-k-s]x[s]w[n-s]=jST[k,n].s=–¥¥(b)Letm+k=s.Then,jST[k,n]=åx[s-k]x[s]w[n-s+k]w[n-s].Itfollowsfroms=–¥thisexpressionthatj[k,n]canbecomputedbyaconvolutionofhk[n]=w[n]w[n+k]withSTx[n]x[n–s]asindicatedinFigureP11.2.11.20–aX(z)Y(z)21–aS(z)–1za–12-1AnalysisyieldsS(z)=azS(z)+X(z),andY(z)=–aX(z)+(1-a)zS(z).SolvingtheX(z)firstequationwegetS(z)=,whichwhensubstitutedinthesecondequationyields-11-az-1Y(z)-a+zaftersomealgebra=.ThetransferfunctionisthusseentobeaType1X(z)1-az-1allpassoftheformofEq.(6.58)andcanthusberealizedusinganyoneofthesingle-multiplierstructuresofFigure6.36.-1Y(z)-a+zA(z)11.21AnalysisofthestructureofFigureP11.4yields=,whereA(z)denotestheX(z)1-az-1A(z)transferfunctionofthe"allpassreverberator".NotethatthisexpressionissimilarinformtothatofEq.(6.58)with"d"replacedby"-a"and"z–1"replacedby"z–1A(z)".HenceanefficientrealizationofthestructureofFigureP11.4alsoisobtainedreadilyfromanyoneofthestructuresofFigure6.36.Onesuchrealizationisindicatedbelow:
–1X(z)z–1A(z)-aY(z)K1K2é1K11ù11.22G(z)={1-A(z)}+{1+A(z)}=Kê{1-A(z)}+{1+A(z)}ú.222222êë2K222úû2Henceinthiscase,theratioK1/K2determinestheamountofboostorcutatlowfrequencies,K2determinestheamountofdcgainorattenuationatallfrequencies,adeterminesthe-1æ2aö3-dBbandwidthDw3-dB=cosç2÷,andthecenterfrequencywoisrelatedtobè1+aøthroughb=cosw.oalpha=0.8;beta=0.4;K1=[0.9];K2=[0.52];nbp=((1-alpha)/2)*[10-1];dbp=[1-beta*(1+alpha)alpha];nbs=((1+alpha)/2)*[1-2*beta1];dbs=dbp;[Hlp,w]=freqz(nbp,dbp,512);[Hhp,w]=freqz(nbs,dbs,512);holdonfork=1:length(K1)form=1:length(K2)H=K1(k)*Hlp+K2(m)*Hhp;semilogx(w/pi,20*log10(abs(H)));xlabel("Gain,dB");ylabel("omega/pi");clearH;holdon;endendgridonaxis([.011-88]);11.23ThetransposeofthedecimatorstructureofFigure11.63yields
x[n]2E00(z)3z–1E01(z)3z–1–1z–1zE02(z)32E10(z)3y[n]z–1E11(z)3z–1E12(z)311.243H(z)4R0(z)34R0(z)34-1-4zzR1(z)3R1(z)3z3-1-4zzR2(z)3R2(z)3z6(a)(b)R34R0(z)430(z)-1z-1z-1zzR1(z)34R1(z)43z-1z-1z-1zR2(z)34R2(z)43(c)(d)
4E20(z)3-1z4E21(z)-1zz-14Ez-122(z)-1z4E23(z)4E10(z)3-1z4E11(z)-1-1z-1zz4E12(z)-1z4E13(z)4E00(z)3-1z4E01(z)-1z4E02(z)-1z4E03(z)(e)M11.1FiguresbelowillustratetheapplicationofProgram11_1indetectingthetouch-tonedigitsAand3:Touch-ToneSymbol=ATouch-ToneSymbol=3M11.2ForR=16,thetwostrongpeaksoccuratk=3and5.Theassociatedfrequenciesare2p´335w=,orf==0.1875,andf==0.3125.ForR=32,thetwostrongpeaksoccurat116116216510k=5and10.Theassociatedfrequenciesaref==0.15625,andf==0.3125.132232
ForR=64,thetwostrongpeaksoccuratk=11and22.Theassociatedfrequenciesaref=11/64=0.1718,andf=20/64=0.3125.ForR=128,thetwostrongpeaksoccuratk=1221and39.Theassociatedfrequenciesaref=21/128=0.1641,andf=39/128=0.3047.12Moreover,thelasttwoplotsshowanumberofminorpeaksanditisnotclearbyexaminingtheseplotswhetherornotthereareothersinusoidsoflesserstrengthspresentinthesequencebeinganalyzed.AnincreaseinthesizeoftheDFTincreasestheresolutionofthespectralanalysisbyreducingtheseparationbetweenadjacentDFTsamples.Alsotheestimatedvaluesofthefrequenciesofthesinusoidgetclosertotheactualvaluesof0.167and0.3076asthesizeoftheDFTincreases.M11.3Astheseparationbetweenthetwofrequenciesdecreases,thedistancebetweenthetwomaximasintheDFTofthesequencedecreases,andwhenf2=0.21,thesecondsinusoidcannotbedeterminedfromtheDFTplot.Thisisduetotheuseofalength-16rectangularwindowtotruncatetheoriginalinfinite-lengthsequence.Foralength-16rectangularwindow,twoadjacentsinusoidscanbedistinguishediftheirangularfrequenciesareapartby4phalfthemainlobewidthofradiansorequivalently,iftheirfrequenciesareapartbyN2=0.0625.NotethattheDFTlengthR=128isallplots.N
M11.4f2=0.21,f1=0.18.Hence,Df=0.03.ForaHammingwindowthemainlobewidth8pDML=.TheDFTlengthR=128inallplots.N(i)N=16.Hereitisnotpossibletodistinguishthetwosinusoids.Thisalsocanbeseen8fromthevalueofDML==0.5,andhence,halfofthemainlobewidthisgreaterthanDf.16(ii)IncreasingNto32,makestheseparationbetweenthetwopeaksvisible.However,itisdifficulttoidentifythepeaksaccurately.
(iii)IncreasingNto64,makestheseparationbetweenthetwopeaksmorevisible.However,itisstilldifficulttoidentifythepeaksaccurately.(iv)ForN=128,theseparationbetweenthetwopeaksclearlyvisible.Notealsothesuppressionoftheminorpeaksduetotheuseofataperedwindow.M11.5ResultsaresimilartothatinProblemM11.4.M11.6f2=0.21,f1=0.18.Hence,Df=0.03.TheDFTlengthR=128inallplots.
(i)ForN=16,itisdifficulttoidentifythetwosinusoids.(ii)ForN=32,therearetwopeaksclearlyvisibleatk=36and43,respectively.(iii)ForN=64,itisdifficulttoidentifythetwosinusoids.(iv)ForN=128,therearetwopeaksclearlyvisibleatk=37and41,respectively.M11.7
TheSNRcomputedbytheprogramis–7.4147dB.Thereisapeakatthefrequencyindex29whosenormalizedfrequencyequivalentisequalto29/256=0.1133.HencetheDFTapproachhascorrectlyidentifiedthefrequencyofthesinusoidcorruptedbythenoise.M11.8TheSNRcomputedbytheprogramis–7.7938dB.Thereisapeakatthefrequencyindex42whosenormalizedfrequencyequivalentisequalto42/256=0.1641.HencetheDFTapproachhascorrectlyidentifiedthefrequencyofthesinusoidcorruptedbythenoise.M11.9Thefollowingprogramcanbeusedtoplotthepowerspectrumestimatesofthenoisecorruptedsignalwindowedbyarectangularwindow.%PowerSpectrumEstimation%nfft=input("Typeinthefftsize=");n=0:1000;g=sin(0.1*pi*n)+sin(0.2*pi*n)+randn(size(n));window=boxcar(nfft);[Pxx,f]=psd(g,nfft,2,window);plot(f/2,10*log10(Pxx));gridxlabel("omega/pi");ylabel("PowerSpectrum,dB");titletext=sprintf("PowerSpectrumWithWindowSize=%d",nfft);title(titletext);
Thepowerspectrumestimatewithwindowsize=64and256areshownbelowPowerSpectrumWithWindowSize=64PowerSpectrumWithWindowSize=25615201510105500-5-5-1000.10.20.30.40.500.10.20.30.40.5w/pw/pM11.10Program_11_4canbeusedtoevaluatetheBartlettandWelchestimatebychangingg=2*sin(0.12*pi*n)+sin(0.28*pi*n)+randn(size(n));tog=sin(0.1*pi*n)+sin(0.2*pi*n)+randn(size(n));andthelinewindow=hamming(256)withwindow=boxcar(1024)fortheBartlettestimate,andwithwindow=hanning(1024)fortheWelchestimate.Alsosetnfft=1024.TheplotoftheBartlettestimateofthepowerspectrumestimateforthenoisecorruptedsignalisshownbelowBartlettEstimate(Overalp=0samples)3020100-10-20-3000.10.20.30.40.5w/pTheWelchestimatesofthepowerspectrumwithanoverlappingHannwindowforoverlapsof64and128samplesareshownbelow
WelchEstimate(Overalp=64samples)WelchEstimate(Overalp=128samples)30302020101000-10-10-20-20-30-3000.10.20.30.40.500.10.20.30.40.5w/pw/pM11.11Usethestatementb=remez(11,[00.30.51],[1100],[11]);todesigntheFIRfilter.Thenusethestatement[d,p0]=lpc(b,order);andrunitfororder=4,5and6todetermineanequivalentall-polemodel.ThemagnituderesponseoftheorignialFIRfilter(solidline)andtheall-poleequivalent(dottedline)areshownbelowfordifferentvaluesoforder.Orderofall-poleequivalent=4Orderofall-poleequivalent=51.51.5OriginalOriginalEstimateEstimate110.50.50000.20.40.60.8100.20.40.60.81w/pw/pOrderofall-poleequivalent=61.5OriginalEstimate10.5000.20.40.60.81w/p'