⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 pr7_38.m

📁 Spread Spectrum and CDMA Principles and Applications 书籍和代码
💻 M
字号:
%Problem 7.38;
%simulating oversaturated synchronous CDMA;

clear all; close all;
n=8; %set exponent of two in Hadamard matrix size;
K=2^n; %Hadamard matrix size;
N=242; %set signature length, N<K;
S=hadamard(K); %Hadamard matrix;
S=S(1:N,:); %signature matrix ready, signatures are columns;
Nmt=10000; Pr=0; %initialization of cycle in k;
for k=1:Nmt
    B=2*unidrnd(2,1,K)-3; %data vector;
    Y=B*S'; %group signal;
    Dm=Y*S; %vector of correlations in all single-user receivers;
    Be=sign(Dm); %decisions on received users bits;
    x=find(B~=Be); %numbers of users with erroneus decisions;
    Pr=Pr+length(x); %cumulative number of errors;
end;
fprintf('\n');
Pre=Pr/(K*Nmt); %bit error probability;
fprintf('bit error probability BER= %f',Pre);

⌨️ 快捷键说明

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