Receiver » History » Version 2

Muguerza, Joaquin, 03/22/2015 12:28 PM

1 1 Muguerza, Joaquin
h1. Receiving at the Lab
2 1 Muguerza, Joaquin
3 2 Muguerza, Joaquin
{{>toc}}
4 2 Muguerza, Joaquin
5 1 Muguerza, Joaquin
In order to test the whole radio communication chain, a receiver was set up on the laboratory, capable of receiving the RF signal emitted by the Cubesat, demodulating it, decoding the message and displaying it on real time.
6 1 Muguerza, Joaquin
7 1 Muguerza, Joaquin
h2. The set-up
8 1 Muguerza, Joaquin
9 1 Muguerza, Joaquin
The reception of the signal at the laboratory is accomplished by using the architecture shown in the following scheme:
10 1 Muguerza, Joaquin
11 1 Muguerza, Joaquin
p=. !{width: 400px}setup.png!
12 1 Muguerza, Joaquin
_Figure 1: Receiver architecture_
13 1 Muguerza, Joaquin
14 1 Muguerza, Joaquin
The equipment used are:
15 1 Muguerza, Joaquin
* A NI USRP 2920, an instrument capable of receiving radio signals, sampling them and sending the data to a computer (in this case, via Ethernet).
16 1 Muguerza, Joaquin
* A computer running LabVIEW, which handles the data acquisition via Ethernet, and is in charge of processing it afterwards (demodulation, decoding and display). 
17 1 Muguerza, Joaquin
18 1 Muguerza, Joaquin
h3. USRP 
19 1 Muguerza, Joaquin
20 1 Muguerza, Joaquin
National Instruments manufactures a series of products called USRP (Universal Software Radio Peripheral), which consist on transceivers based on Software Defined Radio (SDR). The USRP is a widely used platform since it allows to perform RF prototyping in an easy and quick way, using only a PC running LabVIEW, without the need of extra equipment.
21 1 Muguerza, Joaquin
22 1 Muguerza, Joaquin
This equipment allows to perform both transmission and reception of RF signals. Regarding the transmission, it is possible to receive RF signals in a wide range of frequencies, and then sample them using a very fast SDR. The obtained data is stored in a buffer, until it is sent to a computer in frames of configurable size. The same is valid for transmission: the USRP is capable of receiving digital data, and then transmitting it via RF in a wide range of carrier frequencies. 
23 1 Muguerza, Joaquin
24 1 Muguerza, Joaquin
p=. !{width: 370px}IMAG3349.jpg!
25 1 Muguerza, Joaquin
_Figure 2: NI USRP-2920 at the lab_
26 1 Muguerza, Joaquin
27 1 Muguerza, Joaquin
The model of the USRP used at the lab is the NI USRP-2920. This version works with a central frequency in the range from 50 MHz up to 2.2 GHz, covering the ISM, FM radio, GPS, GSM and radar bands. In particular, it covers the frequency used by the Cubesat, which is the 433 MHz ISM band.
28 1 Muguerza, Joaquin
29 1 Muguerza, Joaquin
The USRP-2920 is able to sample the signal and acquire I/Q (In-Phase and Quadrature) data with a rate ranging from 200ksamples/sec to 20 Msamples/sec, and send them via Ethernet with a speed of up to 25 Msamples/sec, to be processed with NI LabVIEW. The acquired I/Q samples can be used to demodulate different types of analog modulated signals (AM, FM or PM). 
30 1 Muguerza, Joaquin
31 1 Muguerza, Joaquin
In the present case, the modulation used is BFSK (Binary Frequency Shift Keying), with a carrier frequency of 433 MHz, and frequency shift of +/- 20 KHz (a total shift of 40 KHz). In order to meet the Nyquist criterion and avoid aliasing, the sampling must be done at, at least, 80 KHz. The USRP amply meets this requirement. 
32 1 Muguerza, Joaquin
33 1 Muguerza, Joaquin
The USRP acts as a host in a local network, and the communication with the computer is done over IP (the USRP has its own IP address). The interface is done directly with LabVIEW, which provides a set of modules required to work with this equipment (configuring and establishing a connection, data acquisition and transmission, etc). Once a connection is set up, the USRP sends the sampled data at request of LabVIEW.
34 1 Muguerza, Joaquin
35 1 Muguerza, Joaquin
The parameters needed to establish the connection, and successfully sample the radio signal are shown on the figure 3, where LabVIEW Front Panel is shown.
36 1 Muguerza, Joaquin
37 1 Muguerza, Joaquin
h3. LabVIEW Virtual Instrument
38 1 Muguerza, Joaquin
39 1 Muguerza, Joaquin
!>LabVIEW_Logo_vert_color.png! The software chosen to process the data is LabVIEW, of National Instruments, due to its compatibility with the USRP and to the simplicity with which the acquired data can be processed in order to obtain the message.
40 1 Muguerza, Joaquin
41 1 Muguerza, Joaquin
LabVIEW, a graphic programming platform, is ideal for measuring, processing and displaying data in real time. Unlike most common programming languages, which are for declarative programming (and basically state a sequence of instructions), LabVIEW is a data-driven programming language, and what describes is the processing to be done to the data. LabVIEW uses a graphical interface, in which the data is represented by lines, and the processing applied to it by different function blocks. Thus, by interconnecting the lines with the blocks the desired processing is achieved. All this makes LabVIEW more suitable for real time data processing than other alternatives. A LabVIEW program is divided into two parts: the Front Panel, and the Block Diagram.
42 1 Muguerza, Joaquin
43 1 Muguerza, Joaquin
_The Front Panel_
44 1 Muguerza, Joaquin
45 1 Muguerza, Joaquin
In LabVIEW, the interaction between the user and the program is done through the Front Panel. Here, the user can find all the parameters that can be set in order to control the execution, and also he can find all the important data displayed.
46 1 Muguerza, Joaquin
47 1 Muguerza, Joaquin
The developed front panel looks as follows:
48 1 Muguerza, Joaquin
49 1 Muguerza, Joaquin
p=. !{width: 1000px}frontpanel.png!
50 1 Muguerza, Joaquin
_Figure 3: Front Panel of the LabVIEW Virtual Instrument_
51 1 Muguerza, Joaquin
52 1 Muguerza, Joaquin
At the top, right-side, the user may find all the parameters that need to be set in order to correctly acquired and demodulate the data. The list of parameters to be set are:
53 1 Muguerza, Joaquin
54 1 Muguerza, Joaquin
* *IP Address:* IP address of the USRP.
55 1 Muguerza, Joaquin
* *IQ Sampling Rate:* Sampling rate of the signal. 200k is the minimum value.
56 1 Muguerza, Joaquin
* *Carrier Frequency:* Central frequency at which the USRP tunes. The frequency used here is the carrier frequency of the FSK.
57 1 Muguerza, Joaquin
* *Gain:* optional amplification of the signal. The default value is 0dB.
58 1 Muguerza, Joaquin
* *Active antenna:* the USRP counts with several antenna connectors. The one in use is RX2.
59 1 Muguerza, Joaquin
* *Samples per frame:* amount of samples per each Ethernet frame. This value should be small enough to give the impression of real time processing of the signal. 
60 1 Muguerza, Joaquin
* *Samples per symbol:* the number of samples per FSK symbol to be used in the demodulation. The default value is 16.
61 1 Muguerza, Joaquin
* *FSK deviation:* the frequency shift between the Carrier Frequency and each of the two subcarriers. This value is equal to 20 KHz.
62 1 Muguerza, Joaquin
63 1 Muguerza, Joaquin
Below these parameters, a text box displays the messages obtained from the RF signal. The messages have the format described in Payload Integration page.
64 1 Muguerza, Joaquin
65 1 Muguerza, Joaquin
p=. !{width: 1000px}frontpanel1.png!
66 1 Muguerza, Joaquin
_Figure 4: Close up of the Front Panel graphs._
67 1 Muguerza, Joaquin
68 1 Muguerza, Joaquin
The four graphs at the right-side show different signals throughout the whole decoding process:
69 1 Muguerza, Joaquin
* At top-left, the spectrum of the sampled signal is shown. This signal has been translated from the carrier frequency to the baseband and, is a complex signal, meaning that the spectrum will not be even. If well centered, both signal peaks (corresponding to the ON and OFF subcarriers) will superpose at 20 KHz. 
70 1 Muguerza, Joaquin
* At bottom-left, the sampled IQ time signal is displayed. It can be seen the frequency shift when the symbol changes. 
71 1 Muguerza, Joaquin
* At top-right, the signal shown is at the output of the FSK demodulator. Here, the input signal has been sampled and demodulated. The Manchester symbols and the sync signal can be seen.
72 1 Muguerza, Joaquin
* At bottom-right, the bit stream obtained from the above signal is displayed (after synchronizing, and translating the Manchester symbols into bits). 
73 1 Muguerza, Joaquin
74 1 Muguerza, Joaquin
_The Block Diagram_ 
75 1 Muguerza, Joaquin
76 1 Muguerza, Joaquin
The LabVIEW Virtual Instrument is able to acquire and process the data in real time. This is achieved in the following manner:  the program runs in a constant loop (until the stop button is pressed), which consists of two main parts: acquisition and processing. The acquisition is also done with an inner loop, each iteration receiving a frame of data from the USRP, and storing it in a vector variable it. When a certain amount of data is stored (in this case, 7 Msamples), the loop is stopped, and this data is processed. Before inputing it in the demodulator, the received signal is downsampled in order to work with a smaller amount of data.
77 1 Muguerza, Joaquin
78 1 Muguerza, Joaquin
p=. !{width: 1000px}lab1.png!
79 1 Muguerza, Joaquin
_Figure 5: Main program loop, with acquisition loop, down sampling and demodulation._
80 1 Muguerza, Joaquin
81 1 Muguerza, Joaquin
The processing is done in a dedicated subVI, which takes as input the downsampled waveform, the number of samples per symbol and the frequency shift. A function block already made available by LabVIEW (available in the RF Modulation package) demodulates the signal, passing from an analog waveform to a stream of bits.
82 1 Muguerza, Joaquin
83 1 Muguerza, Joaquin
p=. !{width: 500px}lab2.png!
84 1 Muguerza, Joaquin
_Figure 6: Signal demodulation._
85 1 Muguerza, Joaquin
86 1 Muguerza, Joaquin
The output signal is, however, not the information bit stream yet. This is due to the Manchester encoding performed to the bit stream at the transmitter side, where each bit was encoded as a rising or falling flank. In order to decode Manchester at the right point, a synchronization sequence is used, a burst of 14 ‘1’s. After this sequence is detected, the stream is finally translated into the information bit stream, depending on each flank.
87 1 Muguerza, Joaquin
88 1 Muguerza, Joaquin
p=. !{width: 550px}lab3.png!
89 1 Muguerza, Joaquin
_Figure 7: Loop in charge of looking for the sync sequence._
90 1 Muguerza, Joaquin
 
91 1 Muguerza, Joaquin
p=. !{width: 700px}lab4.png!
92 1 Muguerza, Joaquin
_Figure 8: Part where the each Manchester symbol is translated into bits._
93 1 Muguerza, Joaquin
94 1 Muguerza, Joaquin
Finally, the next step is to remove the start and stop bits, and obtain each Baudot character. This is achieved by taking every seven bits, and removing the first and last bit. At last, each Baudot character is mapped to its associated ASCII character and displayed on screen.  
95 1 Muguerza, Joaquin
 
96 1 Muguerza, Joaquin
p=. !{width: 800px}lab5.png!
97 1 Muguerza, Joaquin
_Figure 9: Part where the start and stop bits are removed, and the Baudot words translated into ASCII._
98 1 Muguerza, Joaquin
99 1 Muguerza, Joaquin
h2. Results
100 1 Muguerza, Joaquin
101 1 Muguerza, Joaquin
The final results are shown in the text box, where the decode message is shown. Normally, when no errors are encountered, and the sync is successfully performed, the message obtained looks like the following:
102 1 Muguerza, Joaquin
103 1 Muguerza, Joaquin
bq. $gpgga,000112,4333.8509,n,00128.5476,e,0,00,,00142.4,m,049
104 1 Muguerza, Joaquin
105 1 Muguerza, Joaquin
In this case, there is position information available since enough satellites have been contacted, and the position obtained is 43º33´N, 1º28´E. When the GPS receiver obtains information from satellites, but not enough to do a trilateration, only the UTC time is shown.  If no satellites are available at the moment, the GPS receiver may indicate the last obtained position if it is not too old.