experiment6_2.m

来自「Simon Haykin的《Communication Systems》(《通信」· M 代码 · 共 82 行

M
82
字号
% Experiment 6, CS: Haykin% Generating 127-chip PN sequences% polynomial1(x)  = x^7 +x+1% polynomial2(x) = x^7+x^6 + x^5 + x^4 + 1% Autocorrelation and cross correlation functions% requires functions pn_corr.m, PNseq.m, shift_register.m to run% polynomialspol1=[1 0 0  0 0 0 1 1];pol2=[1 1 1 1  0 0 0 1];% chip sizeN=127;% generating the PN sequencepnseq1 = PNseq(pol1);pnseq2 = PNseq(pol2);% mapping  antipodal signals (0-->-1,  1-->1)u=2*pnseq1-1;v=2*pnseq2-1;% autocorrelation of pnseq1[corrf]=pn_corr(u, u, N);% printsfigure(1)plot(-125:126,corrf(2:253)); axis([-126, 126,-10, 150])xlabel(' Delay \tau')ylabel(' Autocorrelation function R_{c}(\tau)')%autocorrelation of pnseq2[corrf]=pn_corr(v, v, N)% printsfigure(2)plot(-125:126,corrf(2:253)); axis([-126, 126,-10, 150])xlabel(' Delay \tau')ylabel(' Autocorrelation function R_{c}(\tau)')% cross correlation of pnseq1, pnseq2[c_corr]=pn_corr(u, v, N)% printsfigure(3)plot(-125:126,c_corr(2:253)); axis([-126, 126,-50, 50])xlabel(' Delay \tau')ylabel(' Cross-correlation function R_{ji}(\tau)')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?