?? mc_spreading.m
字號:
% spreading.m
%
% Function to perform spreading codes
%
% Programmed by SP.Feng
%
function [S]=mc_spreading(inputData,numUser,numData,cSpread,spreadLength)
%****************** variables *************************
% inputData : input data (numUser-by-numData matrix)
% numUser : Number of paralell users
% numData : Number of data
% spreadLength : length of spreading codes
% *****************************************************
% cSpread=[1 1 1 1 1 1 1 1;1 -1 1 -1 1 -1 1 -1;...
% 1 1 -1 -1 1 1 -1 -1;1 -1 -1 1 1 -1 -1 1;...
% 1 1 1 1 -1 -1 -1 -1;1 -1 1 -1 -1 1 -1 1;...
% 1 1 -1 -1 -1 -1 1 1;1 -1 -1 1 -1 1 1 -1];
S = zeros(numUser,numData*spreadLength);
for n=1:numData
for k=1:spreadLength
tempS(k) = cSpread(k)*inputData(:,n);
end
S(:,(n-1)*spreadLength+1:n*spreadLength) = tempS;
end
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -