Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Certified by :
NOTES : * If the thesis is CONFIDENTAL or RESTRICTED, please attach with the letter from
the organization with period and reasons for confidentiality or restriction.
i
“I hereby declare that I have read this thesis and in my opinion this thesis is sufficient in
terms of scope and quality for the award of the degree of Bachelor of Engineering
(Electrical-Telecommunication).”
Signature : ……………………………………..
Name of Supervisor : PROF. DR NORSHEILA BT FISAL
Date : 3rd July 2012
SDR BASED OFDM FOR LOW RATE VIDEO TRANSMISSION SYSTEM
JULY 2012
ii
I declare that this thesis entitled “SDR based OFDM for low rate video transmission” is
the result of my own research except as cited in the references. The thesis
has not been accepted for any degree and is not concurrently submitted in
candidature of any degree.
Signature : ………………………………………...
Name : MOHD HIDIR BIN MOHD SALLEH
Date : July 2012
iii
Dedicated, to….
ACKNOWLEDGEMENT
First and foremost, all praise is to Allah, the Almighty, the Benevolent for His
blessings, guidance and for giving me strength, health and the inspiration to embark on
this journey. I would also like to show my gratefulness to my most adorable supervisor
Prof. Norsheila Binti Fisal for all her long last guidance and motivation including her
willingness on sharing her deeply and essential knowledge towards me to accomplish this
project.
ABSTRACT
Video signals require high bandwidth channels to ensure good Quality of Service (QoS).
However, if the channels have a limited capacity, then there is a need to provide a design
a mechanism that gives reasonable Quality of Service (QoS). The challenge is to design
an appropriate baseband processing for low bit rate video transmission in order to achieve
the desired QoS. An example of and video data transmission application that has a
limited capacity is video transmission in wireless sensor network. This project deploys a
software defined radio (SDR) platform using USRP and GNU radio to provide
programmable architecture for low bit rate video transmission over the wireless medium.
This thesis presents the implementation of video transmission using Software Defined
Radio (SDR) for M-ary quadrature amplitude modulation (M-QAM) in Orthogonal
Frequency Division Multiplexing (OFDM) system.
vi
ABSTRAK
Isyarat video memerlukan saluran jalur lebar yang tinggi untuk memastikan Kualiti
Perkhidmatan (QoS) yang baik. Walau bagaimanapun, jika saluran mempunyai kapasiti
yang terhad, adalah menjadi keperluan untuk menyediakan mekanisme reka bentuk yang
memberikan Kualiti Perkhidmatan (QoS) munasabah. Cabaran yang dihadapi adalah
untuk mereka bentuk pemprosesan jalur asas yang sesuai untuk video penghantaran
berkadaran bit rendah bagi mencapai QoS yang diingini. Satu contoh dan applikasi video
penghantaran data yang mempunyai kapasiti yang terhad adalah penghantaran video
dalam rangkaian sensor tanpa wayar. Projek ini berplatformkan radio ditakrifkan oleh
perisian (SDR) yang menggunakan USRP dan GNU radio untuk menyediakan seni bina
atur cara bagi video penghantaran berkadar bit rendah pada medium wayarles. Tesis ini
membentangkan pelaksanaan penghantaran video menggunakan Radio didefinikan oleh
Perisian (SDR) untuk M-Ary pemodulatan amplitud sukuan (M-QAM) dalam sistem
Pemultipleksan Pembahagian Frekuensi ortogonal (OFDM).
vii
TABLE OF CONTENT
DECLARATION ii
DEDICATION iii
ACKNOWLEDGEMENTS iv
ABSTRACT v
ABSTRAK vi
TABLE OF CONTENTS vii
LIST OF TABLES x
LIST OF FIGURES xi
LIST OF ABBREVIATIONS xiii
LIST OF SYMBOLS xv
1 INTRODUCTION 1
1.1 Project Background 1
1.2 Introduction To SDR 2
1.3 Problem Statements 3
1.4 Objectives 4
1.5 Scope Of Work 4
1.6 Thesis Outline 5
2 LITERATURE REVIEW 7
2.1 Video 7
2.1.1 Analog video 8
2.1.2 Digital video 8
viii
3 METHODOLOGY 30
3.1 Methodology Of Project 30
3.2 Hardware Setup 30
3.3 Software Setup 31
3.3.1 GNU radio installation for Ubuntu 31
3.4 System Design 33
3.4.1 Designing a simple digital video broadcasting 34
3.4.2 Creating a pipeline 35
3.4.3 Gstreamer source coding 37
3.4.4 GNU Radio Companion 39
3.4.5 Bitrate calculation 41
3.5 Summary 44
3.5.1 Transmitter Flowchart 45
ix
5 CONCLUSION 64
5.1 Conclusion 64
5.2 Suggestions/Recommendation 65
5.2.1 Python 66
5.2.2 Synchronization 66
5.2.3 Protocol 66
REFERENCES 67
APPENDIX A 70
APPENDIX B 71
APPENDIX C 75
APPENDIX D 79
x
LIST OF TABLES
LIST OF FIGURES
LIST OF ABBREVIATIONS
LIST OF SYMBOLS
W - Width
H - Height
Fr - Frame Rate
GHz - Giga Hertz
MHz - Mega Hertz
Kbps - kilobits per second
dB - Decibel
BW Bandwidth
DR Data rate
CR Coded Rate
Tg Guard interval
Tfft FFT period
df Subcarrier spacing
Tsymbol OFDM symbol period
1
CHAPTER 1
INTRODUCTION
Conventional television, radio and telephone which are built based on special RF
circuit are considered as hardware dependent technologies. All of these devices may be
categorized as hardware defined radio (HDR) due to their limitation in functionality
which depends on dedicated RF card. All parameters in radio access interface are fixed
parameters which cannot be reconfigured. HDR devices were specially designed to meet
the end-user application. By doing that, users only need to buy and use the hardware
according to the specification provided by the suppliers. The problems exist when the
user wants to reconfigure the hardware especially for other purposes. Users have to buy
and replace with new hardware to be used for the other specific application. Software
Define Radio (SDR) devices allow simple reconfiguration of the software or design
instead of new program to make it function as they wanted to. Today, the usage of SDR
is crucial as it will save a lot of expenses in developing outstanding applications.
2
The basic hardware architecture of SDR contains an analog and a digital part as
illustrated in figure 1.1. The analog of Radio Frequency (RF) end part is on the left hand
side of the antenna. The right hand side part is the digital end part. In the analog form,
the signal received from the antenna is first amplified by using Low Noise Amplifier
(LNA). Then, it is mixed and filtered by a band pass filter (BPF) to generate an
intermediate frequency (IF) signal. The signal is then digitized by the ADC using high
speed converter before it is down-converted to a baseband signal. Then, the digital signal
3
Similarly at the transmitter part, the video is first modulated into baseband signal
and changed into analog output. It is then up-converted and bandpass filtered to generate
the RF signal. The RF signal is further amplified by the Power Amplifier (PA) and the
fed to the antenna.
Video transmission requires high bandwidth and good quality of service (QoS)
applications mainly involves streaming as well as applications that require higher quality.
However, if the channels have limited capacity, then it is required to provide a design
mechanism that gives reasonable QoS. The challenge is to design an appropriate
baseband processing for low bit rate video transmission in order to achieve the desired
QoS.
1.4 Objectives
The main goal of the project is to develop and implement a low rate
reconfigurable video transmission on ISM band via SDR.
4
In order to determine the span of the project, scope of work for this project must
be identified first at the beginning of the project. In this project, the main scope is to
apply M-ary Quadrature Amplitude Modulation (M-QAM) modulation scheme in OFDM
system for video transmission application. The OFDM system is constructed by using
SDR technique with M-QAM as the mapper.
The SDR technique comprises of both software and hardware platforms. GNU
radio software will be used as the software whiles the Universal Software Radio
Peripheral (USRP) as the hardware platform.
On the software part, the GNU Radio Companion which is graphical interface for
GNU Radio software has been used to make the reconfiguration process become easier.
The GNU Radio is a Python based programming which implemented in open source
operating system such as Ubuntu or Fedora. The basic functions of GNU Radio has been
5
programmed by using C++ and the block functions must be glued together to make an
OFDM system by using Python programming.
The overall project designs is implemented at 2.4 GHz industrial, scientific and
medical (ISM) band that provided by RFX 2.4 daughterboard
Chapter 4 discusses the result and discussion related to this project. The results
obtained is divided into two parts, where the first part consists of serial experimental to
achieve the best configuration in OFDM system while the second part is analysis on the
BER and quality of received video.
Chapter 5 is the last part of this project. In Chapter 5, the overall project design
and experiments is concluded. In addition, the limitations and future work of this project
also are discussed.
7
CHAPTER 2
LITERATURE REVIEW
2.1 Video
There are several types of composite video such as Phase Alternating Line (PAL),
National Television System Committee (NTSC) and Sequential Couleur Avec Memoire
or sequential color with memory (SECAM). PAL is one of widely use analogue
television encoding system. The encoding process is different and incompatible between
each other. Once the video signal is received, there is a need to create the color of the
picture, and synchronize the line and frame pulse.
By capturing the video signals and scanning to the computer or television screen,
a picture can be drawn. An electrical signal was horizontally drawn across the display
one line at a time. The amplitude of this signal versus time represents the instantaneous
brightness at that physical point on the display. Figure 2.1 shows the signal amplitude
relationship to the brightness on the display.
The digital video standard is determined by more than 60 companies who joined a
consortium for digital video format consumer. The companies include Panasonic, Sony,
Victor Corporation of Japan (JVC), Sanyo, Hitachi and many more. Digital video
consists of a series of orthogonal bitmap digital images displayed in rapid succession at a
constant rate. These images are called frames. The rate at which frames are displayed is
measured in frames per second (FPS). Since every frame is an orthogonal bitmap digital
9
image, a frame comprises a raster of pixels. Pixels are described by one property, their
color. The color of a pixel is represented by a fixed number of bits. If more bits are used,
the more subtle variations of colors can be reproduced. This is called the color depth
(CD) of the video.
There are several formats used in digital television (TV), webcam or other video
products such as standard definition television (SDTV) and high definition television
(HDTV). Both of these formats are distinguished by scanning modes, frame rates, video
dimension and etc. Figure below illustrates the SDTV and HDTV dimension formats.
10
Before compressing and encoding of a video signal, there are several terms and
configurations should be set at the transmitter such as dimension, aspect-ratio, color-
space and video frame rate in order to derive the image formats.
The term dimension is not necessarily refers to the size when displaying the video
but it shows the pixel array used to encode the video. This is because many video
standards do not use square type of pixel. The dimension of a video is usually in
the format of width x height (w x h) and the unit is pixel. Aspect-ratio or the ratio
between video widths to its heights represents the captured video in a single
frame. The aspect-ratio standards are written in whole number such as 4:3 and
16:9. However, most of video standards use pixels aspect-ratio to display the real
frame as the pixels is mostly in rectangular forms.
11
Frame rate can be represented as the total images produced by a device within certain
duration and the unit of frame per second (fps) is often used. There are several
standards of frame rate frequently used in TV and film-making business such as
24fps, 25fps and 30fps. Color model such as red, green and blue (RGB) and cyan,
magenta, yellow and black CMYK must be first determined and mapped using color
space format such as sRGB and Adobe RGB [17].
For example, if a video used a frame size of 320x240 (Width x Height or WH) at a
color depth, CD of 24bits and a frame rate, Fr of 10fps within duration of 1 hour
(60x60=3600seconds). Therefore, the properties of the video are as follows:
pixels per frame = 320 * 240 = 76800 pixels
bits per frame = 76800 * 24 = 1843200 = 1.84Mbits
bit rate (BR) = 1.84Mbits * 10 = 18.4Mbits/sec
video size (VS) = 18.4Mbits/sec * 3600sec = 66 240Mbits = 8.28 Gbytes
12
Properties Formula
Video Size VS = BR * T = W * H * CD * Fr * T
pixels_per_frame W*H
pixels_per_second W * H * Fr
bits_per_frame W * H * CD
FFmpeg is fast video or audio converter software program that produces libraries
and programs to facilitate user while using multimedia data such as video and audio. The
ffmpeg is able to read any raw video files and resize it to desired size with a high quality
polyphase filters. Besides that, ffpmpeg is also able to convert arbitrary input files such
as pipes, regular video, network streams and etc. into arbitrary output files which need to
be specified by output filenames.
The most important packages that are involved with the use of FFmpeg are
libavcodec (a library for audio / video codec), libavformat (a library for audio / video
container mux and demux), and ffmpeg command line program to transcode multimedia
13
files. FFmpeg is published under the GNU Lesser General Public License 2.1 + or the
GNU General Public License 2 + (depending on the options allowed) [16].
Ffmpeg encoder can support many video formats such as moving picture
excellent group-4 (MPEG-4), H.264 and MPEG-4 advanced video coding (AVC) through
its library called libx264. Therefore, it is important to download the library lib264
including the headers as a pre-installation before users can really use the configuration.
To build the libx264 library, the command below must be configured [23]:
--enable-libx264
After enabling the libx264, users can try configuring the desired input and output
of a video by using the following commands:
i. Set the frame rate of output file to 25 frame per second (fps):
ffmpeg –i input.avi –r 25 output.avi
ii. Force the input (only for raw types video) frame rate to 1fps and 24fps output
frame rate:
ffmpeg –r 1 –i input.m2v –r 25 output.avi
Then the packets data will be passed to the decoder except for the data which is
streamcopy types is selected to the stream. The function of decoder is to produce data
frames with original size without compression. The frames is further transfer to the filter
so that filtration of video can be performed be being encoded. The filtered frames are
15
then encoded by using encoder before they were further multiplex by the muxer. At this
rate, the output will become packets once again. Finally, the muxer process the packets
data and write the output
Before the frames can be encoded, the filtration process needs to be performed by
ffmpeg via filter provided in libavfilter library. The filters can be connected to each other
to build a chain of filters namely as filtergraphs. There are two types of filtergraphs that
can be identified by ffmpeg software. Those filtergraphs were distinguished in terms of
complexity as the first type is a simple filtergraph and the other one is a complex
filtergraph.
A simple filtergraph is a chain of filters having one input and one output. From
figure 2.4(a), a simple filtergraph can be added to the diagram to illustrate the process of
encoding filtered frames. The fitergraph is added in between decoded frames and
encoded packets data to become figure 2.4 (b) as shown below:
16
The filtration process can be described by the following simple filtergraph diagram in
Figure 2.5. Likewise, the figure 2.6 shows the complexity of Complex filtergraph.
2.2 Hardware
The main focus that must be achieved in SDR technique is to construct the RF-
related works by using software dependence system. Eventually, there still a need of
hardware structure to ensure that digital signal processing must be done and to convert
the digital data into analogue form before it can be transmitted to the respected channel.
The Universal Software Radio Peripheral (USRP) type 1 will be used in this project as
the hardware platform. The chosen of USRP rather than USRP2 is because it is
significantly easier to be setup when compared to the USRP2 which will take longer time
since there is additional memory card needed in USRP2 that make them more powerful
compare to USRP. In order to provide MIMO (multiple inputs, multiple outputs)
systems, all sampling clocks and local oscillators must be in coherent. The advantage of
USRP and USRP2 is the hardware can apply both transmit and receive operation
simultaneously.
2.2.1 USRP
USRP USRP2
8 MHz instantaneous of RF bandwidth 25 MHz instantaneous of RF bandwidth
The radio can be accessible from one the radio to be accessible from more
computer than one computer
USB interface Gigabit Ethernet interfaces
Lowest cost Highest cost
Slower FPGA Faster FPGA
ADCs (12-bits 64 MS/s) ADCs (14-bits 100 MS/s)
ADCs (14-bits 128 MS/s) ADCs (16-bits 400 MS/s)
19
There are 4 slots available on USRP motherboard for the daughter boards to be
mounted to give a fully integrated RF fronts-end. The daughter boards may divide into
several types depends on the frequency spectrum being used on certain application. The
maximum allocation for transmitter daughter board and receiver daughter boards are two
of each type in one time. The daughterboard itself contains a pair of high speed analog to
digital converter (ADC) for the receiver and a pair of digital to analog converter (DAC)
for the transmitter.
The daughter boards are divided into several types depending on their
applications either transmit, receive or both transmit and receive at one time. The
daughter board types can also be categorized based on their operating RF frequency such
as 400MHz, 900Mhz, 2.4Ghz and etc. Figure 2.8 below shows the details of several
popular types of daughter boards.
20
2.2.3 ADC
receiver using high speed ADC. The ADC used in this USRP is four ADC with sampling
rate 64M symbol/s 12 bit ADC.
2.2.4 DAC
DAC functioned to convert the digital or discrete time signal into analog or
continuous signal. In SDR, before the signal being transmitted to antenna it was
converted from digital into analog at the transmitter path using high speed DAC. The
DAC used in this USRP is up to four DAC with sampling rate 128M symbol/s 14 bit
ADC.
Universal Serial Bus (USB) is the industry standard in the mid-1990s developed,
used cable assemblies, connectors and communication protocol on the bus for the
communication connection, and the power of computers and electronic devices. [3].
Before users can start exploring the GNU Radio, they must first understand the
fundamental process in the FPGA. As can be seen from figure 2.9 below, all 4 ADCs and
4 DACs need to be connected to the FPGA simply to perform a high bandwidth signal,
but in order to connect to USB 2.0, it must reduce the bit rate.
Standard FPGA contains digital down converters (DDC) with cascaded integrated
comb (CIC) filter and also digital up converters (DUC). There are four DDCs in FPGA
which can be connected to whether 1, 2 or 4 RX channel in the eceiver path. Each of
these DDCs contain two inputs; I and Q that enables the ADCs in RX path to route either
in I or Q input of any DDCs and therefore enable multiple channels to be selected from
similar ADC [7].
Software radio is a way of getting the code as close as possible to the antenna. In
the proposed SDR system, the software platform for SDR is GNU Radio which is a
software toolkit to develop and organize software radio. The hardware is the USRP
board.
Figure 2.10: Basic SDR system based on USRP and GNU Radio[13]
Figure 2.10 illustrates how GNU Radio and USRP are both related to each
other. After the received signal is down-converted into baseband signal, the GNU
Radio takes over and plays its role to process the signal until it being modulated and
able to be played back
24
Based on [19], there are several limitations need to be considered while dealing
with the SDR architecture. These limitations may impact some processes in the system
to be delayed or ineffective. The limitations are:
i. Bus delays:
Bus delay is a fixed delay occurs due to the bus transmission. It is relatively
easy to deal with by supporting the accurate scheduling. However, large
effects can occur to the spectrum of the delay and the carrier sensing.
Therefore, it will affected the related packets, and the fast recognition packets
because they need information that is time consuming for the implementation
of a number of tasks.
The channel allowed for noise effect testing, multipath test and also clipping. In
order to add noise effect, a pseudo-random data were added to the transmitted signal.
While in multipath test, some copies of data with attenuation and delayed were added to
the transmitted signal. Meanwhile, in clipping effect the amplifier saturation were varied.
27
In order to avoid delay spread in video transmission, a sort of signal can be added
at the beginning of the OFDM symbol as the Cyclic Prefix (CP). The use of CP can be
28
either as guard interval of OFDM symbol or as the repetition of the OFDM symbol.
According to [10], the OFDM symbol should at least 5times of the guard bands.
In QAM, the constellation points are usually arranged using square grid so that
the vertical and horizontal spacing have equal distance from each point, although other
configurations might be possible such as cross-QAM. The number of constellation points
usually in power of two (e.g.: 2,4,8…) due to the digital properties which is in binary.
Since QAM is usually square, some of these are rare; the most common forms are 16-
QAM, 64-QAM and 256-QAM.
CHAPTER 3
METHODOLOGY
This project developed a video transmission in OFDM system via SDR technique
which concerned both software and hardware problems. This chapter discusses the
method and algorithms used in this project.
This project requires the use of hardware and software. Before it can be started,
users need to make sure all the hardware is sufficient and running in good condition. The
first hardware needed in this project is two units of PCs; the first one is used as
transmitter whiles the other one as receiver. However, users may only require using one
PC only which will acts as both transmitter and receiver at the same time. The PC must
31
The installation of GNU radio is easier for Ubuntu users because there is an
application named „Synaptic Package Manager‟ allows users to select the necessary
package to be downloaded and installed automatically. After Ubuntu is installed
successfully, user will found many applications on the Ubuntu menu bar such as terminal,
home folder, Ubuntu software centre and Synaptic Package Manager (SPM).
32
By right click on the SPM on Ubuntu menu bar, the screenshot as shown in figure
3.1 will appears and allows users to search for the desired package.
After that, users only need to search for „gnu radio‟ in the search box before the
related package appears below the search box. The necessary package is then chosen and
applied for installation.
After few minutes (depends on the internet speed) the installation is completed
and ready to be used. By default, the gnuradio package is installed in path below:
usr/lib/python2.7/dist-packages/gnuradio
33
The GNU radio also provides some examples as benchmark for new users to try.
The benchmark is saved automatically to the path:
usr/lib/python2.7/dist-packages/gnuradio
Users might also try to play with some python examples which have been already saved
at:
usr/share/gnuradio/examples/digital
This chapter explains in details the system design for transmitting a video using
OFDM system with SDR as the architecture. There are two important software need to
be configured in this project, which are gstreamer and GNU Radio Companion (GRC).
Gstreamer is powerful open source software enough to design the desired video
specification at the transmitter as well as to display the received video. On the other
hand, GRC is flexible software in handling RF signal of the video. The design is further
explained in section 3.4.1 to 3.4.4.
34
This section describes how to design a simple digital video transmission system
using GNU Radio, USRP and Ubuntu operating system. Those are the main components
needed to be prepared for the system:
i. Video Webcam
The webcam can either be built internally or externally connected to a PC. The
webcam is turned on or activated by inserting “v4l2src” command at the
beginning part of gstreamer.
ii. A Computer installed with GNU Radio and Gstreamer (the gstreamer can be
installed directly from Ubuntu software center)
iii. A USRP or USRP 2 (for this project, USRP with RFX 2.4Ghz daughter board is
being used).
USRP
Webcam
The hardware setup including a webcam and a USRP connected to the desktop as
shown in Figure 3.2. The webcam can either be externally or internally connected to the
desktop. The software setup is achieved on the desktop with Linux, either Fedora or
Ubuntu operating system is recommended.
Pipeline creation is the most important step to provide the environment of real
time video transmission. Pipeline acts as a tunnel which connects between multimedia
files to GNU Radio. To create a pipeline, the user can apply the following commands:
Figure 3.3 shown an OFDM transceiver with 2 Unix pipeline connected to the
gstreamer. In order to experience the real time video transmission, a pipeline linking
between gstreamer model and GNU Radio software must be created first and saves at any
path in the desktop. There are 2 Unix pipeline need to be created, which are videotx.ts
and videorx.ts for the transmitter and receiver respectively.
A video transmission begins when the camera at the transmitter is turned on. The
video is first compressed to desired size by reconfiguring it at the terminal using
gstreamer code before being encoded and multiplexed and write the output to the
pipeline. Section 3.4.3 discussed further about the operation of gstreamer.
In GRC blocks discussed in section 3.4.3, the file source block is to provide any
video source such as raw video, video files or pipe as the source. By choosing the
videotx pipeline as the source, the video from gstreamer that has been transmitted to the
37
videotx pipeline, is the input of the OFDM system. The OFDM system that is configured
in GRC, produces baseband configuration, which is then transferred to be processed in
USRP.
The signal transmitted from Tx antenna on USRP is then received by the received
Rx antenna to be demodulated using OFDM demodulation. The output from the
demodulation is then sent to the videorx pipeline as the last station in GRC. The pipeline
must be read by gstreamer using the necessary code configured at the terminal, which is
discussed in section 3.4.3.
In [21], there are several ways of configuring gstreamer video. To transmit the
video using gstreamer and send it through the pipeline that has been created in section
3.4.2, the following command are used:
By implementing the previous commands as shown in figure 3.4, the video will
automatically send through the pipeline namely videotx. The pipeline will remain in the
pause condition as long as there is no further processing done to the pipeline.
The next step is to activate the pipeline using GNU radio source code, at this rate
the user need to create a reliable digital signal processing flow graph using GNU Radio
Companion (GRC). On top of that, users also can configure the source code by using
python programming and simulate it by using GNU radio. In this project, the uses of
GRC is more practical, since it can save time to reconfigure the RF options such as
modulation schemes, system bandwidth and etc.
On the receiver part, the reverse operation of the transmitter takes place. User
need to play the video by activating the videorx pipeline using the following commands:
39
Note that the file of videorx.ts is saved by default at Ubuntu home files. Despite
of using pair of encoder-mux such as “x264enc-flutsmux”, users can also try to replace it
with another pair such as “theoraenc-oggmux” or “ffenc_mpeg4-avimux”. The video
quality varies based on the encoder used at the transmitter.
To create signal flow graphs and generate flow-graph source code for the system
design, a GNU Radio Companion (GRC) software based on graphical user interface
(GUI) is used. It is currently still under development by Josh Blum, a member at Ettus
Research group. GNU Radio Companion (GRC) is used in this project due its simplicity
to reconfigure. Each GRC block is python based programmed and combined to a
dedicated xml file. The xml files may contain but not limited to their parameters, IO
ports and template to generate corresponding output. To ensure blocks compatibility for
the future, the id key and file name must match the GNU radio blocks modules.
Appendix B is an example of xml file for OFDM basic clock. The Figure 3.5
corresponds to the OFDM transceiver system flow graph that has been used in this
project.
40
2 3
The OFDM modulation block is marked with number one and red circle is the
most important block to be configured. There are several parameters such as payload
length, FFT length and occupied tones that need to be configured by the user. The xml
file of the block is shown in Appendix C.
The number 2 and number 3 mark the generating and simulating tools in GRC.
The numbered 2 tool used to generates the Python code of the system in this project as
shown in Appendix D. After the Python code has been generated, user can now simulate
the system to get the output by clicking the tool as marked by number 3 in figure 3.5.
41
In order to calculate the coded bit rate some parameters need to be set such as:
i) System bandwidth, BW = 1MHz
ii) Number of FFT bin = 64
iii) Number of occupied tones = 32
iv) Number of cyclic prefix =16
v) Encoder rate = 1/2 or 2/3
For the system specified as above, we can calculate some important parameters as
below:
• Df = 1M/64 = 15.625kb/s
• Tfft = 1/df = 64us
• Tg(25%) = (16/64)(64us)=16us
• Tsymbol = 80us
42
• Nsymbol = 12500
Then, the coded bit rate is calculated depending on the modulation scheme being
used whether 16-QAM, 8-QAM or QPSK:
i) For 16-QAM
CR = 32x4x12500 = 1.6Mb/s
DR = 6.4 Mb/s x ½ = 0.8Mb/s
The OFDM capacity can simply be calculated by using the formula of bandwidth
capacity as shown in table 3.1 as:
3.5 Summary
User interface
Turn ON webcam
Terminal
GNU Radio
USRP
GNU Radio
Defined the DSP need to be done by the FPGA
(demodulation type, FFT bin, desired IF and RF
frequency)
USRP
Daughterboard process the RF signal before it
transmitted to antenna
The digital data converted to analog
FPGA done the DSP
Terminal
Choose appropriate video decoder and demux
User interface
Display the received video
CHAPTER 4
4.1 Introduction
Some experiments have been conducted using one USRP and one laptop as
transceiver. The results for those experiments will be further discussed in this chapter as
well as the preliminary and main parts of this chapter. In preliminary part, the conducted
experiments were more focus on transmitting and receiving video using OFDM
modulation while in main part, the quality of the video will be discussed based on Bit
Error Rate (BER) as well as the Symbol Error Rate (SER).
48
The main objective in the preliminary works is to get an acceptable QoS video at
the receiver side. As the main modulation mapping used in this project is to use M-QAM
modulation, therefore several experiments has been conducted by varying the necessary
variables purposely to observe the best quality of received video.
It is known that we can transmit video signal by using OFDM modulation due to
its high bit rate transmission advantage. However, to adapt with low bandwidth
limitation in USRP, some variable might need to be set in suitable value to achieve
acceptable quality of service. In order to observe the ability to display the video on
receiver side, the numbers of subcarriers were varied from 32 to 80 while some other
variables such as FFT length and cyclic prefix were fixed to a certain value as below:
i) Gstreamer:
-frame rate: 10fps and
- bitrate compression:256kbps
ii) GRC:
-modulation:16-QAM
- FFT length:128
-occupied tones/subcarriers: varied
-cyclic prefixes: 32
49
The achieved bit rate for every configuration was calculated and their average is
tabulated in table 4.1 below.
Table 4.1: The achievable bit rate of various occupied subcarriers for 128 FFT length
Number of occupied subcarriers
32 48 64 80
Average Bit rate
46.9 97.8 130.4 177.2
(kbps)
Max bandwidth
250 375 500 625
(kHz)
% of achieved
18.76 26.08 26.08 28.35
bitrate
Table 4.2(a): The video snapshot of 32 occupied subcarriers for 128 FFT length
Occupied Subcarrier Video Snapshot
32
51
Table 4.2(b): The video snapshot of various occupied subcarriers in 128 FFT length
Occupied Subcarrier Video Snapshot
48
64
80
52
Table 4.1 reveals that the achievable system bit rate can be increased by
increasing the occupied subcarriers in the OFDM system. As a result, the percentage of
bit rate achieved for their respective maximum bandwidth was increased as well as
illustrated in figure 4.1. As a conclusion, 80 subcarriers is the best configuration among
these four subcarriers as it can achieve more than 28% of bandwidth usage.
Table 4.2(a) and 4.2(b) is the received video snapshot for several configurations
of subcarriers as studied in this experiment whereas the transmitted video snapshot shown
in figure 4.2. Based on the results in figure 4.1 and table 4.2 (a) and (b), it can be
concluded that the more the bitrate achieved by the system, the better the quality of
receivable video as the good QoS required the maximum throughput of the system
53
Basically, there are only two types of modulation provided in GNU Radio
Companion (GRC) 3.2.2 which are Phase Shift Keying (PSK) and Quadrature Amplitude
Modulation (QAM). This experiment was conducted to compare on video ability while
using 16-QAM modulation scheme to other scheme such as QPSK and BPSK. All of
these schemes were possible to be used in OFDM but, this experiment is to determine the
best modulation to adapt with USRP environment.
In this experiment, the modulation schemes are varied and the following value is fixed:
iii) Gstreamer:
-frame rate: 10fps and
- bitrate compression:256kbps
iv) GRC:
-modulation:16-QAM
- FFT length:128
-50% occupied tones/bandwidths
-25% cyclic prefixes
54
BPSK (1 bit)
55
Table 4.3(b): The received video snapshot for 2,3 and 4 modulation bit
QPSK (2 bit)
8-QAM (3 bit)
16-QAM (4 bit)
56
Based on Table 2 above, it is shown that the best way to transmit a video by using
USRP is by using BPSK modulation scheme. Although, it was possible to transmit using
16-QAM modulation, it is verified that using a lower transmission rate such as BPSK is
more reliable as the daughter board allows limited data rate of 256kb/s. Lower bit rate
experience lower probability of bit error rate. 16-QAM using 4bits/FFT subcarrier
provides high bit rate which is not suitable enough for smaller sampling rate of DAC and
ADC in USRP.
As calculated in part 3.4.5, and tabulated in table 3.3 bit rate for 16-QAM system
with 50% occupied bandwidth and 25% of CP, the data rate is 800kbps, while 400kbps
and 200kbps for QPSK and BPSK respectively. However, the video is compressed to
256kb/s and thus, the BPSK with bit rate of 200kb/s is the most suitable modulation
scheme to adapt with 256kb/s channel bandwidth.
57
One of the reasons of why a video cannot be displayed is because there is too
much packet lost during transmission. The number of packet transmitted can be reduced
by increasing the payload length. In this experiment, the QoS on the displayed video is
studied by manipulating the payload length from 128 to 2048 kbit/packet at the
transmitter and the following value is fixed:
i) Gstreamer:
-frame rate: 10fps and
- bitrate compression:256kbps
ii) GRC:
-modulation:16-QAM
- FFT length:128
-50% occupied tones/bandwidths
-25% cyclic prefixes
128
256
512
59
1024
2048
60
30
25
20
15
10
0
128 256 512 1024 2048
% of achievable bit rate 20.02 23.62 24.22 30 30.16
Figure 4.5: Percentage of achievable bit rate for various payload length
61
From table 4.5, it can be concluded that, the percentage of achievable bit rate is
significantly increased while increasing the Payload Length from 128 to 2048. However,
there is not much different while increasing the payload length from 256 to 512 and from
1024 to 2048. Consequently, the video quality was improved as the Payload Length
increases as shown in the table 4.5(a) and 4.5 (b). However, the maximum payload
length allowable by GRC is 4096 and the increases of payload length to a higher value
might cause the video failed to be displayed.
62
BER is a common way to measure on how much error occurs when signals
received. A good system should have very minimum number of BER counts even though
a zero BER is nearly impossible for a system to be designed. FFT bin will provide the
desired narrowband for a single subcarrier, the higher the FFT bin, the narrower the
subcarrier signals. The following value must be configured before transmit the video:
i) Gstreamer:
- frame rate: 10fps and
- bitrate compression:256kbps
ii) GRC:
- modulation:16-QAM
- FFT length: variable
63
Figure 4.6: The BER counts for different size of FFT and samples size
Figure 4.6 above shows the BER counted at the receiver while using 16-QAM
modulation schemes. As can be seen, the BER is significantly large for all sizes of FFT
since there is no synchronization that has been made in this project. By using 5000
samples, the BER is slightly decreased when the number of FFT length increases.
However, as the samples data increase to 10000, the BER is significantly improved as the
FFT size increases from 128 to 256 and from 256 to 512 FFT size. As a conclusion, the
error rate can be reduced as the number of subcarrier increases.
64
CHAPTER 5
CONCLUSION
5.1 Conclusion
By utilizing GNU Radio Companion (GRC) Software, an OFDM system has been
built for purpose of video transmission. At the transmitter part, a pipeline namely
„videotx‟ has been created first to enable streaming application likewise a „videorx‟
pipeline on the receiver part to enable streaming on the receiver. The video must be
configured first at the transmitter to ensure a low rate video transmission by set up the
suitable encoder, multiplexer, frame rate, compression rate and specified the pipeline
location where it wants to be transmitted. A bandwidth of 1 MHz was set at the USRP as
the hardware platform in which the digital signals were processed before it can be
transmitted through real antenna. There are many flexible configurations which can be
set by the user to meets their needs. At the terminal, user can reconfigure the video
which they want to transmit for example users can add time overlay to enhance the time
management if necessary besides choosing appropriate pair of encoder and multiplexer.
Most of the video signals were encoded using commands „ffenc_mpeg‟ and „avimux‟ as
encoder and multiplexer respectively because it is lossy type of encoder which suitable to
65
do the experiments. However, there are other pairs such as „theoraenc & oggmux‟ and
„x264enc & flutsmux‟ that can replace the encoder & muxer pair as long as the software
library has been downloaded in Linux.
The flexibility of this project was not only limited in terminal but also in the
software platform in SDR which is GNU Radio. The modulation schemes are among the
popular part in GNU Radio where a user might want to reconfigure especially for the
researchers besides the channel frequency, system bandwidth, signals filter and etc.
1.2 Suggestions/Recommendation
This section might be useful for further study of OFDM or if someone wants to
make project related to this topic or to improve this project.
66
1.2.1 Python
1.2.2 Synchronization
1.2.3 Protocol
There are some protocols can be added to the USRP such as Wireless Sensor
Network (WSN) for low rate transmission and Wireless Local Area Network (WLAN)
for higher data rate transmission. The setup guidance for both of these protocols has been
discussed in more details in [13].
67
REFERENCES
6. “http://en.wikipedia.org/wiki/Quadrature_amplitude_modulation”,visited 2011-
12-28
8. Dawei Shen(2005), Tutorial 1: GNU Radio Installation Guide - Step by Step, May
19, 2005
68
10. Muhammad Nasir Bin Othman (2011). Cyclic Prefix Design For Orthogonal
Frequency Division Multiplexing (OFDM) Using FPGA.
11. Joseph Wamicha,Simon Winberg (2011), IEEE 802.11 OFDM Software Defined
Radio Beacon Frame Transmission.
12. Mohamed Syahrezal bin Kudus (2010). Video Transmission Via Software Defined
Radio. Universiti Teknologi Malaysia.
13. Alalelddin Muhamed (2010). Studying Media Access and Control Protocols.
Sweden.
14. Chao Chen, Robert W. Heath Jr., Alan C. Bovik And Gustavo De Veciana
(2011),” Adaptive Policies For Real-Time Video Transmission: A Markov
Decision Process Framework”,
15. Nur Saffiyah bt Mohd Suhaimi (2010). Audio Data Transmission Using Software
Defined Radio. Universiti Teknologi Malaysia
18. Hen-Geul Yeh, Paul Ingerson (2010), Software-Defined Radio for OFDM
Transceivers,
19. Dipankar R, Mario G, Emerging Wireless Technologies and the Future Mobile
Internet, Cambridge Books Online, page 185-186
69
20. Gavin Y., Mineo T. and Rajive B. (2005), Effects of Detailed OFDM Modeling in
Network Simulation, Society for Modeling and Simulation International (SCS)
APPENDIX A
APPENDIX B
All of these modules must be installed first especially the modules with (*) mark
because those were important components. The modules can be downloaded from GNU
72
Radio‟s website and the new version of these modules can be checked and downloaded
using following commands:
$export CVS_RSH="ssh"
$cvs -z3 -d:ext:anoncvs@savannah.gnu.org:/cvsroot/gnuradio co -P <modulename>
The USRP CVS tree is hosted on SourceForge. Use these commands to check the usrp
module out:
Then a directory with the module name will appear in your current folder. Every time you
should
2. Installing gnuradio-core
This step will requires many pre-installed packages and is the very important
step/module. In order to avoid further trouble, the development tools and the X-window
development tools must be checked during Linux and GNU installation. These are 3
important packages that often found to be missing and necessary to be installed:
1. FFTW
Webpage: http://www.fftw.org/
Download page: http://www.fftw.org/download.html
2. cppunit
Webpage: http://cppunit.sourceforge.net
Download page: https://sourceforge.net/project/showfiles.php?group id=11795
3. SWIG
73
Webpage: http://www.swig.org
Download page: http://sourceforge.net/projects/swig/
The following steps will install the gnuradio-core. Users must ensure that the following
commands were install in gnuradio-core folder downloaded from CVS in step 3.3.1:
2. $ ./bootstrap
3. $ ./configure --enable-maintainer-mode
4. $ make
5. $ make check
6. $ make install
4. Installing of gr-wxgui
Webpage: http://www.wxPython.org/
Download page: https://sourceforge.net/project/showfiles.php?group id=10718
To enable the graphical user interface (GUI) such as FFT graph and oscilloscope
function in GNU Radio, there is a need to install gr-wxgui and it is based on wxPython.
Therefore, the installation of wxPhyton should come first.
Webpage: http://sdcc.sourceforge.net/
Download page: http://sourceforge.net/project/showfiles.php?group id=599
The above link is to download SDCC free C compiler. SDCC is important to
build the firmware interfaces for GNU Radio‟s use.
74
7. Post-installation tasks
After the steps in 3.3.1-3.3.6 done, users may want to open the files. The installed
file will be by default save in:
APPENDIX C
<?xml version="1.0"?>
<!--
###################################################
##OFDM Mod
###################################################
-->
<block>
<name>OFDM Mod</name>
<key>blks2_ofdm_mod</key>
<import>from grc_gnuradio import blks2 as grc_blks2</import>
<import>from gnuradio import blks2</import>
<make>grc_blks2.packet_mod_$(type.fcn)(blks2.ofdm_mod(
options=grc_blks2.options(
modulation="$modulation",
fft_length=$fft_length,
occupied_tones=$occupied_tones,
cp_length=$cp_length,
pad_for_usrp=$pad_for_usrp,
log=None,
verbose=None,
),
),
payload_length=$payload_length,
)</make>
<param>
<name>Input Type</name>
<key>type</key>
<value>float</value>
<type>enum</type>
<option>
<name>Complex</name>
<key>complex</key>
<opt>fcn:c</opt>
</option>
76
<option>
<name>Float</name>
<key>float</key>
<opt>fcn:f</opt>
</option>
<option>
<name>Int</name>
<key>int</key>
<opt>fcn:i</opt>
</option>
<option>
<name>Short</name>
<key>short</key>
<opt>fcn:s</opt>
</option>
<option>
<name>Byte</name>
<key>byte</key>
<opt>fcn:b</opt>
</option>
</param>
<param>
<name>Modulation</name>
<key>modulation</key>
<type>enum</type>
<option>
<name>BPSK</name>
<key>bpsk</key>
</option>
<option>
<name>QPSK</name>
<key>qpsk</key>
</option>
<option>
<name>8PSK</name>
<key>8psk</key>
</option>
<option>
<name>QAM8</name>
<key>qam8</key>
</option>
<option>
<name>QAM16</name>
<key>qam16</key>
</option>
<option>
77
<name>QAM64</name>
<key>qam64</key>
</option>
<option>
<name>QAM256</name>
<key>qam256</key>
</option>
</param>
<param>
<name>FFT Length</name>
<key>fft_length</key>
<value>512</value>
<type>int</type>
</param>
<param>
<name>Occupied Tones</name>
<key>occupied_tones</key>
<value>200</value>
<type>int</type>
</param>
<param>
<name>Cyclic Prefix Length</name>
<key>cp_length</key>
<value>128</value>
<type>int</type>
</param>
<param>
<name>Pad for USRP</name>
<key>pad_for_usrp</key>
<type>enum</type>
<option>
<name>Yes</name>
<key>True</key>
</option>
<option>
<name>No</name>
<key>False</key>
</option>
</param>
<param>
<name>Payload Length</name>
<key>payload_length</key>
<value>0</value>
<type>int</type>
</param>
<sink>
78
<name>in</name>
<type>$type</type>
</sink>
<source>
<name>out</name>
<type>complex</type>
</source>
<doc>Payload Length: 0 for automatic.</doc>
</block>
79
APPENDIX D
#!/usr/bin/env python
##################################################
# Gnuradio Python Flow Graph
# Title: Top Block
# Generated: Fri Jun 29 14:06:51 2012
##################################################
class top_block(grc_wxgui.top_block_gui):
def __init__(self):
grc_wxgui.top_block_gui.__init__(self, title="Top Block")
##################################################
# Variables
##################################################
self.samp_rate = samp_rate = 2000000
##################################################
# Blocks
##################################################
self.blks2_ofdm_demod_0 =
grc_blks2.packet_demod_b(blks2.ofdm_demod(
options=grc_blks2.options(
modulation="qam16",
fft_length=128,
occupied_tones=64,
80
cp_length=32,
snr=15,
log=None,
verbose=None,
),
callback=lambda ok, payload:
self.blks2_ofdm_demod_0.recv_pkt(ok, payload),
),
)
self.blks2_ofdm_mod_0 = grc_blks2.packet_mod_b(blks2.ofdm_mod(
options=grc_blks2.options(
modulation="qam16",
fft_length=128,
occupied_tones=64,
cp_length=32,
pad_for_usrp=True,
log=None,
verbose=None,
),
),
payload_length=64,
)
self.gr_file_sink_0 = gr.file_sink(gr.sizeof_char*1,
"/home/ubuntu/videorx")
self.gr_file_source_0 = gr.file_source(gr.sizeof_char*1,
"/home/ubuntu/videotx", True)
self.gr_multiply_const_vxx_0 = gr.multiply_const_vcc((5000, ))
self.gr_throttle_0 = gr.throttle(gr.sizeof_gr_complex*1, samp_rate)
self.usrp_simple_sink_x_0 = grc_usrp.simple_sink_c(which=0, side="A")
self.usrp_simple_sink_x_0.set_interp_rate(128)
self.usrp_simple_sink_x_0.set_frequency(2400000000, verbose=True)
self.usrp_simple_sink_x_0.set_gain(0)
self.usrp_simple_sink_x_0.set_enable(True)
self.usrp_simple_sink_x_0.set_auto_tr(True)
self.usrp_simple_source_x_0 = grc_usrp.simple_source_c(which=0,
side="A", rx_ant="TX/RX")
self.usrp_simple_source_x_0.set_decim_rate(64)
self.usrp_simple_source_x_0.set_frequency(2400000000, verbose=True)
self.usrp_simple_source_x_0.set_gain(15)
self.wxgui_scopesink2_0 = scopesink2.scope_sink_c(
self.GetWin(),
title="Scope Plot",
sample_rate=samp_rate,
v_scale=0,
t_scale=0,
ac_couple=False,
81
xy_mode=False,
num_inputs=1,
)
self.Add(self.wxgui_scopesink2_0.win)
##################################################
# Connections
##################################################
self.connect((self.blks2_ofdm_demod_0, 0), (self.gr_file_sink_0, 0))
self.connect((self.gr_file_source_0, 0), (self.blks2_ofdm_mod_0, 0))
self.connect((self.usrp_simple_source_x_0, 0),
(self.blks2_ofdm_demod_0, 0))
self.connect((self.blks2_ofdm_mod_0, 0), (self.gr_multiply_const_vxx_0,
0))
self.connect((self.gr_multiply_const_vxx_0, 0), (self.gr_throttle_0, 0))
self.connect((self.gr_throttle_0, 0), (self.usrp_simple_sink_x_0, 0))
self.connect((self.usrp_simple_source_x_0, 0), (self.wxgui_scopesink2_0,
0))
if __name__ == '__main__':
parser = OptionParser(option_class=eng_option, usage="%prog: [options]")
(options, args) = parser.parse_args()
tb = top_block()
tb.Run(True)