Does the NRHDLDownlinkReceiver work for channel bandwidth = 10mHz and 5mHz? Even though SSB is transmitted in the simulated test cases, none was detected.

4 次查看(过去 30 天)
The simulated test cases are generated using the 5G Waveform Generator tool, under the downlink FRC category.
The parameters for the simulated waveforms are:
  • Frequency range = FR1
  • MCS = QPSK
  • Subcarrier spacing = 15 kHz
  • Channel bandwidth = 5 MHz/ 10 MHz
  • Duplex mode = FDD
  • Subframes = 10
  • Layers = 1
  • Cell identity = 8
  • RNTI = 1
  • Windowing source = Auto
  • Sample rate source = Auto
According to the resource grid, an SSB has been generated in slot 0
However, when ran through the NRHDLDownlinkReceiver code, which is as such:
%% Generate a Test Waveform
%
% This section shows how to use the MATLAB reference functions to
% search for SSBs in a waveform, demodulate and decode an SSB to recover the MIB, and recover the scheduled SIB1.
%
% Use the |nrhdlexamples.generateRxWaveform| function to generate
% a 5G FR1 waveform containing SSB bursts and the corresponding SIB1 transmissions.
% Change the |simulationCase| to explore different parameter sets. The full
% set of simulation cases is shown.
rxWaveform = rx.waveform;
minChanBW = 5;
Lmax = 16;
rxSampleRate = rx.Fs;
% scsSSB = rx.config.waveform.SSBurst.SubcarrierSpacingCommon;
FoCoarse = 0;
% disp('Test waveform configurations:')
% disp(nrhdlexamples.generateRxWaveform('list'));
%
% rng('default');
%
% simulationCase = "SimCase 1";
% [rxWaveform,ssbPattern,minChanBW,Lmax,rxSampleRate,txMIB,simCase] = nrhdlexamples.generateRxWaveform(simulationCase);
%
% disp("Selected Simulation case:" + newline);
% disp(simCase);
%% Plot the spectogram of the waveform.
% The plot shows a spectogram of the SSBs, CORESET0s, and PDSCH regions
% carrying SIB1. These regions are generated with different power levels.
% The amplitude of each resource element is indicated by its color.
% % Guess scsSSB as 5kHz
% scsSSB = 5;
% figure(1); clf;
% nfft = round(rxSampleRate/(scsSSB*1e3));
% spectrogram(rxWaveform(:,1),ones(nfft,1),0,nfft,'centered',rxSampleRate,'yaxis','MinThreshold',-110);
% title('Spectrogram of the Received Waveform (5 KHz)')
% Guess scsSSB as 15kHz
scsSSB = 15;
figure(2); clf;
nfft = round(rxSampleRate/(scsSSB*1e3));
spectrogram(rxWaveform(:,1),ones(nfft,1),0,nfft,'centered',rxSampleRate,'yaxis','MinThreshold',-110);
title('Spectrogram of the Received Waveform (15 KHz)')
% Guess scsSSB as 30kHz
scsSSB = 30;
figure(3); clf;
nfft = round(rxSampleRate/(scsSSB*1e3));
spectrogram(rxWaveform(:,1),ones(nfft,1),0,nfft,'centered',rxSampleRate,'yaxis','MinThreshold',-110);
title('Spectrogram of the Received Waveform (30 KHz)')
% % Guess scsSSB as 60kHz
% scsSSB = 60;
% figure(4); clf;
% nfft = round(rxSampleRate/(scsSSB*1e3));
% spectrogram(rxWaveform(:,1),ones(nfft,1),0,nfft,'centered',rxSampleRate,'yaxis','MinThreshold',-110);
% title('Spectrogram of the Received Waveform (60 KHz)')
%% Detect SSBs
%
% Use the |nrhdlexamples.ssbDetect| function to find SSBs in the waveform
% by searching for PSS symbols. This example calls the function with a
% coarse carrier frequency offset estimate of zero and a subcarrier spacing
% determined from the SSB pattern of the generated waveform. The function
% corrects the coarse frequency offset and measures the
% residual fine frequency offset of each SSB. Frequency offset input and
% output are given in Hz. The function returns a list of detected PSS
% symbols as a structure array.
% Display the structure array contents by converting it to a table.
scsSSB = 30;
[pssList,diagnostics] = nrhdlexamples.ssbDetect(rxWaveform,FoCoarse,scsSSB);
% Check if any PSS have been detected
if isempty(pssList)
disp('No PSS found during SSB detection.');
return;
end
disp('Detected PSS list:')
disp(struct2table(pssList));
%%
% The |nrhdlexamples.ssbDetect| function also returns a structure containing
% diagnostic signals. Use this output to plot the PSS correlation
% results. Each peak in the correlator output shown corresponds
% to an entry in the PSS list.
figure(2); clf;
nrhdlexamples.plotUtils.PSSCorrelation(diagnostics,'PSS Correlation');
%%
% Use the |nrhdlexamples.ssbDetect| function to OFDM-demodulate one of the SSBs
% and attempt SSS detection. For this operation, call the function with an optional
% 4th argument that specifies the timing offset and NCellID2 of the desired SSB.
% This example chooses the PSS with the highest correlation metric, however
% you can choose any of the detected SSBs.
% Correct the frequency offset by passing in the sum of the coarse and
% fine frequency offset estimates.
[~,maxCorrIdx] = max(vertcat(pssList.pssCorrelation));
chosenPSS = pssList(maxCorrIdx);
disp('Selected PSS:')
disp(struct2table(chosenPSS));
FoFine = chosenPSS.frequencyOffset;
FoEst = FoCoarse + FoFine;
[ssBlockInfo,ssbGrid,diagnostics] = nrhdlexamples.ssbDetect(rxWaveform,FoEst,scsSSB,chosenPSS);
% Check SSB successfully demodulated
if isempty(ssBlockInfo)
disp('Failed to demodulate selected SSB.');
return;
end
%%
% In demodulation mode, the function returns three outputs instead of
% two. The |ssBlockInfo| structure contains further details of the SSB, such as the
% SSS correlation strength and the overall cell ID. The |ssGrid| output is a matrix
% containing the demodulated OFDM symbols.
% Display the SSB info to confirm that the cell ID is
% correctly decoded.
disp('SSB info for demodulated SSB:')
disp(ssBlockInfo);
%%
% Display the resulting SSB resource grid.
figure(3); clf;
imagesc(abs(ssbGrid));
colorbar;
axis xy;
xlabel('OFDM symbol');
ylabel('Subcarrier');
title('SSB Resource Grid');
%%
%
% The |diagnostics| output includes SSS correlation results for all
% 336 possible sequences. Plot the SSS correlation results.
figure(4); clf;
nrhdlexamples.plotUtils.SSSCorrelation(diagnostics,'SSS Correlation')
%% Search for Cells
%
% This section shows how to use the |nrhdlexamples.cellSearch| function
% to search for and demodulate SSBs when the frequency
% offset and subcarrier spacing are not known.
% As described previously, the |nrhdlexamples.cellSearch| function builds on
% the |nrhdlexamples.ssbDetect| function by adding a search controller
% that looks for SSBs at different subcarrier spacings
% and frequency offsets.
%%
% Apply a frequency offset to test the coarse and fine frequency
% recovery functionality.
Fo = 10000;
t = (0:length(rxWaveform)-1).'/61.44e6;
rxWaveform = rxWaveform .* exp(1i*2*pi*Fo*t);
%%
% Define the frequency range endpoints and subcarrier spacing search space
% and call the |nrhdlexamples.cellSearch| function. The function displays
% information on the search progress as it runs.
% The frequency range endpoints must be multiples of half the
% maximum subcarrier spacing.
frequencyRange = [-60 60];
subcarrierSpacings = [15 30];
[ssBlockInfo,ssbGrid] = nrhdlexamples.cellSearch(rxWaveform,frequencyRange,subcarrierSpacings,struct(...
'DisplayPlots',false,...
'DisplayCommandWindowOutput',true));
% Check cell search successfully found and demodulated SSB.
if isempty(ssBlockInfo)
disp('Cell search failed to find or demodulate SSB.');
return;
end
%%
% As shown in the summary, the receiver returned the correct
% subcarrier spacing of 30 kHz, a cell ID of 1, and the measured frequency offset is close to the
% expected value of 10 kHz.
%% Decode SSB
%
% Use the |nrhdlexamples.ssbDecode| function to decode the SSB resource grid and recover the MIB.
% The |nrhdlexamples.ssbDecode| function is based on the BCH decoding
% stages of the <docid:5g_ug#mw_a4db8282-8f25-4802-8b02-548bab69b7dd NR Cell Search and MIB and SIB1 Recovery> example.
[mibInfo,decodeDiags] = nrhdlexamples.ssbDecode(ssbGrid,ssBlockInfo.NCellID,Lmax);
% Check MIB successfully decoded from SSB.
if mibInfo.err
disp('Failed to decode MIB from SSB.');
return;
end
%%
% Plot the correlation peaks for the DMRS search. DMRS search is performed
% to determine ibar_ssb and the SSB index.
figure(5); clf;
plot(0:7,decodeDiags.dmrsCorr);
title('DMRS Search Correlation');
xlabel('ibar ssb');
ylabel('Correlation strength');
%%
% Plot the PBCH QPSK constellation after phase equalization.
figure(6); clf;
plot(decodeDiags.qpskSymb,'o');
xlim(max(abs(real(decodeDiags.qpskSymb))).*[-1.1 1.1]);
ylim(max(abs(imag(decodeDiags.qpskSymb))).*[-1.1 1.1]);
title('PBCH Symbol Constellation');
xlabel('In-phase');
ylabel('Quadrature');
%%
% Initialising the expected MIB
txMIB.NFrame = [];
txMIB.SubcarrierSpacingCommon = rx.config.waveform.SSBurst.SubcarrierSpacingCommon;
txMIB.k_SSB = rx.config.waveform.SSBurst.KSSB;
txMIB.DMRSTypeAPosition = rx.config.waveform.SSBurst.DMRSTypeAPosition;
txMIB.PDCCHConfigSIB1 = rx.config.waveform.SSBurst.PDCCHConfigSIB1;
txMIB.CellBarred = rx.config.waveform.SSBurst.CellBarred;
txMIB.IntraFreqReselection = rx.config.waveform.SSBurst.IntraFreqReselection;
%%
% Display the decoded information and compare the transmitted and received MIB structures.
% These results show that the information was successfully decoded.
disp(['BCH CRC: ' num2str(mibInfo.err) newline]);
disp('Decoded information');
disp(mibInfo);
disp('Decoded MIB');
disp(mibInfo.mib);
disp('Expected MIB');
disp(txMIB);
%%
disp(ssBlockInfo);
No PSS/SSS is detected. Really appreciate your help!

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Sources and Sinks 的更多信息

产品


版本

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by