mirror of https://github.com/pvnis/srsRAN_4G.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
67 lines
2.3 KiB
Matlab
67 lines
2.3 KiB
Matlab
enb=struct('NCellID',1,'NDLRB',50,'NSubframe',2,'CFI',2,'CyclicPrefix','Normal','CellRefP',1,'Ng','One','PHICHDuration','Normal','DuplexMode','FDD');
|
|
|
|
RNTI=65535;
|
|
|
|
addpath('../../build/srslte/lib/phch/test')
|
|
|
|
cec.PilotAverage = 'UserDefined'; % Type of pilot averaging
|
|
cec.FreqWindow = 9; % Frequency window size
|
|
cec.TimeWindow = 9; % Time window size
|
|
cec.InterpType = 'linear'; % 2D interpolation type
|
|
cec.InterpWindow = 'Causal'; % Interpolation window type
|
|
cec.InterpWinSize = 1; % Interpolation window size
|
|
|
|
subframe_rx=lteOFDMDemodulate(enb,y);
|
|
%subframe_rx=reshape(input,[],14);
|
|
[hest,nest] = lteDLChannelEstimate(enb, cec, subframe_rx);
|
|
|
|
% Search PDCCH
|
|
pdcchIndices = ltePDCCHIndices(enb);
|
|
[pdcchRx, pdcchHest] = lteExtractResources(pdcchIndices, subframe_rx, hest);
|
|
[dciBits, pdcchSymbols] = ltePDCCHDecode(enb, pdcchRx, pdcchHest, nest);
|
|
pdcch = struct('RNTI', RNTI);
|
|
dci = ltePDCCHSearch(enb, pdcch, dciBits); % Search PDCCH for DCI
|
|
|
|
if ~isempty(dci)
|
|
|
|
dci = dci{1};
|
|
disp(dci);
|
|
|
|
% Get the PDSCH configuration from the DCI
|
|
[pdsch, trblklen] = hPDSCHConfiguration(enb, dci, pdcch.RNTI);
|
|
pdsch.NTurboDecIts = 10;
|
|
pdsch.Modulation = {'QPSK'};
|
|
pdsch.RV=0;
|
|
%trblklen=75376;
|
|
fprintf('PDSCH settings after DCI decoding:\n');
|
|
disp(pdsch);
|
|
|
|
fprintf('Decoding PDSCH...\n\n');
|
|
% Get PDSCH indices
|
|
[pdschIndices,pdschIndicesInfo] = ltePDSCHIndices(enb, pdsch, pdsch.PRBSet);
|
|
[pdschRx, pdschHest] = lteExtractResources(pdschIndices, subframe_rx, hest);
|
|
% Decode PDSCH
|
|
[dlschBits,pdschSymbols] = ltePDSCHDecode(enb, pdsch, pdschRx, pdschHest, nest);
|
|
[sib1, crc] = lteDLSCHDecode(enb, pdsch, trblklen, dlschBits);
|
|
|
|
%[dec2, data, pdschRx2, pdschSymbols2, e_bits] = srslte_pdsch(enb, pdsch, ...
|
|
% trblklen, ...
|
|
% subframe_rx, hest, nest);
|
|
|
|
|
|
scatter(real(pdschSymbols{1}),imag(pdschSymbols{1}))
|
|
|
|
if crc == 0
|
|
fprintf('PDSCH OK.\n\n');
|
|
else
|
|
fprintf('PDSCH ERROR.\n\n');
|
|
end
|
|
|
|
else
|
|
% indicate that DCI decoding failed
|
|
fprintf('DCI decoding failed.\n\n');
|
|
end
|
|
|
|
%indices=indices+1;
|
|
%plot(t,indices(t),t,pdschIndices(t))
|
|
|