Skip to content
This repository was archived by the owner on Nov 18, 2022. It is now read-only.

Methodology for measuring the gain between pairs of nodes

Andrei Toma edited this page Jul 25, 2013 · 20 revisions

Introduction

This package provides Python *.py files for measuring and calculating the gain (Cij - contains the antenna's gain and the environmental attenuation) between two nodes located in a VESNA-based wireless sensor network that uses ALH protocol in order to communicate.

Before using this package, please install VESNA ALH Tools and Python bindings for VESNA spectrum sensor application. In order to do this, please follow the steps described here:

Methodology for measuring the gain between two nodes

We consider a system formed by a single transmitter-receiver pair: TXi - RXj

		+------+          +------+
		| TXi  | --Cij--> | RXj  |
		+------+          +------+ 
		   |		     |
	 	   |		     |
	 	  _|_		    _|_

	Fig.1 Cij - is the channel gain between 
            	    transmitter i and receiver j

We define Cij = (PRXj - Pnoise) / (PTXi) where:

PRXj [W] is the power received at receiver j
PTXi [W] is the power transmitted by transmitter i
Pnoise [W] is the noise power.

	   +------+                          +------+
	   | TXi  | ----------Cij----------> | RXj  |
	   +------+                          +------+ 

Fig.2 Ideal situation, where in the system there is no noise power

			Cij = PRXj / PTXi

	+------+                   +-----+        +------+
	| TXi  | ----------Cij-----| ADD |------> | RXj  |
	+------+                   +-----+        +------+ 
				      ^
				      |
				      |
				  +-------+
				  | noise |
				  +-------+

Fig.3 Real situation, where the noise signal adds to the transmitted signal

			Cij = (PRXj - Pnoise) / (PTXi)

Steps to follow in order to measure the gain between two nodes:

  1. Measure the noise power. No signal should be generated by the transmitter during this step.
  2. Generate a signal.
  3. Measure the received signal
  4. Calculate Cij gain

Practical logical scheme

  1. Sense the spectrum for about 2 seconds. The received power is in [dBm]
  2. Convert the received power to Watts
  3. Average the power [W] results
  4. Generate a signal for 10 seconds
  5. Sense the sepctrum for 2 seconds
  6. Convert the received power to Watts
  7. Average the power [W]results
  8. Calculate Cij gain
  • 1,2,3 - Pnoise measuring
  • 4,5,6,7 - PRX measuring

gainCalculations.py

gainCalculations.py contains class GainCalculations with the following methods:

  • 1) calculateInstantGain(coor_id,tx_id,rx_id)
  • defines one transmission node and one reception node
  • sets the measurement frequency, transmitting power in [dBm], transmission duration in [s] and the sensing duration in seconds
  • configures the reception node for sensing
  • starts the sensing on the reception node
  • measures the noise power
  • configures the transmission noise for signal generation
  • starts the transmission
  • measures the received signal
  • returns the calculated Cij gain
  • 2) getAverageDataMeasurementsFromFile(coor_id,node_id)
  • reads the data from file (data was stored in a file by the sensing method)
  • it averages the power at every frequency
  • returns a list with the following structure:[frequency,averaged power for one specific frequency]
  • 3) getAverageGain(coord_id,tx_id,rx_id)
  • reads the data from file
  • it averages all the gain data in that file
  • 4) printResultsInAFile(results_list, coor_id, tx_id, rx_id)
  • appends results_list in a file
  • the results_list contains :[gain,received_power[w],noise_power[w],transmitted_power[w], date]
  • 5) plotGains(coor_id,tx_id,rx_id)
  • opens the file containing the gain measurements
  • plots the gains Cij(t)