how i get SNR and SINR values?

3,076 views
Skip to first unread message

meriemsmache

unread,
Apr 19, 2012, 6:53:48 AM4/19/12
to ns-3-users
hello ns3-users
i need to calculate IR (interfernce ration), i know that IR =( SINR/
SNR)
SINR is Signal to Interference plus Noise Ratio and SNR is Signal-to-
noise ratio
i know that SNR and SINR are calculated in interference helper
So , could someone give me an idea (guide me )how i call those
value (snr and sinr)?

陈旋

unread,
Apr 19, 2012, 8:17:14 AM4/19/12
to ns-3-...@googlegroups.com
I found it is hard because of no interface to call them. when i set up a wifi network, it seems to be called by the model  function. if you must, i think you can modify the model.

2012/4/19 meriemsmache <merie...@yahoo.fr>

--
You received this message because you are subscribed to the Google Groups "ns-3-users" group.
To post to this group, send email to ns-3-...@googlegroups.com.
To unsubscribe from this group, send email to ns-3-users+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/ns-3-users?hl=en.


Smach Meriem

unread,
Apr 19, 2012, 1:31:29 PM4/19/12
to ns-3-...@googlegroups.com
hello
it's me again i'm new in ns-3 , so please can u explain for me how u did that ?
can u give an example please ,
 thank you


De : Smach Meriem <merie...@yahoo.fr>
À : ns-3-...@googlegroups.com
Envoyé le : Jeudi 19 avril 2012 17h52
Objet : Re : how i get SNR and SINR values?

thank u very much  
but can explain 4 me how u did that please?

De : 陈旋 <hitch...@gmail.com>
À : ns-3-...@googlegroups.com
Envoyé le : Jeudi 19 avril 2012 14h17
Objet : Re: how i get SNR and SINR values?

陈旋

unread,
Apr 20, 2012, 7:40:24 AM4/20/12
to ns-3-...@googlegroups.com
void
771 YansWifiPhy::EndReceive (Ptr<Packet> packet, Ptr<InterferenceHelper::Event> event)
772 {
773 NS_LOG_FUNCTION (this << packet << event);
774 NS_ASSERT (IsStateRx ());
775 NS_ASSERT (event->GetEndTime () == Simulator::Now ());
777 struct InterferenceHelper::SnrPer snrPer;
778 snrPer = m_interference.CalculateSnrPer (event);
779 m_interference.NotifyRxEnd ();
781 NS_LOG_DEBUG ("mode=" << (event->GetPayloadMode ().GetDataRate ()) <<
782 ", snr=" << snrPer.snr << ", per=" << snrPer.per << ", size=" << packet->GetSize ());
783 if (m_random.GetValue () > snrPer.per)
784 {
785 NotifyRxEnd (packet);
786 uint32_t dataRate500KbpsUnits = event->GetPayloadMode ().GetDataRate () / 500000;
787 bool isShortPreamble = (WIFI_PREAMBLE_SHORT == event->GetPreambleType ());
788 double signalDbm = RatioToDb (event->GetRxPowerW ()) + 30;
789 double noiseDbm = RatioToDb (event->GetRxPowerW () / snrPer.snr) - GetRxNoiseFigure () + 30;
790 NotifyMonitorSniffRx (packet, (uint16_t)GetChannelFrequencyMhz (), GetChannelNumber (), dataRate500KbpsUnits, isShortPreamble, signalDbm, noiseDbm);
791 m_state->SwitchFromRxEndOk (packet, snrPer.snr, event->GetPayloadMode (), event->GetPreambleType ());
792 }
793 else
794 {
795 /* failure. */
796 NotifyRxDrop (packet);
797 m_state->SwitchFromRxEndError (packet, snrPer.snr);
798 }
if you want to get the s or n or i, you can have a look at the YansWifiPhy.cc/.h.
m_interference is a complex class depending on the wifiphy. so i think you can only get it in the source code in the yanswifiphy.cc

2012/4/20 Smach Meriem <merie...@yahoo.fr>

Smach Meriem

unread,
Apr 20, 2012, 7:53:00 AM4/20/12
to ns-3-...@googlegroups.com
ok thank u very much
 i think i  understand your idea , i will create a new file .cc /.h  in wich i will tag the value of snr and sinr in packet


Envoyé le : Vendredi 20 avril 2012 13h40
Objet : Re: Re : how i get SNR and SINR values?

mohsenhs

unread,
Apr 21, 2014, 9:07:06 PM4/21/14
to ns-3-...@googlegroups.com, Smach Meriem
Hi Meriem

I have the same problem and I need to get IR, If you have done anything could you share it with me plz. Any help is highly appreciated.

Sincerely
Mohsen

Sameer

unread,
Apr 22, 2014, 2:02:00 AM4/22/14
to ns-3-...@googlegroups.com, Smach Meriem
If you search this group you will find posts which suggest that you use tag for the SNR and SINR values. It would mean changing the wifi code of ns3. I suggest you have a look at this github repo... the wifi module there has added the tags for SNR and SINR. You could then strip those tags in your application from the packet and use the values

Sameer

unread,
Apr 22, 2014, 2:03:28 AM4/22/14
to ns-3-...@googlegroups.com, Smach Meriem
If you search this group you will find posts which suggest that you use tag for the SNR and SINR values. It would mean changing the wifi code of ns3. I suggest you have a look at this github repo... the wifi module there has added the tags for SNR and SINR. You could then strip those tags in your application from the packet and use the values


On Tuesday, April 22, 2014 6:37:06 AM UTC+5:30, mohsenhs wrote:

Mohsen Hajsalehi

unread,
Apr 22, 2014, 3:53:18 AM4/22/14
to ns-3-...@googlegroups.com
Hi Samer

Thanks for your prompt reply and special thanks for the link.

Regards,


--
You received this message because you are subscribed to a topic in the Google Groups "ns-3-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ns-3-users/CTQ2wyRaYc4/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ns-3-users+...@googlegroups.com.

To post to this group, send email to ns-3-...@googlegroups.com.

Smach Meriem

unread,
Apr 19, 2012, 11:52:45 AM4/19/12
to ns-3-...@googlegroups.com
thank u very much  
but can explain 4 me how u did that please?

De : 陈旋 <hitch...@gmail.com>
À : ns-3-...@googlegroups.com
Envoyé le : Jeudi 19 avril 2012 14h17
Objet : Re: how i get SNR and SINR values?

ragada...@gmail.com

unread,
Jun 24, 2022, 9:19:36 AM6/24/22
to ns-3-users
Hi
In which  repositories  I can found the wifi update
Reply all
Reply to author
Forward
0 new messages