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"
77 void DoRun (
void)
override;
94 :
TestCase (std::string (
"SpectrumValue ") + str)
97 NS_ASSERT (maskRefsLeft.size () % 2 == 0 && maskRefsRight.size () % 2 == 0);
98 uint16_t freq = 5170 + (bw / 2);
99 double refTxPowerW = 1;
101 double outerBandMaximumRejection = -40;
108 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection);
117 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection);
124 freq = 2402 + (bw / 2);
125 outerBandMaximumRejection = -45;
128 m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection);
133 NS_ASSERT (bw == 20 || bw == 40 || bw == 80 || bw == 160);
134 m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection);
142 freq = 2402 + (bw / 2);
143 outerBandMaximumRejection = -45;
145 NS_ASSERT (bw == 20 || bw == 40 || bw == 80 || bw == 160);
146 m_actualSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw, -20.0, -28.0, outerBandMaximumRejection);
156 for (uint32_t i = 0; i < maskRefsLeft.size (); i = i + 2)
163 for (uint32_t i = 0; i < maskRefsRight.size (); i = i + 2)
182 if (
start.first == stop.first)
185 vect.push_back (
start);
190 double slope = (stop.second -
start.second) / (stop.first -
start.first);
191 for (uint32_t i =
start.first; i <= stop.first; i++)
193 double val =
start.second + slope * (i -
start.first);
194 vect.push_back (std::make_pair (i, val));
197 NS_ASSERT (vect.back ().first == stop.first
205 double currentPowerDbr = 0.0;
206 double maxPowerW = (*m_actualSpectrum)[0];
209 maxPowerW =
std::max (maxPowerW, *vit);
215 currentPowerDbr = 10.0 * std::log10 ((*
m_actualSpectrum)[it->first] / maxPowerW);
216 NS_LOG_LOGIC (
"For " << it->first <<
", expected: " << it->second <<
" vs obtained: " << currentPowerDbr);
218 "Spectrum value mismatch for left guard band (" << it->first <<
")");
223 currentPowerDbr = 10.0 * std::log10 ((*
m_actualSpectrum)[it->first] / maxPowerW);
224 NS_LOG_LOGIC (
"For " << it->first <<
", expected: " << it->second <<
" vs obtained: " << currentPowerDbr);
226 "Spectrum value mismatch for right guard band (" << it->first <<
")");
253 NS_LOG_INFO (
"Creating WifiTransmitMaskTestSuite");
262 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
263 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
264 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
265 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
266 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
267 maskSlopesLeft.push_back (std::make_pair (63, -20.0));
268 maskSlopesLeft.push_back (std::make_pair (64, -20.0));
269 maskSlopesLeft.push_back (std::make_pair (69, -3.333));
270 maskSlopesRight.push_back (std::make_pair (123, -3.333));
271 maskSlopesRight.push_back (std::make_pair (128, -20.0));
272 maskSlopesRight.push_back (std::make_pair (129, -20.0));
273 maskSlopesRight.push_back (std::make_pair (131, -20.0));
274 maskSlopesRight.push_back (std::make_pair (132, -20.276));
275 maskSlopesRight.push_back (std::make_pair (160, -28.000));
276 maskSlopesRight.push_back (std::make_pair (161, -28.375));
277 maskSlopesRight.push_back (std::make_pair (192, -40.0));
279 5, maskSlopesLeft, maskSlopesRight, tol),
284 maskSlopesLeft.clear ();
285 maskSlopesRight.clear ();
286 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
287 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
288 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
289 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
290 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
291 maskSlopesLeft.push_back (std::make_pair (63, -20.0));
292 maskSlopesLeft.push_back (std::make_pair (64, -20.0));
293 maskSlopesLeft.push_back (std::make_pair (69, -3.333));
294 maskSlopesRight.push_back (std::make_pair (123, -3.333));
295 maskSlopesRight.push_back (std::make_pair (128, -20.0));
296 maskSlopesRight.push_back (std::make_pair (129, -20.0));
297 maskSlopesRight.push_back (std::make_pair (131, -20.0));
298 maskSlopesRight.push_back (std::make_pair (132, -20.276));
299 maskSlopesRight.push_back (std::make_pair (160, -28.000));
300 maskSlopesRight.push_back (std::make_pair (161, -28.375));
301 maskSlopesRight.push_back (std::make_pair (192, -40.0));
303 10, maskSlopesLeft, maskSlopesRight, tol),
310 maskSlopesLeft.clear ();
311 maskSlopesRight.clear ();
312 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
313 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
314 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
315 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
316 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
317 maskSlopesLeft.push_back (std::make_pair (63, -20.0));
318 maskSlopesLeft.push_back (std::make_pair (64, -20.0));
319 maskSlopesLeft.push_back (std::make_pair (69, -3.333));
320 maskSlopesRight.push_back (std::make_pair (123, -3.333));
321 maskSlopesRight.push_back (std::make_pair (128, -20.0));
322 maskSlopesRight.push_back (std::make_pair (129, -20.0));
323 maskSlopesRight.push_back (std::make_pair (131, -20.0));
324 maskSlopesRight.push_back (std::make_pair (132, -20.276));
325 maskSlopesRight.push_back (std::make_pair (160, -28.000));
326 maskSlopesRight.push_back (std::make_pair (161, -28.375));
327 maskSlopesRight.push_back (std::make_pair (192, -40.0));
329 20, maskSlopesLeft, maskSlopesRight, tol),
336 20, maskSlopesLeft, maskSlopesRight, tol),
343 maskSlopesLeft.clear ();
344 maskSlopesRight.clear ();
345 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
346 maskSlopesLeft.push_back (std::make_pair (31, -28.531));
347 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
348 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
349 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
350 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
351 maskSlopesLeft.push_back (std::make_pair (62, -20.0));
352 maskSlopesLeft.push_back (std::make_pair (67, -3.333));
353 maskSlopesRight.push_back (std::make_pair (125, -3.333));
354 maskSlopesRight.push_back (std::make_pair (130, -20.0));
355 maskSlopesRight.push_back (std::make_pair (131, -20.0));
356 maskSlopesRight.push_back (std::make_pair (131, -20.0));
357 maskSlopesRight.push_back (std::make_pair (132, -20.276));
358 maskSlopesRight.push_back (std::make_pair (160, -28.000));
359 maskSlopesRight.push_back (std::make_pair (161, -28.531));
360 maskSlopesRight.push_back (std::make_pair (192, -45.000));
362 20, maskSlopesLeft, maskSlopesRight, tol),
367 maskSlopesLeft.clear ();
368 maskSlopesRight.clear ();
369 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
370 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
371 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
372 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
373 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
374 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
375 maskSlopesLeft.push_back (std::make_pair (62, -20.0));
376 maskSlopesLeft.push_back (std::make_pair (67, -3.333));
377 maskSlopesRight.push_back (std::make_pair (125, -3.333));
378 maskSlopesRight.push_back (std::make_pair (130, -20.0));
379 maskSlopesRight.push_back (std::make_pair (131, -20.0));
380 maskSlopesRight.push_back (std::make_pair (131, -20.0));
381 maskSlopesRight.push_back (std::make_pair (132, -20.276));
382 maskSlopesRight.push_back (std::make_pair (160, -28.000));
383 maskSlopesRight.push_back (std::make_pair (161, -28.375));
384 maskSlopesRight.push_back (std::make_pair (192, -40.0));
386 20, maskSlopesLeft, maskSlopesRight, tol),
391 maskSlopesLeft.clear ();
392 maskSlopesRight.clear ();
393 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
394 maskSlopesLeft.push_back (std::make_pair (63, -28.266));
395 maskSlopesLeft.push_back (std::make_pair (64, -28.000));
396 maskSlopesLeft.push_back (std::make_pair (124, -20.131));
397 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
398 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
399 maskSlopesLeft.push_back (std::make_pair (126, -20.0));
400 maskSlopesLeft.push_back (std::make_pair (131, -3.333));
401 maskSlopesRight.push_back (std::make_pair (253, -3.333));
402 maskSlopesRight.push_back (std::make_pair (258, -20.0));
403 maskSlopesRight.push_back (std::make_pair (259, -20.0));
404 maskSlopesRight.push_back (std::make_pair (259, -20.0));
405 maskSlopesRight.push_back (std::make_pair (260, -20.131));
406 maskSlopesRight.push_back (std::make_pair (320, -28.000));
407 maskSlopesRight.push_back (std::make_pair (321, -28.266));
408 maskSlopesRight.push_back (std::make_pair (384, -45.000));
410 40, maskSlopesLeft, maskSlopesRight, tol),
415 maskSlopesLeft.clear ();
416 maskSlopesRight.clear ();
417 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
418 maskSlopesLeft.push_back (std::make_pair (63, -28.188));
419 maskSlopesLeft.push_back (std::make_pair (64, -28.000));
420 maskSlopesLeft.push_back (std::make_pair (124, -20.131));
421 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
422 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
423 maskSlopesLeft.push_back (std::make_pair (126, -20.0));
424 maskSlopesLeft.push_back (std::make_pair (131, -3.333));
425 maskSlopesRight.push_back (std::make_pair (253, -3.333));
426 maskSlopesRight.push_back (std::make_pair (258, -20.0));
427 maskSlopesRight.push_back (std::make_pair (259, -20.0));
428 maskSlopesRight.push_back (std::make_pair (259, -20.0));
429 maskSlopesRight.push_back (std::make_pair (260, -20.131));
430 maskSlopesRight.push_back (std::make_pair (320, -28.000));
431 maskSlopesRight.push_back (std::make_pair (321, -28.188));
432 maskSlopesRight.push_back (std::make_pair (384, -40.0));
434 40, maskSlopesLeft, maskSlopesRight, tol),
441 maskSlopesLeft.clear ();
442 maskSlopesRight.clear ();
443 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
444 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
445 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
446 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
447 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
448 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
449 maskSlopesLeft.push_back (std::make_pair (62, -20.0));
450 maskSlopesLeft.push_back (std::make_pair (67, -3.333));
451 maskSlopesRight.push_back (std::make_pair (125, -3.333));
452 maskSlopesRight.push_back (std::make_pair (130, -20.0));
453 maskSlopesRight.push_back (std::make_pair (131, -20.0));
454 maskSlopesRight.push_back (std::make_pair (131, -20.0));
455 maskSlopesRight.push_back (std::make_pair (132, -20.276));
456 maskSlopesRight.push_back (std::make_pair (160, -28.000));
457 maskSlopesRight.push_back (std::make_pair (161, -28.375));
458 maskSlopesRight.push_back (std::make_pair (192, -40.0));
460 20, maskSlopesLeft, maskSlopesRight, tol),
465 maskSlopesLeft.clear ();
466 maskSlopesRight.clear ();
467 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
468 maskSlopesLeft.push_back (std::make_pair (63, -28.188));
469 maskSlopesLeft.push_back (std::make_pair (64, -28.000));
470 maskSlopesLeft.push_back (std::make_pair (124, -20.131));
471 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
472 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
473 maskSlopesLeft.push_back (std::make_pair (126, -20.0));
474 maskSlopesLeft.push_back (std::make_pair (131, -3.333));
475 maskSlopesRight.push_back (std::make_pair (253, -3.333));
476 maskSlopesRight.push_back (std::make_pair (258, -20.0));
477 maskSlopesRight.push_back (std::make_pair (259, -20.0));
478 maskSlopesRight.push_back (std::make_pair (259, -20.0));
479 maskSlopesRight.push_back (std::make_pair (260, -20.131));
480 maskSlopesRight.push_back (std::make_pair (320, -28.000));
481 maskSlopesRight.push_back (std::make_pair (321, -28.188));
482 maskSlopesRight.push_back (std::make_pair (384, -40.0));
484 40, maskSlopesLeft, maskSlopesRight, tol),
489 maskSlopesLeft.clear ();
490 maskSlopesRight.clear ();
491 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
492 maskSlopesLeft.push_back (std::make_pair (127, -28.094));
493 maskSlopesLeft.push_back (std::make_pair (128, -28.000));
494 maskSlopesLeft.push_back (std::make_pair (252, -20.064));
495 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
496 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
497 maskSlopesLeft.push_back (std::make_pair (254, -20.0));
498 maskSlopesLeft.push_back (std::make_pair (259, -3.333));
499 maskSlopesRight.push_back (std::make_pair (509, -3.333));
500 maskSlopesRight.push_back (std::make_pair (514, -20.0));
501 maskSlopesRight.push_back (std::make_pair (515, -20.0));
502 maskSlopesRight.push_back (std::make_pair (515, -20.0));
503 maskSlopesRight.push_back (std::make_pair (516, -20.064));
504 maskSlopesRight.push_back (std::make_pair (640, -28.000));
505 maskSlopesRight.push_back (std::make_pair (641, -28.094));
506 maskSlopesRight.push_back (std::make_pair (768, -40.0));
508 80, maskSlopesLeft, maskSlopesRight, tol),
513 maskSlopesLeft.clear ();
514 maskSlopesRight.clear ();
515 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
516 maskSlopesLeft.push_back (std::make_pair (255, -28.047));
517 maskSlopesLeft.push_back (std::make_pair (256, -28.000));
518 maskSlopesLeft.push_back (std::make_pair (508, -20.032));
519 maskSlopesLeft.push_back (std::make_pair (509, -20.0));
520 maskSlopesLeft.push_back (std::make_pair (509, -20.0));
521 maskSlopesLeft.push_back (std::make_pair (510, -20.0));
522 maskSlopesLeft.push_back (std::make_pair (515, -3.333));
523 maskSlopesRight.push_back (std::make_pair (1021, -3.333));
524 maskSlopesRight.push_back (std::make_pair (1026, -20.0));
525 maskSlopesRight.push_back (std::make_pair (1027, -20.0));
526 maskSlopesRight.push_back (std::make_pair (1027, -20.0));
527 maskSlopesRight.push_back (std::make_pair (1028, -20.032));
528 maskSlopesRight.push_back (std::make_pair (1280, -28.000));
529 maskSlopesRight.push_back (std::make_pair (1281, -28.047));
530 maskSlopesRight.push_back (std::make_pair (1536, -40.0));
532 160, maskSlopesLeft, maskSlopesRight, tol),
539 maskSlopesLeft.clear ();
540 maskSlopesRight.clear ();
541 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
542 maskSlopesLeft.push_back (std::make_pair (127, -28.133));
543 maskSlopesLeft.push_back (std::make_pair (128, -28.000));
544 maskSlopesLeft.push_back (std::make_pair (252, -20.064));
545 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
546 maskSlopesLeft.push_back (std::make_pair (255, -20.0));
547 maskSlopesLeft.push_back (std::make_pair (256, -20.0));
548 maskSlopesLeft.push_back (std::make_pair (261, -3.333));
549 maskSlopesRight.push_back (std::make_pair (507, -3.333));
550 maskSlopesRight.push_back (std::make_pair (512, -20.0));
551 maskSlopesRight.push_back (std::make_pair (513, -20.0));
552 maskSlopesRight.push_back (std::make_pair (515, -20.0));
553 maskSlopesRight.push_back (std::make_pair (516, -20.064));
554 maskSlopesRight.push_back (std::make_pair (640, -28.000));
555 maskSlopesRight.push_back (std::make_pair (641, -28.133));
556 maskSlopesRight.push_back (std::make_pair (768, -45.000));
558 20, maskSlopesLeft, maskSlopesRight, tol),
563 maskSlopesLeft.clear ();
564 maskSlopesRight.clear ();
565 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
566 maskSlopesLeft.push_back (std::make_pair (127, -28.094));
567 maskSlopesLeft.push_back (std::make_pair (128, -28.000));
568 maskSlopesLeft.push_back (std::make_pair (252, -20.064));
569 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
570 maskSlopesLeft.push_back (std::make_pair (255, -20.0));
571 maskSlopesLeft.push_back (std::make_pair (256, -20.0));
572 maskSlopesLeft.push_back (std::make_pair (261, -3.333));
573 maskSlopesRight.push_back (std::make_pair (507, -3.333));
574 maskSlopesRight.push_back (std::make_pair (512, -20.0));
575 maskSlopesRight.push_back (std::make_pair (513, -20.0));
576 maskSlopesRight.push_back (std::make_pair (515, -20.0));
577 maskSlopesRight.push_back (std::make_pair (516, -20.064));
578 maskSlopesRight.push_back (std::make_pair (640, -28.000));
579 maskSlopesRight.push_back (std::make_pair (641, -28.094));
580 maskSlopesRight.push_back (std::make_pair (768, -40.0));
582 20, maskSlopesLeft, maskSlopesRight, tol),
587 maskSlopesLeft.clear ();
588 maskSlopesRight.clear ();
589 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
590 maskSlopesLeft.push_back (std::make_pair (255, -28.066));
591 maskSlopesLeft.push_back (std::make_pair (256, -28.000));
592 maskSlopesLeft.push_back (std::make_pair (505, -20.032));
593 maskSlopesLeft.push_back (std::make_pair (506, -20.0));
594 maskSlopesLeft.push_back (std::make_pair (510, -20.0));
595 maskSlopesLeft.push_back (std::make_pair (511, -20.0));
596 maskSlopesLeft.push_back (std::make_pair (523, -1.538));
597 maskSlopesRight.push_back (std::make_pair (1013, -1.538));
598 maskSlopesRight.push_back (std::make_pair (1025, -20.0));
599 maskSlopesRight.push_back (std::make_pair (1026, -20.0));
600 maskSlopesRight.push_back (std::make_pair (1030, -20.0));
601 maskSlopesRight.push_back (std::make_pair (1031, -20.032));
602 maskSlopesRight.push_back (std::make_pair (1280, -28.000));
603 maskSlopesRight.push_back (std::make_pair (1281, -28.066));
604 maskSlopesRight.push_back (std::make_pair (1536, -45.000));
606 40, maskSlopesLeft, maskSlopesRight, tol),
611 maskSlopesLeft.clear ();
612 maskSlopesRight.clear ();
613 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
614 maskSlopesLeft.push_back (std::make_pair (255, -28.047));
615 maskSlopesLeft.push_back (std::make_pair (256, -28.000));
616 maskSlopesLeft.push_back (std::make_pair (505, -20.032));
617 maskSlopesLeft.push_back (std::make_pair (506, -20.0));
618 maskSlopesLeft.push_back (std::make_pair (510, -20.0));
619 maskSlopesLeft.push_back (std::make_pair (511, -20.0));
620 maskSlopesLeft.push_back (std::make_pair (523, -1.538));
621 maskSlopesRight.push_back (std::make_pair (1013, -1.538));
622 maskSlopesRight.push_back (std::make_pair (1025, -20.0));
623 maskSlopesRight.push_back (std::make_pair (1026, -20.0));
624 maskSlopesRight.push_back (std::make_pair (1030, -20.0));
625 maskSlopesRight.push_back (std::make_pair (1031, -20.032));
626 maskSlopesRight.push_back (std::make_pair (1280, -28.000));
627 maskSlopesRight.push_back (std::make_pair (1281, -28.047));
628 maskSlopesRight.push_back (std::make_pair (1536, -40.0));
630 40, maskSlopesLeft, maskSlopesRight, tol),
635 maskSlopesLeft.clear ();
636 maskSlopesRight.clear ();
637 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
638 maskSlopesLeft.push_back (std::make_pair (511, -28.033));
639 maskSlopesLeft.push_back (std::make_pair (512, -28.000));
640 maskSlopesLeft.push_back (std::make_pair (1017, -20.016));
641 maskSlopesLeft.push_back (std::make_pair (1018, -20.0));
642 maskSlopesLeft.push_back (std::make_pair (1022, -20.0));
643 maskSlopesLeft.push_back (std::make_pair (1023, -20.0));
644 maskSlopesLeft.push_back (std::make_pair (1035, -1.538));
645 maskSlopesRight.push_back (std::make_pair (2037, -1.538));
646 maskSlopesRight.push_back (std::make_pair (2049, -20.0));
647 maskSlopesRight.push_back (std::make_pair (2050, -20.0));
648 maskSlopesRight.push_back (std::make_pair (2054, -20.0));
649 maskSlopesRight.push_back (std::make_pair (2055, -20.016));
650 maskSlopesRight.push_back (std::make_pair (2560, -28.000));
651 maskSlopesRight.push_back (std::make_pair (2561, -28.033));
652 maskSlopesRight.push_back (std::make_pair (3072, -45.000));
654 80, maskSlopesLeft, maskSlopesRight, tol),
659 maskSlopesLeft.clear ();
660 maskSlopesRight.clear ();
661 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
662 maskSlopesLeft.push_back (std::make_pair (511, -28.023));
663 maskSlopesLeft.push_back (std::make_pair (512, -28.000));
664 maskSlopesLeft.push_back (std::make_pair (1017, -20.016));
665 maskSlopesLeft.push_back (std::make_pair (1018, -20.0));
666 maskSlopesLeft.push_back (std::make_pair (1022, -20.0));
667 maskSlopesLeft.push_back (std::make_pair (1023, -20.0));
668 maskSlopesLeft.push_back (std::make_pair (1035, -1.538));
669 maskSlopesRight.push_back (std::make_pair (2037, -1.538));
670 maskSlopesRight.push_back (std::make_pair (2049, -20.0));
671 maskSlopesRight.push_back (std::make_pair (2050, -20.0));
672 maskSlopesRight.push_back (std::make_pair (2054, -20.0));
673 maskSlopesRight.push_back (std::make_pair (2055, -20.016));
674 maskSlopesRight.push_back (std::make_pair (2560, -28.000));
675 maskSlopesRight.push_back (std::make_pair (2561, -28.023));
676 maskSlopesRight.push_back (std::make_pair (3072, -40.0));
678 80, maskSlopesLeft, maskSlopesRight, tol),
685 maskSlopesLeft.clear ();
686 maskSlopesRight.clear ();
687 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
688 maskSlopesLeft.push_back (std::make_pair (1023, -28.012));
689 maskSlopesLeft.push_back (std::make_pair (1024, -28.000));
690 maskSlopesLeft.push_back (std::make_pair (2041, -20.008));
691 maskSlopesLeft.push_back (std::make_pair (2042, -20.0));
692 maskSlopesLeft.push_back (std::make_pair (2046, -20.0));
693 maskSlopesLeft.push_back (std::make_pair (2047, -20.0));
694 maskSlopesLeft.push_back (std::make_pair (2059, -1.538));
695 maskSlopesRight.push_back (std::make_pair (4085, -1.538));
696 maskSlopesRight.push_back (std::make_pair (4097, -20.0));
697 maskSlopesRight.push_back (std::make_pair (4098, -20.0));
698 maskSlopesRight.push_back (std::make_pair (4102, -20.0));
699 maskSlopesRight.push_back (std::make_pair (4103, -20.008));
700 maskSlopesRight.push_back (std::make_pair (5120, -28.000));
701 maskSlopesRight.push_back (std::make_pair (5121, -28.012));
702 maskSlopesRight.push_back (std::make_pair (6144, -40.0));
704 160, maskSlopesLeft, maskSlopesRight, tol),
707 maskSlopesLeft.clear ();
708 maskSlopesRight.clear ();
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)
IndexPowerVect m_expectedLeftPsd
expected power values for left guard bandwidth
double m_tolerance
tolerance (in dB)
std::pair< uint32_t, double > IndexPowerPair
typedef for a pair of sub-band index and relative power value (dBr)
IndexPowerVect m_expectedRightPsd
expected power values for right guard bandwidth
WifiOfdmMaskSlopesTestCase(const char *str, WifiStandard standard, WifiPhyBand band, uint8_t bw, IndexPowerVect maskRefsLeft, IndexPowerVect maskRefsRight, double tol)
Constructor.
void DoRun(void) override
Implementation to actually run this TestCase.
virtual ~WifiOfdmMaskSlopesTestCase()
Ptr< SpectrumValue > m_actualSpectrum
actual spectrum value
static void InterpolateAndAppendValues(IndexPowerVect &vect, IndexPowerPair start, IndexPowerPair stop, double tol)
Interpolate PSD values for indexes between provided start and stop and append to provided vector.
Test suite for checking the consistency of different OFDM-based transmit masks.
WifiTransmitMaskTestSuite()
Values::const_iterator ConstValuesBegin() const
Values::const_iterator ConstValuesEnd() const
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file,...
#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.
#define NS_LOG_LOGIC(msg)
Use NS_LOG to output a message of level LOG_LOGIC.
#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.
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...
#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 ...
WifiStandard
Identifies the IEEE 802.11 specifications that a Wifi device can be configured to use.
WifiPhyBand
Identifies the PHY 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.
static WifiTransmitMaskTestSuite g_WifiTransmitMaskTestSuite