|
|
| 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; |
|
|
| 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% of power is within +/- 1MHz of center frequency, and 1% 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% each. |
| 75 |
// The two outer side bands contain roughly 0.5% each. |
| 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 |
} |