A Discrete-Event Network Simulator
API
wifi-transmit-mask-test.cc
Go to the documentation of this file.
1/* -*- Mode: C++; c-file-style: "gnu"; indent-tabs-mode:nil; -*- */
2/*
3 * Copyright (c) 2017 Orange Labs
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation;
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 *
18 * Author: Rediet <getachew.redieteab@orange.com>
19 */
20
21#include <cmath>
22#include "ns3/test.h"
23#include "ns3/log.h"
24#include "ns3/fatal-error.h"
25#include "ns3/wifi-spectrum-value-helper.h"
26#include "ns3/wifi-standards.h"
27#include "ns3/wifi-phy-band.h"
28
29using namespace ns3;
30
31NS_LOG_COMPONENT_DEFINE ("WifiTransmitMaskTest");
32
41{
42public:
46 typedef std::pair<uint32_t, double> IndexPowerPair;
47
51 typedef std::vector<IndexPowerPair> IndexPowerVect;
52
66 WifiOfdmMaskSlopesTestCase (const std::string& name, WifiStandard standard,
67 WifiPhyBand band, uint16_t channelWidth,
68 const IndexPowerVect& maskRefs,
69 double tolerance, std::size_t precision,
70 const std::vector<bool>& puncturedSubchannels = std::vector<bool>{});
71 virtual ~WifiOfdmMaskSlopesTestCase () = default;
72
73private:
74 void DoSetup (void) override;
75 void DoRun (void) override;
76
87
90 uint16_t m_channelWidth;
91 std::vector<bool> m_puncturedSubchannels;
94 double m_tolerance;
95 std::size_t m_precision;
96};
97
98WifiOfdmMaskSlopesTestCase::WifiOfdmMaskSlopesTestCase (const std::string& name, WifiStandard standard, WifiPhyBand band, uint16_t channelWidth,
99 const IndexPowerVect& maskRefs,
100 double tolerance, std::size_t precision,
101 const std::vector<bool>& puncturedSubchannels)
102 : TestCase (std::string ("SpectrumValue ") + name),
103 m_standard {standard},
104 m_band {band},
105 m_channelWidth {channelWidth},
106 m_puncturedSubchannels {puncturedSubchannels},
107 m_actualSpectrum {},
108 m_expectedPsd {maskRefs},
109 m_tolerance {tolerance},
110 m_precision {precision}
111{
112 NS_LOG_FUNCTION (this << name << standard << band << channelWidth << tolerance << precision << puncturedSubchannels.size ());
113}
114
115void
117{
118 NS_LOG_FUNCTION (this);
119 NS_ASSERT (m_expectedPsd.size () % 2 == 0); //start/stop pairs expected
120
121 uint16_t freq = 0;
122 double outerBandMaximumRejection = 0.0;
123 switch (m_band)
124 {
125 default:
127 freq = 5170 + (m_channelWidth / 2); // so as to have 5180/5190/5210/5250 for 20/40/80/160
128 outerBandMaximumRejection = -40; // in dBr
129 break;
131 freq = 2402 + (m_channelWidth / 2); //so as to have 2412/2422 for 20/40
132 outerBandMaximumRejection = (m_standard >= WIFI_STANDARD_80211n) ? -45 : -40; // in dBr
133 break;
135 freq = 5945 + (m_channelWidth / 2); // so as to have 5945/5955/5975/6015 for 20/40/80/160
136 outerBandMaximumRejection = -40; // in dBr
137 break;
138 }
139
140 double refTxPowerW = 1; // have to work in dBr when comparing though
141 switch (m_standard)
142 {
145 NS_ASSERT ((m_channelWidth == 5) || (m_channelWidth == 10));
146 freq = 5860;
147 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, m_channelWidth, refTxPowerW, m_channelWidth, -20.0, -28.0, outerBandMaximumRejection);
148 break;
149
153 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, m_channelWidth, refTxPowerW, m_channelWidth, -20.0, -28.0, outerBandMaximumRejection);
154 break;
155
159 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, m_channelWidth, refTxPowerW, m_channelWidth, -20.0, -28.0, outerBandMaximumRejection);
160 break;
161
163 NS_ASSERT (m_channelWidth == 20 || m_channelWidth == 40);
164 m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, m_channelWidth, refTxPowerW, m_channelWidth, -20.0, -28.0, outerBandMaximumRejection);
165 break;
166
169 NS_ASSERT (m_channelWidth == 20 || m_channelWidth == 40 || m_channelWidth == 80 || m_channelWidth == 160);
170 m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, m_channelWidth, refTxPowerW, m_channelWidth, -20.0, -28.0, outerBandMaximumRejection);
171 break;
172
174 NS_ASSERT ((m_band != WIFI_PHY_BAND_2_4GHZ) || (m_channelWidth != 160)); // not enough space in 2.4 GHz bands
175 NS_ASSERT (m_channelWidth == 20 || m_channelWidth == 40 || m_channelWidth == 80 || m_channelWidth == 160);
176 m_actualSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (freq,
178 refTxPowerW,
180 -20.0,
181 -28.0,
182 outerBandMaximumRejection,
184 break;
185
186 default:
187 NS_FATAL_ERROR ("Standard unknown or non-OFDM");
188 break;
189 }
190
191 NS_LOG_INFO ("Build expected PSD");
192 IndexPowerVect builtPsd;
193 for (uint32_t i = 0; i < m_expectedPsd.size (); i += 2)
194 {
196 }
197 m_expectedPsd = builtPsd;
198}
199
200void
203{
204 NS_LOG_FUNCTION (start.first << start.second << stop.first << stop.second);
205 NS_ASSERT (start.first <= stop.first);
206
207 if (start.first == stop.first) //only one point, no need to interpolate
208 {
209 NS_ASSERT (start.second == stop.second);
210 vect.push_back (start);
211 NS_LOG_LOGIC ("Append (" << start.first << ", " << stop.second << ")");
212 return;
213 }
214
215 double slope = (stop.second - start.second) / (stop.first - start.first);
216 for (uint32_t i = start.first; i <= stop.first; i++)
217 {
218 double val = start.second + slope * (i - start.first);
219 double multiplier = std::round (std::pow (10.0, static_cast<double> (m_precision)));
220 val = std::floor (val * multiplier + 0.5) / multiplier;
221 vect.push_back (std::make_pair (i, val));
222 NS_LOG_LOGIC ("Append (" << i << ", " << val << ")");
223 }
224
225 NS_ASSERT (vect.back ().first == stop.first
226 && TestDoubleIsEqual (vect.back ().second, stop.second, m_tolerance));
227}
228
229void
231{
232 NS_LOG_FUNCTION (this);
233 double currentPowerDbr = 0.0; //have to work in dBr so as to compare with expected slopes
234 double maxPowerW = (*m_actualSpectrum)[0];
235 for (auto&& vit = m_actualSpectrum->ConstValuesBegin (); vit != m_actualSpectrum->ConstValuesEnd (); ++vit)
236 {
237 maxPowerW = std::max (maxPowerW, *vit);
238 }
239
240 NS_LOG_INFO ("Compare expected PSD");
241 for (const auto& [subcarrier, expectedValue] : m_expectedPsd)
242 {
243 currentPowerDbr = 10.0 * std::log10 ((*m_actualSpectrum)[subcarrier] / maxPowerW);
244 NS_LOG_LOGIC ("For " << subcarrier << ", expected: " << expectedValue << " vs obtained: " << currentPowerDbr);
245 NS_TEST_EXPECT_MSG_EQ_TOL (currentPowerDbr, expectedValue, m_tolerance,
246 "Spectrum value mismatch for subcarrier " << subcarrier);
247 }
248}
249
250
258{
259public:
261};
262
264
266 : TestSuite ("wifi-transmit-mask", UNIT)
267{
268 // LogLevel logLevel = (LogLevel)(LOG_PREFIX_FUNC | LOG_PREFIX_TIME | LOG_LEVEL_ALL);
269 // LogComponentEnable ("WifiTransmitMaskTest", logLevel);
270 // LogComponentEnable ("WifiSpectrumValueHelper", logLevel);
271
272 NS_LOG_INFO ("Creating WifiTransmitMaskTestSuite");
273
275 double tol = 10e-2; // in dB
276 double prec = 10; // in decimals
277
278 // ============================================================================================
279 // 11p 5MHz
280 NS_LOG_FUNCTION ("Check slopes for 11p 5MHz");
281 maskSlopes.clear ();
282 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
283 maskSlopes.push_back (std::make_pair (31, -28.375)); // Outer band left (stop)
284 maskSlopes.push_back (std::make_pair (32, -28.000)); // Middle band left (start)
285 maskSlopes.push_back (std::make_pair (60, -20.276)); // Middle band left (stop)
286 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (start)
287 maskSlopes.push_back (std::make_pair (63, -20.0)); // Flat junction band left (stop)
288 maskSlopes.push_back (std::make_pair (64, -20.0)); // Inner band left (start)
289 maskSlopes.push_back (std::make_pair (69, -3.333)); // Inner band left (stop)
290 maskSlopes.push_back (std::make_pair (123, -3.333)); // Inner band right (start)
291 maskSlopes.push_back (std::make_pair (128, -20.0)); // Inner band right (stop)
292 maskSlopes.push_back (std::make_pair (129, -20.0)); // Flat junction band right (start)
293 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (stop)
294 maskSlopes.push_back (std::make_pair (132, -20.276)); // Middle band right (start)
295 maskSlopes.push_back (std::make_pair (160, -28.000)); // Middle band right (stop)
296 maskSlopes.push_back (std::make_pair (161, -28.375)); // Outer band right (start)
297 maskSlopes.push_back (std::make_pair (192, -40.0)); // Outer band right (stop)
299 5, maskSlopes, tol, prec),
300 TestCase::QUICK);
301
302 // ============================================================================================
303 // 11p 10MHz
304 NS_LOG_FUNCTION ("Check slopes for 11p 10MHz");
305 maskSlopes.clear ();
306 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
307 maskSlopes.push_back (std::make_pair (31, -28.375)); // Outer band left (stop)
308 maskSlopes.push_back (std::make_pair (32, -28.000)); // Middle band left (start)
309 maskSlopes.push_back (std::make_pair (60, -20.276)); // Middle band left (stop)
310 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (start)
311 maskSlopes.push_back (std::make_pair (63, -20.0)); // Flat junction band left (stop)
312 maskSlopes.push_back (std::make_pair (64, -20.0)); // Inner band left (start)
313 maskSlopes.push_back (std::make_pair (69, -3.333)); // Inner band left (stop)
314 maskSlopes.push_back (std::make_pair (123, -3.333)); // Inner band right (start)
315 maskSlopes.push_back (std::make_pair (128, -20.0)); // Inner band right (stop)
316 maskSlopes.push_back (std::make_pair (129, -20.0)); // Flat junction band right (start)
317 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (stop)
318 maskSlopes.push_back (std::make_pair (132, -20.276)); // Middle band right (start)
319 maskSlopes.push_back (std::make_pair (160, -28.000)); // Middle band right (stop)
320 maskSlopes.push_back (std::make_pair (161, -28.375)); // Outer band right (start)
321 maskSlopes.push_back (std::make_pair (192, -40.0)); // Outer band right (stop)
323 10, maskSlopes, tol, prec),
324 TestCase::QUICK);
325
326 // ============================================================================================
327 // 11a
328 NS_LOG_FUNCTION ("Check slopes for 11a");
329 maskSlopes.clear ();
330 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
331 maskSlopes.push_back (std::make_pair (31, -28.375)); // Outer band left (stop)
332 maskSlopes.push_back (std::make_pair (32, -28.000)); // Middle band left (start)
333 maskSlopes.push_back (std::make_pair (60, -20.276)); // Middle band left (stop)
334 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (start)
335 maskSlopes.push_back (std::make_pair (63, -20.0)); // Flat junction band left (stop)
336 maskSlopes.push_back (std::make_pair (64, -20.0)); // Inner band left (start)
337 maskSlopes.push_back (std::make_pair (69, -3.333)); // Inner band left (stop)
338 maskSlopes.push_back (std::make_pair (123, -3.333)); // Inner band right (start)
339 maskSlopes.push_back (std::make_pair (128, -20.0)); // Inner band right (stop)
340 maskSlopes.push_back (std::make_pair (129, -20.0)); // Flat junction band right (start)
341 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (stop)
342 maskSlopes.push_back (std::make_pair (132, -20.276)); // Middle band right (start)
343 maskSlopes.push_back (std::make_pair (160, -28.000)); // Middle band right (stop)
344 maskSlopes.push_back (std::make_pair (161, -28.375)); // Outer band right (start)
345 maskSlopes.push_back (std::make_pair (192, -40.0)); // Outer band right (stop)
347 20, maskSlopes, tol, prec),
348 TestCase::QUICK);
349
350 // ============================================================================================
351 // 11g
352 NS_LOG_FUNCTION ("Check slopes for 11g");
353 // same slopes as 11a
355 20, maskSlopes, tol, prec),
356 TestCase::QUICK);
357
358 // ============================================================================================
359 // 11n 20MHz @ 2.4GHz
360 NS_LOG_FUNCTION ("Check slopes for 11n 20MHz @ 2.4GHz");
361 maskSlopes.clear ();
362 maskSlopes.push_back (std::make_pair (0, -45.000)); // Outer band left (start)
363 maskSlopes.push_back (std::make_pair (31, -28.531)); // Outer band left (stop)
364 maskSlopes.push_back (std::make_pair (32, -28.000)); // Middle band left (start)
365 maskSlopes.push_back (std::make_pair (60, -20.276)); // Middle band left (stop)
366 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (start)
367 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (stop)
368 maskSlopes.push_back (std::make_pair (62, -20.0)); // Inner band left (start)
369 maskSlopes.push_back (std::make_pair (67, -3.333)); // Inner band left (stop)
370 maskSlopes.push_back (std::make_pair (125, -3.333)); // Inner band right (start)
371 maskSlopes.push_back (std::make_pair (130, -20.0)); // Inner band right (stop)
372 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (start)
373 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (stop)
374 maskSlopes.push_back (std::make_pair (132, -20.276)); // Middle band right (start)
375 maskSlopes.push_back (std::make_pair (160, -28.000)); // Middle band right (stop)
376 maskSlopes.push_back (std::make_pair (161, -28.531)); // Outer band right (start)
377 maskSlopes.push_back (std::make_pair (192, -45.000)); // Outer band right (stop)
379 20, maskSlopes, tol, prec),
380 TestCase::QUICK);
381
382 // ============================================================================================
383 // 11n 20MHz @ 5GHz
384 NS_LOG_FUNCTION ("Check slopes for 11n 20MHz @ 5GHz");
385 maskSlopes.clear ();
386 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
387 maskSlopes.push_back (std::make_pair (31, -28.375)); // Outer band left (stop)
388 maskSlopes.push_back (std::make_pair (32, -28.000)); // Middle band left (start)
389 maskSlopes.push_back (std::make_pair (60, -20.276)); // Middle band left (stop)
390 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (start)
391 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (stop)
392 maskSlopes.push_back (std::make_pair (62, -20.0)); // Inner band left (start)
393 maskSlopes.push_back (std::make_pair (67, -3.333)); // Inner band left (stop)
394 maskSlopes.push_back (std::make_pair (125, -3.333)); // Inner band right (start)
395 maskSlopes.push_back (std::make_pair (130, -20.0)); // Inner band right (stop)
396 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (start)
397 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (stop)
398 maskSlopes.push_back (std::make_pair (132, -20.276)); // Middle band right (start)
399 maskSlopes.push_back (std::make_pair (160, -28.000)); // Middle band right (stop)
400 maskSlopes.push_back (std::make_pair (161, -28.375)); // Outer band right (start)
401 maskSlopes.push_back (std::make_pair (192, -40.0)); // Outer band right (stop)
403 20, maskSlopes, tol, prec),
404 TestCase::QUICK);
405
406 // ============================================================================================
407 // 11n 40MHz @ 2.4GHz
408 NS_LOG_FUNCTION ("Check slopes for 11n 40MHz @ 2.4GHz");
409 maskSlopes.clear ();
410 maskSlopes.push_back (std::make_pair (0, -45.000)); // Outer band left (start)
411 maskSlopes.push_back (std::make_pair (63, -28.266)); // Outer band left (stop)
412 maskSlopes.push_back (std::make_pair (64, -28.000)); // Middle band left (start)
413 maskSlopes.push_back (std::make_pair (124, -20.131)); // Middle band left (stop)
414 maskSlopes.push_back (std::make_pair (125, -20.0)); // Flat junction band left (start)
415 maskSlopes.push_back (std::make_pair (125, -20.0)); // Flat junction band left (stop)
416 maskSlopes.push_back (std::make_pair (126, -20.0)); // Inner band left (start)
417 maskSlopes.push_back (std::make_pair (131, -3.333)); // Inner band left (stop)
418 maskSlopes.push_back (std::make_pair (253, -3.333)); // Inner band right (start)
419 maskSlopes.push_back (std::make_pair (258, -20.0)); // Inner band right (stop)
420 maskSlopes.push_back (std::make_pair (259, -20.0)); // Flat junction band right (start)
421 maskSlopes.push_back (std::make_pair (259, -20.0)); // Flat junction band right (stop)
422 maskSlopes.push_back (std::make_pair (260, -20.131)); // Middle band right (start)
423 maskSlopes.push_back (std::make_pair (320, -28.000)); // Middle band right (stop)
424 maskSlopes.push_back (std::make_pair (321, -28.266)); // Outer band right (start)
425 maskSlopes.push_back (std::make_pair (384, -45.000)); // Outer band right (stop)
427 40, maskSlopes, tol, prec),
428 TestCase::QUICK);
429
430 // ============================================================================================
431 // 11n 20MHz @ 5GHz
432 NS_LOG_FUNCTION ("Check slopes for 11n 40MHz @ 5GHz");
433 maskSlopes.clear ();
434 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
435 maskSlopes.push_back (std::make_pair (63, -28.188)); // Outer band left (stop)
436 maskSlopes.push_back (std::make_pair (64, -28.000)); // Middle band left (start)
437 maskSlopes.push_back (std::make_pair (124, -20.131)); // Middle band left (stop)
438 maskSlopes.push_back (std::make_pair (125, -20.0)); // Flat junction band left (start)
439 maskSlopes.push_back (std::make_pair (125, -20.0)); // Flat junction band left (stop)
440 maskSlopes.push_back (std::make_pair (126, -20.0)); // Inner band left (start)
441 maskSlopes.push_back (std::make_pair (131, -3.333)); // Inner band left (stop)
442 maskSlopes.push_back (std::make_pair (253, -3.333)); // Inner band right (start)
443 maskSlopes.push_back (std::make_pair (258, -20.0)); // Inner band right (stop)
444 maskSlopes.push_back (std::make_pair (259, -20.0)); // Flat junction band right (start)
445 maskSlopes.push_back (std::make_pair (259, -20.0)); // Flat junction band right (stop)
446 maskSlopes.push_back (std::make_pair (260, -20.131)); // Middle band right (start)
447 maskSlopes.push_back (std::make_pair (320, -28.000)); // Middle band right (stop)
448 maskSlopes.push_back (std::make_pair (321, -28.188)); // Outer band right (start)
449 maskSlopes.push_back (std::make_pair (384, -40.0)); // Outer band right (stop)
451 40, maskSlopes, tol, prec),
452 TestCase::QUICK);
453
454 // ============================================================================================
455 // 11ac 20MHz
456 NS_LOG_FUNCTION ("Check slopes for 11ac 20MHz");
457 maskSlopes.clear ();
458 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
459 maskSlopes.push_back (std::make_pair (31, -28.375)); // Outer band left (stop)
460 maskSlopes.push_back (std::make_pair (32, -28.000)); // Middle band left (start)
461 maskSlopes.push_back (std::make_pair (60, -20.276)); // Middle band left (stop)
462 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (start)
463 maskSlopes.push_back (std::make_pair (61, -20.0)); // Flat junction band left (stop)
464 maskSlopes.push_back (std::make_pair (62, -20.0)); // Inner band left (start)
465 maskSlopes.push_back (std::make_pair (67, -3.333)); // Inner band left (stop)
466 maskSlopes.push_back (std::make_pair (125, -3.333)); // Inner band right (start)
467 maskSlopes.push_back (std::make_pair (130, -20.0)); // Inner band right (stop)
468 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (start)
469 maskSlopes.push_back (std::make_pair (131, -20.0)); // Flat junction band right (stop)
470 maskSlopes.push_back (std::make_pair (132, -20.276)); // Middle band right (start)
471 maskSlopes.push_back (std::make_pair (160, -28.000)); // Middle band right (stop)
472 maskSlopes.push_back (std::make_pair (161, -28.375)); // Outer band right (start)
473 maskSlopes.push_back (std::make_pair (192, -40.0)); // Outer band right (stop)
475 20, maskSlopes, tol, prec),
476 TestCase::QUICK);
477
478 // ============================================================================================
479 // 11ac 20MHz
480 NS_LOG_FUNCTION ("Check slopes for 11ac 40MHz");
481 maskSlopes.clear ();
482 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
483 maskSlopes.push_back (std::make_pair (63, -28.188)); // Outer band left (stop)
484 maskSlopes.push_back (std::make_pair (64, -28.000)); // Middle band left (start)
485 maskSlopes.push_back (std::make_pair (124, -20.131)); // Middle band left (stop)
486 maskSlopes.push_back (std::make_pair (125, -20.0)); // Flat junction band left (start)
487 maskSlopes.push_back (std::make_pair (125, -20.0)); // Flat junction band left (stop)
488 maskSlopes.push_back (std::make_pair (126, -20.0)); // Inner band left (start)
489 maskSlopes.push_back (std::make_pair (131, -3.333)); // Inner band left (stop)
490 maskSlopes.push_back (std::make_pair (253, -3.333)); // Inner band right (start)
491 maskSlopes.push_back (std::make_pair (258, -20.0)); // Inner band right (stop)
492 maskSlopes.push_back (std::make_pair (259, -20.0)); // Flat junction band right (start)
493 maskSlopes.push_back (std::make_pair (259, -20.0)); // Flat junction band right (stop)
494 maskSlopes.push_back (std::make_pair (260, -20.131)); // Middle band right (start)
495 maskSlopes.push_back (std::make_pair (320, -28.000)); // Middle band right (stop)
496 maskSlopes.push_back (std::make_pair (321, -28.188)); // Outer band right (start)
497 maskSlopes.push_back (std::make_pair (384, -40.0)); // Outer band right (stop)
499 40, maskSlopes, tol, prec),
500 TestCase::QUICK);
501
502 // ============================================================================================
503 // 11ac 80MHz
504 NS_LOG_FUNCTION ("Check slopes for 11ac 80MHz");
505 maskSlopes.clear ();
506 maskSlopes.clear ();
507 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
508 maskSlopes.push_back (std::make_pair (127, -28.094)); // Outer band left (stop)
509 maskSlopes.push_back (std::make_pair (128, -28.000)); // Middle band left (start)
510 maskSlopes.push_back (std::make_pair (252, -20.064)); // Middle band left (stop)
511 maskSlopes.push_back (std::make_pair (253, -20.0)); // Flat junction band left (start)
512 maskSlopes.push_back (std::make_pair (253, -20.0)); // Flat junction band left (stop)
513 maskSlopes.push_back (std::make_pair (254, -20.0)); // Inner band left (start)
514 maskSlopes.push_back (std::make_pair (259, -3.333)); // Inner band left (stop)
515 maskSlopes.push_back (std::make_pair (509, -3.333)); // Inner band right (start)
516 maskSlopes.push_back (std::make_pair (514, -20.0)); // Inner band right (stop)
517 maskSlopes.push_back (std::make_pair (515, -20.0)); // Flat junction band right (start)
518 maskSlopes.push_back (std::make_pair (515, -20.0)); // Flat junction band right (stop)
519 maskSlopes.push_back (std::make_pair (516, -20.064)); // Middle band right (start)
520 maskSlopes.push_back (std::make_pair (640, -28.000)); // Middle band right (stop)
521 maskSlopes.push_back (std::make_pair (641, -28.094)); // Outer band right (start)
522 maskSlopes.push_back (std::make_pair (768, -40.0)); // Outer band right (stop)
524 80, maskSlopes, tol, prec),
525 TestCase::QUICK);
526
527 // ============================================================================================
528 // 11ac 20MHz
529 NS_LOG_FUNCTION ("Check slopes for 11ac 160MHz");
530 maskSlopes.clear ();
531 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
532 maskSlopes.push_back (std::make_pair (255, -28.047)); // Outer band left (stop)
533 maskSlopes.push_back (std::make_pair (256, -28.000)); // Middle band left (start)
534 maskSlopes.push_back (std::make_pair (508, -20.032)); // Middle band left (stop)
535 maskSlopes.push_back (std::make_pair (509, -20.0)); // Flat junction band left (start)
536 maskSlopes.push_back (std::make_pair (509, -20.0)); // Flat junction band left (stop)
537 maskSlopes.push_back (std::make_pair (510, -20.0)); // Inner band left (start)
538 maskSlopes.push_back (std::make_pair (515, -3.333)); // Inner band left (stop)
539 maskSlopes.push_back (std::make_pair (1021, -3.333)); // Inner band right (start)
540 maskSlopes.push_back (std::make_pair (1026, -20.0)); // Inner band right (stop)
541 maskSlopes.push_back (std::make_pair (1027, -20.0)); // Flat junction band right (start)
542 maskSlopes.push_back (std::make_pair (1027, -20.0)); // Flat junction band right (stop)
543 maskSlopes.push_back (std::make_pair (1028, -20.032)); // Middle band right (start)
544 maskSlopes.push_back (std::make_pair (1280, -28.000)); // Middle band right (stop)
545 maskSlopes.push_back (std::make_pair (1281, -28.047)); // Outer band right (start)
546 maskSlopes.push_back (std::make_pair (1536, -40.0)); // Outer band right (stop)
548 160, maskSlopes, tol, prec),
549 TestCase::QUICK);
550
551 // ============================================================================================
552 // 11ax 20MHz @ 2.4GHz
553 NS_LOG_FUNCTION ("Check slopes for 11ax 20MHz @ 2.4GHz");
554 maskSlopes.clear ();
555 maskSlopes.push_back (std::make_pair (0, -45.000)); // Outer band left (start)
556 maskSlopes.push_back (std::make_pair (127, -28.133)); // Outer band left (stop)
557 maskSlopes.push_back (std::make_pair (128, -28.000)); // Middle band left (start)
558 maskSlopes.push_back (std::make_pair (252, -20.064)); // Middle band left (stop)
559 maskSlopes.push_back (std::make_pair (253, -20.0)); // Flat junction band left (start)
560 maskSlopes.push_back (std::make_pair (255, -20.0)); // Flat junction band left (stop)
561 maskSlopes.push_back (std::make_pair (256, -20.0)); // Inner band left (start)
562 maskSlopes.push_back (std::make_pair (261, -3.333)); // Inner band left (stop)
563 maskSlopes.push_back (std::make_pair (262, 0.0)); // allocated band left (start)
564 maskSlopes.push_back (std::make_pair (382, 0.0)); // allocated band left (stop)
565 maskSlopes.push_back (std::make_pair (383, -20.0)); // DC band (start)
566 maskSlopes.push_back (std::make_pair (385, -20.0)); // DC band (stop)
567 maskSlopes.push_back (std::make_pair (386, 0.0)); // allocated band right (start)
568 maskSlopes.push_back (std::make_pair (506, 0.0)); // allocated band right (stop)
569 maskSlopes.push_back (std::make_pair (507, -3.333)); // Inner band right (start)
570 maskSlopes.push_back (std::make_pair (512, -20.0)); // Inner band right (stop)
571 maskSlopes.push_back (std::make_pair (513, -20.0)); // Flat junction band right (start)
572 maskSlopes.push_back (std::make_pair (515, -20.0)); // Flat junction band right (stop)
573 maskSlopes.push_back (std::make_pair (516, -20.064)); // Middle band right (start)
574 maskSlopes.push_back (std::make_pair (640, -28.000)); // Middle band right (stop)
575 maskSlopes.push_back (std::make_pair (641, -28.133)); // Outer band right (start)
576 maskSlopes.push_back (std::make_pair (768, -45.000)); // Outer band right (stop)
578 20, maskSlopes, tol, prec),
579 TestCase::QUICK);
580
581 // ============================================================================================
582 // 11ax 20MHz @ 5GHz
583 NS_LOG_FUNCTION ("Check slopes for 11ax 20MHz @ 5GHz");
584 maskSlopes.clear ();
585 maskSlopes.clear ();
586 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
587 maskSlopes.push_back (std::make_pair (127, -28.094)); // Outer band left (stop)
588 maskSlopes.push_back (std::make_pair (128, -28.000)); // Middle band left (start)
589 maskSlopes.push_back (std::make_pair (252, -20.064)); // Middle band left (stop)
590 maskSlopes.push_back (std::make_pair (253, -20.0)); // Flat junction band left (start)
591 maskSlopes.push_back (std::make_pair (255, -20.0)); // Flat junction band left (stop)
592 maskSlopes.push_back (std::make_pair (256, -20.0)); // Inner band left (start)
593 maskSlopes.push_back (std::make_pair (261, -3.333)); // Inner band left (stop)
594 maskSlopes.push_back (std::make_pair (262, 0.0)); // allocated band left (start)
595 maskSlopes.push_back (std::make_pair (382, 0.0)); // allocated band left (stop)
596 maskSlopes.push_back (std::make_pair (383, -20.0)); // DC band (start)
597 maskSlopes.push_back (std::make_pair (385, -20.0)); // DC band (stop)
598 maskSlopes.push_back (std::make_pair (386, 0.0)); // allocated band right (start)
599 maskSlopes.push_back (std::make_pair (506, 0.0)); // allocated band right (stop)
600 maskSlopes.push_back (std::make_pair (507, -3.333)); // Inner band right (start)
601 maskSlopes.push_back (std::make_pair (512, -20.0)); // Inner band right (stop)
602 maskSlopes.push_back (std::make_pair (513, -20.0)); // Flat junction band right (start)
603 maskSlopes.push_back (std::make_pair (515, -20.0)); // Flat junction band right (stop)
604 maskSlopes.push_back (std::make_pair (516, -20.064)); // Middle band right (start)
605 maskSlopes.push_back (std::make_pair (640, -28.000)); // Middle band right (stop)
606 maskSlopes.push_back (std::make_pair (641, -28.094)); // Outer band right (start)
607 maskSlopes.push_back (std::make_pair (768, -40.0)); // Outer band right (stop)
609 20, maskSlopes, tol, prec),
610 TestCase::QUICK);
611
612 // ============================================================================================
613 // 11ax 40MHz @ 2.4GHz
614 NS_LOG_FUNCTION ("Check slopes for 11ax 40MHz @ 2.4GHz");
615 maskSlopes.clear ();
616 maskSlopes.push_back (std::make_pair (0, -45.000)); // Outer band left (start)
617 maskSlopes.push_back (std::make_pair (255, -28.066)); // Outer band left (stop)
618 maskSlopes.push_back (std::make_pair (256, -28.000)); // Middle band left (start)
619 maskSlopes.push_back (std::make_pair (505, -20.032)); // Middle band left (stop)
620 maskSlopes.push_back (std::make_pair (506, -20.0)); // Flat junction band left (start)
621 maskSlopes.push_back (std::make_pair (510, -20.0)); // Flat junction band left (stop)
622 maskSlopes.push_back (std::make_pair (511, -20.0)); // Inner band left (start)
623 maskSlopes.push_back (std::make_pair (523, -1.538)); // Inner band left (stop)
624 maskSlopes.push_back (std::make_pair (524, 0.0)); // allocated band left (start)
625 maskSlopes.push_back (std::make_pair (765, 0.0)); // allocated band left (stop)
626 maskSlopes.push_back (std::make_pair (766, -20.0)); // DC band (start)
627 maskSlopes.push_back (std::make_pair (770, -20.0)); // DC band (stop)
628 maskSlopes.push_back (std::make_pair (771, 0.0)); // allocated band right (start)
629 maskSlopes.push_back (std::make_pair (1012, 0.0)); // allocated band right (stop)
630 maskSlopes.push_back (std::make_pair (1013, -1.538)); // Inner band right (start)
631 maskSlopes.push_back (std::make_pair (1025, -20.0)); // Inner band right (stop)
632 maskSlopes.push_back (std::make_pair (1026, -20.0)); // Flat junction band right (start)
633 maskSlopes.push_back (std::make_pair (1030, -20.0)); // Flat junction band right (stop)
634 maskSlopes.push_back (std::make_pair (1031, -20.032)); // Middle band right (start)
635 maskSlopes.push_back (std::make_pair (1280, -28.000)); // Middle band right (stop)
636 maskSlopes.push_back (std::make_pair (1281, -28.066)); // Outer band right (start)
637 maskSlopes.push_back (std::make_pair (1536, -45.000)); // Outer band right (stop)
639 40, maskSlopes, tol, prec),
640 TestCase::QUICK);
641
642 // ============================================================================================
643 // 11ax 40MHz @ 5GHz
644 NS_LOG_FUNCTION ("Check slopes for 11ax 40MHz @ 5GHz");
645 maskSlopes.clear ();
646 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
647 maskSlopes.push_back (std::make_pair (255, -28.047)); // Outer band left (stop)
648 maskSlopes.push_back (std::make_pair (256, -28.000)); // Middle band left (start)
649 maskSlopes.push_back (std::make_pair (505, -20.032)); // Middle band left (stop)
650 maskSlopes.push_back (std::make_pair (506, -20.0)); // Flat junction band left (start)
651 maskSlopes.push_back (std::make_pair (510, -20.0)); // Flat junction band left (stop)
652 maskSlopes.push_back (std::make_pair (511, -20.0)); // Inner band left (start)
653 maskSlopes.push_back (std::make_pair (523, -1.538)); // Inner band left (stop)
654 maskSlopes.push_back (std::make_pair (524, 0.0)); // allocated band left (start)
655 maskSlopes.push_back (std::make_pair (765, 0.0)); // allocated band left (stop)
656 maskSlopes.push_back (std::make_pair (766, -20.0)); // DC band (start)
657 maskSlopes.push_back (std::make_pair (770, -20.0)); // DC band (stop)
658 maskSlopes.push_back (std::make_pair (771, 0.0)); // allocated band right (start)
659 maskSlopes.push_back (std::make_pair (1012, 0.0)); // allocated band right (stop)
660 maskSlopes.push_back (std::make_pair (1013, -1.538)); // Inner band right (start)
661 maskSlopes.push_back (std::make_pair (1025, -20.0)); // Inner band right (stop)
662 maskSlopes.push_back (std::make_pair (1026, -20.0)); // Flat junction band right (start)
663 maskSlopes.push_back (std::make_pair (1030, -20.0)); // Flat junction band right (stop)
664 maskSlopes.push_back (std::make_pair (1031, -20.032)); // Middle band right (start)
665 maskSlopes.push_back (std::make_pair (1280, -28.000)); // Middle band right (stop)
666 maskSlopes.push_back (std::make_pair (1281, -28.047)); // Outer band right (start)
667 maskSlopes.push_back (std::make_pair (1536, -40.0)); // Outer band right (stop)
669 40, maskSlopes, tol, prec),
670 TestCase::QUICK);
671
672 // ============================================================================================
673 // 11ax 80MHz @ 2.4GHz
674 NS_LOG_FUNCTION ("Check slopes for 11ax 80MHz @ 2.4GHz");
675 maskSlopes.clear ();
676 maskSlopes.push_back (std::make_pair (0, -45.000)); // Outer band left (start)
677 maskSlopes.push_back (std::make_pair (511, -28.033)); // Outer band left (stop)
678 maskSlopes.push_back (std::make_pair (512, -28.000)); // Middle band left (start)
679 maskSlopes.push_back (std::make_pair (1017, -20.016)); // Middle band left (stop)
680 maskSlopes.push_back (std::make_pair (1018, -20.0)); // Flat junction band left (start)
681 maskSlopes.push_back (std::make_pair (1022, -20.0)); // Flat junction band left (stop)
682 maskSlopes.push_back (std::make_pair (1023, -20.0)); // Inner band left (start)
683 maskSlopes.push_back (std::make_pair (1035, -1.538)); // Inner band left (stop)
684 maskSlopes.push_back (std::make_pair (1036, 0.0)); // allocated band left (start)
685 maskSlopes.push_back (std::make_pair (1533, 0.0)); // allocated band left (stop)
686 maskSlopes.push_back (std::make_pair (1534, -20.0)); // DC band (start)
687 maskSlopes.push_back (std::make_pair (1538, -20.0)); // DC band (stop)
688 maskSlopes.push_back (std::make_pair (1539, 0.0)); // allocated band right (start)
689 maskSlopes.push_back (std::make_pair (2036, 0.0)); // allocated band right (stop)
690 maskSlopes.push_back (std::make_pair (2037, -1.538)); // Inner band right (start)
691 maskSlopes.push_back (std::make_pair (2049, -20.0)); // Inner band right (stop)
692 maskSlopes.push_back (std::make_pair (2050, -20.0)); // Flat junction band right (start)
693 maskSlopes.push_back (std::make_pair (2054, -20.0)); // Flat junction band right (stop)
694 maskSlopes.push_back (std::make_pair (2055, -20.016)); // Middle band right (start)
695 maskSlopes.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop)
696 maskSlopes.push_back (std::make_pair (2561, -28.033)); // Outer band right (start)
697 maskSlopes.push_back (std::make_pair (3072, -45.000)); // Outer band right (stop)
699 80, maskSlopes, tol, prec),
700 TestCase::QUICK);
701
702 // ============================================================================================
703 // 11ax 80MHz @ 5GHz
704 NS_LOG_FUNCTION ("Check slopes for 11ax 80MHz @ 5GHz");
705 maskSlopes.clear ();
706 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
707 maskSlopes.push_back (std::make_pair (511, -28.023)); // Outer band left (stop)
708 maskSlopes.push_back (std::make_pair (512, -28.000)); // Middle band left (start)
709 maskSlopes.push_back (std::make_pair (1017, -20.016)); // Middle band left (stop)
710 maskSlopes.push_back (std::make_pair (1018, -20.0)); // Flat junction band left (start)
711 maskSlopes.push_back (std::make_pair (1022, -20.0)); // Flat junction band left (stop)
712 maskSlopes.push_back (std::make_pair (1023, -20.0)); // Inner band left (start)
713 maskSlopes.push_back (std::make_pair (1035, -1.538)); // Inner band left (stop)
714 maskSlopes.push_back (std::make_pair (1036, 0.0)); // allocated band left (start)
715 maskSlopes.push_back (std::make_pair (1533, 0.0)); // allocated band left (stop)
716 maskSlopes.push_back (std::make_pair (1534, -20.0)); // DC band (start)
717 maskSlopes.push_back (std::make_pair (1538, -20.0)); // DC band (stop)
718 maskSlopes.push_back (std::make_pair (1539, 0.0)); // allocated band right (start)
719 maskSlopes.push_back (std::make_pair (2036, 0.0)); // allocated band right (stop)
720 maskSlopes.push_back (std::make_pair (2037, -1.538)); // Inner band right (start)
721 maskSlopes.push_back (std::make_pair (2049, -20.0)); // Inner band right (stop)
722 maskSlopes.push_back (std::make_pair (2050, -20.0)); // Flat junction band right (start)
723 maskSlopes.push_back (std::make_pair (2054, -20.0)); // Flat junction band right (stop)
724 maskSlopes.push_back (std::make_pair (2055, -20.016)); // Middle band right (start)
725 maskSlopes.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop)
726 maskSlopes.push_back (std::make_pair (2561, -28.023)); // Outer band right (start)
727 maskSlopes.push_back (std::make_pair (3072, -40.0)); // Outer band right (stop)
729 80, maskSlopes, tol, prec),
730 TestCase::QUICK);
731
732 // ============================================================================================
733 // 11ax 160MHz @ 2.4GHz -> not enough space so skip
734
735 // ============================================================================================
736 // 11ax 160MHz @ 5GHz
737 NS_LOG_FUNCTION ("Check slopes for 11ax 160MHz @ 5GHz");
738 maskSlopes.clear ();
739 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
740 maskSlopes.push_back (std::make_pair (1023, -28.012)); // Outer band left (stop)
741 maskSlopes.push_back (std::make_pair (1024, -28.000)); // Middle band left (start)
742 maskSlopes.push_back (std::make_pair (2041, -20.008)); // Middle band left (stop)
743 maskSlopes.push_back (std::make_pair (2042, -20.0)); // Flat junction band left (start)
744 maskSlopes.push_back (std::make_pair (2046, -20.0)); // Flat junction band left (stop)
745 maskSlopes.push_back (std::make_pair (2047, -20.0)); // Inner band left (start)
746 maskSlopes.push_back (std::make_pair (2059, -1.538)); // Inner band left (stop)
747 maskSlopes.push_back (std::make_pair (2060, 0.0)); // first 80 MHz allocated band left (start)
748 maskSlopes.push_back (std::make_pair (2557, 0.0)); // first 80 MHz allocated band left (stop)
749 maskSlopes.push_back (std::make_pair (2558, -20.0)); // first 80 MHz DC band (start)
750 maskSlopes.push_back (std::make_pair (2562, -20.0)); // first 80 MHz DC band (stop)
751 maskSlopes.push_back (std::make_pair (2563, 0.0)); // first 80 MHz allocated band right (start)
752 maskSlopes.push_back (std::make_pair (3060, 0.0)); // first 80 MHz allocated band right (stop)
753 maskSlopes.push_back (std::make_pair (3061, -20.0)); // gap between 80 MHz bands (start)
754 maskSlopes.push_back (std::make_pair (3083, -20.0)); // gap between 80 MHz bands (start)
755 maskSlopes.push_back (std::make_pair (3084, 0.0)); // second 80 MHz allocated band left (start)
756 maskSlopes.push_back (std::make_pair (3581, 0.0)); // second 80 MHz allocated band left (stop)
757 maskSlopes.push_back (std::make_pair (3582, -20.0)); // second 80 MHz DC band (start)
758 maskSlopes.push_back (std::make_pair (3586, -20.0)); // second 80 MHz DC band (stop)
759 maskSlopes.push_back (std::make_pair (3587, 0.0)); // second 80 MHz allocated band right (start)
760 maskSlopes.push_back (std::make_pair (4084, 0.0)); // second 80 MHz allocated band right (stop)
761 maskSlopes.push_back (std::make_pair (4085, -1.538)); // Inner band right (start)
762 maskSlopes.push_back (std::make_pair (4097, -20.0)); // Inner band right (stop)
763 maskSlopes.push_back (std::make_pair (4098, -20.0)); // Flat junction band right (start)
764 maskSlopes.push_back (std::make_pair (4102, -20.0)); // Flat junction band right (stop)
765 maskSlopes.push_back (std::make_pair (4103, -20.008)); // Middle band right (start)
766 maskSlopes.push_back (std::make_pair (5120, -28.000)); // Middle band right (stop)
767 maskSlopes.push_back (std::make_pair (5121, -28.012)); // Outer band right (start)
768 maskSlopes.push_back (std::make_pair (6144, -40.0)); // Outer band right (stop)
770 160, maskSlopes, tol, prec),
771 TestCase::QUICK);
772
773 // ============================================================================================
774 // 11ax 80MHz @ 5GHz - first 20 MHz subchannel punctured
775 NS_LOG_FUNCTION ("Check slopes for 11ax 80MHz @ 5GHz with first 20 MHz subchannel punctured");
776 maskSlopes.clear ();
777 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
778 maskSlopes.push_back (std::make_pair (511, -28.023)); // Outer band left (stop)
779 maskSlopes.push_back (std::make_pair (512, -28.000)); // Middle band left (start)
780 maskSlopes.push_back (std::make_pair (1017, -20.016)); // Middle band left (stop)
781 maskSlopes.push_back (std::make_pair (1018, -20.0)); // Flat junction band left (start)
782 maskSlopes.push_back (std::make_pair (1022, -20.0)); // Flat junction band left (stop)
783 maskSlopes.push_back (std::make_pair (1023, -20.0)); // punctured band (start)
784 maskSlopes.push_back (std::make_pair (1272, -20.0)); // punctured band (stop)
785 maskSlopes.push_back (std::make_pair (1273, -20.0)); // punctured band increasing slope (start)
786 maskSlopes.push_back (std::make_pair (1279, 0.0)); // punctured band increasing slope (stop)
787 maskSlopes.push_back (std::make_pair (1280, 0.0)); // allocated band left (start)
788 maskSlopes.push_back (std::make_pair (1533, 0.0)); // allocated band left (stop)
789 maskSlopes.push_back (std::make_pair (1534, -20.0)); // DC band (start)
790 maskSlopes.push_back (std::make_pair (1538, -20.0)); // DC band (stop)
791 maskSlopes.push_back (std::make_pair (1539, 0.0)); // allocated band right (start)
792 maskSlopes.push_back (std::make_pair (2036, 0.0)); // allocated band right (stop)
793 maskSlopes.push_back (std::make_pair (2037, -1.538)); // Inner band right (start)
794 maskSlopes.push_back (std::make_pair (2049, -20.0)); // Inner band right (stop)
795 maskSlopes.push_back (std::make_pair (2050, -20.0)); // Flat junction band right (start)
796 maskSlopes.push_back (std::make_pair (2054, -20.0)); // Flat junction band right (stop)
797 maskSlopes.push_back (std::make_pair (2055, -20.016)); // Middle band right (start)
798 maskSlopes.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop)
799 maskSlopes.push_back (std::make_pair (2561, -28.023)); // Outer band right (start)
800 maskSlopes.push_back (std::make_pair (3072, -40.0)); // Outer band right (stop)
801 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 80MHz first subchannel punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
802 80, maskSlopes, tol, prec, {1, 0, 0, 0}),
803 TestCase::QUICK);
804
805 // ============================================================================================
806 // 11ax 80MHz @ 5GHz - second 20 MHz subchannel punctured
807 NS_LOG_FUNCTION ("Check slopes for 11ax 80MHz @ 5GHz with second 20 MHz subchannel punctured");
808 maskSlopes.clear ();
809 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
810 maskSlopes.push_back (std::make_pair (511, -28.023)); // Outer band left (stop)
811 maskSlopes.push_back (std::make_pair (512, -28.000)); // Middle band left (start)
812 maskSlopes.push_back (std::make_pair (1017, -20.016)); // Middle band left (stop)
813 maskSlopes.push_back (std::make_pair (1018, -20.0)); // Flat junction band left (start)
814 maskSlopes.push_back (std::make_pair (1022, -20.0)); // Flat junction band left (stop)
815 maskSlopes.push_back (std::make_pair (1023, -20.0)); // Inner band left (start)
816 maskSlopes.push_back (std::make_pair (1035, -1.538)); // Inner band left (stop)
817 maskSlopes.push_back (std::make_pair (1036, 0.0)); // allocated band left (start)
818 maskSlopes.push_back (std::make_pair (1279, 0.0)); // allocated band left (stop)
819 maskSlopes.push_back (std::make_pair (1280, 0.0)); // punctured band decreasing slope (start)
820 maskSlopes.push_back (std::make_pair (1286, -20.0)); // punctured band decreasing slope (stop)
821 maskSlopes.push_back (std::make_pair (1287, -20.0)); // punctured band (start)
822 maskSlopes.push_back (std::make_pair (1528, -20.0)); // punctured band (stop)
823 maskSlopes.push_back (std::make_pair (1529, -20.0)); // punctured band increasing slope (start)
824 maskSlopes.push_back (std::make_pair (1533, -6.667)); // punctured band increasing slope (stop)
825 maskSlopes.push_back (std::make_pair (1534, -20.0)); // DC band (start)
826 maskSlopes.push_back (std::make_pair (1538, -20.0)); // DC band (stop)
827 maskSlopes.push_back (std::make_pair (1539, 0.0)); // allocated band right (start)
828 maskSlopes.push_back (std::make_pair (2036, 0.0)); // allocated band right (stop)
829 maskSlopes.push_back (std::make_pair (2037, -1.538)); // Inner band right (start)
830 maskSlopes.push_back (std::make_pair (2049, -20.0)); // Inner band right (stop)
831 maskSlopes.push_back (std::make_pair (2050, -20.0)); // Flat junction band right (start)
832 maskSlopes.push_back (std::make_pair (2054, -20.0)); // Flat junction band right (stop)
833 maskSlopes.push_back (std::make_pair (2055, -20.016)); // Middle band right (start)
834 maskSlopes.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop)
835 maskSlopes.push_back (std::make_pair (2561, -28.023)); // Outer band right (start)
836 maskSlopes.push_back (std::make_pair (3072, -40.0)); // Outer band right (stop)
837 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 80MHz second subchannel punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
838 80, maskSlopes, tol, prec, {0, 1, 0, 0}),
839 TestCase::QUICK);
840
841 // ============================================================================================
842 // 11ax 80MHz @ 5GHz - third 20 MHz subchannel punctured
843 NS_LOG_FUNCTION ("Check slopes for 11ax 80MHz @ 5GHz with third 20 MHz subchannel punctured");
844 maskSlopes.clear ();
845 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
846 maskSlopes.push_back (std::make_pair (511, -28.023)); // Outer band left (stop)
847 maskSlopes.push_back (std::make_pair (512, -28.000)); // Middle band left (start)
848 maskSlopes.push_back (std::make_pair (1017, -20.016)); // Middle band left (stop)
849 maskSlopes.push_back (std::make_pair (1018, -20.0)); // Flat junction band left (start)
850 maskSlopes.push_back (std::make_pair (1022, -20.0)); // Flat junction band left (stop)
851 maskSlopes.push_back (std::make_pair (1023, -20.0)); // Inner band left (start)
852 maskSlopes.push_back (std::make_pair (1035, -1.538)); // Inner band left (stop)
853 maskSlopes.push_back (std::make_pair (1036, 0.0)); // allocated band left (start)
854 maskSlopes.push_back (std::make_pair (1533, 0.0)); // allocated band left (stop)
855 maskSlopes.push_back (std::make_pair (1534, -20.0)); // DC band (start)
856 maskSlopes.push_back (std::make_pair (1535, -20.0)); // DC band (stop)
857 maskSlopes.push_back (std::make_pair (1539, -10.0)); // punctured band decreasing slope (start)
858 maskSlopes.push_back (std::make_pair (1542, -20.0)); // punctured band decreasing slope (stop)
859 maskSlopes.push_back (std::make_pair (1543, -20.0)); // punctured band (start)
860 maskSlopes.push_back (std::make_pair (1784, -20.0)); // punctured band (stop)
861 maskSlopes.push_back (std::make_pair (1785, -20.0)); // punctured band increasing slope (start)
862 maskSlopes.push_back (std::make_pair (1791, 0.0)); // punctured band increasing slope (stop)
863 maskSlopes.push_back (std::make_pair (1792, 0.0)); // allocated band right (start)
864 maskSlopes.push_back (std::make_pair (2036, 0.0)); // allocated band right (stop)
865 maskSlopes.push_back (std::make_pair (2037, -1.538)); // Inner band right (start)
866 maskSlopes.push_back (std::make_pair (2049, -20.0)); // Inner band right (stop)
867 maskSlopes.push_back (std::make_pair (2050, -20.0)); // Flat junction band right (start)
868 maskSlopes.push_back (std::make_pair (2054, -20.0)); // Flat junction band right (stop)
869 maskSlopes.push_back (std::make_pair (2055, -20.016)); // Middle band right (start)
870 maskSlopes.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop)
871 maskSlopes.push_back (std::make_pair (2561, -28.023)); // Outer band right (start)
872 maskSlopes.push_back (std::make_pair (3072, -40.0)); // Outer band right (stop)
873 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 80MHz third subchannel punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
874 80, maskSlopes, tol, prec, {0, 0, 1, 0}),
875 TestCase::QUICK);
876
877 // ============================================================================================
878 // 11ax 80MHz @ 5GHz - last 20 MHz subchannel punctured
879 NS_LOG_FUNCTION ("Check slopes for 11ax 80MHz @ 5GHz with last 20 MHz subchannel punctured");
880 maskSlopes.clear ();
881 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
882 maskSlopes.push_back (std::make_pair (511, -28.023)); // Outer band left (stop)
883 maskSlopes.push_back (std::make_pair (512, -28.000)); // Middle band left (start)
884 maskSlopes.push_back (std::make_pair (1017, -20.016)); // Middle band left (stop)
885 maskSlopes.push_back (std::make_pair (1018, -20.0)); // Flat junction band left (start)
886 maskSlopes.push_back (std::make_pair (1022, -20.0)); // Flat junction band left (stop)
887 maskSlopes.push_back (std::make_pair (1023, -20.0)); // Inner band left (start)
888 maskSlopes.push_back (std::make_pair (1035, -1.538)); // Inner band left (stop)
889 maskSlopes.push_back (std::make_pair (1036, 0.0)); // allocated band left (start)
890 maskSlopes.push_back (std::make_pair (1533, 0.0)); // allocated band left (stop)
891 maskSlopes.push_back (std::make_pair (1534, -20.0)); // DC band (start)
892 maskSlopes.push_back (std::make_pair (1538, -20.0)); // DC band (stop)
893 maskSlopes.push_back (std::make_pair (1539, 0.0)); // allocated band right (start)
894 maskSlopes.push_back (std::make_pair (1791, 0.0)); // allocated band right (stop)
895 maskSlopes.push_back (std::make_pair (1792, 0.0)); // punctured band decreasing slope (start)
896 maskSlopes.push_back (std::make_pair (1798, -20.0)); // punctured band decreasing slope (stop)
897 maskSlopes.push_back (std::make_pair (1799, -20.0)); // punctured band (start)
898 maskSlopes.push_back (std::make_pair (2049, -20.0)); // punctured band (stop)
899 maskSlopes.push_back (std::make_pair (2050, -20.0)); // Flat junction band right (start)
900 maskSlopes.push_back (std::make_pair (2054, -20.0)); // Flat junction band right (stop)
901 maskSlopes.push_back (std::make_pair (2055, -20.016)); // Middle band right (start)
902 maskSlopes.push_back (std::make_pair (2560, -28.000)); // Middle band right (stop)
903 maskSlopes.push_back (std::make_pair (2561, -28.023)); // Outer band right (start)
904 maskSlopes.push_back (std::make_pair (3072, -40.0)); // Outer band right (stop)
905 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 80MHz last subchannel punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
906 80, maskSlopes, tol, prec, {0, 0, 0, 1}),
907 TestCase::QUICK);
908
909 // ============================================================================================
910 // 11ax 160MHz @ 5GHz - first two 20 MHz subchannels punctured
911 NS_LOG_FUNCTION ("Check slopes for 11ax 160MHz @ 5GHz with two first 20 MHz subchannels punctured");
912 maskSlopes.clear ();
913 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
914 maskSlopes.push_back (std::make_pair (1023, -28.012)); // Outer band left (stop)
915 maskSlopes.push_back (std::make_pair (1024, -28.000)); // Middle band left (start)
916 maskSlopes.push_back (std::make_pair (2041, -20.008)); // Middle band left (stop)
917 maskSlopes.push_back (std::make_pair (2042, -20.0)); // Flat junction band left (start)
918 maskSlopes.push_back (std::make_pair (2046, -20.0)); // Flat junction band left (stop)
919 maskSlopes.push_back (std::make_pair (2047, -20.0)); // punctured band (start)
920 maskSlopes.push_back (std::make_pair (2552, -20.0)); // punctured band (stop)
921 maskSlopes.push_back (std::make_pair (2553, -20.0)); // punctured band increasing slope (start)
922 maskSlopes.push_back (std::make_pair (2557, -6.66667)); // punctured band increasing slope (stop)
923 maskSlopes.push_back (std::make_pair (2558, -20.0)); // first 80 MHz DC band (start)
924 maskSlopes.push_back (std::make_pair (2562, -20.0)); // first 80 MHz DC band (stop)
925 maskSlopes.push_back (std::make_pair (2563, 0.0)); // first 80 MHz allocated band right (start)
926 maskSlopes.push_back (std::make_pair (3060, 0.0)); // first 80 MHz allocated band right (stop)
927 maskSlopes.push_back (std::make_pair (3061, -20.0)); // gap between 80 MHz bands (start)
928 maskSlopes.push_back (std::make_pair (3083, -20.0)); // gap between 80 MHz bands (start)
929 maskSlopes.push_back (std::make_pair (3084, 0.0)); // second 80 MHz allocated band left (start)
930 maskSlopes.push_back (std::make_pair (3581, 0.0)); // second 80 MHz allocated band left (stop)
931 maskSlopes.push_back (std::make_pair (3582, -20.0)); // second 80 MHz DC band (start)
932 maskSlopes.push_back (std::make_pair (3586, -20.0)); // second 80 MHz DC band (stop)
933 maskSlopes.push_back (std::make_pair (3587, 0.0)); // second 80 MHz allocated band right (start)
934 maskSlopes.push_back (std::make_pair (4084, 0.0)); // second 80 MHz allocated band right (stop)
935 maskSlopes.push_back (std::make_pair (4085, -1.538)); // Inner band right (start)
936 maskSlopes.push_back (std::make_pair (4097, -20.0)); // Inner band right (stop)
937 maskSlopes.push_back (std::make_pair (4098, -20.0)); // Flat junction band right (start)
938 maskSlopes.push_back (std::make_pair (4102, -20.0)); // Flat junction band right (stop)
939 maskSlopes.push_back (std::make_pair (4103, -20.008)); // Middle band right (start)
940 maskSlopes.push_back (std::make_pair (5120, -28.000)); // Middle band right (stop)
941 maskSlopes.push_back (std::make_pair (5121, -28.012)); // Outer band right (start)
942 maskSlopes.push_back (std::make_pair (6144, -40.0)); // Outer band right (stop)
943 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 160MHz first subchannels punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
944 160, maskSlopes, tol, prec, {1, 1, 0, 0, 0, 0, 0, 0}),
945 TestCase::QUICK);
946
947 // ============================================================================================
948 // 11ax 160MHz @ 5GHz - third and fourth 20 MHz subchannels punctured
949 NS_LOG_FUNCTION ("Check slopes for 11ax 160MHz @ 5GHz with third and fourth 20 MHz subchannels punctured");
950 maskSlopes.clear ();
951 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
952 maskSlopes.push_back (std::make_pair (1023, -28.012)); // Outer band left (stop)
953 maskSlopes.push_back (std::make_pair (1024, -28.000)); // Middle band left (start)
954 maskSlopes.push_back (std::make_pair (2041, -20.008)); // Middle band left (stop)
955 maskSlopes.push_back (std::make_pair (2042, -20.0)); // Flat junction band left (start)
956 maskSlopes.push_back (std::make_pair (2046, -20.0)); // Flat junction band left (stop)
957 maskSlopes.push_back (std::make_pair (2047, -20.0)); // Inner band left (start)
958 maskSlopes.push_back (std::make_pair (2059, -1.538)); // Inner band left (stop)
959 maskSlopes.push_back (std::make_pair (2060, 0.0)); // first 80 MHz allocated band left (start)
960 maskSlopes.push_back (std::make_pair (2557, 0.0)); // first 80 MHz allocated band left (stop)
961 maskSlopes.push_back (std::make_pair (2558, -20.0)); // first 80 MHz DC band (start)
962 maskSlopes.push_back (std::make_pair (2562, -20.0)); // first 80 MHz DC band (stop)
963 maskSlopes.push_back (std::make_pair (2563, -10.0)); // punctured band decreasing slope (start)
964 maskSlopes.push_back (std::make_pair (2566, -20.0)); // punctured band decreasing slope (stop)
965 maskSlopes.push_back (std::make_pair (2567, -20.0)); // punctured band (start)
966 maskSlopes.push_back (std::make_pair (3060, -20.0)); // punctured band (stop)
967 maskSlopes.push_back (std::make_pair (3061, -20.0)); // gap between 80 MHz bands (start)
968 maskSlopes.push_back (std::make_pair (3083, -20.0)); // gap between 80 MHz bands (start)
969 maskSlopes.push_back (std::make_pair (3084, 0.0)); // second 80 MHz allocated band left (start)
970 maskSlopes.push_back (std::make_pair (3581, 0.0)); // second 80 MHz allocated band left (stop)
971 maskSlopes.push_back (std::make_pair (3582, -20.0)); // second 80 MHz DC band (start)
972 maskSlopes.push_back (std::make_pair (3586, -20.0)); // second 80 MHz DC band (stop)
973 maskSlopes.push_back (std::make_pair (3587, 0.0)); // second 80 MHz allocated band right (start)
974 maskSlopes.push_back (std::make_pair (4084, 0.0)); // second 80 MHz allocated band right (stop)
975 maskSlopes.push_back (std::make_pair (4085, -1.538)); // Inner band right (start)
976 maskSlopes.push_back (std::make_pair (4097, -20.0)); // Inner band right (stop)
977 maskSlopes.push_back (std::make_pair (4098, -20.0)); // Flat junction band right (start)
978 maskSlopes.push_back (std::make_pair (4102, -20.0)); // Flat junction band right (stop)
979 maskSlopes.push_back (std::make_pair (4103, -20.008)); // Middle band right (start)
980 maskSlopes.push_back (std::make_pair (5120, -28.000)); // Middle band right (stop)
981 maskSlopes.push_back (std::make_pair (5121, -28.012)); // Outer band right (start)
982 maskSlopes.push_back (std::make_pair (6144, -40.0)); // Outer band right (stop)
983 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 160MHz third and fourth subchannels punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
984 160, maskSlopes, tol, prec, {0, 0, 1, 1, 0, 0, 0, 0}),
985 TestCase::QUICK);
986
987 // ============================================================================================
988 // 11ax 160MHz @ 5GHz - fifth and sixth 20 MHz subchannels punctured
989 NS_LOG_FUNCTION ("Check slopes for 11ax 160MHz @ 5GHz with fifth and sixth 20 MHz subchannels punctured");
990 maskSlopes.clear ();
991 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
992 maskSlopes.push_back (std::make_pair (1023, -28.012)); // Outer band left (stop)
993 maskSlopes.push_back (std::make_pair (1024, -28.000)); // Middle band left (start)
994 maskSlopes.push_back (std::make_pair (2041, -20.008)); // Middle band left (stop)
995 maskSlopes.push_back (std::make_pair (2042, -20.0)); // Flat junction band left (start)
996 maskSlopes.push_back (std::make_pair (2046, -20.0)); // Flat junction band left (stop)
997 maskSlopes.push_back (std::make_pair (2047, -20.0)); // Inner band left (start)
998 maskSlopes.push_back (std::make_pair (2059, -1.538)); // Inner band left (stop)
999 maskSlopes.push_back (std::make_pair (2060, 0.0)); // first 80 MHz allocated band left (start)
1000 maskSlopes.push_back (std::make_pair (2557, 0.0)); // first 80 MHz allocated band left (stop)
1001 maskSlopes.push_back (std::make_pair (2558, -20.0)); // first 80 MHz DC band (start)
1002 maskSlopes.push_back (std::make_pair (2562, -20.0)); // first 80 MHz DC band (stop)
1003 maskSlopes.push_back (std::make_pair (2563, 0.0)); // first 80 MHz allocated band right (start)
1004 maskSlopes.push_back (std::make_pair (3060, 0.0)); // first 80 MHz allocated band right (stop)
1005 maskSlopes.push_back (std::make_pair (3061, -20.0)); // gap between 80 MHz bands (start)
1006 maskSlopes.push_back (std::make_pair (3083, -20.0)); // gap between 80 MHz bands (start)
1007 maskSlopes.push_back (std::make_pair (3084, -20.0)); // punctured band (start)
1008 maskSlopes.push_back (std::make_pair (3576, -20.0)); // punctured band (stop)
1009 maskSlopes.push_back (std::make_pair (3577, -20.0)); // punctured band increasing slope (start)
1010 maskSlopes.push_back (std::make_pair (3581, -6.667)); // punctured band increasing slope (stop)
1011 maskSlopes.push_back (std::make_pair (3582, -20.0)); // second 80 MHz DC band (start)
1012 maskSlopes.push_back (std::make_pair (3586, -20.0)); // second 80 MHz DC band (stop)
1013 maskSlopes.push_back (std::make_pair (3587, 0.0)); // second 80 MHz allocated band right (start)
1014 maskSlopes.push_back (std::make_pair (4084, 0.0)); // second 80 MHz allocated band right (stop)
1015 maskSlopes.push_back (std::make_pair (4085, -1.538)); // Inner band right (start)
1016 maskSlopes.push_back (std::make_pair (4097, -20.0)); // Inner band right (stop)
1017 maskSlopes.push_back (std::make_pair (4098, -20.0)); // Flat junction band right (start)
1018 maskSlopes.push_back (std::make_pair (4102, -20.0)); // Flat junction band right (stop)
1019 maskSlopes.push_back (std::make_pair (4103, -20.008)); // Middle band right (start)
1020 maskSlopes.push_back (std::make_pair (5120, -28.000)); // Middle band right (stop)
1021 maskSlopes.push_back (std::make_pair (5121, -28.012)); // Outer band right (start)
1022 maskSlopes.push_back (std::make_pair (6144, -40.0)); // Outer band right (stop)
1023 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 160MHz fifth and sixth subchannels punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
1024 160, maskSlopes, tol, prec, {0, 0, 0, 0, 1, 1, 0, 0}),
1025 TestCase::QUICK);
1026
1027 // ============================================================================================
1028 // 11ax 160MHz @ 5GHz - last two 20 MHz subchannels punctured
1029 NS_LOG_FUNCTION ("Check slopes for 11ax 160MHz @ 5GHz with two last 20 MHz subchannels punctured");
1030 maskSlopes.clear ();
1031 maskSlopes.push_back (std::make_pair (0, -40.0)); // Outer band left (start)
1032 maskSlopes.push_back (std::make_pair (1023, -28.012)); // Outer band left (stop)
1033 maskSlopes.push_back (std::make_pair (1024, -28.000)); // Middle band left (start)
1034 maskSlopes.push_back (std::make_pair (2041, -20.008)); // Middle band left (stop)
1035 maskSlopes.push_back (std::make_pair (2042, -20.0)); // Flat junction band left (start)
1036 maskSlopes.push_back (std::make_pair (2046, -20.0)); // Flat junction band left (stop)
1037 maskSlopes.push_back (std::make_pair (2047, -20.0)); // Inner band left (start)
1038 maskSlopes.push_back (std::make_pair (2059, -1.538)); // Inner band left (stop)
1039 maskSlopes.push_back (std::make_pair (2060, 0.0)); // first 80 MHz allocated band left (start)
1040 maskSlopes.push_back (std::make_pair (2557, 0.0)); // first 80 MHz allocated band left (stop)
1041 maskSlopes.push_back (std::make_pair (2558, -20.0)); // first 80 MHz DC band (start)
1042 maskSlopes.push_back (std::make_pair (2562, -20.0)); // first 80 MHz DC band (stop)
1043 maskSlopes.push_back (std::make_pair (2563, 0.0)); // first 80 MHz allocated band right (start)
1044 maskSlopes.push_back (std::make_pair (3060, 0.0)); // first 80 MHz allocated band right (stop)
1045 maskSlopes.push_back (std::make_pair (3061, -20.0)); // gap between 80 MHz bands (start)
1046 maskSlopes.push_back (std::make_pair (3083, -20.0)); // gap between 80 MHz bands (start)
1047 maskSlopes.push_back (std::make_pair (3084, 0.0)); // second 80 MHz allocated band left (start)
1048 maskSlopes.push_back (std::make_pair (3581, 0.0)); // second 80 MHz allocated band left (stop)
1049 maskSlopes.push_back (std::make_pair (3582, -20.0)); // second 80 MHz DC band (start)
1050 maskSlopes.push_back (std::make_pair (3586, -20.0)); // second 80 MHz DC band (stop)
1051 maskSlopes.push_back (std::make_pair (3587, -10.0)); // punctured band decreasing slope (start)
1052 maskSlopes.push_back (std::make_pair (3590, -20.0)); // punctured band decreasing slope (stop)
1053 maskSlopes.push_back (std::make_pair (3591, -20.0)); // punctured band (start)
1054 maskSlopes.push_back (std::make_pair (4097, -20.0)); // punctured band (stop)
1055 maskSlopes.push_back (std::make_pair (4098, -20.0)); // Flat junction band right (start)
1056 maskSlopes.push_back (std::make_pair (4102, -20.0)); // Flat junction band right (stop)
1057 maskSlopes.push_back (std::make_pair (4103, -20.008)); // Middle band right (start)
1058 maskSlopes.push_back (std::make_pair (5120, -28.000)); // Middle band right (stop)
1059 maskSlopes.push_back (std::make_pair (5121, -28.012)); // Outer band right (start)
1060 maskSlopes.push_back (std::make_pair (6144, -40.0)); // Outer band right (stop)
1061 AddTestCase (new WifiOfdmMaskSlopesTestCase ("11ax_5GHz 160MHz last subchannels punctured", WIFI_STANDARD_80211ax, WIFI_PHY_BAND_5GHZ,
1062 160, maskSlopes, tol, prec, {0, 0, 0, 0, 0, 0, 1, 1}),
1063 TestCase::QUICK);
1064}
#define max(a, b)
Definition: 80211b.c:43
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 (dBr)
double m_tolerance
tolerance (in dB)
std::vector< bool > m_puncturedSubchannels
bitmap indicating whether a 20 MHz subchannel is punctured or not (only used for 802....
std::pair< uint32_t, double > IndexPowerPair
typedef for a pair of sub-band index and relative power value (dBr)
uint16_t m_channelWidth
the channel width in MHz to use for the test
void InterpolateAndAppendValues(IndexPowerVect &vect, IndexPowerPair start, IndexPowerPair stop)
Interpolate PSD values for indexes between provided start and stop and append to provided vector.
WifiOfdmMaskSlopesTestCase(const std::string &name, WifiStandard standard, WifiPhyBand band, uint16_t channelWidth, const IndexPowerVect &maskRefs, double tolerance, std::size_t precision, const std::vector< bool > &puncturedSubchannels=std::vector< bool >{})
Constructor.
void DoRun(void) override
Implementation to actually run this TestCase.
WifiPhyBand m_band
the wifi PHY band to use for the test
virtual ~WifiOfdmMaskSlopesTestCase()=default
void DoSetup(void) override
Implementation to do any local setup required for this TestCase.
Ptr< SpectrumValue > m_actualSpectrum
actual spectrum 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 use for the test
Test suite for checking the consistency of different OFDM-based transmit masks.
Values::const_iterator ConstValuesBegin() const
Values::const_iterator ConstValuesEnd() const
encapsulates test code
Definition: test.h:994
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
Definition: test.cc:299
A suite of tests to run.
Definition: test.h:1188
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
Definition: assert.h:67
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
Definition: fatal-error.h:165
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
Definition: log.h:206
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
Definition: log.h:290
#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:282
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:44
#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:491
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyBand
Identifies the PHY band.
Definition: wifi-phy-band.h:33
@ WIFI_STANDARD_80211a
@ WIFI_STANDARD_80211p
@ WIFI_STANDARD_80211n
@ WIFI_STANDARD_80211g
@ WIFI_STANDARD_80211ax
@ WIFI_STANDARD_80211ac
@ WIFI_PHY_BAND_6GHZ
The 6 GHz band.
Definition: wifi-phy-band.h:39
@ WIFI_PHY_BAND_2_4GHZ
The 2.4 GHz band.
Definition: wifi-phy-band.h:35
@ WIFI_PHY_BAND_5GHZ
The 5 GHz band.
Definition: wifi-phy-band.h:37
Every class exported by the ns3 library is enclosed in the ns3 namespace.
STL namespace.
def start()
Definition: core.py:1852
static WifiTransmitMaskTestSuite g_WifiTransmitMaskTestSuite