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

📄 cp0201_2ppm_th.m

📁 利用压缩包内的5和函数产生PPM调制的UWB信号
💻 M
字号:
%FUNCTION 2.4 "cp0201_2PPM_TH"
%
%Introduces the TH code given by 'THcode' and implements binary PPM
%modulation
%'seq' is the input binary stream
%'fc' is the sampling frequency for the generated signal
%'Tc' is the chip time
%'Ts' is the average pulse repetition time
%'dPPM' is the PPM delta shift
%'THcode' is the TH code
%
%The function generate two output streams
%'2PPMTHseq' is the output with both TH and 2PPM
%'THseq' is the output with only the TH
function [PPMTHseq,THseq]=cp0201_2PPM_TH(seq,fc,Tc,Ts,dPPM,THcode)
%----------------------------------------------------------------
%Step One - Implementation of the 2PPM-TH modulator
%----------------------------------------------------------------
dt=1./fc; 
framesamples=floor(Ts./dt);
chipsamples=floor(Tc./dt);
PPMsamples=floor(dPPM./dt);

THp=length(THcode);

totlength=framesamples*length(seq);
PPMTHseq=zeros(1,totlength);
THseq=zeros(1,totlength);
%----------------------------------------------------------------
%Step Two - Main loop for introducing TH and 2PPM
%----------------------------------------------------------------
for k=1:length(seq)
    %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;
    
    %introduction of 2PPM
    index=index+seq(k)*PPMsamples;
    PPMTHseq(index)=1;
end


⌨️ 快捷键说明

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