2008-12-22(简略版,仅供参考,如有错误敬请见谅)由于DSP2第一次作业比较简单,因此这里没有给出答案。DSP2第二次作业1.Asinusoidalsignal)2/sin()(πnnx=isappliedtoasecond-orderlinearpredictorasinFig.1.CalculatethetheoreticalACF(Auto-CorrelationFunction)ofthesignalandthepredictioncoefficients.VerifythatthezerosoftheFIRpredictionfilterareontheunitcircleattherightfrequency.UsingtheLMSalgorithmwith1.0=δ,showtheevolutionofthecoefficientsfromtime0=nto.Howisthatevolutionmodifiedifthesignalgorithmisusedinstead.10=n1−z1−z++)(nx)(ne)(1na)(2naFig.1.Second-orderpredictionfilter解:a)计算预测系数理论值(滤波器系数的维纳最优解),由2cos21]2)(sin2sin[21]2)(sin2[sin)]()([)(10πππππkkiiknnEknxnxEkrixx=−=−=−=∑=⎥⎦⎤⎢⎣⎡=⎥⎦⎤⎢⎣⎡=∴2/1002/1)0()1()1()0(rrrrRx,⎥⎦⎤⎢⎣⎡−=⎥⎦⎤⎢⎣⎡==2/10)2()1()]()([rrnxnyEryx11201optxyxaHRra−⎡⎤⎡⎤===⎢⎥⎢⎥−⎣⎦⎣⎦输出最小均方误差理论值可由下式计算:2min00[()]0.5011/2TToptyxJEynHr⎡⎤⎡⎤=−=−⎢⎥⎢⎥−−⎣⎦⎣⎦=其中5.0)0()]([)]([22===rnxEnyEb)FIR滤波器零点:jzzzazHiii±=⇒+=−=−=−∑22111)(,即零点在正弦信号x(n)频率的21,0πω±=对应的z平面位置.c)用LMS算法,n=0~10时系数的近似值LMS:2008-12-22⎩⎨⎧+−+=++++=+)1()()1()1()1()1()()1(nXnHnynenenXnHnHTδ在线性预测误差滤波的LMS算法中:)1()1()]1(),([)()1()](),([)()(21+⇒+−=⇒+=⇒nxnynxnxnXnXnananAnHTT⎩⎨⎧−+=+++=+)()()1()1()1()()()1(nXnAnxnenenXnAnATδ()⎪⎩⎪⎨⎧===TAnnxnnx]0,0[)0(0,0)(),2sin()(π所以,LMS算法下的预测误差滤波器[]⎪⎪⎩⎪⎪⎨⎧⎥⎦⎤⎢⎣⎡−++⎥⎦⎤⎢⎣⎡=⎥⎦⎤⎢⎣⎡++⎥⎦⎤⎢⎣⎡−−+=+)1()()1()()()1()1()1()()()()1()1(212121nxnxnenananananxnxnananxneδ344.000344.00729.027.00027.0081.019.00019.009.01.0001.0010)2(0)2(0)2()2(20)1(0)1(1)1()1(10)0(0)0(0212121−−−−−−−−−−=============aaxenaaxenaand)符号算法[]⎪⎪⎩⎪⎪⎨⎧⎥⎦⎤⎢⎣⎡−++⎥⎦⎤⎢⎣⎡=⎥⎦⎤⎢⎣⎡++⎥⎦⎤⎢⎣⎡−−+=+)1()()]1([)()()1()1()1()()()()1()1(212121nxnxsignnesignnananananxnxnananxneδ)()]([0,1)(nxnxsignnx=∴±=∵2008-12-224.0004.007.03.0003.008.02.0002.009.01.0001.0010)2(0)2(0)2()2(20)1(0)1(1)1()1(10)0(0)0(0212121−−−−−−−−−−=============aaxenaaxenaan2.Asecond-orderadaptiveFIRfilterhastheinputas)2/sin()(πnnx=and)2(5.0)1()()(−+−+=nxnxnxnyasreferencesignal.Calculatethecoefficients,startingfromzeroinitialvalues,fromtimen=0ton=10.Calculatethetheoreticalresidualerrorandthetimeconstantandcomparewiththeexperimentalresults.()1.0=δ解:取1.0=δa)计算n=0~10的系数⎪⎩⎪⎨⎧+++=++−+=+−+−+=)3()1()1()()1()2()1()()1()1()1()2(5.0)1()()(nenXnHnHnXnHnynenxnxnxnyTδ2cos21)(πkkrxx=⎥⎦⎤⎢⎣⎡=⎥⎦⎤⎢⎣⎡=2/1002/1)0()1()1()0(rrrrRx,⎥⎦⎤⎢⎣⎡=⎥⎦⎤⎢⎣⎡++++=2/14/1)1(5.0)0()1()2(5.0)1()0(rrrrrrryx①⎥⎦⎤⎢⎣⎡==−12/11yxxoptrRH2min[()]ToptyxJEynHr=−⎥⎦⎤⎢⎣⎡⎥⎦⎤⎢⎣⎡−−+−−+−+−+−+=2/14/112/1)]2()()2()1()1()(2)2(25.0)1()([222TnxnxnxnxnxnxnxnxnxE08/5)2()1(3)0(25.2=−++=rrr2008-12-22②Theoreticalresidualerror:0)21()(2min=+≈∞⇒∞σδNJJ③Theoreticaltimeconstant:2211111120(,)(0)0.10.5NekxkxkxRrNτλλδλδσδ=≈======×∑是特征值σλ注意:由于均方收敛的时间常数比均值收敛的时间常数小,所以实际应用中采用较保守的理论估计值,即采用均值收敛的时间常数作为算法收敛的时间常数的理论估计值.④利用(2)(3)作迭代:)0(0)(=nnx,0)0()0(21==hh[]⎪⎪⎩⎪⎪⎨⎧⎥⎦⎤⎢⎣⎡+++⎥⎦⎤⎢⎣⎡=⎥⎦⎤⎢⎣⎡++⎥⎦⎤⎢⎣⎡+−+=+)()1()1()()()1()1()()1()()()1()1(212121nxnxnenhnhnhnhnxnxnhnhnyneδ)1(5.0)()1()1(−+++=+nxnxnxny5.01112624.0]0,1[]4095.0,2376.0[1010]4095.0,2376.0[]06561.0,0[6561.0]1,0[]3439.0,2376.0[5.019]3429.0,2376.0[]0,02916.0[2916.0]0,1[]3439.0,2084.0[108]3439.0,2084.0[]0729.0,0[729.0]1,0[]271.0,2084.0[5.017]271.0,2084.0[]0,0324.0[324.0]0,1[]271.0,176.0[106]271.0,176.0[]081.0,0[81.0]1,0[]19.0,176.0[5.015]19.0,176.0[]0,036.0[36.0]0,1[]19.0,14.0[104]19.0,14.0[]09.0,0[9.0]1,0[]1.0,14.0[5.013]1.0,14.0[]0,04.0[4.0]0,1[]1.0,1.0[102]1.0,1.0[]1.0,0[1]1,0[]0,1.0[111.]0,01[]0,1.0[1]0,1[]0,0[000)1()1()1()1()1()()()(−−−−−−−−−−−−−−−−−−+++++TTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTTnHnXnenenXnHnynxnδb)根据实验结果计算残差和时间常数残差=0698.0)11(2=e时间常数:通过观察见,在n为偶数时,误差变化波动大,因此应选择在n为奇数时的误差值确定时间常数较合理.2916.0)9()8()9()9(=−=XHyeT26424.0)11()10()11()11(−=−=XHyeT)0)(,0)()]([(2994.20)()11()]()9([2222)911(222=∞=∞=∞=⇒∞−=∞−−×−eJeEeeeee所以在计算时可假设由于ττ2008-12-22所以实验结果和理论值是符合的.3.Adaptivelineenhancer.Consideranadaptivethird-orderFIRpredictor.Theinputsignalis)()sin()(0nbnnx+=ωwhereisawhitenoisewithpower.Calculatetheoptimalcoefficients.Givethenoisepowerinthesequence)(nb2bσ31,,≤≤iaopti∑=−=31,)()(ioptiinxansaswellasthesignalpower.CalculatetheSNRenhancement.解:a)计算31,,≤≤iaopti⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎣⎡+++=20002000221cos212cos21cos2121cos212cos21cos2121bbbxRσωωωσωωωσ,)1()(+=nxny由于窄带信号为白噪声,时延参数D选择1。⎥⎥⎥⎥⎥⎥⎦⎤⎢⎢⎢⎢⎢⎢⎣⎡=⇒0003cos212cos21cos21ωωωyxr⎥⎥⎥⎦⎤⎢⎢⎢⎣⎡==⇒−optoptoptyxxoptaaarRA3211b)原2021bSNRσ=而∑=−=3122})]({[)}({iioptinxaEnSE)2(2)1()(2)0()(313221232221raaraaaaraaa+++++=031032212322212coscos)(21)(ωωaaaaaaaaa+++⋅++=(信号)2232221)(baaaσ+++(噪声)2008-12-22所以此时])(2coscos)(1[212232221031032212bbaaaaaaaaaSNRσωωσ+++++=))(2coscos)(21(232221031032210aaaaaaaaaSNR+++++=ωω))(2coscos)(21(0/tenhancemen23222103103221aaaaaaaaaSNRSNRSNR+++++==ωωDSPII第三次作业答案一、ThedefinitionofthediscreteSTFTofadigitalsignal{}xnnZ()∈isasfollowing:∑+∞=−∞=−−=mmNkmjemnwmxknX/2)()(),(π,(-windowfunction,-lengthof)。PleaseexplaintheabovediscreteSTFTfromfilteringpointanddemonstratetheOLAmethodoftheinversediscreteSTFT(即证明离散STFT反变换的OLA法,有时又称着OLA综合方法)。)(nwwN)(nw答:1、从滤波器的角度解释STFT分成从低通和带通两部分,具体见课件第四章第17、19页。需要公式和框图说明。2、21()[(,)](0)knjNpLynXpLkeWNπ+∞=−∞=∑,由STFT的定义有:2(,)[()()knjNmXpLkxnwpLneπ+∞−=−∞=−∑],讲p看做常数时,y(n)表达式中中括号部分是对X(pL,k)做IDFT变换,即为:yp(n)=x(n)w(pL-n)。所以:()()()()()[](0)(0)ppLLynxnwpLnxnwpLnWW+∞+∞=−∞=−∞=