get_ep.m
来自「一个UWB仿真程序包」· M 代码 · 共 35 行
M
35 行
%% EP stands for error protection%% EP contains the ths, scrambling and interleaver_state%% function [ep,symbol_start] = get_ep(PACKET_LENGTH, ...% SYMBOL_LENGTH, ...% BURST_LENGTH, ...% samples)%function [ep] = get_ep(PACKET_LENGTH, ... SYMBOL_LENGTH, ... BURST_LENGTH, ... samples)NHOP = SYMBOL_LENGTH/BURST_LENGTH/4;fprintf('Number of hops available = %d\n',NHOP);% $$$ % Get the polarity of the bursts% $$$ polarity = 2*round(rand(1,))-1;% $$$ % $$$ % Time-hopping sequence% $$$ ths = discr_unif(0,NHOP-1,PACKET_LENGTH);% Get the polarity and the time-hopping sequenceinit_reg = [1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0];[polarity,ep.ths] = ... mex_scrambler(1,PACKET_LENGTH*BURST_LENGTH,BURST_LENGTH,log2(NHOP),init_reg);ep.scrambling = 2*polarity-1;% Get the interleaver state%ep.interleaver_seed = round(2^20*rand);ep.interleaver_seed = [];
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?