24 #include "ns3/fatal-error.h" 25 #include "ns3/wifi-spectrum-value-helper.h" 26 #include "ns3/wifi-phy-standard.h" 75 virtual void DoRun (
void);
96 NS_ASSERT (maskRefsLeft.size () % 2 == 0 && maskRefsRight.size () % 2 == 0);
97 uint16_t freq = 5170 + (bw / 2);
98 double refTxPowerW = 1;
106 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw);
111 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw);
121 m_actualSpectrum = WifiSpectrumValueHelper::CreateOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw);
126 freq = 2402 + (bw / 2);
130 m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw);
135 NS_ASSERT (bw == 20 || bw == 40 || bw == 80 || bw == 160);
136 m_actualSpectrum = WifiSpectrumValueHelper::CreateHtOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw);
142 freq = 2402 + (bw / 2);
145 NS_ASSERT (bw == 20 || bw == 40 || bw == 80 || bw == 160);
146 m_actualSpectrum = WifiSpectrumValueHelper::CreateHeOfdmTxPowerSpectralDensity (freq, bw, refTxPowerW, bw);
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 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 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 maskSlopesLeft, maskSlopesRight, tol),
336 maskSlopesLeft, maskSlopesRight, tol),
343 maskSlopesLeft, maskSlopesRight, tol),
350 maskSlopesLeft.clear ();
351 maskSlopesRight.clear ();
352 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
353 maskSlopesLeft.push_back (std::make_pair (31, -28.531));
354 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
355 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
356 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
357 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
358 maskSlopesLeft.push_back (std::make_pair (62, -20.0));
359 maskSlopesLeft.push_back (std::make_pair (67, -3.333));
360 maskSlopesRight.push_back (std::make_pair (125, -3.333));
361 maskSlopesRight.push_back (std::make_pair (130, -20.0));
362 maskSlopesRight.push_back (std::make_pair (131, -20.0));
363 maskSlopesRight.push_back (std::make_pair (131, -20.0));
364 maskSlopesRight.push_back (std::make_pair (132, -20.276));
365 maskSlopesRight.push_back (std::make_pair (160, -28.000));
366 maskSlopesRight.push_back (std::make_pair (161, -28.531));
367 maskSlopesRight.push_back (std::make_pair (192, -45.000));
369 maskSlopesLeft, maskSlopesRight, tol),
374 maskSlopesLeft.clear ();
375 maskSlopesRight.clear ();
376 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
377 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
378 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
379 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
380 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
381 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
382 maskSlopesLeft.push_back (std::make_pair (62, -20.0));
383 maskSlopesLeft.push_back (std::make_pair (67, -3.333));
384 maskSlopesRight.push_back (std::make_pair (125, -3.333));
385 maskSlopesRight.push_back (std::make_pair (130, -20.0));
386 maskSlopesRight.push_back (std::make_pair (131, -20.0));
387 maskSlopesRight.push_back (std::make_pair (131, -20.0));
388 maskSlopesRight.push_back (std::make_pair (132, -20.276));
389 maskSlopesRight.push_back (std::make_pair (160, -28.000));
390 maskSlopesRight.push_back (std::make_pair (161, -28.375));
391 maskSlopesRight.push_back (std::make_pair (192, -40.0));
393 maskSlopesLeft, maskSlopesRight, tol),
398 maskSlopesLeft.clear ();
399 maskSlopesRight.clear ();
400 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
401 maskSlopesLeft.push_back (std::make_pair (63, -28.266));
402 maskSlopesLeft.push_back (std::make_pair (64, -28.000));
403 maskSlopesLeft.push_back (std::make_pair (124, -20.131));
404 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
405 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
406 maskSlopesLeft.push_back (std::make_pair (126, -20.0));
407 maskSlopesLeft.push_back (std::make_pair (131, -3.333));
408 maskSlopesRight.push_back (std::make_pair (253, -3.333));
409 maskSlopesRight.push_back (std::make_pair (258, -20.0));
410 maskSlopesRight.push_back (std::make_pair (259, -20.0));
411 maskSlopesRight.push_back (std::make_pair (259, -20.0));
412 maskSlopesRight.push_back (std::make_pair (260, -20.131));
413 maskSlopesRight.push_back (std::make_pair (320, -28.000));
414 maskSlopesRight.push_back (std::make_pair (321, -28.266));
415 maskSlopesRight.push_back (std::make_pair (384, -45.000));
417 maskSlopesLeft, maskSlopesRight, tol),
422 maskSlopesLeft.clear ();
423 maskSlopesRight.clear ();
424 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
425 maskSlopesLeft.push_back (std::make_pair (63, -28.188));
426 maskSlopesLeft.push_back (std::make_pair (64, -28.000));
427 maskSlopesLeft.push_back (std::make_pair (124, -20.131));
428 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
429 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
430 maskSlopesLeft.push_back (std::make_pair (126, -20.0));
431 maskSlopesLeft.push_back (std::make_pair (131, -3.333));
432 maskSlopesRight.push_back (std::make_pair (253, -3.333));
433 maskSlopesRight.push_back (std::make_pair (258, -20.0));
434 maskSlopesRight.push_back (std::make_pair (259, -20.0));
435 maskSlopesRight.push_back (std::make_pair (259, -20.0));
436 maskSlopesRight.push_back (std::make_pair (260, -20.131));
437 maskSlopesRight.push_back (std::make_pair (320, -28.000));
438 maskSlopesRight.push_back (std::make_pair (321, -28.188));
439 maskSlopesRight.push_back (std::make_pair (384, -40.0));
441 maskSlopesLeft, maskSlopesRight, tol),
448 maskSlopesLeft.clear ();
449 maskSlopesRight.clear ();
450 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
451 maskSlopesLeft.push_back (std::make_pair (31, -28.375));
452 maskSlopesLeft.push_back (std::make_pair (32, -28.000));
453 maskSlopesLeft.push_back (std::make_pair (60, -20.276));
454 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
455 maskSlopesLeft.push_back (std::make_pair (61, -20.0));
456 maskSlopesLeft.push_back (std::make_pair (62, -20.0));
457 maskSlopesLeft.push_back (std::make_pair (67, -3.333));
458 maskSlopesRight.push_back (std::make_pair (125, -3.333));
459 maskSlopesRight.push_back (std::make_pair (130, -20.0));
460 maskSlopesRight.push_back (std::make_pair (131, -20.0));
461 maskSlopesRight.push_back (std::make_pair (131, -20.0));
462 maskSlopesRight.push_back (std::make_pair (132, -20.276));
463 maskSlopesRight.push_back (std::make_pair (160, -28.000));
464 maskSlopesRight.push_back (std::make_pair (161, -28.375));
465 maskSlopesRight.push_back (std::make_pair (192, -40.0));
467 maskSlopesLeft, maskSlopesRight, tol),
472 maskSlopesLeft.clear ();
473 maskSlopesRight.clear ();
474 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
475 maskSlopesLeft.push_back (std::make_pair (63, -28.188));
476 maskSlopesLeft.push_back (std::make_pair (64, -28.000));
477 maskSlopesLeft.push_back (std::make_pair (124, -20.131));
478 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
479 maskSlopesLeft.push_back (std::make_pair (125, -20.0));
480 maskSlopesLeft.push_back (std::make_pair (126, -20.0));
481 maskSlopesLeft.push_back (std::make_pair (131, -3.333));
482 maskSlopesRight.push_back (std::make_pair (253, -3.333));
483 maskSlopesRight.push_back (std::make_pair (258, -20.0));
484 maskSlopesRight.push_back (std::make_pair (259, -20.0));
485 maskSlopesRight.push_back (std::make_pair (259, -20.0));
486 maskSlopesRight.push_back (std::make_pair (260, -20.131));
487 maskSlopesRight.push_back (std::make_pair (320, -28.000));
488 maskSlopesRight.push_back (std::make_pair (321, -28.188));
489 maskSlopesRight.push_back (std::make_pair (384, -40.0));
491 maskSlopesLeft, maskSlopesRight, tol),
496 maskSlopesLeft.clear ();
497 maskSlopesRight.clear ();
498 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
499 maskSlopesLeft.push_back (std::make_pair (127, -28.094));
500 maskSlopesLeft.push_back (std::make_pair (128, -28.000));
501 maskSlopesLeft.push_back (std::make_pair (252, -20.064));
502 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
503 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
504 maskSlopesLeft.push_back (std::make_pair (254, -20.0));
505 maskSlopesLeft.push_back (std::make_pair (259, -3.333));
506 maskSlopesRight.push_back (std::make_pair (509, -3.333));
507 maskSlopesRight.push_back (std::make_pair (514, -20.0));
508 maskSlopesRight.push_back (std::make_pair (515, -20.0));
509 maskSlopesRight.push_back (std::make_pair (515, -20.0));
510 maskSlopesRight.push_back (std::make_pair (516, -20.064));
511 maskSlopesRight.push_back (std::make_pair (640, -28.000));
512 maskSlopesRight.push_back (std::make_pair (641, -28.094));
513 maskSlopesRight.push_back (std::make_pair (768, -40.0));
515 maskSlopesLeft, maskSlopesRight, tol),
520 maskSlopesLeft.clear ();
521 maskSlopesRight.clear ();
522 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
523 maskSlopesLeft.push_back (std::make_pair (255, -28.047));
524 maskSlopesLeft.push_back (std::make_pair (256, -28.000));
525 maskSlopesLeft.push_back (std::make_pair (508, -20.032));
526 maskSlopesLeft.push_back (std::make_pair (509, -20.0));
527 maskSlopesLeft.push_back (std::make_pair (509, -20.0));
528 maskSlopesLeft.push_back (std::make_pair (510, -20.0));
529 maskSlopesLeft.push_back (std::make_pair (515, -3.333));
530 maskSlopesRight.push_back (std::make_pair (1021, -3.333));
531 maskSlopesRight.push_back (std::make_pair (1026, -20.0));
532 maskSlopesRight.push_back (std::make_pair (1027, -20.0));
533 maskSlopesRight.push_back (std::make_pair (1027, -20.0));
534 maskSlopesRight.push_back (std::make_pair (1028, -20.032));
535 maskSlopesRight.push_back (std::make_pair (1280, -28.000));
536 maskSlopesRight.push_back (std::make_pair (1281, -28.047));
537 maskSlopesRight.push_back (std::make_pair (1536, -40.0));
539 maskSlopesLeft, maskSlopesRight, tol),
546 maskSlopesLeft.clear ();
547 maskSlopesRight.clear ();
548 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
549 maskSlopesLeft.push_back (std::make_pair (127, -28.133));
550 maskSlopesLeft.push_back (std::make_pair (128, -28.000));
551 maskSlopesLeft.push_back (std::make_pair (252, -20.064));
552 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
553 maskSlopesLeft.push_back (std::make_pair (255, -20.0));
554 maskSlopesLeft.push_back (std::make_pair (256, -20.0));
555 maskSlopesLeft.push_back (std::make_pair (261, -3.333));
556 maskSlopesRight.push_back (std::make_pair (507, -3.333));
557 maskSlopesRight.push_back (std::make_pair (512, -20.0));
558 maskSlopesRight.push_back (std::make_pair (513, -20.0));
559 maskSlopesRight.push_back (std::make_pair (515, -20.0));
560 maskSlopesRight.push_back (std::make_pair (516, -20.064));
561 maskSlopesRight.push_back (std::make_pair (640, -28.000));
562 maskSlopesRight.push_back (std::make_pair (641, -28.133));
563 maskSlopesRight.push_back (std::make_pair (768, -45.000));
565 maskSlopesLeft, maskSlopesRight, tol),
570 maskSlopesLeft.clear ();
571 maskSlopesRight.clear ();
572 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
573 maskSlopesLeft.push_back (std::make_pair (127, -28.094));
574 maskSlopesLeft.push_back (std::make_pair (128, -28.000));
575 maskSlopesLeft.push_back (std::make_pair (252, -20.064));
576 maskSlopesLeft.push_back (std::make_pair (253, -20.0));
577 maskSlopesLeft.push_back (std::make_pair (255, -20.0));
578 maskSlopesLeft.push_back (std::make_pair (256, -20.0));
579 maskSlopesLeft.push_back (std::make_pair (261, -3.333));
580 maskSlopesRight.push_back (std::make_pair (507, -3.333));
581 maskSlopesRight.push_back (std::make_pair (512, -20.0));
582 maskSlopesRight.push_back (std::make_pair (513, -20.0));
583 maskSlopesRight.push_back (std::make_pair (515, -20.0));
584 maskSlopesRight.push_back (std::make_pair (516, -20.064));
585 maskSlopesRight.push_back (std::make_pair (640, -28.000));
586 maskSlopesRight.push_back (std::make_pair (641, -28.094));
587 maskSlopesRight.push_back (std::make_pair (768, -40.0));
589 maskSlopesLeft, maskSlopesRight, tol),
594 maskSlopesLeft.clear ();
595 maskSlopesRight.clear ();
596 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
597 maskSlopesLeft.push_back (std::make_pair (255, -28.066));
598 maskSlopesLeft.push_back (std::make_pair (256, -28.000));
599 maskSlopesLeft.push_back (std::make_pair (505, -20.032));
600 maskSlopesLeft.push_back (std::make_pair (506, -20.0));
601 maskSlopesLeft.push_back (std::make_pair (510, -20.0));
602 maskSlopesLeft.push_back (std::make_pair (511, -20.0));
603 maskSlopesLeft.push_back (std::make_pair (523, -1.538));
604 maskSlopesRight.push_back (std::make_pair (1013, -1.538));
605 maskSlopesRight.push_back (std::make_pair (1025, -20.0));
606 maskSlopesRight.push_back (std::make_pair (1026, -20.0));
607 maskSlopesRight.push_back (std::make_pair (1030, -20.0));
608 maskSlopesRight.push_back (std::make_pair (1031, -20.032));
609 maskSlopesRight.push_back (std::make_pair (1280, -28.000));
610 maskSlopesRight.push_back (std::make_pair (1281, -28.066));
611 maskSlopesRight.push_back (std::make_pair (1536, -45.000));
613 maskSlopesLeft, maskSlopesRight, tol),
618 maskSlopesLeft.clear ();
619 maskSlopesRight.clear ();
620 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
621 maskSlopesLeft.push_back (std::make_pair (255, -28.047));
622 maskSlopesLeft.push_back (std::make_pair (256, -28.000));
623 maskSlopesLeft.push_back (std::make_pair (505, -20.032));
624 maskSlopesLeft.push_back (std::make_pair (506, -20.0));
625 maskSlopesLeft.push_back (std::make_pair (510, -20.0));
626 maskSlopesLeft.push_back (std::make_pair (511, -20.0));
627 maskSlopesLeft.push_back (std::make_pair (523, -1.538));
628 maskSlopesRight.push_back (std::make_pair (1013, -1.538));
629 maskSlopesRight.push_back (std::make_pair (1025, -20.0));
630 maskSlopesRight.push_back (std::make_pair (1026, -20.0));
631 maskSlopesRight.push_back (std::make_pair (1030, -20.0));
632 maskSlopesRight.push_back (std::make_pair (1031, -20.032));
633 maskSlopesRight.push_back (std::make_pair (1280, -28.000));
634 maskSlopesRight.push_back (std::make_pair (1281, -28.047));
635 maskSlopesRight.push_back (std::make_pair (1536, -40.0));
637 maskSlopesLeft, maskSlopesRight, tol),
642 maskSlopesLeft.clear ();
643 maskSlopesRight.clear ();
644 maskSlopesLeft.push_back (std::make_pair (0, -45.000));
645 maskSlopesLeft.push_back (std::make_pair (511, -28.033));
646 maskSlopesLeft.push_back (std::make_pair (512, -28.000));
647 maskSlopesLeft.push_back (std::make_pair (1017, -20.016));
648 maskSlopesLeft.push_back (std::make_pair (1018, -20.0));
649 maskSlopesLeft.push_back (std::make_pair (1022, -20.0));
650 maskSlopesLeft.push_back (std::make_pair (1023, -20.0));
651 maskSlopesLeft.push_back (std::make_pair (1035, -1.538));
652 maskSlopesRight.push_back (std::make_pair (2037, -1.538));
653 maskSlopesRight.push_back (std::make_pair (2049, -20.0));
654 maskSlopesRight.push_back (std::make_pair (2050, -20.0));
655 maskSlopesRight.push_back (std::make_pair (2054, -20.0));
656 maskSlopesRight.push_back (std::make_pair (2055, -20.016));
657 maskSlopesRight.push_back (std::make_pair (2560, -28.000));
658 maskSlopesRight.push_back (std::make_pair (2561, -28.033));
659 maskSlopesRight.push_back (std::make_pair (3072, -45.000));
661 maskSlopesLeft, maskSlopesRight, tol),
666 maskSlopesLeft.clear ();
667 maskSlopesRight.clear ();
668 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
669 maskSlopesLeft.push_back (std::make_pair (511, -28.023));
670 maskSlopesLeft.push_back (std::make_pair (512, -28.000));
671 maskSlopesLeft.push_back (std::make_pair (1017, -20.016));
672 maskSlopesLeft.push_back (std::make_pair (1018, -20.0));
673 maskSlopesLeft.push_back (std::make_pair (1022, -20.0));
674 maskSlopesLeft.push_back (std::make_pair (1023, -20.0));
675 maskSlopesLeft.push_back (std::make_pair (1035, -1.538));
676 maskSlopesRight.push_back (std::make_pair (2037, -1.538));
677 maskSlopesRight.push_back (std::make_pair (2049, -20.0));
678 maskSlopesRight.push_back (std::make_pair (2050, -20.0));
679 maskSlopesRight.push_back (std::make_pair (2054, -20.0));
680 maskSlopesRight.push_back (std::make_pair (2055, -20.016));
681 maskSlopesRight.push_back (std::make_pair (2560, -28.000));
682 maskSlopesRight.push_back (std::make_pair (2561, -28.023));
683 maskSlopesRight.push_back (std::make_pair (3072, -40.0));
685 maskSlopesLeft, maskSlopesRight, tol),
692 maskSlopesLeft.clear ();
693 maskSlopesRight.clear ();
694 maskSlopesLeft.push_back (std::make_pair (0, -40.0));
695 maskSlopesLeft.push_back (std::make_pair (1023, -28.012));
696 maskSlopesLeft.push_back (std::make_pair (1024, -28.000));
697 maskSlopesLeft.push_back (std::make_pair (2041, -20.008));
698 maskSlopesLeft.push_back (std::make_pair (2042, -20.0));
699 maskSlopesLeft.push_back (std::make_pair (2046, -20.0));
700 maskSlopesLeft.push_back (std::make_pair (2047, -20.0));
701 maskSlopesLeft.push_back (std::make_pair (2059, -1.538));
702 maskSlopesRight.push_back (std::make_pair (4085, -1.538));
703 maskSlopesRight.push_back (std::make_pair (4097, -20.0));
704 maskSlopesRight.push_back (std::make_pair (4098, -20.0));
705 maskSlopesRight.push_back (std::make_pair (4102, -20.0));
706 maskSlopesRight.push_back (std::make_pair (4103, -20.008));
707 maskSlopesRight.push_back (std::make_pair (5120, -28.000));
708 maskSlopesRight.push_back (std::make_pair (5121, -28.012));
709 maskSlopesRight.push_back (std::make_pair (6144, -40.0));
711 maskSlopesLeft, maskSlopesRight, tol),
ERP-OFDM PHY (Clause 19, Section 19.5)
Ptr< SpectrumValue > m_actualSpectrum
actual spectrum value
#define NS_LOG_FUNCTION(parameters)
If log level LOG_FUNCTION is enabled, this macro will output all input parameters separated by "...
OFDM PHY for the 5 GHz band (Clause 17 with 5 MHz channel bandwidth)
Test suite for checking the consistency of different OFDM-based transmit masks.
HT PHY for the 5 GHz band (clause 20)
IndexPowerVect m_expectedLeftPsd
expected power values for left guard bandwidth
WifiOfdmMaskSlopesTestCase(const char *str, WifiPhyStandard standard, uint8_t bw, IndexPowerVect maskRefsLeft, IndexPowerVect maskRefsRight, double tol)
Constructor.
double m_tolerance
tolerance (in dB)
Test checks if Wifi spectrum values for OFDM are generated properly.
#define NS_ASSERT(condition)
At runtime, in debugging builds, if this condition is not true, the program prints the source file...
#define NS_LOG_COMPONENT_DEFINE(name)
Define a Log component with a specific name.
std::pair< uint32_t, double > IndexPowerPair
typedef for a pair of sub-band index and relative power value (dBr)
HE PHY for the 2.4 GHz band (clause 26)
OFDM PHY for the 5 GHz band (Clause 17 with 10 MHz channel bandwidth)
#define NS_LOG_INFO(msg)
Use NS_LOG to output a message of level LOG_INFO.
#define NS_FATAL_ERROR(msg)
Report a fatal error with a message and terminate.
HT PHY for the 2.4 GHz band (clause 20)
Values::const_iterator ConstValuesBegin() const
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...
WifiPhyStandard
Identifies the PHY specification that a Wifi device is configured to use.
HE PHY for the 5 GHz band (clause 26)
void AddTestCase(TestCase *testCase, TestDuration duration=QUICK)
Add an individual child TestCase to this test suite.
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 ...
IndexPowerVect m_expectedRightPsd
expected power values for right guard bandwidth
This is intended to be the configuration used in this paper: Gavin Holland, Nitin Vaidya and Paramvir...
virtual ~WifiOfdmMaskSlopesTestCase()
OFDM PHY for the 5 GHz band (Clause 17)
Every class exported by the ns3 library is enclosed in the ns3 namespace.
Values::const_iterator ConstValuesEnd() const
WifiTransmitMaskTestSuite()
std::vector< IndexPowerPair > IndexPowerVect
typedef for a vector of pairs of sub-band index and relative power value (dBr)
NS_LOG_LOGIC("Net device "<< nd<< " is not bridged")
static WifiTransmitMaskTestSuite g_WifiTransmitMaskTestSuite
virtual void DoRun(void)
Implementation to actually run this TestCase.