This repository was archived by the owner on Nov 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
Methodology for measuring the gain between pairs of nodes
Andrei Toma edited this page Jul 25, 2013
·
20 revisions
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:
-
- Installation of VESNA ALH Tools (see its own README file for installation instructions)
-
- Installation of Python bindings for VESNA spectrum application (see its own README file for installation instructions)
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)
- Measure the noise power. No signal should be generated by the transmitter during this step.
- Generate a signal.
- Measure the received signal
- Calculate Cij gain
- Sense the spectrum for about 2 seconds. The received power is in [dBm]
- Convert the received power to Watts
- Average the power [W] results
- Generate a signal for 10 seconds
- Sense the sepctrum for 2 seconds
- Convert the received power to Watts
- Average the power [W]results
- Calculate Cij gain
- 1,2,3 - Pnoise measuring
- 4,5,6,7 - PRX measuring
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)