WordPress.com



Mobile Computing – 687

Software Radio – USRP Experiments

Table of Contents

1 Sound file Transmission using FM 2

1.1 Changing sound file format 2

1.2 Modulation and Transmission of audio 2

1.3 Steps of experiment 3

2 JPEG file transmission using wireless media 4

2.1 Transfer of JPEG file from one USRP to another through loop-back cable 4

2.2 Transfer of JPEG file over wireless network 4

2.3 Steps of Experiment 4

3 Modulation/Demodulation using π/4 DQPSK technique 6

3.1 Steps of Experiments 6

3.1.1 Bit Error Rate comparison 6

3.1.2 Effect of different modulation schemes on audio file 6

3.1.3 Spectrum analysis 7

Sound file Transmission using FM

In this experiment a sound file is transmitted on wireless channel and received on a commercial radio device. Following are the major steps of execution.

1 Changing sound file format

For this project, the goal was to transmit mp3 format sound file using GNU Radio software package and USRP hardware. But it was found that GNURadio accepts only .raw files for transmission. A work around this problem is to convert the audio file format from mp3 to .raw using a Linux command “sox” (SOX - SOund eXchange).

Sox can convert many a sound file formats into another. It takes arguments such as input file, output file, output file extension, sampling rate, size of samples etc. For more information about this command man page of Linux can be accessed. For the experiments purpose, following command was used to convert test.mp3 file to test.raw.

sox test.mp3 -r 32000 -t raw -l -c 1 test.raw

Since GNU Radio will be transmitting the sound files according to a play list, the converted sound file should be included in a play list and the play list should be made available to the GNU Radio. Following is the play list format to be followed.

[pic]

Figure 1- .pls (play list) format

2 Modulation and Transmission of audio

The base code was taken from fm_tx4.py file of GNURadio project. GNU radio provides a good support for signal processing and one of the useful signal processing blocks is wfm_tx(), which stands for wide band FM transmitter. This block was used to modulate the signal to FM.

After the python code is completed for FM transmission, sound file can be transmitted using USRP and application specific daughterboard. For this experiment, Basic Tx daughterboard is used. Following command can be given from the terminal to transmit the sound file with .raw file format and the signal can be listened to using a commercial radio device with support for FM reception.

Sudo python “filename.py” –l “playlistfilename.pls”

3 Steps of experiment

To reproduce the results following steps should be followed.

I. Convert the file format of intended audio file from mp3 to .raw using Linux command “sox”.

II. Set up the USRP board with Basic Tx daughter board and antenna attached.

III. Set up a commercial FM receiver device at an unused frequency in FM band. The same can be achieved with another USRP board functioning as receiver at the predefined frequency.

IV. Start the audio transmission using following command at the transmitter host machine.

python “filename.py” –l “playlistfilename.pls”

If user doesn't have rights to run python script, the above command can be modified.

Sudo python “filename.py” –l “playlistfilename.pls”

JPEG file transmission using wireless media

In this experiment a JPEG file is transmitted on wireless channel from one host machine and received on another host machine using USRP. Looking at the complexity of the task, this project is divided in two phases.

1 Transfer of JPEG file from one USRP to another through loop-back cable

For this part of the experiment, “benchmark_tx.py” and “benchmark_rx.py” from GNU Radio package have been used as frame work to transmit packets from the transmitter and received at receiver respectively.

The basic Benchmark_tx just dumps the data i.e. just transmits the data through USRP on wireless channel. Benchmark_rx application is always in listening mode and just listens to the incoming data through USRP. These two python codes take various command line arguments such as type of de/modulation scheme, bit rate and the packet size. The default modulation scheme, bit rate and packet size is GMSK, 500kbps, and 1500 bytes respectively.

For this implementation, DBPSK was chosen as desired modulation/demodulation scheme. It confirmed the transmission of JPEG file. Basic Tx and Rx daughter boards were used for transmission and reception of data bytes. Both

2 Transfer of JPEG file over wireless network

As per the documentation, only 1200 MHz and 2400 MHz daughter boards work reliably for wireless transmission. There is higher degree of packet loss and packet corruption in wireless media. The base code of benchmark_tx.py and benchmark_rx.py is modified to include protection against packet loss and packet corruption along with duplicate packets. Both the daughter boards needs to be about 3 meters apart. Following are the modification implemented in base code.

• Tx should send a packet and waits to receive an “ACK” from receiver.

• Tx starts a timer after sending a packet

• Tx will retransmit a packet when either it receives “NACK” or timer times out.

• When Tx receives any data while waiting for “N/ACK”, rx_callback function is called, which is similar to rx_callback in Rx program. If packet is not corrupted, it is checked for “ACK” or “NACK” message. Transmission or same packet or new one is decided on this message.

• Rx should wait for receiving a data packet from Tx. After checking the integrity of received data, an

• “ACK” mssage is sent to Tx and data is stored in destination file. If packet integrity check is failed, a

• “NACK” message is sent to Tx.

• In case of duplicate packets arriving at Rx due to loss of “ACK” in the channel, Rx will send the “ACK” message but will not store the data in destination file.

3 Steps of Experiment

To reproduce the results of wireless transmission, following steps should be followed.

I. Set up the USRP board with 1200 MHz tranceiver daughter board and antenna on two host machines with one machine as sender and another as receiver.

II. Keep both the USRP boards 3 meters apart.

III. Start the receiver by feeding the following command.

python benchmark_rx.py -m DBPSK -v

IV. Start transmission of JPEG file by feeding following command at sender host machine.

python benchmark_tx.py -m DBPSK -v -s 288 –from-file=test.jpg

Modulation/Demodulation using π/4 DQPSK technique

Currently GNU Radio supports three modulation/demodulation schemes namely GMSK, DQPSK and DBPSK. In this part of experiment π/4-DQPSK is implemented. π/4-DQPSK is a kind of PSK (Phase shifted keying) which uses the information of the phase to transmit bits and used in the North American second generation IS-54 digital cellular system. It is the π/4 shifted QPSK combined with differential encoding. Figure 2 shows the Constellation diagram for π/4-QPSK. It uses two QPSK signal constellations offset by π/4 relative to each other, shown in Figure 2, one QPSK (the blue points), for odd-numbered symbols and the other (the green points) for even-numbered symbols. The two constellations are used alternately. In differentially-encoded QPSK, the phase-shifts are corresponded to bits which are transmitted.

[pic]

Figure 2 Constellation diagram for π/4-QPSK

Implementation of π/4-QPSK is based on mydqpsk.py from GNU Radio package. This experiment consists of three major parts, comparison of Bit Error Rate (BER) for different modulation/demodulation schemes, comparison of modulation on audio files and spectrum analysis of different modulation schemes.

1 Steps of Experiments

1 Bit Error Rate comparison

Files corresponding to bit error rate comparison are in BER folder of this project. Inputs to this application are Eb/No, modulation scheme and large amount of data. Following steps need to be followed for this experiment.

I. From the BER folder run Main.py python code.

II. From file menu select PlaySound option to verify the sound card functioning.

III. Now select Generate Data option from File menu to generate large amount of data and feed in a random integer number which will generate corresponding number of data bytes.

IV. Click DPSK Modulation and select the type of modulation scheme to modulate the sample data. Now wait for modulation to get finished.

V. Click Transmit Data option and input the floating point value of Eb/No and demodulation scheme. Wait for demodulation to finish.

VI. Click Calculate BER option to find the BER under the given modulation/demodulation scheme and Eb/No value.

2 Effect of different modulation schemes on audio file

This part of the experiment exhibits the effect of BER on the quality of voice (data). Corresponding files are in audio folder of the project. Following are the steps to follow for this part of experiment.

I. Record a sound by using audio_to_file.py. ( command – python audio_to_file.py hello.wav)

II. Run the Main.py from audio folder.

III. From File menu select PlaySound option to verify functioning of sound card.

IV. Click DPSK Modulation and select the type of modulation scheme to modulate the sample data. Now wait for modulation to get finished.

V. Click Transmit Data option and input the floating point value of Eb/No and demodulation scheme. Wait for demodulation to finish. Now exit from the Main.py script.

VI. To test the effect of modulation scheme and noise on audio data, run audio_play.py command.

python audio_play.py -F out_int.dat

3 Spectrum analysis

This part of experiment exhibits the shape of the spectrum with USRP as its output device while choosing from the available modulation/demodulation schemes. Following are the steps to follow.

I. Setup USRP with basic Tx daughter board.

II. Run Main_Tx.py from Transmitter folder. (command – python Main_Tx.py -f 4000000)

III. From Options menu, click Modulate_Transmit option and input the number of data bytes to be generated for modulation and modulation scheme.

IV. After completion of this step, results can be seen on the oscilloscope showing the spectrum.

V. Once done with the experiment click Exit option to exit from the testing application.

................
................

In order to avoid copyright disputes, this page is only a partial summary.

Google Online Preview   Download