simualting the spreading using Walsh Codes

12 ビュー (過去 30 日間)
Anne
Anne 2012 年 5 月 5 日
A = [-1 -1 1 1]; B = [-1 1 -1 1]; C = [1 1 -1 -1];
% Generating the code and its timing sequence:
N = 4; H = hadamard(N);
cA = H(2,:); cB = H(3,:); cC = H(4,:);
% Number of samples per chip: Tc_samp = ones(1,4);
codeA = []; codeB = []; codeC = [];
for k = 1 : length(cA)
codeA = [codeA cA(k)*Tc_samp];
codeB = [codeB cB(k)*Tc_samp];
codeC = [codeC cC(k)*Tc_samp];
end
% Generation of Tx Data:
Tx_data = [];
for k = 1 : length(A)
uA = A(k)*codeA;
uB = B(k)*codeB;
uC = C(k)*codeC;
Tx_data = [Tx_data uA+uB+uC];
end
NN = length(Tx_data)
uAb = []; uBb = []; uCb = [];
for k = 1 : NN / 16
index = (k - 1)*NN/4 + 1 : k*NN/4;
uAb = [uAb sum(Tx_data(index).*codeA)];
uBb = [uBb sum(Tx_data(index).*codeB)];
uCb = [uCb sum(Tx_data(index).*codeC)];
end uAb % Error:
res1 = A-uAb/16;
res2 = B-uBb/16;
res3 = C-uCb/16;
i am unable to understand this code , help me in understanding every statement of this code.

回答 (0 件)

カテゴリ

Help Center および File ExchangeLarge Files and Big Data についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by