資源描述:
《用burg法實現(xiàn)功率譜估計》由會員上傳分享,免費在線閱讀,更多相關(guān)內(nèi)容在教育資源-天天文庫。
1、用burg法實現(xiàn)功率譜估計一.數(shù)據(jù)為:實現(xiàn)功率譜估計的matlan源代碼:clearFs=500;n=0:1/Fs:0.5;w1=200*pi;A1=5;w2=300*pi;A2=12;xn=A1*(cos(w1*n)+j*sin(w1*n))+A2*(j*sin(w2*n)+cos(w2*n))+randn(size(n));%xn=A1*exp(jw1n)+A2*exp(jw2n);subplot(211);plot(n,xn);xlabel('n');ylabel('xn');title('xn=A1*exp(jw1n)+A2*exp(jw2n)+e(n)'
2、);ymax_xn=max(xn)+0.2;ymin_xn=min(xn)-0.2;axis([00.5ymin_xnymax_xn]);p=floor(length(xn)/3)+2;nfft=1024;[xpsd,f]=pburg(xn,p,nfft,Fs);pmax=max(xpsd);xpsd=xpsd/pmax;xpsd=10*log10(xpsd);subplot(212);plot(f,xpsd);title('PowerSpectralestimatewithburg');ylabel('PowerSpectralestimate(dB)');xl
3、abel('f(Hz)');gridon;ymin_psd=min(xpsd)-1;ymax_psd=max(xpsd)+1;axis([0Fs/2ymin_psdymax_psd]);實驗結(jié)果:(1)下圖依次是階數(shù)為N/3,N/2二.數(shù)據(jù)為:Matlab源代碼:clearclf'clcN=100;Fs=500;%產(chǎn)生x1信號即AR信號vn=rands(1,N);xn=zeros(1,N);xn(1)=vn(1);xn(2)=vn(2);a1=0.78;a2=-0.96;forn=3:Nxn(n)=vn(n)+a1*xn(n-1)+a2*xn(n-2)endsub
4、plot(211);plot(xn);title('xn(n)=noise(n)+a1*xn(n-1)+a2*xn(n-2)');p=floor(length(xn)/5);nfft=1024;[xpsd,f]=pburg(xn,p,nfft,Fs);pmax=max(xpsd);xpsd=xpsd/pmax;xpsd=10*log10(xpsd);subplot(212);plot(f,xpsd);title('PowerSpectralestimatewithburg');ylabel('PowerSpectralestimate(dB)');xlabel('
5、f(Hz)');gridon;ymin_psd=min(xpsd)-1;ymax_psd=max(xpsd)+1;axis([0Fs/2ymin_psdymax_psd]);