selfcorr.m
来自「本程序实现随机数的产生和在相同调制方式下功率谱比较」· M 代码 · 共 36 行
M
36 行
%--求第一组序列的自相关函数
m=zeros(1,200);
for i=0:199
s=1;
l=zeros(1,200);
for j=i+1:200
l(1,s)=a(1,j);
s=s+1;
end
m(1,i+1)=a*rot90(l,-1); %--求步长为i自相关函数值
end
%--求第二组序列的自相关函数
m1=zeros(1,200);
for i=0:199
s1=1;
l1=zeros(1,200);
for j=i+1:200
l1(1,s1)=a1(1,j);
s1=s1+1;
end
m1(1,i+1)=a1*rot90(l1,-1); %--求步长为i自相关函数值
end
%--分别作两信号序列的自相关函数图
b=1:200;
figure(1)
subplot(211)
plot(b,m,'r');
grid on
title('selfcorr figure for data whose corcoef is 0.2')
subplot(212)
plot(b,m1,'r');
grid on
title('selfcorr figure for data whose corcoef is 0.8');
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?