資源簡介
譜估計(jì)代碼,含有改進(jìn)經(jīng)典譜估計(jì)和現(xiàn)代譜估計(jì)。

代碼片段和文件信息
%----------------------------------------------------------------------%
%%%%%%%%%%%%%classical?spectrum?estimation%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%Liudan%%%%%%%%%%%
%%%2010-12-11%%%%%%%%
clear?all
close?all
clc
fs=1000;
Ts=1/fs;
n=1024;
t=[0:1:n-1]*Ts;
%%%%%%%%%%周期圖法測頻精度仿真,改變信號(hào)的長度%%%%%%%%%%%%%%%%%%%%%%%%
fc1=150;
fc2=150.1;
fc3=150.015;
snr=0;
sn=10.^(snr/10);
wc1=50*2/fs;
wc2=450*2/fs;
w=[wc1?wc2];
h=fir1(128w);
n0=randn(1n);
n1=conv(n0h);
n1=n1(128/2+1:end-128/2);
std=var(n1);
x=sin(2*pi*fc1*t)+sin(2*pi*fc2*t)+sin(2*pi*fc3*t);
n2=sqrt(3/(2*sn*std))*n1;
n3=fft(n21024);
f=[0:511]*fs/1024;
figureplot(fn3(1:512));
xlabel(‘頻率/Hz‘);
title(‘200Hz帶限噪聲‘);
y=x+n2;
Nfft1=1024;
Sw1=fft(yNfft1);
A1=abs(Sw1).^2/Nfft1;
%?A1=10*log10(A1);
f2=fs*[0:Nfft1/2]/Nfft1;
%?figureplot(f2A1(1:1+Nfft1/2));
%?xlabel(‘頻率/Hz‘);
%?ylabel(‘功率譜‘);
%?title(‘1024點(diǎn)信號(hào)長度周期圖法測頻精度分析‘);
%?%?%%%%%%%%%周期圖法頻譜分辨率的仿真,改變矩形窗函數(shù)的長度%%%%%%%%%%%%%%%%%%%
fc4=300;
fc5=160;
fc6=350;
fc8=400;
fc7=420;
x1=sin(2*pi*fc7*t)+sin(2*pi*fc4*t)+sin(2*pi*fc1*t)+sin(2*pi*fc8*t)+sin(2*pi*fc6*t)+sin(2*pi*fc5*t);
x1=2*sin(2*pi*fc1*t)+2.^0.5*sin(2*pi*fc5*t);
Nfft0=1024*1024;
x12=fft(x1Nfft0);
f2=fs*[0:Nfft0/2]/Nfft0;
x12=abs(x12);
%?%?figureplot(f2x12(1:1+Nfft0/2));
%?%?xlabel(‘頻率/Hz‘);
%?%?ylabel(‘頻譜‘);
%?%?title(‘信號(hào)的fft‘);
n22=sqrt(3/(sn*std))*n1;
y1=x1+n22;
%?y1=x1;
%?window1=rectwin(1024)‘;
%?window1=[window1?zeros(1length(t)-length(window1))];
%?y11=y1.*window1;
%?Nfft2=1024;
%?Sw2=fft(y11Nfft2);
%?A2=abs(Sw2).^2/Nfft2;
%?A2=10*log10(A2);
%?f22=fs*[0:Nfft2/2]/Nfft2;
%?figureplot(f22A2(1:1+Nfft2/2));
%?xlabel(‘頻率/Hz‘);
%?ylabel(‘功率譜/dB‘);
%?title(‘512點(diǎn)矩形窗周期圖法‘);
%?%?%%%%%%%%%%%%%周期圖法改變窗的類型以后的仿真%%%%%%%%%%
window2=rectwin(256)‘;
window2=[window2?zeros(1length(x)-length(window2))];
y11=y1.*window2;
Nfft2=1024*8;
Sw2=fft(y11Nfft2);
A2=abs(Sw2).^2/Nfft2;
A2=10*log10(A2);
f22=fs*(0:Nfft2/2)/Nfft2;
figureplot(f22A2(1:Nfft2/2+1));
xlabel(‘頻率/Hz‘);
ylabel(‘功率譜/dB‘);
title(‘矩形窗周期圖法‘);
window3=bartlett(256)‘;
window3=[window3?zeros(1length(x)-length(window3))];
y11=y1.*window3;
Nfft2=1024*8;
Sw2=fft(y11Nfft2);
A2=abs(Sw2).^2/Nfft2;
A2=10*log10(A2);
f22=fs*(0:Nfft2/2)/Nfft2;
figureplot(f22A2(1:Nfft2/2+1));
xlabel(‘頻率/Hz‘);
ylabel(‘功率譜/dB‘);
title(‘bartlett窗周期圖法‘);
window4=hamming(256)‘;
window4=[window4?zeros(1length(x)-length(window4))];
y11=y1.*window4;
Nfft2=1024*8;
Sw2=fft(y11Nfft2);
A2=abs(Sw2).^2/Nfft2;
A2=10*log10(A2);
f22=fs*(0:Nfft2/2)/Nfft2;
figureplot(f22A2(1:Nfft2/2+1));
xlabel(‘頻率/Hz‘);
ylabel(‘功率譜/dB‘);
title(‘hamming窗周期圖法‘);
window5=hann(256)‘;
window5=[window5?zeros(1length(x)-length(window5))];
y11=y1.*window5;
Nfft2=1024*8;
Sw2=fft(y11Nfft2);
A2=abs(Sw2).^2/Nfft2;
A2=10*log10(A2);
f22=fs*(0:Nfft2/2)/Nfft2;
figureplot(f22A2(1:Nfft2/2+1));
xlabel(‘頻率/Hz‘);
ylabel(‘功率譜dB‘);
title(‘hann窗周期圖法‘);
window6=blackman(256)‘;
window6=[window6?zeros(1length(x)-leng
?屬性????????????大小?????日期????時(shí)間???名稱
-----------?---------??----------?-----??----
?????文件???????3830??2010-12-16?19:23??現(xiàn)代譜估計(jì)?matlab程序\classicalestimation.asv
?????文件???????3830??2010-12-16?19:23??現(xiàn)代譜估計(jì)?matlab程序\classicalestimation.m
?????文件???????2735??2010-12-16?09:26??現(xiàn)代譜估計(jì)?matlab程序\classicalimprovement.m
?????文件???????1415??2010-12-14?19:41??現(xiàn)代譜估計(jì)?matlab程序\LD.m
?????文件???????1390??2010-12-14?13:56??現(xiàn)代譜估計(jì)?matlab程序\modemspetrumestimation.m
?????文件???????1124??2010-12-14?13:33??現(xiàn)代譜估計(jì)?matlab程序\modernspetrumestimation.m
?????目錄??????????0??2012-11-12?21:44??現(xiàn)代譜估計(jì)?matlab程序
-----------?---------??----------?-----??----
????????????????14324????????????????????7
評(píng)論
共有 條評(píng)論