?? 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 + -