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

📄 thseq.m

📁 超宽带多用户系统仿真,误码率仿真,内容很好
💻 M
字号:

function THseq=THseq(bits,fc,Tc,Ts,THcode)
% --------------------------------------------------
% Step One - Implementation of the 2PPM-TH modulator
% --------------------------------------------------
%产生信号序列
fc=50e9;
bits=rand(1,20)>0.5;
Tc=1e-9;
Ts=5e-9;
THcode = floor(rand(1,3).*2);
dt = 1 ./ fc;                   % sampling period
framesamples = floor(Ts./dt);   % no. of samples between
chipsamples = floor (Tc./dt);   % no. of samples for t
THp = length(THcode);           % TH-code periodicity

totlength = framesamples*length(bits);
THseq=zeros(1,totlength);
% ------------------------------------------------

for k = 1 : length(bits)
    
    % uniform pulse position
    index = 1 + (k-1)*framesamples;
    
    % introduction of TH
    kTH = THcode(1+mod(k-1,THp));
    index = index + kTH*chipsamples;
    THseq(index) = 1;
end % for k = 1 : length(seq)

⌨️ 快捷键说明

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