Skip to content

Commit

Permalink
doc: Improved README
Browse files Browse the repository at this point in the history
Signed-off-by: Alberto Escolar Piedras <alberto.escolar.piedras@nordicsemi.no>
  • Loading branch information
aescolar committed Apr 17, 2023
1 parent e09bc2d commit bde72a5
Showing 1 changed file with 44 additions and 14 deletions.
58 changes: 44 additions & 14 deletions docs/README.md
Expand Up @@ -6,31 +6,26 @@ This is a non realistic channel model.
It models NxN independent paths each with a configurable attenuation
This attenuation can also be configured to change over time.

The default atennuation for all paths is set with the command line options
The default atennuation for all paths is set with the command line option
`-at=<attenuation>`.

A file can be used to set the attenuation for some/all of the individual paths.
This file is specified with the command line option `-file=<attenuations_file>`
This file is specified with the command line option `-file=<att_matrix_file>`

This file shall have one separate line per path like:<br>
`x y : {value|"<attenuation_file>"}`<br>
e.g.:
```
1 2 : 65
2 1 : 65
1 3 : "/myfolder/att_file.txt"
3 1 : "/myfolder/att_file.txt"
```
`x y : {value|"<timed_attenuation_file>"}`<br>

Where:

* x is the transmitter number, x = 0..N-1
* y is the receiver number y != x
* N being the number of devices in the simulation
* value is a floating point value in dB
* `<attenuation_file>` : is the path to a `<attenuation_file>` as described
below which applies to that path
* `<timed_attenuation_file>` : is the path to a `<timed_attenuation_file>` as
described below which applies to that path.
Note that this file name shall be provided in between `""`
* Not all paths need to be provided. Those omited will default to the attenuation
provided from the command line.

The file names can be either absolute or relative to `bin/`

Expand All @@ -46,10 +41,10 @@ Therefore the channel model won't be called to reevaluate conditions during a
packet unless the devices which are transmitting change.


### The `<attenuation_file>`:
### The `<timed_attenuation_file>`:

This file contains 2 columns, the first column represents time in
microseconds, and the second column the attenuation at that given time.
microseconds (an integer value), and the second column the attenuation at that given time.
The times shall be in ascending order.<br>
If the simulation time is found in the file, the channel will use the
corresponding attenuation value.<br>
Expand All @@ -59,3 +54,38 @@ If the simulation time is before the first time value in the file, the
channel will use the first atttenuation provided in the file.<br>
If the simulation time is after the last time value in the file, the channel
will use the last attenuation provided in the file.<br>

### The `-atextra=<extra_attenuation>` command line option:

You can provide an extra attenuation to be added to all paths, independently of
how their attenuation was originally calculated, with the `-atextra` command line
option.
This `extra_attenuation` value will just be added to all paths.

### An example:

`./bs_2G4_phy_v1 -D=3 -s=Hola -channel=multiatt -argschannel -at=40 -file=paths_att_file.txt`

`paths_att_file.txt`:
```
0 1 : 65
1 0 : 65
0 2 : "/myfolder/att_file.txt"
2 0 : "/myfolder/att_file.txt"
#Note that the paths from 1<->2 are not specified. They will default to the -at command line parameter
```

`att_file.txt`:
```
1000000 60
11000000 120
11000001 60
```

With this configuration, the radio traffic between device:

* device 0 and device 1 will have an attenuation of 65dB
* device 0 and device 2 will have an attenuation of
* 60dB up to the first second
* An increasing attenuation between 60->120 dB, between the first second and the 11th. At a rate of 6dB per second
* A sudden reduction in the attenuation to 60 dB right after, which is maintained thereafter.

0 comments on commit bde72a5

Please sign in to comment.