def performGainMeasurement():
    #You can do a gain measurement at any time you want. You can save the results in a file if you want to check them later
    #You have to specify the coordinator_id , transmitter's node id, receiver's node id
    #Optional you can specify at which frequency to measure(2420Mhz default) , to or not to save the results, and how long should the generator transmit a signal (recommended to be at least 5 seconds, default value=10)
    gain = GainCalculations.calculateInstantGain(10001, 25, 2, measuring_freq=2422e6, saveresults=False, transmitting_duration=5)
    #returned gain is in linear scale. 
    print gain
    print "%.3f dB" %(10.00*math.log10(gain))
Exemplo n.º 2
0
 def measureGains(self):
     # takes instant channel gains, it does not apply any filter or anything else
     # measure direct gain
     self.direct_gain = GainCalculations.calculateInstantGain(
         self.coordinator_id,
         self.tx_node.node_id,
         self.rx_node.node_id,
         measuring_freq=2420e6,
         saveresults=False,
         transmitting_duration=4,
     )
     # measure cross gain
     self.cross_gain = GainCalculations.calculateInstantGain(
         self.coordinator_id,
         self.neighbor_player.tx_node.node_id,
         self.rx_node.node_id,
         measuring_freq=2420e6,
         saveresults=False,
         transmitting_duration=6,
     )