Bug 2783

Summary: WifiPhy::NotifyMonitorSniffRx() is insensitive to RxNoiseFigure
Product: ns-3 Reporter: Tom Henderson <tomh>
Component: wifiAssignee: sebastien.deronne
Status: RESOLVED FIXED    
Severity: normal CC: Izydor.sokoler, ns-bugs
Priority: P3    
Version: unspecified   
Hardware: All   
OS: All   

Description Tom Henderson 2017-09-15 01:43:26 UTC
NotifyMonitorSniffRx() reports signal and noise as follows (line 2550 in wifi-phy.cc):

          signalNoise.signal = RatioToDb (event->GetRxPowerW ()) + 30;
          signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;

However, RxNoiseFigure is already accounted for in the snrPer calculation of InterferenceHelper.

A user (Izydor Sokoler) suggests this statement instead:

          signalNoise.noise = RatioToDb (event->GetRxPowerW () / snrPer.snr) + 30;

and complained that, e.g. the wifi-spectrum-per-example.cc, which reports this trace as the SNR, is insensitive to changing RxNoiseFigure values.
Comment 1 sebastien.deronne 2017-09-20 16:50:33 UTC
I agree with the proposed change.
Comment 2 Tom Henderson 2017-09-21 12:56:36 UTC
Before the patch:
----------------
$ ./waf --run 'wifi-spectrum-per-example --ns3::WifiPhy::RxNoiseFigure=7'

wifiType: ns3::SpectrumWifiPhy distance: 50m; sent: 1000 TxPower: 1 dBm (1.3 mW)
index   MCS Rate (Mb/s) Tput (Mb/s) Received Signal (dBm) Noise (dBm)  SNR (dB)
    0     0       6.5     5.76513    7414    -79.6633    -100.966     21.3027
    1     1        13       11.58   14892    -79.6633    -100.966     21.3027
    2     2      19.5     17.3856   22358    -79.6633    -100.966     21.3027
    3     3        26     22.9991   29577    -79.6633    -100.966     21.3027
    4     4        39           0       0         N/A         N/A         N/A

$ ./waf --run 'wifi-spectrum-per-example --ns3::WifiPhy::RxNoiseFigure=10'

wifiType: ns3::SpectrumWifiPhy distance: 50m; sent: 1000 TxPower: 1 dBm (1.3 mW)
index   MCS Rate (Mb/s) Tput (Mb/s) Received Signal (dBm) Noise (dBm)  SNR (dB)
    0     0       6.5     5.76513    7414    -79.6633    -100.966     21.3027
    1     1        13       11.58   14892    -79.6633    -100.966     21.3027
    2     2      19.5     17.3825   22354    -79.6633    -100.966     21.3027
    3     3        26           0       0         N/A         N/A         N/A


After the patch:
----------------
$ ./waf --run 'wifi-spectrum-per-example --ns3::WifiPhy::RxNoiseFigure=7'

wifiType: ns3::SpectrumWifiPhy distance: 50m; sent: 1000 TxPower: 1 dBm (1.3 mW)
index   MCS Rate (Mb/s) Tput (Mb/s) Received Signal (dBm) Noise (dBm)  SNR (dB)
    0     0       6.5     5.76513    7414    -79.6633     -93.966     14.3027
    1     1        13       11.58   14892    -79.6633     -93.966     14.3027
    2     2      19.5     17.3856   22358    -79.6633     -93.966     14.3027
    3     3        26     22.9991   29577    -79.6633     -93.966     14.3027
    4     4        39           0       0         N/A         N/A         N/A

$ ./waf --run 'wifi-spectrum-per-example --ns3::WifiPhy::RxNoiseFigure=10'

wifiType: ns3::SpectrumWifiPhy distance: 50m; sent: 1000 TxPower: 1 dBm (1.3 mW)
index   MCS Rate (Mb/s) Tput (Mb/s) Received Signal (dBm) Noise (dBm)  SNR (dB)
    0     0       6.5     5.76513    7414    -79.6633     -90.966     11.3027
    1     1        13       11.58   14892    -79.6633     -90.966     11.3027
    2     2      19.5     17.3825   22354    -79.6633     -90.966     11.3027
    3     3        26           0       0         N/A         N/A         N/A

i.e. performance is not affected by the patch, but reporting of SNR is.  Conceptually, this patch shifts the point of SNR measurement from input to output of amplifier, but this is probably what is expected by users.  I will update and also update documentation (doxygen and manual) about this.
Comment 3 Tom Henderson 2017-09-22 12:46:15 UTC
fixed in changeset 13076:a04e85356951
Comment 4 sebastien.deronne 2017-09-26 02:43:02 UTC
*** Bug 2784 has been marked as a duplicate of this bug. ***