資源簡介
平均周期圖 譜估計 matlab版 平均周期圖 譜估計 matlab版
代碼片段和文件信息
%%
%%信號源1bartlett法
clear?all;
close?all;
clc;
L=50;%數據分段段數
M=512;%每段采樣數據點數
N=L*M;%采樣點個數
MU=0;%噪聲均值
D=0.101;%噪聲方差
times=100
for?i=1:times
v=normrnd(MUsqrt(D)N1);%隨機產生均值為MU方差為D的高斯白噪聲
fs=1;%采樣頻率為1hz
t=1/fs;%采樣周期
f1=0.05;
f2=0.40;
f3=0.42;
z=0;
a1=-0.85;
for?i=1:N
????z=-1*a1*z+v(i);
????x(i)=cos(2*pi*f1*i)+cos(2*pi*f2*i)+cos(2*pi*f3*i)+0.5*z;
end
P=0;
for?i=1:L
????for?j=1:M
????x1(j)=x(j+(i-1)*L);%X1取每段數據的暫存矢量
????end
?X=fft(x1);
P=(X.*conj(X))/M+P;
end
P=P/L;
P=10*log10(P);
n=0:(M/2-1);
f=n/M;
subplot(222);
plot(fP(1:M/2));
hold?on;
xlabel(‘頻率/hz‘);
ylabel(‘功率db‘);
title(‘信號源1的估計功率譜圖‘);
end
%%
%%信號源2
clear?all;
close?all;
clc;
N=1024;%采樣點數
M=32;%每段采樣數據點數
L=N/M;%數據段數;
MU=0;
D=1;
v=normrnd(MUsqrt(D)N1);%隨機產生均值為MU方差為D的高斯白噪聲
fs=1;%采樣頻率為1hz
t=1/fs;%采樣周期
%?f1=0.05;
%?f2=0.40;
%?f3=0.42;
a1=-1.35;
a2=1.34;
a3=-0.66;
a4=0.24;
x=zeros(N+41);
for?i=5:N+4
x(i)=-a1*x(i-1)-a
- 上一篇:AR 譜估計 matlab版
- 下一篇:MATLAB自動多閾值分割
評論
共有 條評論