nti_tr_uwb_1.asv

来自「这是一个较为完整的tr方式uwb接收机的M文件」· ASV 代码 · 共 50 行

ASV
50
字号
%-----------------------------------------------------------------------
%generate tx

%-----------------------------------------------------------------------
%generate channel impulse response
 h = uwb_imr(1,1);
 h = h(1:80); % select proper channel length to make sure there is no IFI
 
%-----------------------------------------------------------------------
%basic settings, the same as in file "nTi_tr_uwb_2.m"
sample_time = 1e-10;
Ns = 1; %Ts/Tf
nTp = 10;
nTd = 80;
nTf = 2*(nTp+nTd);
nTs = Ns*nTf;

data_length = 100;

%-----------------------------------------------------------------------
%generate reference and data pulse in a symbol time Ts, not modulated
[reference,data] = tr_pulse_train(sample_time,nTp,nTd,nTf,Ns);

%-----------------------------------------------------------------------
%small trick for speed
reference = conv(reference,h);
reference = reference(1:nTs);

data = conv(data,h);
data = data(1:nTs);
       
%-----------------------------------------------------------------------    
%random binary source
source = randsrc(1,data_length);
% sourcee = [sourcee,source];

%-----------------------------------------------------------------------
%generate transmitted signal
tx_r = [];
tx_d = [];
for i=1:data_length %n bit
    tx_r = [tx_r ; reference];
    tx_d = [tx_d ; source(i)*data ]; %modulation
end
tx = tx_r + tx_d; %n bit


        

⌨️ 快捷键说明

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