IEEE 802.15.4 subsystem
Sign in or create your account | Project List | Help
IEEE 802.15.4 subsystem Git Source Tree
Root/
| Source at commit 1f003f1c2100f7f3670106fd13df0eaec7a0e4e1 created 7 years 3 months ago. By Werner Almesberger, atusb/atusb.kicad_pcb: grow RF feed trace to 1.9 mm, for 1.0 mm PCB | |
|---|---|
| 1 | Antenna measurements |
| 2 | ==================== |
| 3 | |
| 4 | The objective of antenna measurements is to determine how much energy the |
| 5 | antenna transfers at different frequencies. For this, we set up a sender, |
| 6 | a receiver, connect one to the antennas being tested, and the other to an |
| 7 | arbitrarily chosen lab antenna. |
| 8 | |
| 9 | Since none of the items (sender, receiver, lab antenna) are calibrated, |
| 10 | we can only compare antennas but we cannot determine any absolute |
| 11 | characteristics. |
| 12 | |
| 13 | |
| 14 | Preparing a measurement run |
| 15 | --------------------------- |
| 16 | |
| 17 | Before measuring the characteristics of an antenna, we need to set up the |
| 18 | test environment and obtain a number of filtering parameters. The filters |
| 19 | are used to reduce the effect of noise on the measurements and to suppress |
| 20 | contamination from other sources. |
| 21 | |
| 22 | 1) Install transmitter and receiver. The transmitter is an atusb or atusd |
| 23 | board, the receiver an USRP2+XCVR2450 with the antenna to test. |
| 24 | |
| 25 | (The same setup may also work with a USRP1 or UN210, and a RFX2400 |
| 26 | board.) |
| 27 | |
| 28 | Both should be spaced at least twenty times the wavelength (12.5 cm at |
| 29 | 2405 MHz), or 2.5 m apart. For test runs that can be compared with each |
| 30 | other, antenna placement and orientation have to be exactly the same. |
| 31 | |
| 32 | The sender runs tools/atrf-txrx/atrf-txrx, the receiver runs utilities |
| 33 | from gnuradio. |
| 34 | |
| 35 | 2) Obtain baseline performance values. For example, activate the sender |
| 36 | with |
| 37 | |
| 38 | atrf-txrx -f 2455 -p 0.5 -T +0.5 |
| 39 | |
| 40 | Emit a constant wave at 2455+0.5 MHz with a power of 0.5 dBm or 1.1 mW. |
| 41 | |
| 42 | Monitor the received signal with |
| 43 | |
| 44 | usrp2_fft.py -f 2455.5M -d 16 |
| 45 | |
| 46 | Record the range in which the frequency peak falls. Variations of a few |
| 47 | dB are to be expected. |
| 48 | |
| 49 | 3) Generate a series of sample for a specific setting. |
| 50 | |
| 51 | Example: |
| 52 | |
| 53 | The following script sets up the transmitter, lets it "warm up" for ten |
| 54 | seconds, then takes 100 measurements, stored in files tmp00 through |
| 55 | tmp99 in a directory $PWD/100/. |
| 56 | |
| 57 | In this setup, the receiver's gnuradio runs on a different host than |
| 58 | the sender. Therefore we use ssh and pass the directory from $PWD. |
| 59 | |
| 60 | atrf-txrx -f 2455 -p 2.6 -T +0.5 \ |
| 61 | 'sleep 10; |
| 62 | for a in 0 1 2 3 4 5 6 7 8 9; do |
| 63 | for b in 0 1 2 3 4 5 6 7 8 9; do |
| 64 | ssh ws usrp2_rx_cfile.py -d 16 -f 2455.5M -g 46 -N 1124 \ |
| 65 | '$PWD'/100/tmp$a$b |
| 66 | done |
| 67 | done' |
| 68 | |
| 69 | Each measurement obtains 1124 samples, 1024 samples for the FFT and |
| 70 | 100 samples to cut off (see below). |
| 71 | |
| 72 | 4) Determine the shape of the captured waves in the time domain, e.g., |
| 73 | with |
| 74 | |
| 75 | gnuplot |
| 76 | gnuplot> plot "<./avg 1 <100/tmp00" with lines |
| 77 | |
| 78 | "avg" outputs the magnitude of the recorded wave, averaging over the |
| 79 | specified number of sample. |
| 80 | |
| 81 | Some waves will probably show a peak in the first few samples. We need |
| 82 | to cut off these peaks in the later processing steps. In this example, |
| 83 | we will skip the first 100 samples. |
| 84 | |
| 85 | Besides the initial peak, the waves should be of comparable amplitude. |
| 86 | |
| 87 | 5) Verify the distribution in the frequency domain and determine the noise |
| 88 | floor. |
| 89 | |
| 90 | gnuplot> plot "<./fft -s 100 -d <100/tmp00" with lines |
| 91 | ^ |
| 92 | skip initial peak |
| 93 | |
| 94 | The spectrum should be U-shaped, with narrow peaks tens of dB above |
| 95 | the noise floor near the beginning and the end. Note that the noise |
| 96 | floor is curved and not perfectly flat. |
| 97 | |
| 98 | From this, we pick level of the noise floor. The value should be at or |
| 99 | slightly below the highest peaks of the noise between the large peaks |
| 100 | at the end of the spectrum. |
| 101 | |
| 102 | This noise floor value is used to filter uninteresting samples later |
| 103 | on, removing a constant bias from the results. |
| 104 | |
| 105 | In this example, we'll use a noise floor value of -60 dB. |
| 106 | |
| 107 | 6) Determine the "interesting" frequency range. For this, we consider all |
| 108 | the spectra of the measurements: |
| 109 | |
| 110 | gnuplot> plot "<for n in 100/tmp*; do ./fft -s 100 -d <$n;echo;done" \ |
| 111 | with lines |
| 112 | |
| 113 | There should be a thick noise band in the middle, with pronounced |
| 114 | narrow peaks at the edges. If there are one or two signals on top of |
| 115 | the noise band, some measurements have been compromised and need to be |
| 116 | removed or redone. We will do this in the next step. |
| 117 | |
| 118 | When zooming into the left peak, the "bins" which contribute to the |
| 119 | peaks can be identified. The range should be chosen with some |
| 120 | tolerance, since the frequency may shift a bit during the measurement |
| 121 | process. |
| 122 | |
| 123 | By not considering bins far from the peak, less noise is included in |
| 124 | the final result, complementing the filtering by noise threshold from |
| 125 | step 4). Restricting the bins also eliminates the second peak at the |
| 126 | end of the spectrum. |
| 127 | |
| 128 | In this example, we'll use a range from 0 to 20. |
| 129 | |
| 130 | 7) Obtain the peaks from all measurements |
| 131 | |
| 132 | gnuplot> plot "<for n in 100/tmp*; do ./fft -s 100 0 20 60 <$n;done" \ |
| 133 | with lines |
| 134 | ^ ^ ^ ^ |
| 135 | | | | | |
| 136 | skip, from step 4 | | threshold, 5) |
| 137 | lowest bin highest bin |
| 138 | |
| 139 | This should yield a jagged more or less horizontal line with values |
| 140 | differing by not more than 1-2 dB. If there are any large outliers, |
| 141 | they have been contaminated and should be dropped. |
| 142 | |
| 143 | 8) The final result for one measurement run can be obtained as follows: |
| 144 | |
| 145 | for n in 100/tmp*; do ./fft -s 100 0 20 60 <$n;done | ./range -v 2 |
| 146 | |
| 147 | In this example, "range" eliminates all outliers more than 2 dB from |
| 148 | the average and reports this. |
| 149 | |
| 150 | The output are three numbers: the average (after eliminating |
| 151 | outliers), the minimum, and the maximum. |
| 152 | |
| 153 | |
| 154 | Performing a measurement run |
| 155 | ---------------------------- |
| 156 | |
| 157 | The script "fscan" performs 100 scans of the 26 channels used by IEEE |
| 158 | 802.15.4. The frequency scan is the inner loop, so that slow changes |
| 159 | in environmental parameters (background noise, temperature, etc.) will |
| 160 | affect the spread of the results over the entire frequency range instead |
| 161 | of causing seemingly frequency-dependent distortions. |
| 162 | |
| 163 | The script is written for a setup that uses a pair of hosts, both |
| 164 | sharing the same file system. |
| 165 | |
| 166 | Usage: fscan out-dir [tx-power] |
| 167 | |
| 168 | The output directory must not exist yet. The transmit power is in dBm and |
| 169 | defaults to 2.6 dBm. |
| 170 | |
| 171 | Example: ./fscan testant |
| 172 | |
| 173 | The full run takes approximately half an hour. |
| 174 | |
| 175 | The results are filtered and averaged by the script "evscan". This script |
| 176 | contains the filtering parameters obtained in the preparation, described |
| 177 | above. |
| 178 | |
| 179 | Example: ./evscan testant >testant.out |
| 180 | |
| 181 | The output is a graph with frequency, average signal strength, minimum |
| 182 | and maximum. The format is compatible with gnuplot's "with errorbars" |
| 183 | (or "with errorlines") plot style. |
| 184 | |
| 185 | Finally, the results can be plotted with the script "plscan", which uses |
| 186 | gnuplot to output either in a window or to a PNG file. |
| 187 | |
| 188 | Usage: plscan [-o pngfile] file ... |
| 189 | |
| 190 | More than one graph can be plotted in the same run. The file name is used |
| 191 | as the title for each graph. Titles are truncated at the last dot. |
| 192 | |
| 193 | Example: ./plscan testant.out |
| 194 | |
