README.md
1# ext_2G4_channel_multiatt
2
3This is a channel model for ext_2G4_phy_v1
4
5This is a non realistic channel model.
6It models NxN independent paths each with a configurable attenuation
7This attenuation can also be configured to change over time.
8
9The default atennuation for all paths is set with the command line option
10`-at=<attenuation>`.
11
12A file can be used to set the attenuation for some/all of the individual paths.
13This file is specified with the command line option `-file=<att_matrix_file>`
14
15This file shall have one separate line per path like:<br>
16 `x y : {value|"<timed_attenuation_file>"}`<br>
17
18Where:
19
20* x is the transmitter number, x = 0..N-1
21* y is the receiver number y != x
22* N being the number of devices in the simulation
23* value is a floating point value in dB
24* `<timed_attenuation_file>` : is the path to a `<timed_attenuation_file>` as
25 described below which applies to that path.
26 Note that this file name shall be provided in between `""`
27* Not all paths need to be provided. Those omited will default to the attenuation
28 provided from the command line.
29
30The file names can be either absolute or relative to `bin/`
31
32For both files, `#` is treated as a comment mark (anything after a `#` is
33discarded)
34Empty lines are ignored
35
36Note that the Phy assumes the channel to be pseudo-stationary, that is, that the
37channel propagation conditions are static enough during a packet reception, that
38is, that the coherence time of the channel is much bigger than the typical
39packet length.
40Therefore the channel model won't be called to reevaluate conditions during a
41packet unless the devices which are transmitting change.
42
43
44### The `<timed_attenuation_file>`:
45
46This file contains 2 columns, the first column represents time in
47microseconds (an integer value), and the second column the attenuation at that given time.
48The times shall be in ascending order.<br>
49If the simulation time is found in the file, the channel will use the
50corresponding attenuation value.<br>
51If the simulation time falls in between 2 times in the file, the channel
52will interpolate linearly the attenuation.<br>
53If the simulation time is before the first time value in the file, the
54channel will use the first atttenuation provided in the file.<br>
55If the simulation time is after the last time value in the file, the channel
56will use the last attenuation provided in the file.<br>
57
58### The `-atextra=<extra_attenuation>` command line option:
59
60You can provide an extra attenuation to be added to all paths, independently of
61how their attenuation was originally calculated, with the `-atextra` command line
62option.
63This `extra_attenuation` value will just be added to all paths.
64
65### An example:
66
67`./bs_2G4_phy_v1 -D=3 -s=Hola -channel=multiatt -argschannel -at=40 -file=paths_att_file.txt`
68
69`paths_att_file.txt`:
70```
710 1 : 65
721 0 : 65
730 2 : "/myfolder/att_file.txt"
742 0 : "/myfolder/att_file.txt"
75#Note that the paths from 1<->2 are not specified. They will default to the -at command line parameter
76```
77
78`att_file.txt`:
79```
801000000 60
8111000000 120
8211000001 60
83```
84
85With this configuration, the radio traffic between device:
86
87* device 0 and device 1 will have an attenuation of 65dB
88* device 0 and device 2 will have an attenuation of
89 * 60dB up to the first second
90 * An increasing attenuation between 60->120 dB, between the first second and the 11th. At a rate of 6dB per second
91 * A sudden reduction in the attenuation to 60 dB right after, which is maintained thereafter.
92