pr7_34.m
来自「Spread Spectrum and CDMA Principles and 」· M 代码 · 共 25 行
M
25 行
%Problem 7.34;
%finding minimum distance between group signals for a given synchronous signature set;
S=hadamard(12); %signature matrix, signatures are columns;
dgn=diag(S'*S); S=S*diag(1./sqrt(dgn)); %normalizing all signatures;
Ro=S'*S; %normalized signature correlation matrix;
K=size(S,2); %number of users;
dsqmin=4; %initializing dsqmin;
Eps=[2,zeros(1,K-1)]; %initialize difference vector;
t=cputime;
for k=1:3^K-3^(K-1) %in the loop all possible ternary difference vectors Eps are tried;
ds=Eps*Ro*Eps'; %current squared disrtance;
if ds<dsqmin dsqmin=ds; end; %update dsqmin if for current Eps it is smallest;
%next operators in the loop perform incrementing of Eps in ternary number system {0,2,-2}:
tr=min(find(Eps>-2)); %find minimum position where Eps>-2;
Eps(1:tr-1)=0; %carry of ones realized;
Eps(tr)=2-2*Eps(tr); %ternary incrementing finished;
end;
T=cputime-t;
L=4/(dsqmin+eps); Ldb=10*log10(L);
if dsqmin<1e-12 dsqmin=0; L=inf; Ldb=inf; end;
fprintf('\n');
disp(' min sqdist loss loss,dB T');
disp([dsqmin,L,Ldb,T]);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?