📄 init_data_signal.m
字号:
% Return data_signal: upsampled, pulse shaped and channel filtered% version of the data bit%function [burst, compound_channel, Lb] ... = init_data_signal(FS_CONT, PACKET_LENGTH, ... TC,BURST_LENGTH,SYMBOL_LENGTH, ... ths, scrambling, samples, ... channel_p)% $$$ %% $$$ %% $$$ clear all;% $$$ %% $$$ % Necessary path% $$$ addpath ./rng;% $$$ addpath ../src/channel;% $$$ % $$$ % Some parameters% $$$ PLOT_DEBUG = 0;% $$$ FS_CONT = 10e9;% $$$ PACKET_LENGTH = 3;%127*8;% $$$ % Physical layer% $$$ TC = 2e-9; % Chip length in seconds% $$$ %BURST_LENGTH = 4; % LPRF, in chip% $$$ BURST_LENGTH = 16; % HPRF, in chip% $$$ SYMBOL_LENGTH = 512; % In chip% $$$ NHOP = SYMBOL_LENGTH/BURST_LENGTH/4;% $$$ TF = SYMBOL_LENGTH*TC;% $$$ fprintf('Number of data bit = %d\n',PACKET_LENGTH);% $$$ fprintf('Number of hops available = %d\n',NHOP);% $$$ % Multipath channel% $$$ CH_MODEL = 1;% $$$ CH_ATT_THLD_DB = 30; %rays with bigger attenuation are considered 0% $$$ CH_RNG_SEED = sum(100*clock);PLOT_DEBUG = 0;%TF = SYMBOL_LENGTH*TC;fprintf('Number of data bit = %d\n',PACKET_LENGTH);fprintf('Sampling freq.: %.2e\n',FS_CONT);fprintf('Samples: %d %d %d %d\n', ... samples.chip,samples.burst, ... samples.symbol,samples.packet);fs_cont_GHz = FS_CONT / 1e9;% Get the pulse[monopulse,t] = get_monopulse(1,channel_p.chip_span,... channel_p.pulse_width,TC,samples.chip);monopulse = monopulse/norm(monopulse);fprintf('Norm of the pulse = %.4f\n',norm(monopulse));if(PLOT_DEBUG) figure; plot(t,monopulse);end% $$$ % determine pulse -10dB bandwidth% $$$ threshold_dB = -10;% $$$ [Ess,f_high,f_low,BW] = ...% $$$ cp0702_bandwidth(monopulse,1/FS_CONT,threshold_dB);% $$$ fprintf('-10dB BW of the pulse = %d [Hz]\n',BW);% Multipath channel[channel_cont, channel_discr] = mex_channel(channel_p.model, ... fs_cont_GHz, ... channel_p.thld, ... channel_p.seed);uoi_channel_discr = channel_discr(:,4)';uoi_channel_discr = uoi_channel_discr ./ norm(uoi_channel_discr);fprintf('Norm of the cir = %.4f\n',norm(uoi_channel_discr));% Calculate the compound channel of pulse shape and channel impulse response% responsefprintf('Calculate the compound channel\n');compound_channel = conv(uoi_channel_discr,monopulse);%compound_channel = compound_channel ./ (norm(compound_channel)*BURST_LENGTH);compound_channel = compound_channel ./ norm(compound_channel);fprintf('Norm of the compound channel = %.4f\n',norm(compound_channel));if(PLOT_DEBUG) figure; plot(compound_channel);end% Create the sequence of burstsfprintf('Create the burst sequence\n');[burst,Lb] = get_burst_sequence(compound_channel, ... scrambling, ... samples.chip, ... BURST_LENGTH,PACKET_LENGTH);%burst = burst ./ norm(burst);fprintf('Norm of the burst sequence = %.4f\n',norm(burst));if(PLOT_DEBUG) figure; plot(burst);endreturn;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -