A Discrete-Event Network Simulator
API
Loading...
Searching...
No Matches
wifi-transmit-mask-test.cc
Go to the documentation of this file.
1/*
2 * Copyright (c) 2017 Orange Labs
3 *
4 * SPDX-License-Identifier: GPL-2.0-only
5 *
6 * Author: Rediet <getachew.redieteab@orange.com>
7 */
8
9#include "ns3/fatal-error.h"
10#include "ns3/log.h"
11#include "ns3/test.h"
12#include "ns3/wifi-phy-band.h"
13#include "ns3/wifi-phy-common.h"
14#include "ns3/wifi-spectrum-value-helper.h"
15#include "ns3/wifi-standards.h"
16
17#include <cmath>
18#include <vector>
19
20using namespace ns3;
21
22NS_LOG_COMPONENT_DEFINE("WifiTransmitMaskTest");
23
24/**
25 * @ingroup wifi-test
26 * @ingroup tests
27 *
28 * @brief Test checks if Wifi spectrum values for OFDM are generated properly.
29 * Different test cases are configured by defining different standards and bandwidth.
30 */
32{
33 public:
34 /**
35 * typedef for a pair of sub-band index and relative power value
36 */
37 typedef std::pair<uint32_t, dBr_u> IndexPowerPair;
38
39 /**
40 * typedef for a vector of pairs of sub-band index and relative power value
41 */
42 typedef std::vector<IndexPowerPair> IndexPowerVect;
43
44 /**
45 * Constructor
46 *
47 * @param name test reference name
48 * @param standard selected standard
49 * @param band selected PHY band
50 * @param channelWidth total channel width
51 * @param centerFrequencies the center frequency per contiguous segment
52 * @param maskRefs vector of expected power values and corresponding indexes of generated PSD
53 * (only start and stop indexes/values given)
54 * @param tolerance tolerance
55 * @param precision precision (in decimals)
56 * @param puncturedSubchannels bitmap indicating whether a 20 MHz subchannel is punctured or not
57 * (only for 802.11ax and later)
58 */
59 WifiOfdmMaskSlopesTestCase(const std::string& name,
60 WifiStandard standard,
61 WifiPhyBand band,
62 MHz_u channelWidth,
63 const std::vector<MHz_u>& centerFrequencies,
64 const IndexPowerVect& maskRefs,
65 dB_u tolerance,
66 std::size_t precision,
67 const std::vector<bool>& puncturedSubchannels = std::vector<bool>{});
68 ~WifiOfdmMaskSlopesTestCase() override = default;
69
70 private:
71 void DoSetup() override;
72 void DoRun() override;
73
74 /**
75 * Interpolate PSD values for indexes between provided start and stop and append to provided
76 * vector.
77 *
78 * @param vect vector of sub-band index and relative power value pairs to which interpolated
79 values should be appended
80 * @param start pair of sub-band index and relative power value for interval start
81 * @param stop pair of sub-band index and relative power value for interval stop
82 */
84 IndexPowerPair start,
85 IndexPowerPair stop) const;
86
87 WifiStandard m_standard; ///< the wifi standard to test
88 WifiPhyBand m_band; ///< the wifi PHY band to test
89 MHz_u m_channelWidth; ///< the total channel width to test
90 std::vector<MHz_u> m_centerFreqs; ///< the center frequency per contiguous segment to test
91 std::vector<bool>
92 m_puncturedSubchannels; ///< bitmap indicating whether a 20 MHz subchannel is punctured or
93 ///< not (only used for 802.11ax and later)
94 Ptr<SpectrumValue> m_actualSpectrum; ///< actual spectrum value
95 IndexPowerVect m_expectedPsd; ///< expected power values
96 dB_u m_tolerance; ///< tolerance
97 std::size_t m_precision; ///< precision for double calculations (in decimals)
98};
99
101 const std::string& name,
102 WifiStandard standard,
103 WifiPhyBand band,
104 MHz_u channelWidth,
105 const std::vector<MHz_u>& centerFrequencies,
106 const IndexPowerVect& maskRefs,
107 dB_u tolerance,
108 std::size_t precision,
109 const std::vector<bool>& puncturedSubchannels)
110 : TestCase(std::string("SpectrumValue ") + name),
111 m_standard{standard},
112 m_band{band},
113 m_channelWidth{channelWidth},
114 m_centerFreqs{centerFrequencies},
115 m_puncturedSubchannels{puncturedSubchannels},
116 m_actualSpectrum{},
117 m_expectedPsd{maskRefs},
118 m_tolerance{tolerance},
119 m_precision{precision}
120{
121 NS_LOG_FUNCTION(this << name << standard << band << channelWidth << tolerance << precision
122 << puncturedSubchannels.size());
123}
124
125void
127{
128 NS_LOG_FUNCTION(this);
129 NS_ASSERT(!m_centerFreqs.empty());
130 NS_ASSERT(m_expectedPsd.size() % 2 == 0); // start/stop pairs expected
131
132 dBr_u outerBandMaximumRejection{0.0};
133 switch (m_band)
134 {
135 default:
137 outerBandMaximumRejection = dBr_u{-40};
138 break;
140 outerBandMaximumRejection = (m_standard >= WIFI_STANDARD_80211n) ? dBr_u{-45} : dBr_u{-40};
141 break;
143 outerBandMaximumRejection = dBr_u{-40};
144 break;
145 }
146
147 Watt_u refTxPower{1}; // have to work in dBr when comparing though
148 switch (m_standard)
149 {
156 refTxPower,
158 dBr_u{-20.0},
159 dBr_u{-28.0},
160 outerBandMaximumRejection);
161 break;
162
169 refTxPower,
171 dBr_u{-20.0},
172 dBr_u{-28.0},
173 outerBandMaximumRejection);
174 break;
175
182 refTxPower,
184 dBr_u{-20.0},
185 dBr_u{-28.0},
186 outerBandMaximumRejection);
187 break;
188
194 refTxPower,
196 dBr_u{-20.0},
197 dBr_u{-28.0},
198 outerBandMaximumRejection);
199 break;
200
204 m_channelWidth == MHz_u{80} || m_channelWidth == MHz_u{160});
208 refTxPower,
210 dBr_u{-20.0},
211 dBr_u{-28.0},
212 outerBandMaximumRejection);
213 break;
214
218 (m_channelWidth < MHz_u{80})); // not enough space in 2.4 GHz bands
220 m_channelWidth == MHz_u{80} || m_channelWidth == MHz_u{160} ||
221 m_channelWidth == MHz_u{320});
225 refTxPower,
227 dBr_u{-20.0},
228 dBr_u{-28.0},
229 outerBandMaximumRejection,
231 break;
232
233 default:
234 NS_FATAL_ERROR("Standard unknown or non-OFDM");
235 break;
236 }
237
238 NS_LOG_INFO("Build expected PSD");
239 IndexPowerVect builtPsd;
240 for (uint32_t i = 0; i < m_expectedPsd.size(); i += 2)
241 {
243 }
244 m_expectedPsd = builtPsd;
245}
246
247void
249 IndexPowerPair start,
250 IndexPowerPair stop) const
251{
252 NS_LOG_FUNCTION(start.first << start.second << stop.first << stop.second);
253 NS_ASSERT(start.first <= stop.first);
254
255 if (start.first == stop.first) // only one point, no need to interpolate
256 {
257 NS_ASSERT(start.second == stop.second);
258 vect.push_back(start);
259 NS_LOG_LOGIC("Append (" << start.first << ", " << stop.second << ")");
260 return;
261 }
262
263 const auto slope = (stop.second - start.second) / (stop.first - start.first);
264 for (uint32_t i = start.first; i <= stop.first; i++)
265 {
266 const auto delta{i - start.first};
267 dB_u val{start.second + slope * delta};
268 const auto multiplier = std::round(std::pow(10.0, static_cast<double>(m_precision)));
269 val = dB_u{std::floor(val * multiplier + 0.5) / multiplier};
270 vect.emplace_back(i, val);
271 NS_LOG_LOGIC("Append (" << i << ", " << val << ")");
272 }
273
274 NS_ASSERT(vect.back().first == stop.first &&
275 TestDoubleIsEqual(vect.back().second, stop.second, m_tolerance));
276}
277
278void
280{
281 NS_LOG_FUNCTION(this);
282 dBr_u currentPower{0.0}; // have to work in dBr so as to compare with expected slopes
283 Watt_u maxPower{(*m_actualSpectrum)[0]};
284 for (auto&& vit = m_actualSpectrum->ConstValuesBegin();
285 vit != m_actualSpectrum->ConstValuesEnd();
286 ++vit)
287 {
288 maxPower = std::max(maxPower, Watt_u{*vit});
289 }
290
291 NS_LOG_INFO("Compare expected PSD");
292 for (const auto& [subcarrier, expectedValue] : m_expectedPsd)
293 {
294 currentPower = dBr_u{10.0 * std::log10((*m_actualSpectrum)[subcarrier] / maxPower)};
295 NS_LOG_LOGIC("For " << subcarrier << ", expected: " << expectedValue
296 << " vs obtained: " << currentPower);
297 NS_TEST_EXPECT_MSG_EQ_TOL(currentPower,
298 expectedValue,
300 "Spectrum value mismatch for subcarrier " << subcarrier);
301 }
302}
303
304/**
305 * @ingroup wifi-test
306 * @ingroup tests
307 *
308 * @brief Test suite for checking the consistency of different OFDM-based transmit masks.
309 */
311{
312 public:
314};
315
317
319 : TestSuite("wifi-transmit-mask", Type::UNIT)
320{
321 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
322 // LogComponentEnable ("WifiTransmitMaskTest", logLevel);
323 // LogComponentEnable ("WifiSpectrumValueHelper", logLevel);
324
325 NS_LOG_INFO("Creating WifiTransmitMaskTestSuite");
326
328 dB_u tol{10e-2};
329 double prec = 10; // in decimals
330
331 // ============================================================================================
332 // 11p 5MHz
333 NS_LOG_FUNCTION("Check slopes for 11p 5MHz");
334 maskSlopes = {
335 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
336 std::make_pair(31, dBr_u{-28.375}), // Outer band left (stop)
337 std::make_pair(32, dBr_u{-28.000}), // Middle band left (start)
338 std::make_pair(60, dBr_u{-20.276}), // Middle band left (stop)
339 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (start)
340 std::make_pair(63, dBr_u{-20.0}), // Flat junction band left (stop)
341 std::make_pair(64, dBr_u{-20.0}), // Inner band left (start)
342 std::make_pair(69, dBr_u{-3.333}), // Inner band left (stop)
343 std::make_pair(123, dBr_u{-3.333}), // Inner band right (start)
344 std::make_pair(128, dBr_u{-20.0}), // Inner band right (stop)
345 std::make_pair(129, dBr_u{-20.0}), // Flat junction band right (start)
346 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (stop)
347 std::make_pair(132, dBr_u{-20.276}), // Middle band right (start)
348 std::make_pair(160, dBr_u{-28.000}), // Middle band right (stop)
349 std::make_pair(161, dBr_u{-28.375}), // Outer band right (start)
350 std::make_pair(192, dBr_u{-40.0}), // Outer band right (stop)
351 };
352
356 MHz_u{5},
357 {MHz_u{5860}},
358 maskSlopes,
359 tol,
360 prec),
361 TestCase::Duration::QUICK);
362
363 // ============================================================================================
364 // 11p 10MHz
365 NS_LOG_FUNCTION("Check slopes for 11p 10MHz");
366 maskSlopes = {
367 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
368 std::make_pair(31, dBr_u{-28.375}), // Outer band left (stop)
369 std::make_pair(32, dBr_u{-28.000}), // Middle band left (start)
370 std::make_pair(60, dBr_u{-20.276}), // Middle band left (stop)
371 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (start)
372 std::make_pair(63, dBr_u{-20.0}), // Flat junction band left (stop)
373 std::make_pair(64, dBr_u{-20.0}), // Inner band left (start)
374 std::make_pair(69, dBr_u{-3.333}), // Inner band left (stop)
375 std::make_pair(123, dBr_u{-3.333}), // Inner band right (start)
376 std::make_pair(128, dBr_u{-20.0}), // Inner band right (stop)
377 std::make_pair(129, dBr_u{-20.0}), // Flat junction band right (start)
378 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (stop)
379 std::make_pair(132, dBr_u{-20.276}), // Middle band right (start)
380 std::make_pair(160, dBr_u{-28.000}), // Middle band right (stop)
381 std::make_pair(161, dBr_u{-28.375}), // Outer band right (start)
382 std::make_pair(192, dBr_u{-40.0}), // Outer band right (stop)
383 };
384
388 MHz_u{10},
389 {MHz_u{5860}},
390 maskSlopes,
391 tol,
392 prec),
393 TestCase::Duration::QUICK);
394
395 // ============================================================================================
396 // 11a
397 NS_LOG_FUNCTION("Check slopes for 11a");
398 maskSlopes = {
399 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
400 std::make_pair(31, dBr_u{-28.375}), // Outer band left (stop)
401 std::make_pair(32, dBr_u{-28.000}), // Middle band left (start)
402 std::make_pair(60, dBr_u{-20.276}), // Middle band left (stop)
403 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (start)
404 std::make_pair(63, dBr_u{-20.0}), // Flat junction band left (stop)
405 std::make_pair(64, dBr_u{-20.0}), // Inner band left (start)
406 std::make_pair(69, dBr_u{-3.333}), // Inner band left (stop)
407 std::make_pair(123, dBr_u{-3.333}), // Inner band right (start)
408 std::make_pair(128, dBr_u{-20.0}), // Inner band right (stop)
409 std::make_pair(129, dBr_u{-20.0}), // Flat junction band right (start)
410 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (stop)
411 std::make_pair(132, dBr_u{-20.276}), // Middle band right (start)
412 std::make_pair(160, dBr_u{-28.000}), // Middle band right (stop)
413 std::make_pair(161, dBr_u{-28.375}), // Outer band right (start)
414 std::make_pair(192, dBr_u{-40.0}), // Outer band right (stop)
415 };
416
420 MHz_u{20},
421 {MHz_u{5180}},
422 maskSlopes,
423 tol,
424 prec),
425 TestCase::Duration::QUICK);
426
427 // ============================================================================================
428 // 11g
429 NS_LOG_FUNCTION("Check slopes for 11g");
430 // same slopes as 11a
434 MHz_u{20},
435 {MHz_u{2412}},
436 maskSlopes,
437 tol,
438 prec),
439 TestCase::Duration::QUICK);
440
441 // ============================================================================================
442 // 11n 20MHz @ 2.4GHz
443 NS_LOG_FUNCTION("Check slopes for 11n 20MHz @ 2.4GHz");
444 maskSlopes = {
445 std::make_pair(0, dBr_u{-45.000}), // Outer band left (start)
446 std::make_pair(31, dBr_u{-28.531}), // Outer band left (stop)
447 std::make_pair(32, dBr_u{-28.000}), // Middle band left (start)
448 std::make_pair(60, dBr_u{-20.276}), // Middle band left (stop)
449 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (start)
450 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (stop)
451 std::make_pair(62, dBr_u{-20.0}), // Inner band left (start)
452 std::make_pair(67, dBr_u{-3.333}), // Inner band left (stop)
453 std::make_pair(125, dBr_u{-3.333}), // Inner band right (start)
454 std::make_pair(130, dBr_u{-20.0}), // Inner band right (stop)
455 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (start)
456 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (stop)
457 std::make_pair(132, dBr_u{-20.276}), // Middle band right (start)
458 std::make_pair(160, dBr_u{-28.000}), // Middle band right (stop)
459 std::make_pair(161, dBr_u{-28.531}), // Outer band right (start)
460 std::make_pair(192, dBr_u{-45.000}), // Outer band right (stop)
461 };
462
463 AddTestCase(new WifiOfdmMaskSlopesTestCase("11n_2.4GHz 20MHz",
466 MHz_u{20},
467 {MHz_u{2412}},
468 maskSlopes,
469 tol,
470 prec),
471 TestCase::Duration::QUICK);
472
473 // ============================================================================================
474 // 11n 20MHz @ 5GHz
475 NS_LOG_FUNCTION("Check slopes for 11n 20MHz @ 5GHz");
476 maskSlopes = {
477 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
478 std::make_pair(31, dBr_u{-28.375}), // Outer band left (stop)
479 std::make_pair(32, dBr_u{-28.000}), // Middle band left (start)
480 std::make_pair(60, dBr_u{-20.276}), // Middle band left (stop)
481 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (start)
482 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (stop)
483 std::make_pair(62, dBr_u{-20.0}), // Inner band left (start)
484 std::make_pair(67, dBr_u{-3.333}), // Inner band left (stop)
485 std::make_pair(125, dBr_u{-3.333}), // Inner band right (start)
486 std::make_pair(130, dBr_u{-20.0}), // Inner band right (stop)
487 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (start)
488 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (stop)
489 std::make_pair(132, dBr_u{-20.276}), // Middle band right (start)
490 std::make_pair(160, dBr_u{-28.000}), // Middle band right (stop)
491 std::make_pair(161, dBr_u{-28.375}), // Outer band right (start)
492 std::make_pair(192, dBr_u{-40.0}), // Outer band right (stop)
493 };
494
495 AddTestCase(new WifiOfdmMaskSlopesTestCase("11n_5GHz 20MHz",
498 MHz_u{20},
499 {MHz_u{5180}},
500 maskSlopes,
501 tol,
502 prec),
503 TestCase::Duration::QUICK);
504
505 // ============================================================================================
506 // 11n 40MHz @ 2.4GHz
507 NS_LOG_FUNCTION("Check slopes for 11n 40MHz @ 2.4GHz");
508 maskSlopes = {
509 std::make_pair(0, dBr_u{-45.000}), // Outer band left (start)
510 std::make_pair(63, dBr_u{-28.266}), // Outer band left (stop)
511 std::make_pair(64, dBr_u{-28.000}), // Middle band left (start)
512 std::make_pair(124, dBr_u{-20.131}), // Middle band left (stop)
513 std::make_pair(125, dBr_u{-20.0}), // Flat junction band left (start)
514 std::make_pair(125, dBr_u{-20.0}), // Flat junction band left (stop)
515 std::make_pair(126, dBr_u{-20.0}), // Inner band left (start)
516 std::make_pair(131, dBr_u{-3.333}), // Inner band left (stop)
517 std::make_pair(253, dBr_u{-3.333}), // Inner band right (start)
518 std::make_pair(258, dBr_u{-20.0}), // Inner band right (stop)
519 std::make_pair(259, dBr_u{-20.0}), // Flat junction band right (start)
520 std::make_pair(259, dBr_u{-20.0}), // Flat junction band right (stop)
521 std::make_pair(260, dBr_u{-20.131}), // Middle band right (start)
522 std::make_pair(320, dBr_u{-28.000}), // Middle band right (stop)
523 std::make_pair(321, dBr_u{-28.266}), // Outer band right (start)
524 std::make_pair(384, dBr_u{-45.000}), // Outer band right (stop)
525 };
526
527 AddTestCase(new WifiOfdmMaskSlopesTestCase("11n_2.4GHz 40MHz",
530 MHz_u{40},
531 {MHz_u{2422}},
532 maskSlopes,
533 tol,
534 prec),
535 TestCase::Duration::QUICK);
536
537 // ============================================================================================
538 // 11n 20MHz @ 5GHz
539 NS_LOG_FUNCTION("Check slopes for 11n 40MHz @ 5GHz");
540 maskSlopes = {
541 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
542 std::make_pair(63, dBr_u{-28.188}), // Outer band left (stop)
543 std::make_pair(64, dBr_u{-28.000}), // Middle band left (start)
544 std::make_pair(124, dBr_u{-20.131}), // Middle band left (stop)
545 std::make_pair(125, dBr_u{-20.0}), // Flat junction band left (start)
546 std::make_pair(125, dBr_u{-20.0}), // Flat junction band left (stop)
547 std::make_pair(126, dBr_u{-20.0}), // Inner band left (start)
548 std::make_pair(131, dBr_u{-3.333}), // Inner band left (stop)
549 std::make_pair(253, dBr_u{-3.333}), // Inner band right (start)
550 std::make_pair(258, dBr_u{-20.0}), // Inner band right (stop)
551 std::make_pair(259, dBr_u{-20.0}), // Flat junction band right (start)
552 std::make_pair(259, dBr_u{-20.0}), // Flat junction band right (stop)
553 std::make_pair(260, dBr_u{-20.131}), // Middle band right (start)
554 std::make_pair(320, dBr_u{-28.000}), // Middle band right (stop)
555 std::make_pair(321, dBr_u{-28.188}), // Outer band right (start)
556 std::make_pair(384, dBr_u{-40.0}), // Outer band right (stop)
557 };
558
559 AddTestCase(new WifiOfdmMaskSlopesTestCase("11n_5GHz 40MHz",
562 MHz_u{40},
563 {MHz_u{5190}},
564 maskSlopes,
565 tol,
566 prec),
567 TestCase::Duration::QUICK);
568
569 // ============================================================================================
570 // 11ac 20MHz
571 NS_LOG_FUNCTION("Check slopes for 11ac 20MHz");
572 maskSlopes = {
573 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
574 std::make_pair(31, dBr_u{-28.375}), // Outer band left (stop)
575 std::make_pair(32, dBr_u{-28.000}), // Middle band left (start)
576 std::make_pair(60, dBr_u{-20.276}), // Middle band left (stop)
577 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (start)
578 std::make_pair(61, dBr_u{-20.0}), // Flat junction band left (stop)
579 std::make_pair(62, dBr_u{-20.0}), // Inner band left (start)
580 std::make_pair(67, dBr_u{-3.333}), // Inner band left (stop)
581 std::make_pair(125, dBr_u{-3.333}), // Inner band right (start)
582 std::make_pair(130, dBr_u{-20.0}), // Inner band right (stop)
583 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (start)
584 std::make_pair(131, dBr_u{-20.0}), // Flat junction band right (stop)
585 std::make_pair(132, dBr_u{-20.276}), // Middle band right (start)
586 std::make_pair(160, dBr_u{-28.000}), // Middle band right (stop)
587 std::make_pair(161, dBr_u{-28.375}), // Outer band right (start)
588 std::make_pair(192, dBr_u{-40.0}), // Outer band right (stop)
589 };
590
594 MHz_u{20},
595 {MHz_u{5180}},
596 maskSlopes,
597 tol,
598 prec),
599 TestCase::Duration::QUICK);
600
601 // ============================================================================================
602 // 11ac 20MHz
603 NS_LOG_FUNCTION("Check slopes for 11ac 40MHz");
604 maskSlopes = {
605 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
606 std::make_pair(63, dBr_u{-28.188}), // Outer band left (stop)
607 std::make_pair(64, dBr_u{-28.000}), // Middle band left (start)
608 std::make_pair(124, dBr_u{-20.131}), // Middle band left (stop)
609 std::make_pair(125, dBr_u{-20.0}), // Flat junction band left (start)
610 std::make_pair(125, dBr_u{-20.0}), // Flat junction band left (stop)
611 std::make_pair(126, dBr_u{-20.0}), // Inner band left (start)
612 std::make_pair(131, dBr_u{-3.333}), // Inner band left (stop)
613 std::make_pair(253, dBr_u{-3.333}), // Inner band right (start)
614 std::make_pair(258, dBr_u{-20.0}), // Inner band right (stop)
615 std::make_pair(259, dBr_u{-20.0}), // Flat junction band right (start)
616 std::make_pair(259, dBr_u{-20.0}), // Flat junction band right (stop)
617 std::make_pair(260, dBr_u{-20.131}), // Middle band right (start)
618 std::make_pair(320, dBr_u{-28.000}), // Middle band right (stop)
619 std::make_pair(321, dBr_u{-28.188}), // Outer band right (start)
620 std::make_pair(384, dBr_u{-40.0}), // Outer band right (stop)
621 };
622
626 MHz_u{40},
627 {MHz_u{5190}},
628 maskSlopes,
629 tol,
630 prec),
631 TestCase::Duration::QUICK);
632
633 // ============================================================================================
634 // 11ac 80MHz
635 NS_LOG_FUNCTION("Check slopes for 11ac 80MHz");
636 maskSlopes = {
637 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
638 std::make_pair(127, dBr_u{-28.094}), // Outer band left (stop)
639 std::make_pair(128, dBr_u{-28.000}), // Middle band left (start)
640 std::make_pair(252, dBr_u{-20.064}), // Middle band left (stop)
641 std::make_pair(253, dBr_u{-20.0}), // Flat junction band left (start)
642 std::make_pair(253, dBr_u{-20.0}), // Flat junction band left (stop)
643 std::make_pair(254, dBr_u{-20.0}), // Inner band left (start)
644 std::make_pair(259, dBr_u{-3.333}), // Inner band left (stop)
645 std::make_pair(509, dBr_u{-3.333}), // Inner band right (start)
646 std::make_pair(514, dBr_u{-20.0}), // Inner band right (stop)
647 std::make_pair(515, dBr_u{-20.0}), // Flat junction band right (start)
648 std::make_pair(515, dBr_u{-20.0}), // Flat junction band right (stop)
649 std::make_pair(516, dBr_u{-20.064}), // Middle band right (start)
650 std::make_pair(640, dBr_u{-28.000}), // Middle band right (stop)
651 std::make_pair(641, dBr_u{-28.094}), // Outer band right (start)
652 std::make_pair(768, dBr_u{-40.0}), // Outer band right (stop)
653 };
654
658 MHz_u{80},
659 {MHz_u{5210}},
660 maskSlopes,
661 tol,
662 prec),
663 TestCase::Duration::QUICK);
664
665 // ============================================================================================
666 // 11ac 20MHz
667 NS_LOG_FUNCTION("Check slopes for 11ac 160MHz");
668 maskSlopes = {
669 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
670 std::make_pair(255, dBr_u{-28.047}), // Outer band left (stop)
671 std::make_pair(256, dBr_u{-28.000}), // Middle band left (start)
672 std::make_pair(508, dBr_u{-20.032}), // Middle band left (stop)
673 std::make_pair(509, dBr_u{-20.0}), // Flat junction band left (start)
674 std::make_pair(509, dBr_u{-20.0}), // Flat junction band left (stop)
675 std::make_pair(510, dBr_u{-20.0}), // Inner band left (start)
676 std::make_pair(515, dBr_u{-3.333}), // Inner band left (stop)
677 std::make_pair(1021, dBr_u{-3.333}), // Inner band right (start)
678 std::make_pair(1026, dBr_u{-20.0}), // Inner band right (stop)
679 std::make_pair(1027, dBr_u{-20.0}), // Flat junction band right (start)
680 std::make_pair(1027, dBr_u{-20.0}), // Flat junction band right (stop)
681 std::make_pair(1028, dBr_u{-20.032}), // Middle band right (start)
682 std::make_pair(1280, dBr_u{-28.000}), // Middle band right (stop)
683 std::make_pair(1281, dBr_u{-28.047}), // Outer band right (start)
684 std::make_pair(1536, dBr_u{-40.0}), // Outer band right (stop)
685 };
686
687 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ac 160MHz",
690 MHz_u{160},
691 {MHz_u{5250}},
692 maskSlopes,
693 tol,
694 prec),
695 TestCase::Duration::QUICK);
696
697 // ============================================================================================
698 // 11ac 80+80MHz
699 NS_LOG_FUNCTION("Check slopes for 11ac 80+80MHz");
700 maskSlopes = {
701 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
702 std::make_pair(127, dBr_u{-28.094}), // Outer band left (stop)
703 std::make_pair(128, dBr_u{-28.000}), // Middle band left (start)
704 std::make_pair(252, dBr_u{-20.064}), // Middle band left (stop)
705 std::make_pair(253, dBr_u{-20.0}), // Flat junction band left (start)
706 std::make_pair(253, dBr_u{-20.0}), // Flat junction band left (stop)
707 std::make_pair(254, dBr_u{-20.0}), // Inner band left for first segment (start)
708 std::make_pair(259, dBr_u{-3.333}), // Inner band left for first segment (stop)
709 std::make_pair(509, dBr_u{-3.333}), // Inner band right for first segment (start)
710 std::make_pair(514, dBr_u{-20.0}), // Inner band right for first segment (stop)
711 std::make_pair(515, dBr_u{-20.0}), // Flat junction band right for first segment (start)
712 std::make_pair(515, dBr_u{-20.0}), // Flat junction band right for first segment (stop)
713 std::make_pair(516, dBr_u{-20.01}), // start linear sum region left (no interpolation
714 // possible, so provide 2 times the same point)
715 std::make_pair(516, dBr_u{-20.01}), // start linear sum region left (no interpolation
716 // possible, so provide 2 times the same point)
717 std::make_pair(639, dBr_u{-24.99}), // stop linear sum region left (no interpolation
718 // possible, so provide 2 times the same point)
719 std::make_pair(639, dBr_u{-24.99}), // stop linear sum region left (no interpolation
720 // possible, so provide 2 times the same point)
721 std::make_pair(640, dBr_u{-25.0}), // middle linear sum region (no interpolation possible,
722 // so provide 2 times the same point)
723 std::make_pair(640, dBr_u{-25.0}), // middle linear sum region (no interpolation possible,
724 // so provide 2 times the same point)
725 std::make_pair(641, dBr_u{-24.99}), // start linear sum region right (no interpolation
726 // possible, so provide 2 times the same point)
727 std::make_pair(641, dBr_u{-24.99}), // start linear sum region right (no interpolation
728 // possible, so provide 2 times the same point)
729 std::make_pair(764, dBr_u{-20.01}), // stop linear sum region right (no interpolation
730 // possible, so provide 2 times the same point)
731 std::make_pair(764, dBr_u{-20.01}), // stop linear sum region right (no interpolation
732 // possible, so provide 2 times the same point)
733 std::make_pair(765, dBr_u{-20.0}), // Flat junction band left (start)
734 std::make_pair(765, dBr_u{-20.0}), // Flat junction band left (stop)
735 std::make_pair(766, dBr_u{-20.0}), // Inner band left for second segment (start)
736 std::make_pair(771, dBr_u{-3.333}), // Inner band left for second segment (stop)
737 std::make_pair(1021, dBr_u{-3.333}), // Inner band right for second segment (start)
738 std::make_pair(1026, dBr_u{-20.0}), // Inner band right for second segment (stop)
739 std::make_pair(1027, dBr_u{-20.0}), // Flat junction band right (start)
740 std::make_pair(1027, dBr_u{-20.0}), // Flat junction band right (stop)
741 std::make_pair(1028, dBr_u{-20.016}), // Middle band right (start)
742 std::make_pair(1152, dBr_u{-28.000}), // Middle band right (stop)
743 std::make_pair(1153, dBr_u{-28.023}), // Outer band right (start)
744 std::make_pair(1280, dBr_u{-40.0}), // Outer band right (stop)
745 };
746
747 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ac 80+80MHz",
750 MHz_u{160},
751 {MHz_u{5530}, MHz_u{5690}},
752 maskSlopes,
753 tol,
754 prec),
755 TestCase::Duration::QUICK);
756
757 // ============================================================================================
758 // 11ax 20MHz @ 2.4GHz
759 NS_LOG_FUNCTION("Check slopes for 11ax 20MHz @ 2.4GHz");
760 maskSlopes = {
761 std::make_pair(0, dBr_u{-45.000}), // Outer band left (start)
762 std::make_pair(127, dBr_u{-28.133}), // Outer band left (stop)
763 std::make_pair(128, dBr_u{-28.000}), // Middle band left (start)
764 std::make_pair(252, dBr_u{-20.064}), // Middle band left (stop)
765 std::make_pair(253, dBr_u{-20.0}), // Flat junction band left (start)
766 std::make_pair(255, dBr_u{-20.0}), // Flat junction band left (stop)
767 std::make_pair(256, dBr_u{-20.0}), // Inner band left (start)
768 std::make_pair(261, dBr_u{-3.333}), // Inner band left (stop)
769 std::make_pair(262, dBr_u{0.0}), // allocated band left (start)
770 std::make_pair(382, dBr_u{0.0}), // allocated band left (stop)
771 std::make_pair(383, dBr_u{-20.0}), // DC band (start)
772 std::make_pair(385, dBr_u{-20.0}), // DC band (stop)
773 std::make_pair(386, dBr_u{0.0}), // allocated band right (start)
774 std::make_pair(506, dBr_u{0.0}), // allocated band right (stop)
775 std::make_pair(507, dBr_u{-3.333}), // Inner band right (start)
776 std::make_pair(512, dBr_u{-20.0}), // Inner band right (stop)
777 std::make_pair(513, dBr_u{-20.0}), // Flat junction band right (start)
778 std::make_pair(515, dBr_u{-20.0}), // Flat junction band right (stop)
779 std::make_pair(516, dBr_u{-20.064}), // Middle band right (start)
780 std::make_pair(640, dBr_u{-28.000}), // Middle band right (stop)
781 std::make_pair(641, dBr_u{-28.133}), // Outer band right (start)
782 std::make_pair(768, dBr_u{-45.000}), // Outer band right (stop)
783 };
784
785 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_2.4GHz 20MHz",
788 MHz_u{20},
789 {MHz_u{2412}},
790 maskSlopes,
791 tol,
792 prec),
793 TestCase::Duration::QUICK);
794
795 // ============================================================================================
796 // 11ax 20MHz @ 5GHz
797 NS_LOG_FUNCTION("Check slopes for 11ax 20MHz @ 5GHz");
798 maskSlopes = {
799 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
800 std::make_pair(127, dBr_u{-28.094}), // Outer band left (stop)
801 std::make_pair(128, dBr_u{-28.000}), // Middle band left (start)
802 std::make_pair(252, dBr_u{-20.064}), // Middle band left (stop)
803 std::make_pair(253, dBr_u{-20.0}), // Flat junction band left (start)
804 std::make_pair(255, dBr_u{-20.0}), // Flat junction band left (stop)
805 std::make_pair(256, dBr_u{-20.0}), // Inner band left (start)
806 std::make_pair(261, dBr_u{-3.333}), // Inner band left (stop)
807 std::make_pair(262, dBr_u{0.0}), // allocated band left (start)
808 std::make_pair(382, dBr_u{0.0}), // allocated band left (stop)
809 std::make_pair(383, dBr_u{-20.0}), // DC band (start)
810 std::make_pair(385, dBr_u{-20.0}), // DC band (stop)
811 std::make_pair(386, dBr_u{0.0}), // allocated band right (start)
812 std::make_pair(506, dBr_u{0.0}), // allocated band right (stop)
813 std::make_pair(507, dBr_u{-3.333}), // Inner band right (start)
814 std::make_pair(512, dBr_u{-20.0}), // Inner band right (stop)
815 std::make_pair(513, dBr_u{-20.0}), // Flat junction band right (start)
816 std::make_pair(515, dBr_u{-20.0}), // Flat junction band right (stop)
817 std::make_pair(516, dBr_u{-20.064}), // Middle band right (start)
818 std::make_pair(640, dBr_u{-28.000}), // Middle band right (stop)
819 std::make_pair(641, dBr_u{-28.094}), // Outer band right (start)
820 std::make_pair(768, dBr_u{-40.0}), // Outer band right (stop)
821 };
822
823 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 20MHz",
826 MHz_u{20},
827 {MHz_u{5180}},
828 maskSlopes,
829 tol,
830 prec),
831 TestCase::Duration::QUICK);
832
833 // ============================================================================================
834 // 11ax 40MHz @ 2.4GHz
835 NS_LOG_FUNCTION("Check slopes for 11ax 40MHz @ 2.4GHz");
836 maskSlopes = {
837 std::make_pair(0, dBr_u{-45.000}), // Outer band left (start)
838 std::make_pair(255, dBr_u{-28.066}), // Outer band left (stop)
839 std::make_pair(256, dBr_u{-28.000}), // Middle band left (start)
840 std::make_pair(505, dBr_u{-20.032}), // Middle band left (stop)
841 std::make_pair(506, dBr_u{-20.0}), // Flat junction band left (start)
842 std::make_pair(510, dBr_u{-20.0}), // Flat junction band left (stop)
843 std::make_pair(511, dBr_u{-20.0}), // Inner band left (start)
844 std::make_pair(523, dBr_u{-1.538}), // Inner band left (stop)
845 std::make_pair(524, dBr_u{0.0}), // allocated band left (start)
846 std::make_pair(765, dBr_u{0.0}), // allocated band left (stop)
847 std::make_pair(766, dBr_u{-20.0}), // DC band (start)
848 std::make_pair(770, dBr_u{-20.0}), // DC band (stop)
849 std::make_pair(771, dBr_u{0.0}), // allocated band right (start)
850 std::make_pair(1012, dBr_u{0.0}), // allocated band right (stop)
851 std::make_pair(1013, dBr_u{-1.538}), // Inner band right (start)
852 std::make_pair(1025, dBr_u{-20.0}), // Inner band right (stop)
853 std::make_pair(1026, dBr_u{-20.0}), // Flat junction band right (start)
854 std::make_pair(1030, dBr_u{-20.0}), // Flat junction band right (stop)
855 std::make_pair(1031, dBr_u{-20.032}), // Middle band right (start)
856 std::make_pair(1280, dBr_u{-28.000}), // Middle band right (stop)
857 std::make_pair(1281, dBr_u{-28.066}), // Outer band right (start)
858 std::make_pair(1536, dBr_u{-45.000}), // Outer band right (stop)
859 };
860
861 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_2.4GHz 40MHz",
864 MHz_u{40},
865 {MHz_u{2422}},
866 maskSlopes,
867 tol,
868 prec),
869 TestCase::Duration::QUICK);
870
871 // ============================================================================================
872 // 11ax 40MHz @ 5GHz
873 NS_LOG_FUNCTION("Check slopes for 11ax 40MHz @ 5GHz");
874 maskSlopes = {
875 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
876 std::make_pair(255, dBr_u{-28.047}), // Outer band left (stop)
877 std::make_pair(256, dBr_u{-28.000}), // Middle band left (start)
878 std::make_pair(505, dBr_u{-20.032}), // Middle band left (stop)
879 std::make_pair(506, dBr_u{-20.0}), // Flat junction band left (start)
880 std::make_pair(510, dBr_u{-20.0}), // Flat junction band left (stop)
881 std::make_pair(511, dBr_u{-20.0}), // Inner band left (start)
882 std::make_pair(523, dBr_u{-1.538}), // Inner band left (stop)
883 std::make_pair(524, dBr_u{0.0}), // allocated band left (start)
884 std::make_pair(765, dBr_u{0.0}), // allocated band left (stop)
885 std::make_pair(766, dBr_u{-20.0}), // DC band (start)
886 std::make_pair(770, dBr_u{-20.0}), // DC band (stop)
887 std::make_pair(771, dBr_u{0.0}), // allocated band right (start)
888 std::make_pair(1012, dBr_u{0.0}), // allocated band right (stop)
889 std::make_pair(1013, dBr_u{-1.538}), // Inner band right (start)
890 std::make_pair(1025, dBr_u{-20.0}), // Inner band right (stop)
891 std::make_pair(1026, dBr_u{-20.0}), // Flat junction band right (start)
892 std::make_pair(1030, dBr_u{-20.0}), // Flat junction band right (stop)
893 std::make_pair(1031, dBr_u{-20.032}), // Middle band right (start)
894 std::make_pair(1280, dBr_u{-28.000}), // Middle band right (stop)
895 std::make_pair(1281, dBr_u{-28.047}), // Outer band right (start)
896 std::make_pair(1536, dBr_u{-40.0}), // Outer band right (stop)
897 };
898
899 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 40MHz",
902 MHz_u{40},
903 {MHz_u{5190}},
904 maskSlopes,
905 tol,
906 prec),
907 TestCase::Duration::QUICK);
908
909 // ============================================================================================
910 // 11ax 80MHz @ 5GHz
911 NS_LOG_FUNCTION("Check slopes for 11ax 80MHz @ 5GHz");
912 maskSlopes = {
913 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
914 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
915 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
916 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
917 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
918 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
919 std::make_pair(1023, dBr_u{-20.0}), // Inner band left (start)
920 std::make_pair(1035, dBr_u{-1.538}), // Inner band left (stop)
921 std::make_pair(1036, dBr_u{0.0}), // allocated band left (start)
922 std::make_pair(1533, dBr_u{0.0}), // allocated band left (stop)
923 std::make_pair(1534, dBr_u{-20.0}), // DC band (start)
924 std::make_pair(1538, dBr_u{-20.0}), // DC band (stop)
925 std::make_pair(1539, dBr_u{0.0}), // allocated band right (start)
926 std::make_pair(2036, dBr_u{0.0}), // allocated band right (stop)
927 std::make_pair(2037, dBr_u{-1.538}), // Inner band right (start)
928 std::make_pair(2049, dBr_u{-20.0}), // Inner band right (stop)
929 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right (start)
930 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right (stop)
931 std::make_pair(2055, dBr_u{-20.016}), // Middle band right (start)
932 std::make_pair(2560, dBr_u{-28.000}), // Middle band right (stop)
933 std::make_pair(2561, dBr_u{-28.023}), // Outer band right (start)
934 std::make_pair(3072, dBr_u{-40.0}), // Outer band right (stop)
935 };
936
937 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80MHz",
940 MHz_u{80},
941 {MHz_u{5210}},
942 maskSlopes,
943 tol,
944 prec),
945 TestCase::Duration::QUICK);
946
947 // ============================================================================================
948 // 11ax 160MHz @ 5GHz
949 NS_LOG_FUNCTION("Check slopes for 11ax 160MHz @ 5GHz");
950 maskSlopes = {
951 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
952 std::make_pair(1023, dBr_u{-28.012}), // Outer band left (stop)
953 std::make_pair(1024, dBr_u{-28.000}), // Middle band left (start)
954 std::make_pair(2041, dBr_u{-20.008}), // Middle band left (stop)
955 std::make_pair(2042, dBr_u{-20.0}), // Flat junction band left (start)
956 std::make_pair(2046, dBr_u{-20.0}), // Flat junction band left (stop)
957 std::make_pair(2047, dBr_u{-20.0}), // Inner band left (start)
958 std::make_pair(2059, dBr_u{-1.538}), // Inner band left (stop)
959 std::make_pair(2060, dBr_u{0.0}), // first 80 MHz allocated band left (start)
960 std::make_pair(2557, dBr_u{0.0}), // first 80 MHz allocated band left (stop)
961 std::make_pair(2558, dBr_u{-20.0}), // first 80 MHz DC band (start)
962 std::make_pair(2562, dBr_u{-20.0}), // first 80 MHz DC band (stop)
963 std::make_pair(2563, dBr_u{0.0}), // first 80 MHz allocated band right (start)
964 std::make_pair(3060, dBr_u{0.0}), // first 80 MHz allocated band right (stop)
965 std::make_pair(3061, dBr_u{-20.0}), // gap between 80 MHz bands (start)
966 std::make_pair(3083, dBr_u{-20.0}), // gap between 80 MHz bands (stop)
967 std::make_pair(3084, dBr_u{0.0}), // second 80 MHz allocated band left (start)
968 std::make_pair(3581, dBr_u{0.0}), // second 80 MHz allocated band left (stop)
969 std::make_pair(3582, dBr_u{-20.0}), // second 80 MHz DC band (start)
970 std::make_pair(3586, dBr_u{-20.0}), // second 80 MHz DC band (stop)
971 std::make_pair(3587, dBr_u{0.0}), // second 80 MHz allocated band right (start)
972 std::make_pair(4084, dBr_u{0.0}), // second 80 MHz allocated band right (stop)
973 std::make_pair(4085, dBr_u{-1.538}), // Inner band right (start)
974 std::make_pair(4097, dBr_u{-20.0}), // Inner band right (stop)
975 std::make_pair(4098, dBr_u{-20.0}), // Flat junction band right (start)
976 std::make_pair(4102, dBr_u{-20.0}), // Flat junction band right (stop)
977 std::make_pair(4103, dBr_u{-20.008}), // Middle band right (start)
978 std::make_pair(5120, dBr_u{-28.000}), // Middle band right (stop)
979 std::make_pair(5121, dBr_u{-28.012}), // Outer band right (start)
980 std::make_pair(6144, dBr_u{-40.0}), // Outer band right (stop)
981 };
982
983 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 160MHz",
986 MHz_u{160},
987 {MHz_u{5250}},
988 maskSlopes,
989 tol,
990 prec),
991 TestCase::Duration::QUICK);
992
993 // ============================================================================================
994 // 11ax 80+80MHz @ 5GHz
995 NS_LOG_FUNCTION("Check slopes for 11ax 80+80MHz @ 5GHz");
996 maskSlopes = {
997 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
998 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
999 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
1000 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
1001 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
1002 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
1003 std::make_pair(1023, dBr_u{-20.0}), // Inner band left for first segment (start)
1004 std::make_pair(1035, dBr_u{-1.538}), // Inner band left for first segment (stop)
1005 std::make_pair(1036, dBr_u{0.0}), // allocated band left for first segment (start)
1006 std::make_pair(1533, dBr_u{0.0}), // allocated band left for first segment (stop)
1007 std::make_pair(1534, dBr_u{-20.0}), // DC band for first segment (start)
1008 std::make_pair(1538, dBr_u{-20.0}), // DC band for first segment (stop)
1009 std::make_pair(1539, dBr_u{0.0}), // allocated band right for first segment (start)
1010 std::make_pair(2036, dBr_u{0.0}), // allocated band right for first segment (stop)
1011 std::make_pair(2037, dBr_u{-1.538}), // Inner band right for first segment (start)
1012 std::make_pair(2049, dBr_u{-20.0}), // Inner band right for first segment (stop)
1013 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right for first segment (start)
1014 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right for first segment (stop)
1015 std::make_pair(2055, dBr_u{-20.01}), // start linear sum region left (no interpolation
1016 // possible, so provide 2 times the same point)
1017 std::make_pair(2055, dBr_u{-20.01}), // start linear sum region left (no interpolation
1018 // possible, so provide 2 times the same point)
1019 std::make_pair(2559, dBr_u{-24.99}), // stop linear sum region left (no interpolation
1020 // possible, so provide 2 times the same point)
1021 std::make_pair(2559, dBr_u{-24.99}), // stop linear sum region left (no interpolation
1022 // possible, so provide 2 times the same point)
1023 std::make_pair(2560, dBr_u{-25.0}), // middle linear sum region (no interpolation possible,
1024 // so provide 2 times the same point)
1025 std::make_pair(2560, dBr_u{-25.0}), // middle linear sum region (no interpolation possible,
1026 // so provide 2 times the same point)
1027 std::make_pair(2561, dBr_u{-24.99}), // start linear sum region right (no interpolation
1028 // possible, so provide 2 times the same point)
1029 std::make_pair(2561, dBr_u{-24.99}), // start linear sum region right (no interpolation
1030 // possible, so provide 2 times the same point)
1031 std::make_pair(3065, dBr_u{-20.01}), // stop linear sum region right (no interpolation
1032 // possible, so provide 2 times the same point)
1033 std::make_pair(3065, dBr_u{-20.01}), // stop linear sum region right (no interpolation
1034 // possible, so provide 2 times the same point)
1035 std::make_pair(3066, dBr_u{-20.0}), // Flat junction band left (start)
1036 std::make_pair(3070, dBr_u{-20.0}), // Flat junction band left (stop)
1037 std::make_pair(3071, dBr_u{-20.0}), // Inner band left for second segment (start)
1038 std::make_pair(3083, dBr_u{-1.538}), // Inner band left for second segment (stop)
1039 std::make_pair(3084, dBr_u{0.0}), // allocated band left for second segment (start)
1040 std::make_pair(3581, dBr_u{0.0}), // allocated band left for second segment (stop)
1041 std::make_pair(3582, dBr_u{-20.0}), // DC band for second segment (start)
1042 std::make_pair(3586, dBr_u{-20.0}), // DC band for second segment (stop)
1043 std::make_pair(3587, dBr_u{0.0}), // allocated band right for second segment (start)
1044 std::make_pair(4084, dBr_u{0.0}), // allocated band right for second segment (stop)
1045 std::make_pair(4085, dBr_u{-1.538}), // Inner band right for second segment (start)
1046 std::make_pair(4097, dBr_u{-20.0}), // Inner band right for second segment (stop)
1047 std::make_pair(4098, dBr_u{-20.0}), // Flat junction band right (start)
1048 std::make_pair(4102, dBr_u{-20.0}), // Flat junction band right (stop)
1049 std::make_pair(4103, dBr_u{-20.016}), // Middle band right (start)
1050 std::make_pair(4608, dBr_u{-28.000}), // Middle band right (stop)
1051 std::make_pair(4609, dBr_u{-28.023}), // Outer band right (start)
1052 std::make_pair(5120, dBr_u{-40.0}), // Outer band right (stop)
1053 };
1054
1055 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80+80MHz",
1058 MHz_u{160},
1059 {MHz_u{5530}, MHz_u{5690}},
1060 maskSlopes,
1061 tol,
1062 prec),
1063 TestCase::Duration::QUICK);
1064
1065 // ============================================================================================
1066 // 11ax 80+80MHz @ 5GHz
1067 NS_LOG_FUNCTION("Check slopes for 11ax 80+80MHz @ 5GHz with larger frequency separation "
1068 "between the two PSDs");
1069 maskSlopes = {
1070 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1071 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
1072 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
1073 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
1074 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
1075 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
1076 std::make_pair(1023, dBr_u{-20.0}), // Inner band left for first segment (start)
1077 std::make_pair(1035, dBr_u{-1.538}), // Inner band left for first segment (stop)
1078 std::make_pair(1036, dBr_u{0.0}), // allocated band left for first segment (start)
1079 std::make_pair(1533, dBr_u{0.0}), // allocated band left for first segment (stop)
1080 std::make_pair(1534, dBr_u{-20.0}), // DC band for first segment (start)
1081 std::make_pair(1538, dBr_u{-20.0}), // DC band for first segment (stop)
1082 std::make_pair(1539, dBr_u{0.0}), // allocated band right for first segment (start)
1083 std::make_pair(2036, dBr_u{0.0}), // allocated band right for first segment (stop)
1084 std::make_pair(2037, dBr_u{-1.538}), // Inner band right for first segment (start)
1085 std::make_pair(2049, dBr_u{-20.0}), // Inner band right for first segment (stop)
1086 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right for first segment (start)
1087 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right for first segment (stop)
1088 std::make_pair(2055, dBr_u{-20.01}), // start linear sum region left (no interpolation
1089 // possible, so provide 2 times the same point)
1090 std::make_pair(2055, dBr_u{-20.01}), // start linear sum region left (no interpolation
1091 // possible, so provide 2 times the same point)
1092 std::make_pair(3583, dBr_u{-24.99}), // stop linear sum region left (no interpolation
1093 // possible, so provide 2 times the same point)
1094 std::make_pair(3583, dBr_u{-24.99}), // stop linear sum region left (no interpolation
1095 // possible, so provide 2 times the same point)
1096 std::make_pair(3584, dBr_u{-25.0}), // middle linear sum region (no interpolation possible,
1097 // so provide 2 times the same point)
1098 std::make_pair(3584, dBr_u{-25.0}), // middle linear sum region (no interpolation possible,
1099 // so provide 2 times the same point)
1100 std::make_pair(3585, dBr_u{-24.99}), // start linear sum region right (no interpolation
1101 // possible, so provide 2 times the same point)
1102 std::make_pair(3585, dBr_u{-24.99}), // start linear sum region right (no interpolation
1103 // possible, so provide 2 times the same point)
1104 std::make_pair(5113, dBr_u{-20.01}), // stop linear sum region right (no interpolation
1105 // possible, so provide 2 times the same point)
1106 std::make_pair(5113, dBr_u{-20.01}), // stop linear sum region right (no interpolation
1107 // possible, so provide 2 times the same point)
1108 std::make_pair(5114, dBr_u{-20.0}), // Flat junction band left (start)
1109 std::make_pair(5118, dBr_u{-20.0}), // Flat junction band left (stop)
1110 std::make_pair(5119, dBr_u{-20.0}), // Inner band left for second segment (start)
1111 std::make_pair(5131, dBr_u{-1.538}), // Inner band left for second segment (stop)
1112 std::make_pair(5132, dBr_u{0.0}), // allocated band left for second segment (start)
1113 std::make_pair(5629, dBr_u{0.0}), // allocated band left for second segment (stop)
1114 std::make_pair(5630, dBr_u{-20.0}), // DC band for second segment (start)
1115 std::make_pair(5634, dBr_u{-20.0}), // DC band for second segment (stop)
1116 std::make_pair(5635, dBr_u{0.0}), // allocated band right for second segment (start)
1117 std::make_pair(6132, dBr_u{0.0}), // allocated band right for second segment (stop)
1118 std::make_pair(6133, dBr_u{-1.538}), // Inner band right for second segment (start)
1119 std::make_pair(6145, dBr_u{-20.0}), // Inner band right for second segment (stop)
1120 std::make_pair(6146, dBr_u{-20.0}), // Flat junction band right (start)
1121 std::make_pair(6150, dBr_u{-20.0}), // Flat junction band right (stop)
1122 std::make_pair(6151, dBr_u{-20.016}), // Middle band right (start)
1123 std::make_pair(6656, dBr_u{-28.000}), // Middle band right (stop)
1124 std::make_pair(6657, dBr_u{-28.023}), // Outer band right (start)
1125 std::make_pair(7168, dBr_u{-40.0}), // Outer band right (stop)
1126 };
1127
1128 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80+80MHz large separation",
1131 MHz_u{160},
1132 {MHz_u{5210}, MHz_u{5530}},
1133 maskSlopes,
1134 tol,
1135 prec),
1136 TestCase::Duration::QUICK);
1137
1138 // ============================================================================================
1139 // 11ax 80MHz @ 5GHz - first 20 MHz subchannel punctured
1140 NS_LOG_FUNCTION("Check slopes for 11ax 80MHz @ 5GHz with first 20 MHz subchannel punctured");
1141 maskSlopes = {
1142 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1143 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
1144 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
1145 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
1146 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
1147 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
1148 std::make_pair(1023, dBr_u{-20.0}), // punctured band (start)
1149 std::make_pair(1272, dBr_u{-20.0}), // punctured band (stop)
1150 std::make_pair(1273, dBr_u{-20.0}), // punctured band increasing slope (start)
1151 std::make_pair(1279, dBr_u{0.0}), // punctured band increasing slope (stop)
1152 std::make_pair(1280, dBr_u{0.0}), // allocated band left (start)
1153 std::make_pair(1533, dBr_u{0.0}), // allocated band left (stop)
1154 std::make_pair(1534, dBr_u{-20.0}), // DC band (start)
1155 std::make_pair(1538, dBr_u{-20.0}), // DC band (stop)
1156 std::make_pair(1539, dBr_u{0.0}), // allocated band right (start)
1157 std::make_pair(2036, dBr_u{0.0}), // allocated band right (stop)
1158 std::make_pair(2037, dBr_u{-1.538}), // Inner band right (start)
1159 std::make_pair(2049, dBr_u{-20.0}), // Inner band right (stop)
1160 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right (start)
1161 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right (stop)
1162 std::make_pair(2055, dBr_u{-20.016}), // Middle band right (start)
1163 std::make_pair(2560, dBr_u{-28.000}), // Middle band right (stop)
1164 std::make_pair(2561, dBr_u{-28.023}), // Outer band right (start)
1165 std::make_pair(3072, dBr_u{-40.0}), // Outer band right (stop)
1166 };
1167
1168 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80MHz first subchannel punctured",
1171 MHz_u{80},
1172 {MHz_u{5210}},
1173 maskSlopes,
1174 tol,
1175 prec,
1176 {true, false, false, false}),
1177 TestCase::Duration::QUICK);
1178
1179 // ============================================================================================
1180 // 11ax 80MHz @ 5GHz - second 20 MHz subchannel punctured
1181 NS_LOG_FUNCTION("Check slopes for 11ax 80MHz @ 5GHz with second 20 MHz subchannel punctured");
1182 maskSlopes = {
1183 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1184 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
1185 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
1186 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
1187 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
1188 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
1189 std::make_pair(1023, dBr_u{-20.0}), // Inner band left (start)
1190 std::make_pair(1035, dBr_u{-1.538}), // Inner band left (stop)
1191 std::make_pair(1036, dBr_u{0.0}), // allocated band left (start)
1192 std::make_pair(1279, dBr_u{0.0}), // allocated band left (stop)
1193 std::make_pair(1280, dBr_u{0.0}), // punctured band decreasing slope (start)
1194 std::make_pair(1286, dBr_u{-20.0}), // punctured band decreasing slope (stop)
1195 std::make_pair(1287, dBr_u{-20.0}), // punctured band (start)
1196 std::make_pair(1528, dBr_u{-20.0}), // punctured band (stop)
1197 std::make_pair(1529, dBr_u{-20.0}), // punctured band increasing slope (start)
1198 std::make_pair(1533, dBr_u{-6.667}), // punctured band increasing slope (stop)
1199 std::make_pair(1534, dBr_u{-20.0}), // DC band (start)
1200 std::make_pair(1538, dBr_u{-20.0}), // DC band (stop)
1201 std::make_pair(1539, dBr_u{0.0}), // allocated band right (start)
1202 std::make_pair(2036, dBr_u{0.0}), // allocated band right (stop)
1203 std::make_pair(2037, dBr_u{-1.538}), // Inner band right (start)
1204 std::make_pair(2049, dBr_u{-20.0}), // Inner band right (stop)
1205 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right (start)
1206 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right (stop)
1207 std::make_pair(2055, dBr_u{-20.016}), // Middle band right (start)
1208 std::make_pair(2560, dBr_u{-28.000}), // Middle band right (stop)
1209 std::make_pair(2561, dBr_u{-28.023}), // Outer band right (start)
1210 std::make_pair(3072, dBr_u{-40.0}), // Outer band right (stop)
1211 };
1212
1213 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80MHz second subchannel punctured",
1216 MHz_u{80},
1217 {MHz_u{5210}},
1218 maskSlopes,
1219 tol,
1220 prec,
1221 {false, true, false, false}),
1222 TestCase::Duration::QUICK);
1223
1224 // ============================================================================================
1225 // 11ax 80MHz @ 5GHz - third 20 MHz subchannel punctured
1226 NS_LOG_FUNCTION("Check slopes for 11ax 80MHz @ 5GHz with third 20 MHz subchannel punctured");
1227 maskSlopes = {
1228 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1229 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
1230 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
1231 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
1232 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
1233 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
1234 std::make_pair(1023, dBr_u{-20.0}), // Inner band left (start)
1235 std::make_pair(1035, dBr_u{-1.538}), // Inner band left (stop)
1236 std::make_pair(1036, dBr_u{0.0}), // allocated band left (start)
1237 std::make_pair(1533, dBr_u{0.0}), // allocated band left (stop)
1238 std::make_pair(1534, dBr_u{-20.0}), // DC band (start)
1239 std::make_pair(1535, dBr_u{-20.0}), // DC band (stop)
1240 std::make_pair(1539, dBr_u{-10.0}), // punctured band decreasing slope (start)
1241 std::make_pair(1542, dBr_u{-20.0}), // punctured band decreasing slope (stop)
1242 std::make_pair(1543, dBr_u{-20.0}), // punctured band (start)
1243 std::make_pair(1784, dBr_u{-20.0}), // punctured band (stop)
1244 std::make_pair(1785, dBr_u{-20.0}), // punctured band increasing slope (start)
1245 std::make_pair(1791, dBr_u{0.0}), // punctured band increasing slope (stop)
1246 std::make_pair(1792, dBr_u{0.0}), // allocated band right (start)
1247 std::make_pair(2036, dBr_u{0.0}), // allocated band right (stop)
1248 std::make_pair(2037, dBr_u{-1.538}), // Inner band right (start)
1249 std::make_pair(2049, dBr_u{-20.0}), // Inner band right (stop)
1250 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right (start)
1251 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right (stop)
1252 std::make_pair(2055, dBr_u{-20.016}), // Middle band right (start)
1253 std::make_pair(2560, dBr_u{-28.000}), // Middle band right (stop)
1254 std::make_pair(2561, dBr_u{-28.023}), // Outer band right (start)
1255 std::make_pair(3072, dBr_u{-40.0}), // Outer band right (stop)
1256 };
1257
1258 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80MHz third subchannel punctured",
1261 MHz_u{80},
1262 {MHz_u{5210}},
1263 maskSlopes,
1264 tol,
1265 prec,
1266 {false, false, true, false}),
1267 TestCase::Duration::QUICK);
1268
1269 // ============================================================================================
1270 // 11ax 80MHz @ 5GHz - last 20 MHz subchannel punctured
1271 NS_LOG_FUNCTION("Check slopes for 11ax 80MHz @ 5GHz with last 20 MHz subchannel punctured");
1272 maskSlopes = {
1273 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1274 std::make_pair(511, dBr_u{-28.023}), // Outer band left (stop)
1275 std::make_pair(512, dBr_u{-28.000}), // Middle band left (start)
1276 std::make_pair(1017, dBr_u{-20.016}), // Middle band left (stop)
1277 std::make_pair(1018, dBr_u{-20.0}), // Flat junction band left (start)
1278 std::make_pair(1022, dBr_u{-20.0}), // Flat junction band left (stop)
1279 std::make_pair(1023, dBr_u{-20.0}), // Inner band left (start)
1280 std::make_pair(1035, dBr_u{-1.538}), // Inner band left (stop)
1281 std::make_pair(1036, dBr_u{0.0}), // allocated band left (start)
1282 std::make_pair(1533, dBr_u{0.0}), // allocated band left (stop)
1283 std::make_pair(1534, dBr_u{-20.0}), // DC band (start)
1284 std::make_pair(1538, dBr_u{-20.0}), // DC band (stop)
1285 std::make_pair(1539, dBr_u{0.0}), // allocated band right (start)
1286 std::make_pair(1791, dBr_u{0.0}), // allocated band right (stop)
1287 std::make_pair(1792, dBr_u{0.0}), // punctured band decreasing slope (start)
1288 std::make_pair(1798, dBr_u{-20.0}), // punctured band decreasing slope (stop)
1289 std::make_pair(1799, dBr_u{-20.0}), // punctured band (start)
1290 std::make_pair(2049, dBr_u{-20.0}), // punctured band (stop)
1291 std::make_pair(2050, dBr_u{-20.0}), // Flat junction band right (start)
1292 std::make_pair(2054, dBr_u{-20.0}), // Flat junction band right (stop)
1293 std::make_pair(2055, dBr_u{-20.016}), // Middle band right (start)
1294 std::make_pair(2560, dBr_u{-28.000}), // Middle band right (stop)
1295 std::make_pair(2561, dBr_u{-28.023}), // Outer band right (start)
1296 std::make_pair(3072, dBr_u{-40.0}), // Outer band right (stop)
1297 };
1298
1299 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_5GHz 80MHz last subchannel punctured",
1302 MHz_u{80},
1303 {MHz_u{5210}},
1304 maskSlopes,
1305 tol,
1306 prec,
1307 {false, false, false, true}),
1308 TestCase::Duration::QUICK);
1309
1310 // ============================================================================================
1311 // 11ax 160MHz @ 5GHz - first two 20 MHz subchannels punctured
1313 "Check slopes for 11ax 160MHz @ 5GHz with two first 20 MHz subchannels punctured");
1314 maskSlopes = {
1315 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1316 std::make_pair(1023, dBr_u{-28.012}), // Outer band left (stop)
1317 std::make_pair(1024, dBr_u{-28.000}), // Middle band left (start)
1318 std::make_pair(2041, dBr_u{-20.008}), // Middle band left (stop)
1319 std::make_pair(2042, dBr_u{-20.0}), // Flat junction band left (start)
1320 std::make_pair(2046, dBr_u{-20.0}), // Flat junction band left (stop)
1321 std::make_pair(2047, dBr_u{-20.0}), // punctured band (start)
1322 std::make_pair(2552, dBr_u{-20.0}), // punctured band (stop)
1323 std::make_pair(2553, dBr_u{-20.0}), // punctured band increasing slope (start)
1324 std::make_pair(2557, dBr_u{-6.66667}), // punctured band increasing slope (stop)
1325 std::make_pair(2558, dBr_u{-20.0}), // first 80 MHz DC band (start)
1326 std::make_pair(2562, dBr_u{-20.0}), // first 80 MHz DC band (stop)
1327 std::make_pair(2563, dBr_u{0.0}), // first 80 MHz allocated band right (start)
1328 std::make_pair(3060, dBr_u{0.0}), // first 80 MHz allocated band right (stop)
1329 std::make_pair(3061, dBr_u{-20.0}), // gap between 80 MHz bands (start)
1330 std::make_pair(3083, dBr_u{-20.0}), // gap between 80 MHz bands (stop)
1331 std::make_pair(3084, dBr_u{0.0}), // second 80 MHz allocated band left (start)
1332 std::make_pair(3581, dBr_u{0.0}), // second 80 MHz allocated band left (stop)
1333 std::make_pair(3582, dBr_u{-20.0}), // second 80 MHz DC band (start)
1334 std::make_pair(3586, dBr_u{-20.0}), // second 80 MHz DC band (stop)
1335 std::make_pair(3587, dBr_u{0.0}), // second 80 MHz allocated band right (start)
1336 std::make_pair(4084, dBr_u{0.0}), // second 80 MHz allocated band right (stop)
1337 std::make_pair(4085, dBr_u{-1.538}), // Inner band right (start)
1338 std::make_pair(4097, dBr_u{-20.0}), // Inner band right (stop)
1339 std::make_pair(4098, dBr_u{-20.0}), // Flat junction band right (start)
1340 std::make_pair(4102, dBr_u{-20.0}), // Flat junction band right (stop)
1341 std::make_pair(4103, dBr_u{-20.008}), // Middle band right (start)
1342 std::make_pair(5120, dBr_u{-28.000}), // Middle band right (stop)
1343 std::make_pair(5121, dBr_u{-28.012}), // Outer band right (start)
1344 std::make_pair(6144, dBr_u{-40.0}), // Outer band right (stop)
1345 };
1346
1348 new WifiOfdmMaskSlopesTestCase("11ax_5GHz 160MHz first subchannels punctured",
1351 MHz_u{160},
1352 {MHz_u{5250}},
1353 maskSlopes,
1354 tol,
1355 prec,
1356 {true, true, false, false, false, false, false, false}),
1357 TestCase::Duration::QUICK);
1358
1359 // ============================================================================================
1360 // 11ax 160MHz @ 5GHz - third and fourth 20 MHz subchannels punctured
1362 "Check slopes for 11ax 160MHz @ 5GHz with third and fourth 20 MHz subchannels punctured");
1363 maskSlopes = {
1364 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1365 std::make_pair(1023, dBr_u{-28.012}), // Outer band left (stop)
1366 std::make_pair(1024, dBr_u{-28.000}), // Middle band left (start)
1367 std::make_pair(2041, dBr_u{-20.008}), // Middle band left (stop)
1368 std::make_pair(2042, dBr_u{-20.0}), // Flat junction band left (start)
1369 std::make_pair(2046, dBr_u{-20.0}), // Flat junction band left (stop)
1370 std::make_pair(2047, dBr_u{-20.0}), // Inner band left (start)
1371 std::make_pair(2059, dBr_u{-1.538}), // Inner band left (stop)
1372 std::make_pair(2060, dBr_u{0.0}), // first 80 MHz allocated band left (start)
1373 std::make_pair(2557, dBr_u{0.0}), // first 80 MHz allocated band left (stop)
1374 std::make_pair(2558, dBr_u{-20.0}), // first 80 MHz DC band (start)
1375 std::make_pair(2562, dBr_u{-20.0}), // first 80 MHz DC band (stop)
1376 std::make_pair(2563, dBr_u{-10.0}), // punctured band decreasing slope (start)
1377 std::make_pair(2566, dBr_u{-20.0}), // punctured band decreasing slope (stop)
1378 std::make_pair(2567, dBr_u{-20.0}), // punctured band (start)
1379 std::make_pair(3060, dBr_u{-20.0}), // punctured band (stop)
1380 std::make_pair(3061, dBr_u{-20.0}), // gap between 80 MHz bands (start)
1381 std::make_pair(3083, dBr_u{-20.0}), // gap between 80 MHz bands (stop)
1382 std::make_pair(3084, dBr_u{0.0}), // second 80 MHz allocated band left (start)
1383 std::make_pair(3581, dBr_u{0.0}), // second 80 MHz allocated band left (stop)
1384 std::make_pair(3582, dBr_u{-20.0}), // second 80 MHz DC band (start)
1385 std::make_pair(3586, dBr_u{-20.0}), // second 80 MHz DC band (stop)
1386 std::make_pair(3587, dBr_u{0.0}), // second 80 MHz allocated band right (start)
1387 std::make_pair(4084, dBr_u{0.0}), // second 80 MHz allocated band right (stop)
1388 std::make_pair(4085, dBr_u{-1.538}), // Inner band right (start)
1389 std::make_pair(4097, dBr_u{-20.0}), // Inner band right (stop)
1390 std::make_pair(4098, dBr_u{-20.0}), // Flat junction band right (start)
1391 std::make_pair(4102, dBr_u{-20.0}), // Flat junction band right (stop)
1392 std::make_pair(4103, dBr_u{-20.008}), // Middle band right (start)
1393 std::make_pair(5120, dBr_u{-28.000}), // Middle band right (stop)
1394 std::make_pair(5121, dBr_u{-28.012}), // Outer band right (start)
1395 std::make_pair(6144, dBr_u{-40.0}), // Outer band right (stop)
1396 };
1397
1399 new WifiOfdmMaskSlopesTestCase("11ax_5GHz 160MHz third and fourth subchannels punctured",
1402 MHz_u{160},
1403 {MHz_u{5250}},
1404 maskSlopes,
1405 tol,
1406 prec,
1407 {false, false, true, true, false, false, false, false}),
1408 TestCase::Duration::QUICK);
1409
1410 // ============================================================================================
1411 // 11ax 160MHz @ 5GHz - fifth and sixth 20 MHz subchannels punctured
1413 "Check slopes for 11ax 160MHz @ 5GHz with fifth and sixth 20 MHz subchannels punctured");
1414 maskSlopes = {
1415 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1416 std::make_pair(1023, dBr_u{-28.012}), // Outer band left (stop)
1417 std::make_pair(1024, dBr_u{-28.000}), // Middle band left (start)
1418 std::make_pair(2041, dBr_u{-20.008}), // Middle band left (stop)
1419 std::make_pair(2042, dBr_u{-20.0}), // Flat junction band left (start)
1420 std::make_pair(2046, dBr_u{-20.0}), // Flat junction band left (stop)
1421 std::make_pair(2047, dBr_u{-20.0}), // Inner band left (start)
1422 std::make_pair(2059, dBr_u{-1.538}), // Inner band left (stop)
1423 std::make_pair(2060, dBr_u{0.0}), // first 80 MHz allocated band left (start)
1424 std::make_pair(2557, dBr_u{0.0}), // first 80 MHz allocated band left (stop)
1425 std::make_pair(2558, dBr_u{-20.0}), // first 80 MHz DC band (start)
1426 std::make_pair(2562, dBr_u{-20.0}), // first 80 MHz DC band (stop)
1427 std::make_pair(2563, dBr_u{0.0}), // first 80 MHz allocated band right (start)
1428 std::make_pair(3060, dBr_u{0.0}), // first 80 MHz allocated band right (stop)
1429 std::make_pair(3061, dBr_u{-20.0}), // gap between 80 MHz bands (start)
1430 std::make_pair(3083, dBr_u{-20.0}), // gap between 80 MHz bands (stop)
1431 std::make_pair(3084, dBr_u{-20.0}), // punctured band (start)
1432 std::make_pair(3576, dBr_u{-20.0}), // punctured band (stop)
1433 std::make_pair(3577, dBr_u{-20.0}), // punctured band increasing slope (start)
1434 std::make_pair(3581, dBr_u{-6.667}), // punctured band increasing slope (stop)
1435 std::make_pair(3582, dBr_u{-20.0}), // second 80 MHz DC band (start)
1436 std::make_pair(3586, dBr_u{-20.0}), // second 80 MHz DC band (stop)
1437 std::make_pair(3587, dBr_u{0.0}), // second 80 MHz allocated band right (start)
1438 std::make_pair(4084, dBr_u{0.0}), // second 80 MHz allocated band right (stop)
1439 std::make_pair(4085, dBr_u{-1.538}), // Inner band right (start)
1440 std::make_pair(4097, dBr_u{-20.0}), // Inner band right (stop)
1441 std::make_pair(4098, dBr_u{-20.0}), // Flat junction band right (start)
1442 std::make_pair(4102, dBr_u{-20.0}), // Flat junction band right (stop)
1443 std::make_pair(4103, dBr_u{-20.008}), // Middle band right (start)
1444 std::make_pair(5120, dBr_u{-28.000}), // Middle band right (stop)
1445 std::make_pair(5121, dBr_u{-28.012}), // Outer band right (start)
1446 std::make_pair(6144, dBr_u{-40.0}), // Outer band right (stop)
1447 };
1448
1450 new WifiOfdmMaskSlopesTestCase("11ax_5GHz 160MHz fifth and sixth subchannels punctured",
1453 MHz_u{160},
1454 {MHz_u{5250}},
1455 maskSlopes,
1456 tol,
1457 prec,
1458 {false, false, false, false, true, true, false, false}),
1459 TestCase::Duration::QUICK);
1460
1461 // ============================================================================================
1462 // 11ax 160MHz @ 5GHz - last two 20 MHz subchannels punctured
1464 "Check slopes for 11ax 160MHz @ 5GHz with two last 20 MHz subchannels punctured");
1465 maskSlopes = {
1466 std::make_pair(0, dBr_u{-40.0}), // Outer band left (start)
1467 std::make_pair(1023, dBr_u{-28.012}), // Outer band left (stop)
1468 std::make_pair(1024, dBr_u{-28.000}), // Middle band left (start)
1469 std::make_pair(2041, dBr_u{-20.008}), // Middle band left (stop)
1470 std::make_pair(2042, dBr_u{-20.0}), // Flat junction band left (start)
1471 std::make_pair(2046, dBr_u{-20.0}), // Flat junction band left (stop)
1472 std::make_pair(2047, dBr_u{-20.0}), // Inner band left (start)
1473 std::make_pair(2059, dBr_u{-1.538}), // Inner band left (stop)
1474 std::make_pair(2060, dBr_u{0.0}), // first 80 MHz allocated band left (start)
1475 std::make_pair(2557, dBr_u{0.0}), // first 80 MHz allocated band left (stop)
1476 std::make_pair(2558, dBr_u{-20.0}), // first 80 MHz DC band (start)
1477 std::make_pair(2562, dBr_u{-20.0}), // first 80 MHz DC band (stop)
1478 std::make_pair(2563, dBr_u{0.0}), // first 80 MHz allocated band right (start)
1479 std::make_pair(3060, dBr_u{0.0}), // first 80 MHz allocated band right (stop)
1480 std::make_pair(3061, dBr_u{-20.0}), // gap between 80 MHz bands (start)
1481 std::make_pair(3083, dBr_u{-20.0}), // gap between 80 MHz bands (stop)
1482 std::make_pair(3084, dBr_u{0.0}), // second 80 MHz allocated band left (start)
1483 std::make_pair(3581, dBr_u{0.0}), // second 80 MHz allocated band left (stop)
1484 std::make_pair(3582, dBr_u{-20.0}), // second 80 MHz DC band (start)
1485 std::make_pair(3586, dBr_u{-20.0}), // second 80 MHz DC band (stop)
1486 std::make_pair(3587, dBr_u{-10.0}), // punctured band decreasing slope (start)
1487 std::make_pair(3590, dBr_u{-20.0}), // punctured band decreasing slope (stop)
1488 std::make_pair(3591, dBr_u{-20.0}), // punctured band (start)
1489 std::make_pair(4097, dBr_u{-20.0}), // punctured band (stop)
1490 std::make_pair(4098, dBr_u{-20.0}), // Flat junction band right (start)
1491 std::make_pair(4102, dBr_u{-20.0}), // Flat junction band right (stop)
1492 std::make_pair(4103, dBr_u{-20.008}), // Middle band right (start)
1493 std::make_pair(5120, dBr_u{-28.000}), // Middle band right (stop)
1494 std::make_pair(5121, dBr_u{-28.012}), // Outer band right (start)
1495 std::make_pair(6144, dBr_u{-40.0}), // Outer band right (stop)
1496 };
1497
1499 new WifiOfdmMaskSlopesTestCase("11ax_5GHz 160MHz last subchannels punctured",
1502 MHz_u{160},
1503 {MHz_u{5250}},
1504 maskSlopes,
1505 tol,
1506 prec,
1507 {false, false, false, false, false, false, true, true}),
1508 TestCase::Duration::QUICK);
1509
1510 // ============================================================================================
1511 // 11be 20MHz @ 6GHz
1512 NS_LOG_FUNCTION("Check slopes for 11be 20MHz @ 6GHz");
1513 maskSlopes = {
1514 std::make_pair(0, -40.0), // Outer band left (start)
1515 std::make_pair(127, -28.094), // Outer band left (stop)
1516 std::make_pair(128, -28.000), // Middle band left (start)
1517 std::make_pair(252, -20.064), // Middle band left (stop)
1518 std::make_pair(253, -20.0), // Flat junction band left (start)
1519 std::make_pair(255, -20.0), // Flat junction band left (stop)
1520 std::make_pair(256, -20.0), // Inner band left (start)
1521 std::make_pair(261, -3.333), // Inner band left (stop)
1522 std::make_pair(262, 0.0), // allocated band left (start)
1523 std::make_pair(382, 0.0), // allocated band left (stop)
1524 std::make_pair(383, -20.0), // DC band (start)
1525 std::make_pair(385, -20.0), // DC band (stop)
1526 std::make_pair(386, 0.0), // allocated band right (start)
1527 std::make_pair(506, 0.0), // allocated band right (stop)
1528 std::make_pair(507, -3.333), // Inner band right (start)
1529 std::make_pair(512, -20.0), // Inner band right (stop)
1530 std::make_pair(513, -20.0), // Flat junction band right (start)
1531 std::make_pair(515, -20.0), // Flat junction band right (stop)
1532 std::make_pair(516, -20.064), // Middle band right (start)
1533 std::make_pair(640, -28.000), // Middle band right (stop)
1534 std::make_pair(641, -28.094), // Outer band right (start)
1535 std::make_pair(768, -40.0), // Outer band right (stop)
1536 };
1537
1538 AddTestCase(new WifiOfdmMaskSlopesTestCase("11ax_6GHz 20MHz",
1541 MHz_u{20},
1542 {MHz_u{5955}},
1543 maskSlopes,
1544 tol,
1545 prec),
1546 TestCase::Duration::QUICK);
1547
1548 // ============================================================================================
1549 // 11be 40MHz @ 6GHz
1550 NS_LOG_FUNCTION("Check slopes for 11be 40MHz @ 6GHz");
1551 maskSlopes = {
1552 std::make_pair(0, -40.0), // Outer band left (start)
1553 std::make_pair(255, -28.047), // Outer band left (stop)
1554 std::make_pair(256, -28.000), // Middle band left (start)
1555 std::make_pair(505, -20.032), // Middle band left (stop)
1556 std::make_pair(506, -20.0), // Flat junction band left (start)
1557 std::make_pair(510, -20.0), // Flat junction band left (stop)
1558 std::make_pair(511, -20.0), // Inner band left (start)
1559 std::make_pair(523, -1.538), // Inner band left (stop)
1560 std::make_pair(524, 0.0), // allocated band left (start)
1561 std::make_pair(765, 0.0), // allocated band left (stop)
1562 std::make_pair(766, -20.0), // DC band (start)
1563 std::make_pair(770, -20.0), // DC band (stop)
1564 std::make_pair(771, 0.0), // allocated band right (start)
1565 std::make_pair(1012, 0.0), // allocated band right (stop)
1566 std::make_pair(1013, -1.538), // Inner band right (start)
1567 std::make_pair(1025, -20.0), // Inner band right (stop)
1568 std::make_pair(1026, -20.0), // Flat junction band right (start)
1569 std::make_pair(1030, -20.0), // Flat junction band right (stop)
1570 std::make_pair(1031, -20.032), // Middle band right (start)
1571 std::make_pair(1280, -28.000), // Middle band right (stop)
1572 std::make_pair(1281, -28.047), // Outer band right (start)
1573 std::make_pair(1536, -40.0), // Outer band right (stop)
1574 };
1575
1576 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 40MHz",
1579 MHz_u{40},
1580 {MHz_u{5965}},
1581 maskSlopes,
1582 tol,
1583 prec),
1584 TestCase::Duration::QUICK);
1585
1586 // ============================================================================================
1587 // 11be 80MHz @ 6GHz
1588 NS_LOG_FUNCTION("Check slopes for 11be 80MHz @ 6GHz");
1589 maskSlopes = {
1590 std::make_pair(0, -40.0), // Outer band left (start)
1591 std::make_pair(511, -28.023), // Outer band left (stop)
1592 std::make_pair(512, -28.000), // Middle band left (start)
1593 std::make_pair(1017, -20.016), // Middle band left (stop)
1594 std::make_pair(1018, -20.0), // Flat junction band left (start)
1595 std::make_pair(1022, -20.0), // Flat junction band left (stop)
1596 std::make_pair(1023, -20.0), // Inner band left (start)
1597 std::make_pair(1035, -1.538), // Inner band left (stop)
1598 std::make_pair(1036, 0.0), // allocated band left (start)
1599 std::make_pair(1533, 0.0), // allocated band left (stop)
1600 std::make_pair(1534, -20.0), // DC band (start)
1601 std::make_pair(1538, -20.0), // DC band (stop)
1602 std::make_pair(1539, 0.0), // allocated band right (start)
1603 std::make_pair(2036, 0.0), // allocated band right (stop)
1604 std::make_pair(2037, -1.538), // Inner band right (start)
1605 std::make_pair(2049, -20.0), // Inner band right (stop)
1606 std::make_pair(2050, -20.0), // Flat junction band right (start)
1607 std::make_pair(2054, -20.0), // Flat junction band right (stop)
1608 std::make_pair(2055, -20.016), // Middle band right (start)
1609 std::make_pair(2560, -28.000), // Middle band right (stop)
1610 std::make_pair(2561, -28.023), // Outer band right (start)
1611 std::make_pair(3072, -40.0), // Outer band right (stop)
1612 };
1613
1614 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 80MHz",
1617 MHz_u{80},
1618 {MHz_u{5985}},
1619 maskSlopes,
1620 tol,
1621 prec),
1622 TestCase::Duration::QUICK);
1623
1624 // ============================================================================================
1625 // 11be 160MHz @ 6GHz
1626 NS_LOG_FUNCTION("Check slopes for 11be 160MHz @ 6GHz");
1627 maskSlopes = {
1628 std::make_pair(0, -40.0), // Outer band left (start)
1629 std::make_pair(1023, -28.012), // Outer band left (stop)
1630 std::make_pair(1024, -28.000), // Middle band left (start)
1631 std::make_pair(2041, -20.008), // Middle band left (stop)
1632 std::make_pair(2042, -20.0), // Flat junction band left (start)
1633 std::make_pair(2046, -20.0), // Flat junction band left (stop)
1634 std::make_pair(2047, -20.0), // Inner band left (start)
1635 std::make_pair(2059, -1.538), // Inner band left (stop)
1636 std::make_pair(2060, 0.0), // first 80 MHz allocated band left (start)
1637 std::make_pair(2557, 0.0), // first 80 MHz allocated band left (stop)
1638 std::make_pair(2558, -20.0), // first 80 MHz DC band (start)
1639 std::make_pair(2562, -20.0), // first 80 MHz DC band (stop)
1640 std::make_pair(2563, 0.0), // first 80 MHz allocated band right (start)
1641 std::make_pair(3060, 0.0), // first 80 MHz allocated band right (stop)
1642 std::make_pair(3061, -20.0), // gap between 80 MHz bands (start)
1643 std::make_pair(3083, -20.0), // gap between 80 MHz bands (stop)
1644 std::make_pair(3084, 0.0), // second 80 MHz allocated band left (start)
1645 std::make_pair(3581, 0.0), // second 80 MHz allocated band left (stop)
1646 std::make_pair(3582, -20.0), // second 80 MHz DC band (start)
1647 std::make_pair(3586, -20.0), // second 80 MHz DC band (stop)
1648 std::make_pair(3587, 0.0), // second 80 MHz allocated band right (start)
1649 std::make_pair(4084, 0.0), // second 80 MHz allocated band right (stop)
1650 std::make_pair(4085, -1.538), // Inner band right (start)
1651 std::make_pair(4097, -20.0), // Inner band right (stop)
1652 std::make_pair(4098, -20.0), // Flat junction band right (start)
1653 std::make_pair(4102, -20.0), // Flat junction band right (stop)
1654 std::make_pair(4103, -20.008), // Middle band right (start)
1655 std::make_pair(5120, -28.000), // Middle band right (stop)
1656 std::make_pair(5121, -28.012), // Outer band right (start)
1657 std::make_pair(6144, -40.0), // Outer band right (stop)
1658 };
1659
1660 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 160MHz",
1663 MHz_u{160},
1664 {MHz_u{6025}},
1665 maskSlopes,
1666 tol,
1667 prec),
1668 TestCase::Duration::QUICK);
1669
1670 // ============================================================================================
1671 // 11be 320MHz @ 6GHz
1672 NS_LOG_FUNCTION("Check slopes for 11be 320MHz @ 6GHz");
1673 maskSlopes = {
1674 std::make_pair(0, -40.0), // Outer band left (start)
1675 std::make_pair(2047, -28.012), // Outer band left (stop)
1676 std::make_pair(2048, -28.000), // Middle band left (start)
1677 std::make_pair(4089, -20.008), // Middle band left (stop)
1678 std::make_pair(4090, -20.0), // Flat junction band left (start)
1679 std::make_pair(4094, -20.0), // Flat junction band left (stop)
1680 std::make_pair(4095, -20.0), // Inner band left (start)
1681 std::make_pair(4107, -1.538), // Inner band left (stop)
1682 std::make_pair(4108, 0.0), // first 80 MHz allocated band left (start)
1683 std::make_pair(4605, 0.0), // first 80 MHz allocated band left (stop)
1684 std::make_pair(4606, -20.0), // first 80 MHz DC band (start)
1685 std::make_pair(4610, -20.0), // first 80 MHz DC band (stop)
1686 std::make_pair(4611, 0.0), // first 80 MHz allocated band right (start)
1687 std::make_pair(5108, 0.0), // first 80 MHz allocated band right (stop)
1688 std::make_pair(5109, -20.0), // gap between 80 MHz bands (start)
1689 std::make_pair(5131, -20.0), // gap between 80 MHz bands (stop)
1690 std::make_pair(5132, 0.0), // second 80 MHz allocated band left (start)
1691 std::make_pair(5629, 0.0), // second 80 MHz allocated band left (stop)
1692 std::make_pair(5630, -20.0), // second 80 MHz DC band (start)
1693 std::make_pair(5634, -20.0), // second 80 MHz DC band (stop)
1694 std::make_pair(5635, 0.0), // second 80 MHz allocated band right (start)
1695 std::make_pair(6132, 0.0), // second 80 MHz allocated band right (stop)
1696 std::make_pair(6133, -20.0), // gap between 80 MHz bands (start)
1697 std::make_pair(6155, -20.0), // gap between 80 MHz bands (stop)
1698 std::make_pair(6156, 0.0), // third 80 MHz allocated band left (start)
1699 std::make_pair(6653, 0.0), // third 80 MHz allocated band left (stop)
1700 std::make_pair(6654, -20.0), // third 80 MHz DC band (start)
1701 std::make_pair(6658, -20.0), // third 80 MHz DC band (stop)
1702 std::make_pair(6659, 0.0), // third 80 MHz allocated band right (start)
1703 std::make_pair(7156, 0.0), // third 80 MHz allocated band right (stop)
1704 std::make_pair(7157, -20.0), // gap between 80 MHz bands (start)
1705 std::make_pair(7179, -20.0), // gap between 80 MHz bands (stop)
1706 std::make_pair(7180, 0.0), // fourth 80 MHz allocated band left (start)
1707 std::make_pair(7677, 0.0), // fourth 80 MHz allocated band left (stop)
1708 std::make_pair(7678, -20.0), // fourth 80 MHz DC band (start)
1709 std::make_pair(7682, -20.0), // fourth 80 MHz DC band (stop)
1710 std::make_pair(7683, 0.0), // fourth 80 MHz allocated band right (start)
1711 std::make_pair(8180, 0.0), // fourth 80 MHz allocated band right (stop)
1712 std::make_pair(8181, -1.538), // Inner band right (start)
1713 std::make_pair(8193, -20.0), // Inner band right (stop)
1714 std::make_pair(8194, -20.0), // Flat junction band right (start)
1715 std::make_pair(8198, -20.0), // Flat junction band right (stop)
1716 std::make_pair(8199, -20.008), // Middle band right (start)
1717 std::make_pair(10240, -28.000), // Middle band right (stop)
1718 std::make_pair(10241, -28.012), // Outer band right (start)
1719 std::make_pair(12288, -40.0), // Outer band right (stop)
1720 };
1721
1722 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 320MHz",
1725 MHz_u{320},
1726 {MHz_u{6105}},
1727 maskSlopes,
1728 tol,
1729 prec),
1730 TestCase::Duration::QUICK);
1731
1732 // ============================================================================================
1733 // 11be 320MHz @ 6GHz - first 20 MHz subchannel punctured
1734 std::vector<bool> puncturedSubchannels(16, false);
1735 NS_LOG_FUNCTION("Check slopes for 11be 320MHz @ 6GHz with first 20 MHz subchannel punctured");
1736 maskSlopes = {
1737 std::make_pair(0, -40.0), // Outer band left (start)
1738 std::make_pair(2047, -28.012), // Outer band left (stop)
1739 std::make_pair(2048, -28.000), // Middle band left (start)
1740 std::make_pair(4089, -20.008), // Middle band left (stop)
1741 std::make_pair(4090, -20.0), // Flat junction band left (start)
1742 std::make_pair(4094, -20.0), // Flat junction band left (stop)
1743 std::make_pair(4095, -20.0), // punctured band (start)
1744 std::make_pair(4344, -20.0), // punctured band (stop)
1745 std::make_pair(4345, -20.0), // punctured band increasing slope (start)
1746 std::make_pair(4351, 0.0), // punctured band increasing slope (stop)
1747 std::make_pair(4352, 0.0), // first 80 MHz allocated band left (start)
1748 std::make_pair(4605, 0.0), // first 80 MHz allocated band left (stop)
1749 std::make_pair(4606, -20.0), // first 80 MHz DC band (start)
1750 std::make_pair(4610, -20.0), // first 80 MHz DC band (stop)
1751 std::make_pair(4611, 0.0), // first 80 MHz allocated band right (start)
1752 std::make_pair(5108, 0.0), // first 80 MHz allocated band right (stop)
1753 std::make_pair(5109, -20.0), // gap between 80 MHz bands (start)
1754 std::make_pair(5131, -20.0), // gap between 80 MHz bands (stop)
1755 std::make_pair(5132, 0.0), // second 80 MHz allocated band left (start)
1756 std::make_pair(5629, 0.0), // second 80 MHz allocated band left (stop)
1757 std::make_pair(5630, -20.0), // second 80 MHz DC band (start)
1758 std::make_pair(5634, -20.0), // second 80 MHz DC band (stop)
1759 std::make_pair(5635, 0.0), // second 80 MHz allocated band right (start)
1760 std::make_pair(6132, 0.0), // second 80 MHz allocated band right (stop)
1761 std::make_pair(6133, -20.0), // gap between 80 MHz bands (start)
1762 std::make_pair(6155, -20.0), // gap between 80 MHz bands (stop)
1763 std::make_pair(6156, 0.0), // third 80 MHz allocated band left (start)
1764 std::make_pair(6653, 0.0), // third 80 MHz allocated band left (stop)
1765 std::make_pair(6654, -20.0), // third 80 MHz DC band (start)
1766 std::make_pair(6658, -20.0), // third 80 MHz DC band (stop)
1767 std::make_pair(6659, 0.0), // third 80 MHz allocated band right (start)
1768 std::make_pair(7156, 0.0), // third 80 MHz allocated band right (stop)
1769 std::make_pair(7157, -20.0), // gap between 80 MHz bands (start)
1770 std::make_pair(7179, -20.0), // gap between 80 MHz bands (stop)
1771 std::make_pair(7180, 0.0), // fourth 80 MHz allocated band left (start)
1772 std::make_pair(7677, 0.0), // fourth 80 MHz allocated band left (stop)
1773 std::make_pair(7678, -20.0), // fourth 80 MHz DC band (start)
1774 std::make_pair(7682, -20.0), // fourth 80 MHz DC band (stop)
1775 std::make_pair(7683, 0.0), // fourth 80 MHz allocated band right (start)
1776 std::make_pair(8180, 0.0), // fourth 80 MHz allocated band right (stop)
1777 std::make_pair(8181, -1.538), // Inner band right (start)
1778 std::make_pair(8193, -20.0), // Inner band right (stop)
1779 std::make_pair(8194, -20.0), // Flat junction band right (start)
1780 std::make_pair(8198, -20.0), // Flat junction band right (stop)
1781 std::make_pair(8199, -20.008), // Middle band right (start)
1782 std::make_pair(10240, -28.000), // Middle band right (stop)
1783 std::make_pair(10241, -28.012), // Outer band right (start)
1784 std::make_pair(12288, -40.0), // Outer band right (stop)
1785 };
1786
1787 puncturedSubchannels.at(0) = true;
1788 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 320MHz with first 20 MHz punctured",
1791 MHz_u{320},
1792 {MHz_u{6105}},
1793 maskSlopes,
1794 tol,
1795 prec,
1796 puncturedSubchannels),
1797 TestCase::Duration::QUICK);
1798
1799 // ============================================================================================
1800 // 11be 320MHz @ 6GHz - second 40 MHz subchannel punctured
1801 puncturedSubchannels = std::vector<bool>(16, false);
1802 NS_LOG_FUNCTION("Check slopes for 11be 320MHz @ 6GHz with second 40 MHz subchannel punctured");
1803 maskSlopes = {
1804 std::make_pair(0, -40.0), // Outer band left (start)
1805 std::make_pair(2047, -28.012), // Outer band left (stop)
1806 std::make_pair(2048, -28.000), // Middle band left (start)
1807 std::make_pair(4089, -20.008), // Middle band left (stop)
1808 std::make_pair(4090, -20.0), // Flat junction band left (start)
1809 std::make_pair(4094, -20.0), // Flat junction band left (stop)
1810 std::make_pair(4095, -20.0), // Inner band left (start)
1811 std::make_pair(4107, -1.538), // Inner band left (stop)
1812 std::make_pair(4108, 0.0), // first 80 MHz allocated band left (start)
1813 std::make_pair(4605, 0.0), // first 80 MHz allocated band left (stop)
1814 std::make_pair(4606, -20.0), // first 80 MHz DC band (start)
1815 std::make_pair(4610, -20.0), // first 80 MHz DC band (stop)
1816 std::make_pair(4611, -10.0), // punctured band decreasing slope (start)
1817 std::make_pair(4614, -20.0), // punctured band decreasing slope (stop)
1818 std::make_pair(4615, -20.0), // punctured band (start)
1819 std::make_pair(5108, -20.0), // punctured band (stop)
1820 std::make_pair(5109, -20.0), // gap between 80 MHz bands (start)
1821 std::make_pair(5131, -20.0), // gap between 80 MHz bands (stop)
1822 std::make_pair(5132, 0.0), // second 80 MHz allocated band left (start)
1823 std::make_pair(5629, 0.0), // second 80 MHz allocated band left (stop)
1824 std::make_pair(5630, -20.0), // second 80 MHz DC band (start)
1825 std::make_pair(5634, -20.0), // second 80 MHz DC band (stop)
1826 std::make_pair(5635, 0.0), // second 80 MHz allocated band right (start)
1827 std::make_pair(6132, 0.0), // second 80 MHz allocated band right (stop)
1828 std::make_pair(6133, -20.0), // gap between 80 MHz bands (start)
1829 std::make_pair(6155, -20.0), // gap between 80 MHz bands (stop)
1830 std::make_pair(6156, 0.0), // third 80 MHz allocated band left (start)
1831 std::make_pair(6653, 0.0), // third 80 MHz allocated band left (stop)
1832 std::make_pair(6654, -20.0), // third 80 MHz DC band (start)
1833 std::make_pair(6658, -20.0), // third 80 MHz DC band (stop)
1834 std::make_pair(6659, 0.0), // third 80 MHz allocated band right (start)
1835 std::make_pair(7156, 0.0), // third 80 MHz allocated band right (stop)
1836 std::make_pair(7157, -20.0), // gap between 80 MHz bands (start)
1837 std::make_pair(7179, -20.0), // gap between 80 MHz bands (stop)
1838 std::make_pair(7180, 0.0), // fourth 80 MHz allocated band left (start)
1839 std::make_pair(7677, 0.0), // fourth 80 MHz allocated band left (stop)
1840 std::make_pair(7678, -20.0), // fourth 80 MHz DC band (start)
1841 std::make_pair(7682, -20.0), // fourth 80 MHz DC band (stop)
1842 std::make_pair(7683, 0.0), // fourth 80 MHz allocated band right (start)
1843 std::make_pair(8180, 0.0), // fourth 80 MHz allocated band right (stop)
1844 std::make_pair(8181, -1.538), // Inner band right (start)
1845 std::make_pair(8193, -20.0), // Inner band right (stop)
1846 std::make_pair(8194, -20.0), // Flat junction band right (start)
1847 std::make_pair(8198, -20.0), // Flat junction band right (stop)
1848 std::make_pair(8199, -20.008), // Middle band right (start)
1849 std::make_pair(10240, -28.000), // Middle band right (stop)
1850 std::make_pair(10241, -28.012), // Outer band right (start)
1851 std::make_pair(12288, -40.0), // Outer band right (stop)
1852 };
1853
1854 puncturedSubchannels.at(2) = true;
1855 puncturedSubchannels.at(3) = true;
1856 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 320MHz with second 40 MHz punctured",
1859 MHz_u{320},
1860 {MHz_u{6105}},
1861 maskSlopes,
1862 tol,
1863 prec,
1864 puncturedSubchannels),
1865 TestCase::Duration::QUICK);
1866
1867 // ============================================================================================
1868 // 11be 320MHz @ 6GHz - second 80 MHz subchannel punctured
1869 puncturedSubchannels = std::vector<bool>(16, false);
1870 NS_LOG_FUNCTION("Check slopes for 11be 320MHz @ 6GHz with second 80 MHz subchannel punctured");
1871 maskSlopes = {
1872 std::make_pair(0, -40.0), // Outer band left (start)
1873 std::make_pair(2047, -28.012), // Outer band left (stop)
1874 std::make_pair(2048, -28.000), // Middle band left (start)
1875 std::make_pair(4089, -20.008), // Middle band left (stop)
1876 std::make_pair(4090, -20.0), // Flat junction band left (start)
1877 std::make_pair(4094, -20.0), // Flat junction band left (stop)
1878 std::make_pair(4095, -20.0), // Inner band left (start)
1879 std::make_pair(4107, -1.538), // Inner band left (stop)
1880 std::make_pair(4108, 0.0), // first 80 MHz allocated band left (start)
1881 std::make_pair(4605, 0.0), // first 80 MHz allocated band left (stop)
1882 std::make_pair(4606, -20.0), // first 80 MHz DC band (start)
1883 std::make_pair(4610, -20.0), // first 80 MHz DC band (stop)
1884 std::make_pair(4611, 0.0), // first 80 MHz allocated band right (start)
1885 std::make_pair(5108, 0.0), // first 80 MHz allocated band right (stop)
1886 std::make_pair(5109, -20.0), // gap between 80 MHz bands (start)
1887 std::make_pair(5131, -20.0), // gap between 80 MHz bands (stop)
1888 std::make_pair(5132, -20.0), // punctured band (start)
1889 std::make_pair(6132, -20.0), // punctured band (stop)
1890 std::make_pair(6133, -20.0), // gap between 80 MHz bands (start)
1891 std::make_pair(6155, -20.0), // gap between 80 MHz bands (stop)
1892 std::make_pair(6156, 0.0), // third 80 MHz allocated band left (start)
1893 std::make_pair(6653, 0.0), // third 80 MHz allocated band left (stop)
1894 std::make_pair(6654, -20.0), // third 80 MHz DC band (start)
1895 std::make_pair(6658, -20.0), // third 80 MHz DC band (stop)
1896 std::make_pair(6659, 0.0), // third 80 MHz allocated band right (start)
1897 std::make_pair(7156, 0.0), // third 80 MHz allocated band right (stop)
1898 std::make_pair(7157, -20.0), // gap between 80 MHz bands (start)
1899 std::make_pair(7179, -20.0), // gap between 80 MHz bands (stop)
1900 std::make_pair(7180, 0.0), // fourth 80 MHz allocated band left (start)
1901 std::make_pair(7677, 0.0), // fourth 80 MHz allocated band left (stop)
1902 std::make_pair(7678, -20.0), // fourth 80 MHz DC band (start)
1903 std::make_pair(7682, -20.0), // fourth 80 MHz DC band (stop)
1904 std::make_pair(7683, 0.0), // fourth 80 MHz allocated band right (start)
1905 std::make_pair(8180, 0.0), // fourth 80 MHz allocated band right (stop)
1906 std::make_pair(8181, -1.538), // Inner band right (start)
1907 std::make_pair(8193, -20.0), // Inner band right (stop)
1908 std::make_pair(8194, -20.0), // Flat junction band right (start)
1909 std::make_pair(8198, -20.0), // Flat junction band right (stop)
1910 std::make_pair(8199, -20.008), // Middle band right (start)
1911 std::make_pair(10240, -28.000), // Middle band right (stop)
1912 std::make_pair(10241, -28.012), // Outer band right (start)
1913 std::make_pair(12288, -40.0), // Outer band right (stop)
1914 };
1915
1916 puncturedSubchannels.at(4) = true;
1917 puncturedSubchannels.at(5) = true;
1918 puncturedSubchannels.at(6) = true;
1919 puncturedSubchannels.at(7) = true;
1920 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 320MHz with second 80 MHz punctured",
1923 320,
1924 {6105},
1925 maskSlopes,
1926 tol,
1927 prec,
1928 puncturedSubchannels),
1929 TestCase::Duration::QUICK);
1930
1931 // ============================================================================================
1932 // 11be 320MHz @ 6GHz - last 120 MHz (40 MHz + 80 MHz) subchannel punctured
1933 puncturedSubchannels = std::vector<bool>(16, false);
1934 NS_LOG_FUNCTION("Check slopes for 11be 320MHz @ 6GHz with last 120 MHz subchannel punctured");
1935 maskSlopes = {
1936 std::make_pair(0, -40.0), // Outer band left (start)
1937 std::make_pair(2047, -28.012), // Outer band left (stop)
1938 std::make_pair(2048, -28.000), // Middle band left (start)
1939 std::make_pair(4089, -20.008), // Middle band left (stop)
1940 std::make_pair(4090, -20.0), // Flat junction band left (start)
1941 std::make_pair(4094, -20.0), // Flat junction band left (stop)
1942 std::make_pair(4095, -20.0), // Inner band left (start)
1943 std::make_pair(4107, -1.538), // Inner band left (stop)
1944 std::make_pair(4108, 0.0), // first 80 MHz allocated band left (start)
1945 std::make_pair(4605, 0.0), // first 80 MHz allocated band left (stop)
1946 std::make_pair(4606, -20.0), // first 80 MHz DC band (start)
1947 std::make_pair(4610, -20.0), // first 80 MHz DC band (stop)
1948 std::make_pair(4611, 0.0), // first 80 MHz allocated band right (start)
1949 std::make_pair(5108, 0.0), // first 80 MHz allocated band right (stop)
1950 std::make_pair(5109, -20.0), // gap between 80 MHz bands (start)
1951 std::make_pair(5131, -20.0), // gap between 80 MHz bands (stop)
1952 std::make_pair(5132, 0.0), // second 80 MHz allocated band left (start)
1953 std::make_pair(5629, 0.0), // second 80 MHz allocated band left (stop)
1954 std::make_pair(5630, -20.0), // second 80 MHz DC band (start)
1955 std::make_pair(5634, -20.0), // second 80 MHz DC band (stop)
1956 std::make_pair(5635, 0.0), // second 80 MHz allocated band right (start)
1957 std::make_pair(6132, 0.0), // second 80 MHz allocated band right (stop)
1958 std::make_pair(6133, -20.0), // gap between 80 MHz bands (start)
1959 std::make_pair(6155, -20.0), // gap between 80 MHz bands (stop)
1960 std::make_pair(6156, 0.0), // third 80 MHz allocated band left (start)
1961 std::make_pair(6653, 0.0), // third 80 MHz allocated band left (stop)
1962 std::make_pair(6654, -20.0), // third 80 MHz DC band (start)
1963 std::make_pair(6658, -20.0), // third 80 MHz DC band (stop)
1964 std::make_pair(6659, -10.0), // punctured band decreasing slope (start)
1965 std::make_pair(6662, -20.0), // punctured band decreasing slope (stop)
1966 std::make_pair(6663, -20.0), // punctured band (start)
1967 std::make_pair(8193, -20.0), // punctured band (stop)
1968 std::make_pair(8194, -20.0), // Flat junction band right (start)
1969 std::make_pair(8198, -20.0), // Flat junction band right (stop)
1970 std::make_pair(8199, -20.008), // Middle band right (start)
1971 std::make_pair(10240, -28.000), // Middle band right (stop)
1972 std::make_pair(10241, -28.012), // Outer band right (start)
1973 std::make_pair(12288, -40.0), // Outer band right (stop)
1974 };
1975
1976 puncturedSubchannels.at(10) = true;
1977 puncturedSubchannels.at(11) = true;
1978 puncturedSubchannels.at(12) = true;
1979 puncturedSubchannels.at(13) = true;
1980 puncturedSubchannels.at(14) = true;
1981 puncturedSubchannels.at(15) = true;
1982 AddTestCase(new WifiOfdmMaskSlopesTestCase("11be_6GHz 320MHz with last 120 MHz punctured",
1985 320,
1986 {6105},
1987 maskSlopes,
1988 tol,
1989 prec,
1990 puncturedSubchannels),
1991 TestCase::Duration::QUICK);
1992}
Test checks if Wifi spectrum values for OFDM are generated properly.
std::vector< IndexPowerPair > IndexPowerVect
typedef for a vector of pairs of sub-band index and relative power value
~WifiOfdmMaskSlopesTestCase() override=default
std::vector< bool > m_puncturedSubchannels
bitmap indicating whether a 20 MHz subchannel is punctured or not (only used for 802....
void DoSetup() override
Implementation to do any local setup required for this TestCase.
WifiPhyBand m_band
the wifi PHY band to test
std::vector< MHz_u > m_centerFreqs
the center frequency per contiguous segment to test
Ptr< SpectrumValue > m_actualSpectrum
actual spectrum value
MHz_u m_channelWidth
the total channel width to test
WifiOfdmMaskSlopesTestCase(const std::string &name, WifiStandard standard, WifiPhyBand band, MHz_u channelWidth, const std::vector< MHz_u > &centerFrequencies, const IndexPowerVect &maskRefs, dB_u tolerance, std::size_t precision, const std::vector< bool > &puncturedSubchannels=std::vector< bool >{})
Constructor.
void InterpolateAndAppendValues(IndexPowerVect &vect, IndexPowerPair start, IndexPowerPair stop) const
Interpolate PSD values for indexes between provided start and stop and append to provided vector.
void DoRun() override
Implementation to actually run this TestCase.
std::pair< uint32_t, dBr_u > IndexPowerPair
typedef for a pair of sub-band index and relative power value
IndexPowerVect m_expectedPsd
expected power values
std::size_t m_precision
precision for double calculations (in decimals)
WifiStandard m_standard
the wifi standard to test
Test suite for checking the consistency of different OFDM-based transmit masks.
Smart pointer class similar to boost::intrusive_ptr.
encapsulates test code
Definition test.h:1050
void AddTestCase(TestCase *testCase, Duration duration=Duration::QUICK)
Add an individual child TestCase to this test suite.
Definition test.cc:292
A suite of tests to run.
Definition test.h:1267
Type
Type of test.
Definition test.h:1274
static Ptr< SpectrumValue > CreateHtOfdmTxPowerSpectralDensity(const std::vector< MHz_u > &centerFrequencies, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=dBr_u{-20}, dBr_u minOuterband=dBr_u{-28}, dBr_u lowestPoint=dBr_u{-40})
Create a transmit power spectral density corresponding to OFDM High Throughput (HT/VHT) (802....
static Ptr< SpectrumValue > CreateOfdmTxPowerSpectralDensity(MHz_u centerFrequency, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=dBr_u{-20}, dBr_u minOuterband=dBr_u{-28}, dBr_u lowestPoint=dBr_u{-40})
Create a transmit power spectral density corresponding to OFDM (802.11a/g).
static Ptr< SpectrumValue > CreateHeOfdmTxPowerSpectralDensity(MHz_u centerFrequency, MHz_u channelWidth, Watt_u txPower, MHz_u guardBandwidth, dBr_u minInnerBand=dBr_u{-20}, dBr_u minOuterband=dBr_u{-28}, dBr_u lowestPoint=dBr_u{-40}, const std::vector< bool > &puncturedSubchannels={})
Create a transmit power spectral density corresponding to OFDM High Efficiency (HE/EHT) (802....
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition assert.h:55
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition log.h:191
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition log.h:271
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by ",...
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
Definition log.h:264
bool TestDoubleIsEqual(const double x1, const double x2, const double epsilon)
Compare two double precision floating point numbers and declare them equal if they are within some ep...
Definition test.cc:36
#define NS_TEST_EXPECT_MSG_EQ_TOL(actual, limit, tol, msg)
Test that actual and expected (limit) values are equal to plus or minus some tolerance and report if ...
Definition test.h:500
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyBand
Identifies the PHY band.
@ WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211be
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211ax
@ WIFI_STANDARD_80211ac
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Every class exported by the ns3 library is enclosed in the ns3 namespace.
STL namespace.
static WifiTransmitMaskTestSuite g_WifiTransmitMaskTestSuite