pngen.m
来自「这个是beyong 3G的一个系统仿真程序,它是MC和CDMA的一个结合系统,采」· M 代码 · 共 24 行
M
24 行
function pn_code = pngen(sqLength, noCodes)
% !!! IMPORTANT this function works together with pnsequence.m function
%Generate Pseudo-Noise(PN) sequence using pnsequence.m function
% (Linear Feedback Shift Registers)
%
% PN = PNSEQUENCE(sqLength,noCodes)
%
% sqLength: Length of PN sequence
% noCodes: Number of PN sequences required
%
% Anvar Narzullaev
% Mobile Communication Lab
% Information and Communication Engineering Department
% Yeungnam University, Korea
poly = primpoly(log2(sqLength+1),'all');
[nn,ll] = size(poly);
if nn < noCodes
nn
error('noCodes should be lower or equal to nn');
end
poly = ((dec2bin(poly)*2-97)+1)/2;
for n = 1:noCodes
pn_code(n,:) = pnsequence(poly(n,:),ones(1,log2(sqLength+1)),sqLength);
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?