【发布时间】:2019-05-23 16:55:34
【问题描述】:
我需要更正这段代码,上面写着“维度 1 固定在左侧,但在右侧有所不同([84480 x 1]...”
我正在尝试使用定点转换器来转换此代码。但是,对于 rxWaveform,这个维度 1 的错误是固定在左侧的……
rxWaveform = rxWaveform(1+offset:end,:);
function rxWaveform = new_synch(rxWaveform,pssRef)
%PSSIndices = ltePSSIndices(enb); % getting PSS indexes
%pssGrid = lteDLResourceGrid(enb); % generate empty sub frame for PSS symbols
%pssGrid(PSSIndices) = ltePSS(enb); % map PSS symbols into the subframe
%pssRef = lteOFDMModulate(enb,pssGrid); % generate PSS reference signal via LTE OFDM
% getting the lenghts of the received waveform and PSS reference signal
rxSize = size(rxWaveform,1);
pssSize = size(pssRef,1);
% performing correlation between received waveform and pss symbols
pssCorr = xcorr(rxWaveform,pssRef);
% segmenting resultant vector to identify the first local maximum
pssCorr = pssCorr(rxSize - pssSize:rxSize + pssSize,:);
% extract the index of first local maximum, M is not useful here, just for
% the output result
[M,index] = max((abs(pssCorr)));
%calculating offset using local maximum
offset = index - pssSize -1; % subtracted from 1 due to shift in the
rxWaveform = rxWaveform(1+offset:end,:);
end
【问题讨论】:
标签: matlab dimensions fixed-point