|
Bugzilla – Full Text Bug Listing |
| Summary: | lr-wpan spectrum-value-helper Create TxPsd function | ||
|---|---|---|---|
| Product: | ns-3 | Reporter: | Liang Huo <L.Huo> |
| Component: | lr-wpan | Assignee: | Tom Henderson <tomh> |
| Status: | RESOLVED FIXED | ||
| Severity: | enhancement | CC: | jopen, ns-bugs, tommaso.pecorella |
| Priority: | P5 | ||
| Version: | pre-release | ||
| Hardware: | All | ||
| OS: | All | ||
| Attachments: |
patch to fix the PSD
sample program patch to fix TX and noise PSD |
||
|
Description
Liang Huo
2013-10-17 12:18:18 UTC
(In reply to Liang Huo from comment #0) > Note that in LrWpanSpectrumValueHelper::CreateTxPowerSpectralDensity > > double txPowerDensity = txPower / 2.0e6; > > (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 5] = txPowerDensity * 0.01; // > -20 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 4] = txPowerDensity * 0.01; // > -20 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 3] = txPowerDensity * 0.1; // > -10 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 2] = txPowerDensity * 0.1; // > -10 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 - 1] = txPowerDensity * 0.5; // -3 > dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400] = txPowerDensity; // center > (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 1 ] = txPowerDensity * 0.5; // > -3 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 2 ] = txPowerDensity * 0.1; // > -10 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 3 ] = txPowerDensity * 0.1; // > -10 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 4 ] = txPowerDensity * 0.01; // > -20 dB > (*txPsd)[2405 + 5 * (channel - 11) - 2400 + 5 ] = txPowerDensity * 0.01; // > -20 dB > > The weight of txPowerDensity is not normalized to 1. It is currently 1.22 I agree that this needs to be normalized as you suggest. > > http://code.nsnam.org/tomh/ns-3-lr-wpan/file/60fda85f5921/src/lr-wpan/test/ > lr-wpan-spectrum-value-helper-test.cc#l60 > says if the error is less than 25%, the it is accpeted. Why? Where is this > 25% threshold defined in 802.15.4? Like shown above, due to not being > normalized to 1, the current error is 22%.(1.22-1=0.22) I don't recall the reason for that error margin; however, upon reviewing it again tonight, I think it should be changed. I will look into either a more meaningful test or else putting an assert check in the code itself to ensure that a correct PSD is generated. Created attachment 1729 [details]
patch to fix the PSD
This attachment generates a normalized PSD.
Created attachment 1730 [details]
sample program
This program can be used to verify the normalized PSD; it will be turned into a test.
I believe that the attached patch (as verified by the sample program) will fix the reported issue. Created attachment 1738 [details]
patch to fix TX and noise PSD
I think the proposed patch fixed the problem. However, i think the noise PSD should then also make use of five subbands only. I changed this and corrected a comment in the original patch.
The patch states that a 2 MHz channel is modelled. However, the channel is actually modelled with 3 MHz. Each subband is 1 MHz wide, so there are +- 1.5 MHz around the center frequency. This could be changed by using an even number of subbands, instead of an odd number centered on the center frequency.
(In reply to Sascha Jopen from comment #5) > Created attachment 1738 [details] > patch to fix TX and noise PSD > > I think the proposed patch fixed the problem. However, i think the noise PSD > should then also make use of five subbands only. I changed this and > corrected a comment in the original patch. > > The patch states that a 2 MHz channel is modelled. However, the channel is > actually modelled with 3 MHz. Each subband is 1 MHz wide, so there are +- > 1.5 MHz around the center frequency. This could be changed by using an even > number of subbands, instead of an odd number centered on the center > frequency. I agree with your improvements and can change the comment to state "3 MHz width with 5 MHz spacing". If no other comments, I will generate a test case and commit at some point in the near future. It's fixed in http://code.nsnam.org/lr-wpan/ns-3-lr-wpan/ |