-
Notifications
You must be signed in to change notification settings - Fork 14
/
CheckPUCCHF2Conformance.m
339 lines (296 loc) · 14.1 KB
/
CheckPUCCHF2Conformance.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
%CheckPUCCHF2Conformance Battery of conformance tests for the PUCCH Format 2.
% This class, based on the matlab.unittest.TestCase framework, performs a battery
% of conformance tests on the PUCCH Format 2. Specifically, the tests are a
% subset of those described in TS38.104 Section 8.3.4 and TS38.141 Section 8.3.3.
% The tests consist in running a short simulation and ensuring that some metrics
% (i.e., detection rate, false detection rate or decoder block error rate,
% depending on the case) meet their target value.
%
% CheckPUCCHF2Conformance Properties (Constant):
%
% NSlots - Number of simulated slots.
%
% CheckPUCCHF2Conformance Properties (TestParameter):
%
% TestConfig - PUCCH Format 2 test configurations.
%
% CheckPUCCHF2Conformance Methods (Test, TestTags = {'conformance'}):
%
% checkPUCCHF2shortDetect - Estimates the ACK detection rate for the given
% PUCCH Format 2 configuration.
% checkPUCCHF2shortFalseAlarm - Estimates the false ACK detection rate for the
% given PUCCH Format 2 configuration.
% checkPUCCHF2long - Estimates the UCI block error rate for the given
% PUCCH Format 2 configuration.
%
% Example
% runtests('CheckPUCCHF2Conformance')
%
% See also matlab.unittest, PUCCHBLER.
% Copyright 2021-2024 Software Radio Systems Limited
%
% This file is part of srsRAN-matlab.
%
% srsRAN-matlab is free software: you can redistribute it and/or
% modify it under the terms of the BSD 2-Clause License.
%
% srsRAN-matlab is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
% BSD 2-Clause License for more details.
%
% A copy of the BSD 2-Clause License can be found in the LICENSE
% file in the top-level directory of this distribution.
classdef CheckPUCCHF2Conformance < matlab.unittest.TestCase
properties (Constant)
%Number of simulated slots.
NSlots = 20000;
end % of properties (Constant)
properties (TestParameter)
%PUCCH Format 2 test configurations.
% Defines, for each test, the bandwidth, the subcarrier spacing, the number
% or receive antennas and the target SNR.
TestConfig = generateTestConfig()
end % of properties (TestParameter)
methods (Test, TestTags = {'conformance'})
function checkPUCCHF2shortDetect(obj, TestConfig)
%Estimates the ACK detection rate for the given PUCCH Format 2 configuration.
% The probability of detection of an ACK is defined as the probability of detecting
% an ACK when the signal is present. The tests assume a 4-bit ACK. For more
% information, see TS38.104 Section 8.3.4.1 and TS38.141 Section 8.3.3.1.
import matlab.unittest.fixtures.CurrentFolderFixture
obj.applyFixture(CurrentFolderFixture('../apps/simulators/PUCCHBLER'));
pp = obj.preparePUCCHshort(TestConfig);
pp.TestType = 'Detection';
mu = TestConfig.SubcarrierSpacing / 15;
nFrames = obj.NSlots / 10 / 2^mu;
try
pp(TestConfig.SNRshort, nFrames);
catch ME
obj.assertFail(['PUCCHBLER simulation failed with error: ', ME.message]);
end
detectionRate = 1 - pp.BlockErrorRateSRS;
obj.verifyGreaterThanOrEqual(detectionRate, 0.99, ...
'WARNING: The PUCCH F2 ACK detection rate should be higher than 99%.');
obj.assertGreaterThanOrEqual(detectionRate, 0.95, ...
'ERROR: The PUCCH F2 ACK detection rate is below the hard acceptance threshold of 95%.');
% TODO: export Detection Rate (and possibly other metrics) to grafana.
end % of function checkPUCCHF2shortDetect(obj, TestConfig)
function checkPUCCHF2shortFalseAlarm(obj, TestConfig)
%Estimates the false ACK detection rate for the given PUCCH Format 2 configuration.
% The probability of false detection of the ACK is defined as the probability of
% erroneous detection of an ACK when the input is only noise. For more information,
% see TS38.141 Section 8.3.3.1.
import matlab.unittest.fixtures.CurrentFolderFixture
obj.applyFixture(CurrentFolderFixture('../apps/simulators/PUCCHBLER'));
pp = obj.preparePUCCHshort(TestConfig);
pp.TestType = 'False Alarm';
mu = TestConfig.SubcarrierSpacing / 15;
nFrames = obj.NSlots / 10 / 2^mu;
try
pp(TestConfig.SNRshort, nFrames);
catch ME
obj.assertFail(['PUCCHBLER simulation failed with error: ', ME.message]);
end
obj.verifyLessThanOrEqual(pp.FalseDetectionRateSRS, 0.01, ...
'WARNING: The PUCCH F2 ACK detection rate should be lower than 1%.');
obj.assertLessThanOrEqual(pp.FalseDetectionRateSRS, 0.05, ...
'ERROR: The PUCCH F2 ACK detection rate is above the hard acceptance threshold of 5%.');
% TODO: export False Detection Rate (and possibly other metrics) to grafana.
end % of function checkPUCCHF2shortDetect(obj, TestConfig)
function checkPUCCHF2long(obj, TestConfig)
%Estimates the UCI block error rate for the given PUCCH Format 2 configuration.
% The UCI BLER is defined as the probability of incorrectly decoding the UCI
% information, if present. The payload is of 22 UCI bits, with no CSI Part 2.
% For more information, see TS38.104 Section 8.3.4.2 and TS38.141 Section 8.3.3.2.
import matlab.unittest.fixtures.CurrentFolderFixture
obj.applyFixture(CurrentFolderFixture('../apps/simulators/PUCCHBLER'));
pp = obj.preparePUCCHlong(TestConfig);
pp.TestType = 'Detection';
mu = TestConfig.SubcarrierSpacing / 15 - 1;
nFrames = obj.NSlots / 10 / 2^mu;
try
pp(TestConfig.SNRlong, nFrames);
catch ME
obj.assertFail(['PUCCHBLER simulation failed with error: ', ME.message]);
end
obj.verifyLessThanOrEqual(pp.BlockErrorRateSRS, 0.01, ...
'WARNING: The PUCCH F2 UCI BLER should not be higher than 1%.');
obj.assertLessThanOrEqual(pp.BlockErrorRateSRS, 0.05, ...
'ERROR: The PUCCH F2 UCI BLER is above the hard acceptance threshold of 5%.');
% TODO: export Detection Rate (and possibly other metrics) to grafana.
end % of function checkPUCCHF2shortDetect(obj, TestConfig)
end % of methods (Test, TestTags = {'conformance'})
methods (Access = private)
function pp = preparePUCCHshort(obj, TestConfig)
%Configures a PUCCHBLER object for a UCI of 4 bits.
import matlab.unittest.constraints.IsFile
try
pp = PUCCHBLER;
catch ME
obj.assertFail(['Could not create a PUCCHBLER object because of exception: ', ...
ME.message]);
end
obj.assertClass(pp, 'PUCCHBLER', 'The created object is not a PUCCHBLER object.');
obj.assertThat('../../../+srsMEX/+phy/@srsPUCCHProcessor/pucch_processor_mex.mexa64', IsFile, ...
'Could not find PUCCH processor mex executable.');
pp.PUCCHFormat = 2;
pp.SubcarrierSpacing = TestConfig.SubcarrierSpacing;
pp.NSizeGrid = TestConfig.NSizeGrid;
pp.PRBSet = 0:3;
pp.SymbolAllocation = [13 1];
pp.NumACKBits = 4;
pp.NRxAnts = TestConfig.NRxAnts;
pp.DelayProfile = 'TDLC300';
pp.MaximumDopplerShift = 100;
pp.ImplementationType = 'srs';
pp.PerfectChannelEstimator = false;
pp.QuickSimulation = false;
pp.DisplaySimulationInformation = true;
end % of function pp = preparePUCCHshort(obj, TestConfig)
function pp = preparePUCCHlong(obj, TestConfig)
%Configures a PUCCHBLER object for a UCI of 22 bits.
import matlab.unittest.constraints.IsFile
try
pp = PUCCHBLER;
catch ME
obj.assertFail(['Could not create a PUCCHBLER object because of exception: ', ...
ME.message]);
end
obj.assertClass(pp, 'PUCCHBLER', 'The created object is not a PUCCHBLER object.');
obj.assertThat('../../../+srsMEX/+phy/@srsPUCCHProcessor/pucch_processor_mex.mexa64', IsFile, ...
'Could not find PUCCH processor mex executable.');
pp.PUCCHFormat = 2;
pp.SubcarrierSpacing = TestConfig.SubcarrierSpacing;
pp.NSizeGrid = TestConfig.NSizeGrid;
pp.PRBSet = 0:8;
pp.SymbolAllocation = [12 2];
pp.FrequencyHopping = 'intraSlot';
% The PUCCHBLER object takes care of picking the last PRBs in the second hop.
pp.NumACKBits = 22;
pp.NRxAnts = TestConfig.NRxAnts;
pp.DelayProfile = 'TDLC300';
pp.MaximumDopplerShift = 100;
pp.ImplementationType = 'srs';
pp.PerfectChannelEstimator = false;
pp.QuickSimulation = false;
pp.DisplaySimulationInformation = true;
end % of function pp = preparePUCCHshort(obj, TestConfig)
end % of methods (Access = private)
end % of classdef CheckPUCCHF2Conformance < matlab.unittest.TestCase
function TestConfig = generateTestConfig()
TestConfig = { ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-1', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 15, ...
'NSizeGrid', 25, ... 5 MHz ...
'SNRshort', 5.8, ...
'SNRlong', 0.2 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-1', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 15, ...
'NSizeGrid', 25, ... 5 MHz ...
'SNRshort', 0.4, ...
'SNRlong', -3.6 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-1', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 15, ...
'NSizeGrid', 52, ... 10 MHz ...
'SNRshort', 5.6, ...
'SNRlong', 0.8 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-1', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 15, ...
'NSizeGrid', 52, ... 10 MHz ...
'SNRshort', 0.5, ...
'SNRlong', -3.2 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-1', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 15, ...
'NSizeGrid', 106, ... 20 MHz ...
'SNRshort', 5.9, ...
'SNRlong', 1.2 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-1', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 15, ...
'NSizeGrid', 106, ... 20 MHz ...
'SNRshort', 0.3, ...
'SNRlong', -3.2 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 24, ... 10 MHz ...
'SNRshort', 5.5, ...
'SNRlong', 0.5 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 24, ... 10 MHz ...
'SNRshort', 0.3, ...
'SNRlong', -3.3 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 51, ... 20 MHz ...
'SNRshort', 5.6, ...
'SNRlong', 1.1 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 51, ... 20 MHz ...
'SNRshort', 0.2, ...
'SNRlong', -2.9 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 106, ... 40 MHz ...
'SNRshort', 5.5, ...
'SNRlong', 0.4 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 106, ... 40 MHz ...
'SNRshort', 0.3, ...
'SNRlong', -3.3 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 2, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 273, ... 100 MHz ...
'SNRshort', 5.7, ...
'SNRlong', 0.3 ...
), ...
struct( ...
'Table', 'TS38.104 V15.19.0 Table 8.3.4.x.2-2', ...
'NRxAnts', 4, ...
'SubcarrierSpacing', 30, ...
'NSizeGrid', 273, ... 100 MHz ...
'SNRshort', 0.4, ...
'SNRlong', -3.4 ...
)
};
end