📄 thseq.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 + -