get_burst_sequence.m
来自「source Matlab traites the UWB」· M 代码 · 共 35 行
M
35 行
%% function [y,Lb] =% get_burst_sequence(pulse,polarity,samples_per_chip,BURST_LENGTH,PACKET_LENGTH)%function [y,Lb] = get_burst_sequence(pulse,polarity,samples_per_chip, ... BURST_LENGTH,PACKET_LENGTH)Lp = length(polarity);Lb = (BURST_LENGTH-1)*samples_per_chip+length(pulse)-1;pulse_start = zeros(1,Lb*PACKET_LENGTH);pulse_start_idx = cumsum(ones(BURST_LENGTH,1)*samples_per_chip)-samples_per_chip;burst_start_idx = cumsum(ones(1,PACKET_LENGTH)*Lb)-Lb;% Index of the start of each pulsesignal_idx = repmat(pulse_start_idx,1,PACKET_LENGTH) + ... repmat(burst_start_idx,BURST_LENGTH,1)+1;% Is it faster than the convolution?offset = 0:1:length(pulse)-1;signal_idx = reshape(signal_idx,1,BURST_LENGTH*PACKET_LENGTH);for k = 1:length(signal_idx)-1 pulse_start(signal_idx(k)+offset) = ... polarity(k)*pulse + pulse_start(signal_idx(k)+offset);endoffset=1:1:length(pulse_start)-signal_idx(end);pulse_start(signal_idx(end)+offset) = ... polarity(k)*pulse(offset) + pulse_start(signal_idx(end)+offset);y = pulse_start;% $$$ pulse_start(reshape(signal_idx,1,BURST_LENGTH*PACKET_LENGTH)) = polarity;% $$$ y = conv(pulse,pulse_start);% $$$ y = y(1:Lb*PACKET_LENGTH);
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?