Bugzilla – Bug 2492
RxGain in uan-phy-gen.cc not functional
Last modified: 2017-08-17 11:28:51 UTC
The RxGain attribute in the UanPhyGen class does not appear to be used anywhere. It does not ever affect the received power level, as it should. My suggestion would be to add a line such as "rxPowerDb += m_rxGainDb;" either in UanPhyGen::StartRxPacket or someplace else?
there seems to be two issue here. m_rxGainDb seems to have been copied from Yans wifi phy... and guess what, it's not being used even in that model. Issue 1) yans wifi phy (tom/tommaso any hint here?) Issue 2) (current ticket) UAN phy I agree that the sum should be done in ::StartRxPacket. I can't be done anywhere else since: - transducer should have its own gain - m_rxGainDb is related to PHY (maybe due to emulation of equalizer etc...) - it will be also used by PHY for SINR calculations
(In reply to Federico Guerra from comment #1) > there seems to be two issue here. > m_rxGainDb seems to have been copied from Yans wifi phy... and guess what, > it's not being used even in that model. > > Issue 1) yans wifi phy (tom/tommaso any hint here?) It is used in both SpectrumWifiPhy and YansWifiPhy models.
(In reply to Tom Henderson from comment #2) > (In reply to Federico Guerra from comment #1) > > there seems to be two issue here. > > m_rxGainDb seems to have been copied from Yans wifi phy... and guess what, > > it's not being used even in that model. > > > > Issue 1) yans wifi phy (tom/tommaso any hint here?) > > It is used in both SpectrumWifiPhy and YansWifiPhy models. Actively used or only set and get action? Thanks I'll re check the code then ASAP
Created attachment 2603 [details] proposed patch.
hello, proposed patch attached. Randall, let me know if this is OK with you. thanks Federico
Fine by me. I implemented this and it seems to work OK.
thanks Randall. Tom, the patch is all yours :)
What does the last 'db re uPa' string mean in this log message? Could you make it more clear? NS_LOG_DEBUG ("PHY " << m_mac->GetAddress () << ": rx power after RX gain = " << rxPowerDb << " db re uPa");
Hi Tom, it's official nomenclature of the underwater acoustic power measurement unit, used in the whole model. it means "dB relative to micro Pascal", hence dB re(lative) to u(micro, it should the greek "mu" actually, but with ascii you usually use "u")Pa(scal)". when you say db in underwater acoustic you really mean db re uPa.
pushed in 12365:1ff7fc1e6ba7
Created attachment 2834 [details] Moves RxGain calculation to uan-transducer-hd In doing some more testing on this, I believe our previous patch was an incorrect fix. This applied the gain only to the packet being received, but to all other arrivals (at least when using uan-transducer-hd), the gain was not applied, resulting in incorrect interference calculations. I have attached a second proposed patch which moves the RX gain to be added in uan-transducer-hd instead. This way, it gets applied to ALL arrivals, not just the packet actively being received. I have attached a new patch.
(In reply to Randall Plate from comment #11) > Created attachment 2834 [details] > Moves RxGain calculation to uan-transducer-hd > > In doing some more testing on this, I believe our previous patch was an > incorrect fix. This applied the gain only to the packet being received, but > to all other arrivals (at least when using uan-transducer-hd), the gain was > not applied, resulting in incorrect interference calculations. I have > attached a second proposed patch which moves the RX gain to be added in > uan-transducer-hd instead. This way, it gets applied to ALL arrivals, not > just the packet actively being received. I have attached a new patch. Hi Randall, I would make two small modifications to this patch: 1) add a SetGainDb (double RxGainDb) function to transducer and its parent class. 2) rename ApplyRxGain to ApplyRxGainDb thanks
(In reply to Federico Guerra from comment #12) > (In reply to Randall Plate from comment #11) > > Created attachment 2834 [details] > > Moves RxGain calculation to uan-transducer-hd > > > > In doing some more testing on this, I believe our previous patch was an > > incorrect fix. This applied the gain only to the packet being received, but > > to all other arrivals (at least when using uan-transducer-hd), the gain was > > not applied, resulting in incorrect interference calculations. I have > > attached a second proposed patch which moves the RX gain to be added in > > uan-transducer-hd instead. This way, it gets applied to ALL arrivals, not > > just the packet actively being received. I have attached a new patch. > > Hi Randall, > I would make two small modifications to this patch: > 1) add a SetGainDb (double RxGainDb) function to transducer and its parent > class. > 2) rename ApplyRxGain to ApplyRxGainDb > > thanks Furthermore we need to clarify what's the desired meaning of this rxGain. if it has to be considered as an "antenna" gain then this patch should be ok on the contrary, if it has to be considered as "RxPenaltydB" param in NS-Miracle, i.e. db gain/penalty to be added to SINR/PER computation of the received packet (i.e. no interference) then we the modifications should be different (or non-existant, I need to verify the code).
Created attachment 2903 [details] updated patch Tom, Randall, I've partially modified the patch, by moving some primitives to the correct Transducer interface API, and then by changing some names.
pushed in changeset 13045:db301bf6b92f