Bug 1885

Summary: WifiSpectrumValue5MhzFactory::CreateRfFilter does not align with the used 5Mhz SpectrumModel
Product: ns-3 Reporter: Taqi <takai.kenn>
Component: spectrumAssignee: Nicola Baldo <nicola>
Status: RESOLVED FIXED    
Severity: minor CC: ns-bugs
Priority: P5    
Version: ns-3-dev   
Hardware: PC   
OS: Linux   

Description Taqi 2014-03-17 07:20:31 UTC
Assuming the channel in CreateRfFilter(uint32_t channel) represents the same channel in CreateTxPowerSpectralDensity (double txPower, uint32_t channel), then the configuration of the filter:

  (*rf)[channel - 1] = 1;
  (*rf)[channel    ] = 1;
  (*rf)[channel + 1] = 1;
  (*rf)[channel + 2] = 1;

should be with an offset as in CreateTxPowerSpectralDensity:

  (*txPsd)[channel + 3] = 1;
  (*txPsd)[channel + 4] = 1;
  (*txPsd)[channel + 5] = 1;
  (*txPsd)[channel + 6] = 1;
Comment 1 Nicola Baldo 2014-03-17 07:31:57 UTC
Hi Taqi,

you're right, the implementation of CeateRfFilter() is inconsistent. Anyway, there is currently no code using this method. Do you have a use case for it? If so, it would make sense to fix the implementation. Otherwise, I would just remove it.
Comment 2 Taqi 2014-03-17 08:51:50 UTC
Actually I use WifiSpectrumValue5MhzFactory to generate Spectrum Values and Rf Filters for a spectrum sensor implementation I am working on. I can re-implement the functionality though, if you see it is not worth keeping in ns-3 code.
Comment 3 Nicola Baldo 2014-03-17 08:56:22 UTC
Well if there is at least one person finding it useful it makes sense to keep it!
I just fixed it in changeset ad359a6b7e7d.