📄 ccorr_test.m
字号:
fbconnection=[0 1 0 0 1];
mseq=m_sequence(fbconnection);
fbconnection1 =[0 0 1 0 1];
fbconnection2 =[0 1 1 1 1];
goldseq=gold_seq(fbconnection1,fbconnection2);
ind1 = find(mseq==0);
mseq(ind1)=-1;
ind2 = find(goldseq==0);
goldseq(ind2)=-1; %把“0”映射成“ - 1”
r1=ccorr(mseq);
r2=ccorr(goldseq(1,:));
r3=ccorr(goldseq(1,:),goldseq(2,:));
N=length(mseq);
axis=-N+1:N-1; %定义横轴使自相关峰值移位到0 点
plot(axis,r1,axis,r2,'- .',axis,r3,':');
xlabel('k');
ylabel('R(k)');
title('伪随机序列的相关特性');
legend('m 序列自相关特性','Gold 序列自相关特性','Gold 序列互相关特性');
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -