View | Details | Raw Unified | Return to bug 1775
Collapse All | Expand All

(-)a/src/lr-wpan/model/lr-wpan-spectrum-value-helper.cc (-20 / +18 lines)
 Lines 34-41    Link Here 
34
    NS_LOG_FUNCTION (this);
34
    NS_LOG_FUNCTION (this);
35
35
36
    Bands bands;
36
    Bands bands;
37
    // 1 MHz resolution from 2400 to 2483 MHz (center freq)
37
    // 1 MHz resolution, with center frequency of 2400, 2401, ... 2483
38
    for (int i = -1; i < 85; i++)
38
    // overall frequency span of 2399.5 MHz through 2483.5 MHz (83 bands)
39
    for (int i = -1; i < 83; i++)
39
      {
40
      {
40
        BandInfo bi;
41
        BandInfo bi;
41
        bi.fl = 2400.5e6 + i * 1.0e6;
42
        bi.fl = 2400.5e6 + i * 1.0e6;
 Lines 67-89    Link Here 
67
  // txPower is expressed in dBm. We must convert it into natural unit.
68
  // txPower is expressed in dBm. We must convert it into natural unit.
68
  txPower = pow (10., (txPower - 30) / 10);
69
  txPower = pow (10., (txPower - 30) / 10);
69
70
71
  // The effective occupied bandwidth of the signal is modelled to be 2 MHz.
72
  // 99.5% of power is within +/- 1MHz of center frequency, and 0.5% is outside.
73
  // There are 5 bands containing signal power.  The middle (center) band
74
  // contains half of the power.  The two inner side bands contain 49.5%.
75
  // The two outer side bands contain roughly 0.5%.
70
  double txPowerDensity = txPower / 2.0e6;
76
  double txPowerDensity = txPower / 2.0e6;
71
77
72
  NS_ASSERT_MSG ((channel >= 11 && channel <= 26), "Invalid channel numbers");
78
  NS_ASSERT_MSG ((channel >= 11 && channel <= 26), "Invalid channel numbers");
73
79
74
  // The channel assignment is in section 6.1.2.1
80
  // The channel assignment is in section 6.1.2.1
75
  // Table 25 specify the Tx PSD
81
  // Channel 11 centered at 2.405 GHz, 12 at 2.410 GHz, ... 26 at 2.480 GHz
76
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 5] = txPowerDensity * 0.01; // -20 dB
82
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 2] = txPowerDensity * 0.005;
77
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 4] = txPowerDensity * 0.01; // -20 dB
83
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 1] = txPowerDensity * 0.495;
78
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 3] = txPowerDensity * 0.1; // -10 dB
79
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 2] = txPowerDensity * 0.1; // -10 dB
80
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 1] = txPowerDensity * 0.5; // -3 dB
81
  (*txPsd)[2405 + 5 * (channel - 11) - 2400] = txPowerDensity; // center
84
  (*txPsd)[2405 + 5 * (channel - 11) - 2400] = txPowerDensity; // center
82
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 1 ] = txPowerDensity * 0.5; // -3 dB
85
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 1 ] = txPowerDensity * 0.495;
83
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 2 ] = txPowerDensity * 0.1; // -10 dB
86
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 2 ] = txPowerDensity * 0.005;
84
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 3 ] = txPowerDensity * 0.1; // -10 dB
87
85
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 4 ] = txPowerDensity * 0.01; // -20 dB
88
  // If more power is allocated to more subbands in future revisions of
86
  (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 5 ] = txPowerDensity * 0.01; // -20 dB
89
  // this model, make sure to renormalize so that the integral of the 
90
  // txPsd still equals txPower
87
91
88
  return txPsd;
92
  return txPsd;
89
}
93
}
 Lines 102-118    Link Here 
102
106
103
  NS_ASSERT_MSG ((channel >= 11 && channel <= 26), "Invalid channel numbers");
107
  NS_ASSERT_MSG ((channel >= 11 && channel <= 26), "Invalid channel numbers");
104
108
109
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 2] = noisePowerDensity;
105
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 1] = noisePowerDensity;
110
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 1] = noisePowerDensity;
106
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 2] = noisePowerDensity;
107
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 3] = noisePowerDensity;
108
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 4] = noisePowerDensity;
109
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 - 5] = noisePowerDensity;
110
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400] = noisePowerDensity;
111
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400] = noisePowerDensity;
111
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 1] = noisePowerDensity;
112
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 1] = noisePowerDensity;
112
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 2] = noisePowerDensity;
113
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 2] = noisePowerDensity;
113
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 3] = noisePowerDensity;
114
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 4] = noisePowerDensity;
115
  (*noisePsd)[2405 + 5 * (channel - 11) - 2400 + 5] = noisePowerDensity;
116
114
117
  return noisePsd;
115
  return noisePsd;
118
}
116
}

Return to bug 1775