Skip to content

Commit cfa4391

Browse files
committed
puschbler: enable multi-layer pusch
1 parent e0ad6b2 commit cfa4391

File tree

1 file changed

+27
-11
lines changed

1 file changed

+27
-11
lines changed

apps/simulators/PUSCHBLER/PUSCHBLER.m

Lines changed: 27 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -125,14 +125,11 @@
125125
% file in the top-level directory of this distribution.
126126

127127
classdef PUSCHBLER < matlab.System
128-
properties (Constant)
129-
%Number of transmit antennas.
130-
NTxAnts = 1
131-
end % of constant properties
132-
133128
properties (Nontunable)
134129
%Perfect channel estimation flag.
135130
PerfectChannelEstimator (1, 1) logical = true
131+
%Number of transmit antennas.
132+
NTxAnts = 1
136133
%Number of receive antennas.
137134
NRxAnts = 1
138135
%Bandwidth in number of resource blocks.
@@ -197,13 +194,14 @@
197194
% is set to false.
198195
SRSEstimatorType (1, :) char {mustBeMember(SRSEstimatorType, {'MEX', 'noMEX'})} = 'MEX'
199196
%Flag for emulating O-FH compression.
197+
SRSEqualizerType (1, :) char {mustBeMember(SRSEqualizerType, {'ZF', 'MMSE'})} = 'ZF'
200198
ApplyOFHCompression (1, 1) logical = false
201199
%Bit-width of the compressed IQ samples.
202200
% Only applies if ApplyOFHCompression is set to true.
203201
CompIQwidth (1, 1) double {mustBeInteger, mustBeInRange(CompIQwidth, 1, 16)} = 9
204202
%Time-domain interpolation strategy ('average', 'interpolate').
205203
% Valid only for SRS estimator.
206-
Interpolation (1, :) char {mustBeMember(Interpolation, {'average', 'interpolate'})} = 'average'
204+
SRSInterpolation (1, :) char {mustBeMember(SRSInterpolation, {'average', 'interpolate'})} = 'average'
207205
end % of properties (Nontunable)
208206

209207
properties % Tunable
@@ -639,9 +637,9 @@ function stepImpl(obj, SNRIn, nFrames)
639637
betaDMRS = sqrt(2);
640638

641639
if useSRSDecoder
642-
srsDemodulatePUSCH = srsMEX.phy.srsPUSCHDemodulator;
640+
srsDemodulatePUSCH = srsMEX.phy.srsPUSCHDemodulator(EqualizerStrategy = obj.SRSEqualizerType);
643641
srsChannelEstimate = srsMEX.phy.srsMultiPortChannelEstimator(ImplementationType = obj.SRSEstimatorType, ...
644-
Smoothing = 'filter', Interpolation = obj.Interpolation, CompensateCFO = true);
642+
Smoothing = 'filter', Interpolation = obj.SRSInterpolation, CompensateCFO = true);
645643
end
646644

647645
% %%% Simulation loop.
@@ -684,6 +682,10 @@ function stepImpl(obj, SNRIn, nFrames)
684682
% when the correlation is strong for practical synchronization.
685683
offset = 0;
686684

685+
% Long-term RSRP and noise power estimation.
686+
rsrpLT = 0;
687+
noiseEstLT = 0;
688+
687689
% Loop over the entire waveform length.
688690
for nslot = 0:NSlots-1
689691

@@ -896,12 +898,16 @@ function stepImpl(obj, SNRIn, nFrames)
896898

897899
if useSRSDecoder
898900
if (~perfectChannelEstimator)
899-
[estChannelGrid, noiseEst] = srsChannelEstimate(rxGrid, pusch.SymbolAllocation, ...
901+
[estChannelGrid, noiseEst, extra] = srsChannelEstimate(rxGrid, pusch.SymbolAllocation, ...
900902
dmrsLayerIndices, dmrsLayerSymbols, ...
901903
'CyclicPrefix', carrier.CyclicPrefix, ...
902904
'SubcarrierSpacing', carrier.SubcarrierSpacing, ...
903905
'PortIndices', (0:nRxAnts-1)', ...
904906
'BetaScaling', betaDMRS);
907+
908+
% Update long-term RSRP and noise power estimation.
909+
rsrpLT = rsrpLT + extra.RSRP;
910+
noiseEstLT = noiseEstLT + noiseEst;
905911
end
906912

907913
ulschLLRsInt8 = int8(srsDemodulatePUSCH(rxGrid, estChannelGrid, noiseEst, pusch, ...
@@ -959,6 +965,11 @@ function stepImpl(obj, SNRIn, nFrames)
959965
1e-6*[simThroughputSRS(snrIdx) maxThroughput(snrIdx)]/(usedFrames*10e-3));
960966
fprintf('Throughput(%%) after %.0f frame(s) = %.4f\n', usedFrames, simThroughputSRS(snrIdx)*100/maxThroughput(snrIdx));
961967
fprintf('BLER after %.0f frame(s) = %.4f\n', usedFrames, simBLERSRS(snrIdx)/totalBlocks(snrIdx));
968+
969+
rsrpLT = rsrpLT / (nslot + 1);
970+
noiseEstLT = noiseEstLT / (nslot + 1);
971+
fprintf('Measured SNR = %.1f dB.\n', 10*log10(rsrpLT * pusch.NumLayers / noiseEstLT / betaDMRS^2));
972+
962973
end
963974

964975
end
@@ -994,6 +1005,9 @@ function resetImpl(obj)
9941005
end
9951006

9961007
function releaseImpl(obj)
1008+
% Reset simulation results.
1009+
obj.resetImpl();
1010+
9971011
% Release internal system objects.
9981012
release(obj.Channel);
9991013
release(obj.EncodeULSCH);
@@ -1026,8 +1040,10 @@ function releaseImpl(obj)
10261040
flag = isempty(obj.ThroughputMATLABCtr) || strcmp(obj.ImplementationType, 'srs');
10271041
case {'ThroughputSRS', 'BlockErrorRateSRS'}
10281042
flag = isempty(obj.ThroughputSRSCtr) || strcmp(obj.ImplementationType, 'matlab');
1029-
case 'SRSEstimatorType'
1043+
case {'SRSEstimatorType', 'SRSInterpolation'}
10301044
flag = strcmp(obj.ImplementationType, 'matlab') || obj.PerfectChannelEstimator;
1045+
case 'SRSEqualizerType'
1046+
flag = strcmp(obj.ImplementationType, 'matlab');
10311047
case 'CompIQwidth'
10321048
flag = ~obj.ApplyOFHCompression;
10331049
otherwise
@@ -1062,7 +1078,7 @@ function releaseImpl(obj)
10621078
... Compression.
10631079
'ApplyOFHCompression', 'CompIQwidth', ...
10641080
... Other simulation details.
1065-
'ImplementationType', 'SRSEstimatorType', ...
1081+
'ImplementationType', 'SRSEqualizerType', 'SRSEstimatorType', 'SRSInterpolation', ...
10661082
'QuickSimulation', 'DisplaySimulationInformation', 'DisplayDiagnostics'};
10671083
groups = matlab.mixin.util.PropertyGroup(confProps, 'Configuration');
10681084

0 commit comments

Comments
 (0)