| 1 | [wiki:WikiStart Orbit] > [wiki:NodeHandler NodeHandler] > [wiki:NodeHandler/FAQ FAQ] > Noise Generator Usage |
| 2 | |
| 3 | = Using Noise Generator in Experiments = |
| 4 | |
| 5 | The main idea is this: |
| 6 | |
| 7 | Along with node definitions in the first part of the experiment script, |
| 8 | you also define the antenna to be a part of the experiment |
| 9 | |
| 10 | The antennas are located here: |
| 11 | * Antenna 1: Between node2-1 and node2-2 |
| 12 | * Antenna 2: Between node2-7 and node2-8 |
| 13 | * Antenna 3: Between node7-1 and node7-2 |
| 14 | * Antenna 4: Between node7-7 and node7-8. |
| 15 | |
| 16 | I am attaching a template script to use the noise generator |
| 17 | |
| 18 | The configurable parameters are |
| 19 | * channel on which you want to operate: |
| 20 | Valid channels are 1..11, 36, 40, 44, 48, 52, 56, 60, 64, 149, 153, 157 and 161 |
| 21 | * Noise power on these channels: Limits are from -90 dBm to +5 dBm |
| 22 | |
| 23 | Here is a template script to use the noise generator |
| 24 | {{{ |
| 25 | #Template to use noise generator in the experiment |
| 26 | |
| 27 | Experiment.defProperty(‘noisePower', -44, Noise level injected') |
| 28 | |
| 29 | nodes([2,2], 'sender') {|node| … |
| 30 | |
| 31 | nodes([8,8], ‘receiver') {|node| … |
| 32 | |
| 33 | antenna(4,4).signal {|s| |
| 34 | s.type = ‘noise’ |
| 35 | s.bandwidth = 20 |
| 36 | s.channel = 3 |
| 37 | s.power = Experiment.property(“noisePower") |
| 38 | } |
| 39 | |
| 40 | |
| 41 | whenAllInstalled() {|node| |
| 42 | |
| 43 | allNodes.startApplications |
| 44 | |
| 45 | wait 10 |
| 46 | |
| 47 | # increase noise from -44 dBm to -4dBm in steps of 2 dBm |
| 48 | antenna(4,4).signal.on |
| 49 | -44.step(4, 2) { |p| |
| 50 | Experiment.props.noisePower = p |
| 51 | wait 30 |
| 52 | } |
| 53 | |
| 54 | Experiment.done |
| 55 | |
| 56 | } |
| 57 | |
| 58 | }}} |