You are on page 1of 25

1

PROJ ECT REPORT


ON
Wireless OFDM Link Using MATLAB

Course : Wireless & Cellular Systems

Submitted to : Dr. Vivek Bohara
Assistant Professor , Department of
Communication & Signal Processing
IIIT Delhi.

Project Team : Sanjeev Baghoriya (MT13161)
Nilesh Varshney (MT13159)
Himanshi Saini (MT13155)

Department of Electronics & Communication
Engineering , IIIT Delhi.





2
Abstract

Today in the wireless communication systems , Orthogonal Frequency Division
Multiplexing is rampantly becoming the chosen modulation technique as it can
provide large data rates, low bit error rate & robustness against the channel effects.
So , the objective of this report is to implement an OFDM system for a speech signal
& create a link between a transmitter & a receiver considering AWGN channel
using the MATLAB software .Different signal to noise ratio (SNR)values were used
to analyse the successful recovery of the original message in the presence of AWGN
channel. Matlab code has been designed keeping in view the limitations &
assumptions during the implementation of the OFDM blocks. The report also
discusses the challenges that were faced during the designing of the code & their
solutions.

Keywords : OFDM , BER , SNR, AWGN, ISI, .Wav file ,Matlab ,FFT,IFFT,IDFT.















3
Part 1
Abstract 2
Contents 3
List of figures 4
List of Tables 4
Abbreviation list 6
Chapter 1 Introduction
1.1 OFDM Definition
1.2 Difference between TDMA ,FDMA & OFDM.
1.3 Applications of OFDM
1.4 Advantages & Disadvantages
Part 2
Chapter 2 Assumptions & the Calculated Parameters. 10
3.1 Assumptions while designing
3.2 Parameters used in the implementation
Chapter 3 OFDM Block Diagram 11
2.1 OFDM block diagram explanation
Part 3
Chapter 4 Designing of the OFDM transmitter block in MATLAB 13
Chapter 5 Adding AWGN channel effects & Designing the receiver
block . 19
Chapter 6 Problems tackled during the designing of the OFDM Transmitter
& Receiver blocks. 22
Conclusions 24
Future work 24

4
References 25

LIST OF FIGURES.

Fig 1.1 Single Carrier vs OFDM modulation
Fig.1.2 Frequency Division Multiple Access
Fig.1.3 Time Division Multiple Access
Fig 1.4 Orthogonal Frequency Division Multiple Access
Fig.4.1 OFDM Baseband Block Diagram
Fig 4.1 Input Voice Signal
Fig 4.2 Bits representation of the input voice signal
Fig.4.3 16-QAM Constellation Diagram
Fig.4.4 16-QAM Constellation diagram showing phase & Amplitude
Fig.4.5 Transmitted OFDM Signal with 5 Frames
Fig 4.6. Transmitted OFDM Spectrum
Fig 5.1 Received OFDM signal with AWGN noise
Fig.5.2 Recovered Signal containing Noise
Fig.6.1 OFDM signal when only magnitude of complex envelope is transmitted
Fig 6.2 Matlab .wav clipping error


LIST OF TABLES
Table 3.1 Calculated Parameters used in designing










5



ABBREVIATIONS
OFDM Orthogonal Frequency Division Multiplexing
ICI Inter Carrier Interference
ISI Inter Symbol Intereference
SNR Signal to Noise Ratio
BER Bit Error Rate
PAPR - Peak To Average Power Ratio
FFT - Fast Fourier Transform
IFFT - Inverse Fast Fourier Transform
IDFT - Inverse Discrete Fourier Transform
WAV - Waveform Audio File format
AWGN - Additive White Gaussian Noise
GSM - Global Systems for mobile
TDMA - Time division Multiple Access
FDMA - Frequency Division Multiple Access








6



INTRODUCTION
OFDM BASICS
The project aims at the transmission of the digital data between transmitter and
receiver using Orthogonal Frequency Division Multiplexing (OFDM). The OFDM is
a multiple access technique[1] in which the high digital data stream is divided into
sub stream and each substream is transmitted using number of sub carriers.

Fig 1.1 Single Carrier vs OFDM modulation[2]
The Figure 1.1 shows the transmission of 4 bit data using single carrier and the
OFDM modulation. With the increase in the transmission rate the time for data
reception become lesser but the delay time caused by multipath remains constant.
This limitation in high data rate communication is ignored by sending low speed
data simultaneously. Also the complexity of low date rate transmission[2] is reduced
as compared to single high speed data rate transmission.
ADVANTAGES AND DISADVANTAGES OF OFDM
ADVANTAGES-
1) The major advantage of OFDM is robustness against ISI( Inter Symbol
Interference) and ICI( Inter Carrier Interference) using the cyclic prefix.
2) Increase in the spectrum efficiency by allowing many carriers to overlap.

7
3) The transmitted datastream is divided in many sub stream and each sub-
stream is send using different subchannels such that is experiences flat fading
and thus eliminates the use of equalizers as used in single carrier systems.
4) Channel equalization technique is simpler and easier using frequency domain
equalization technique as compared to the time domain equalization
technique.
5) Channel coding (COFDM) and interleaving can be used to recover the data
bits lost due to frequency selectivity of the channel.
DISADVANTAGES-
1) PEAK-TO-AVERAGE POWER RATIO (PAPR)[3]- The OFDM signal uses
many subcarriers which when added gives large PAPR which causes
nonlinear distortion in OFDM signal. This requires a highly linearity of
amplifiers.
2) Decrease in the efficiency due to guard interval.
3) It is sensitive to frequency synchronization problems.
4) The performance of the OFDM system is affected by frequency offset and
timing mismatch which affects the orthogonality of the subcarriers.
APPLICATIONS
OFDM is used in many wired and wireless applications such as-
Wired- ADSL (Asymmetric digital Subscriber line) and VDSL(Very High bit rate
digital subscriber line) broadband access using POTS(Plain Old Telephone System),
PLC (Power Line Communication).[1]
Wireless-DAB (Digital Audio Broadcasting)[1], HDTV-Digital Video Broadcasting
(DVB), IEEE 802.16 Broadband Wireless Access System, 3GPP UMTS (Universal
Mobile Communication System) , LTE( Long Term Evolution) , IEEE 802.15.3a
Ultra Wideband(UWB) , IEEE 802.11a,g,j,n (Wi-Fi) Wireless LAN, etc.
DIFFERENCE FROM TDMA, FDMA
The FDMA (Frequency Division Multiple Access) is a channel access technique in
which each user is allocated one or many frequency bands. They were generally
used in first generation telecommunication systems such as AMPS (Advanced
Mobile Phone Service). They suffered from low user capacity, security problems.

8

Fig. 1.2 Frequency Division Multiple Access [2]
In Time Division Multiple Access (TDMA) many users uses the same frequency
channel by dividing the data into number of time slots. They are generally used in
2G network like Global System for Mobile Communication (GSM). There are some
cons associated with TDMA. Firstly, an overhead is associated with the change over
between users due to time slotting on the channel limits the number of users.
Secondly, the symbol rate of each channel is very high causing problems with
multipath delay spread.

Fig. 1.3 Time Division Multiple Access
OFDM eliminates the problems associated with FDMA and TDMA as it has higher
spectrum efficiency and no overhead is required but the condition is that the
subcarriers should be orthogonal to each other.

9

Fig 1.4 Orthogonal Frequency Division Multiple Access
Why 44.1KHz audio Sampling rate[4] is used in CD?
There are two reasons-
1) The maximum audio frequency which the humans can hear is 20KHz. To
fulfil the Nyquist criteria the sampling rate should be larger than twice the
maximum frequency used i.e. 40KHz.To prevent this signal from aliasing we
need ideal filter. For practical filters we use a frequency little higher than the
Nyquist rate.
2) In India PAL system in Television is used which has 294 active lines/field,
50fields per seconds, 3 samples/line. So the sampling rate becomes-
294*50*3=44100 Hz










10

ASSUMPTIONS
1. No Multipath Channel has been considered.
2. No Pilot Subcarriers are used.
3. No channel coding has been considered.
4. Number of symbols are known to the receiver.
5. Either Number of frames transmitted or a specific preamble knowledge should be
known to the receiver.
6. Number of carriers are used are known to the receiver.
7. The guard interval to useful time ratio is 5.

PARAMETERS USED
System Bandwidth 3.5KHz
Total number of Carriers 55
Nd , Data Subcarriers 44
Ng, Guard Band Subcarriers 11
Per-carrier Bandwidth 63.63 Hz
Tg/Ts 5
Ts,OFDM Symbol Duration 0.286 ms
Tg,Cyclic prefix duration 0.0572ms
Tn=nTs, spacing duration 15.73ms
T=Tn+nTs , Frame duration 15.7872ms
Transmitted signal duration (5
Frames )
78.936ms

Table 3.1 Calculated Paramters used in designing







11




OFDM BLOCK DIAGRAM
The OFDM is a multicarrier, wideband modulation scheme in which the data is sent
on a number of frequencies which posses a orthogonal relationship with each other.
The function (t) is orthogonal to other function *(t) if

The orthogonality allows many subcarriers to be transmitted in a channel thus
increasing the spectral efficiency. The subcarriers are orthogonal if the carriers
spacing is a multiple of 1/, where is the symbol period.
The Figure below gives the block diagram[1] of OFDM-

Fig. 4.1 OFDM Baseband Block Diagram
The OFDM block diagram[5] consists of the following blocks-
1) Modulator/ Demodulator- The digital data to be transmitted on each carrier is
modulated using either BPSK( Binary Phase Shift Keying), QPSK

12
(Quadrature Phase Shift Keying), QAM(Quadrature Amplitude Modulation)
and selection depends on power and efficiency . In our project we have used
16-QAM.
2) Serial to Parallel Converter- The serial to parallel converter is used to convert
serial data into parallel data. Each data word is assigned one carrier in
transmission.
3) IFFT/FFT-Inverse Fast Fourier Transform (IFFT) is used in the transmitter to
convert signal from frequency domain to the time domain, convert bits into
samples. Fast Fourier Transform(FFT) is used in the receiver and does the
inverse function of IFFT.
4) Cyclic Prefix/Guard Interval- It is used to eliminate ISI (Inter Symbol
Interference) and ICI(Inter Carrier Interference) due to multipath effect. This
prefix is anything between 1/10 to1/4 of the original OFDM symbol. From the
receiver the guard interval is removed. It reduces the sensitivity to time
synchronization problems.
5) DAC/ADC- Analog to Digital Converter(ADC) is used to convert analog
signal to digital signal at a particular sampling rate and DAC(Digital to analog
converter) is used to recover the analog signal from the digital signal.
6) AWGN Channel- Additive White Gaussian Noise Channel is applied to the
transmitted signal. This allows SNR (Signal to Noise ) ratio ,multipath effect
to be controlled. A white noise is added to the transmitted signal.












13



DESIGN OF OFDM TRANSMITTER IN MATLAB
1. Input data- The data that we use as original message & which is fed to the ofdm
modulation system is the speech signal . It is taken into the matlab software by using
the wavrecord(n*fs) command . The n depicts the number of seconds for which
the speech input is taken in a continuous manner .In this finite duration of time it is
required by the system to take number of samples which is designated by fs. By
default in the matlab it is taken as 11025 samples per second .
The input voice signal is plotted usingt the plot command which can be
represented by the sample input we took during the execution.

Fig 4.1 Input Voice Signal
2. Conversion into bits: The input voice data is represented as floating point matrix
which cannot be processed until analog to digital converter is used. So, we use the
de2bi(means decimal to binary) command to convert the input audio into a 16-bit
values. It was also the first challenge the was encountered where the signed as well

14
unsigned floating point values were to be converted into bits so a particular logic
had to be used which is mentioned in the problems faced section.
The figure below shows the digital signal representation in terms of bits

Fig 4.2 Bits representation of the input voice signal
3. Serial to Parallel bits conversion The bits which are stored in a matrix is now
reshaped using the reshape command to convert the [ M x 16] matrix into [(total
no of bits) x 1 ] matrix as a serial data representation that can be fed into the
modulator blocks.
i.e before_qam=reshape(bits,1,total_bits);
4. Modulation using 16-QAM As explained in the previous chapter under the ofdm
modulation describing the 16-QAM modulation techniques advantages over other
schemes , this scheme efficiently converts the bits into the form of symbols to be
transmitted. The total number of symbols transmitted is 11025 symbols which is
also the default sample rate.
Firstly a modulator object is created by using the :
object1 =modem.qammod('M', 16, 'PhaseOffset', 0, 'SymbolOrder',...
'binary', 'InputType', 'bit');
qam_output=modulate(object1,qam_input);

15

Here, M signifies M-ARY system , neglecting any phase offset & taking as bits the
input type . Input type can be integers as well but it is easy to process the bits in the
practical systems.
The received 16-QAM constellation is

Fig. 4.3 16-QAM Constellation Diagram

Fig. 4.4 16-QAM Constellation diagram showing phase & Amplitude.

The scatterplot is basically a mathematical representation of the input data bits that
signify the general symbols along with their magnitudes & the phase relative to each
other. Thus, bits are grouped into the symbols.


5. Conversion into Time Domain signal The output of the QAM is generally in the
frequency domain , so to convert it in the time domain we have to use the Inverse
Discrete Fourier Transform(IDFT) . IFFT command is utilised to implement the

16
efficient ifft algorithm in the matlab as per the number of IDFT points which are
taken as 512, which means that a window of 512 signal samples or bins are taken for
computation.

6. Extraction of the Magnitude & Angle from the IFFT complex output
The ouput of the IFFT process is complex envelope which is in the form y=a+ib , so
this y matrix in complex form cant be processed further & .wav file cant be created
from this. So, to do that we have to extract the magnitude & phase of the complex
values & concatenate together so that total information about the original signal can
be transmitted.
abs(ifft_output) to extract the magnitude & angle(ifft_output) to extract the
phase.
7. Parallel to serial conversion- The reshape command is again used to convert the
parallel magnitude & phase data into the serial data so that the time domain signal
can be continuously transmitted.
8. Phase & Angle data concatenation Both the phase as well as the angel
information are concatenated together to create a single time continuous signal by
using the command : serial_signal=[ mag angle ];
9. Inserting the Cyclic prefix: The length of the cyclic prefix that we have chosen is
25% of the data carriers so that it is greater than the RMS delay spread . We have
chosen the total number of carriers to be 55 & out of them 11 constitutes the cyclic
prefix length. The basic parameters can be referred from chapter 3.
cyclic_prefix=serial_signal(1:1,(column-(ceil(0.25*column))):column);
This command extracts the tail portion of the data symbols & by apprehending it in
the front of the data symbols to avoid the condition of ISI. The command below
explains it:
time_signal=[cyclic_prefix serial_signal];
The length of the cyclic prefix is 0.0572sec .
10. Creating the .wav file The transmitted signal is then converted into an audio
signal by creating a .wav file at relatively low sample rate so that the sound at the
speaker is audible.
i.e wavread(tx,ofdmtx.wav) ; command is used .

17
Below is the transmitted OFDM signal where the cyclic length , symbol length &
total signal length has been specified which consist of 5 frames. The final signal was
created by concatenating the time signal five times to create 5 frames.
i.e time_signal=[ time _signal time_signal time_signal time_signal time_signal ];


Fig. 4.5 Transmitted OFDM Signal with 5 Frames
11. Plotting the Transmit Spectrum The transmit spectrum of the ofdm signal can
be plotted by using the FFTSHIFT command which shifts the centre frequence &
highlights the region where there is maximum spectral density.
Plot(10*log10(abs(fftshift(time_signal))));
is the following command which has been used.




Below is the plotted output in matlab for the transmitted signal spectrum.


18


Fig 4.6. Transmitted OFDM Spectrum
From above we can clearly see that ,out of the 3.5 KHz bandwidth ,more than half
of the bandwidth is saved which can further be utilised in transmitting the pilot
signals , short & long preambles ,etc.













19


ADDING AWGN CHANNEL EFFECTS & DESIGNING OF OFDM
RECEIVER IN MATLAB
1. Adding the AWGN channel effect Additive White Gaussian Noise Channel
effects can be added to the transmitted OFDM signal by using the following
command :
rx_signal=awgn(tx_signal,SNR); where SNR represents the signal to noise ratio &
for different SNR values ,the different effects can be seen on the original signal
recovery .
The transmitted signal gets distorted due to the awgn noise , which can be
represented by the figure below:

Fig 5.1 Received OFDM signal with AWGN noise.
2. Extracting the single OFDM frame The single OFDM frame can be extracted
either the number of frames transmitted to the receiver is known or there is some
known preamble there in the transmitted signal. By comparing the phase or the
preamble portion of the signal ,the frame can be extracted.
Since the single frame is of 0.01578 sec & thus with its known length , the matrix
from the received signal matrix can be extracted.


20
3. Removing the cyclic prefix portion The cyclic length is known to the receiver as
per the assumptions mentioned in the chapter 2. Thus , by the matrix elements of the
received frame beyond the cyclic prefix length are extracted.
without_cyc=rx_unscaled(1:1,(ceil(0.25*frame_length))+1:frame_length);
This is the following logic which we have used in extracting the data symbols as we
already know the cyclic prefix length.

4. Extracting the Magnitude & Angle to create the complex envelope for
demodulation. (Also, converting serial data to parallel )

mag_rx=reshape(mag_rx,numel(mag_rx),1);
ang_rx=reshape(ang_rx,numel(ang_rx),1);
[rx_real rx_img]=pol2cart(ang_rx,mag_rx);
before_fft=rx_real+1i*rx_img;

This is the following logic & the corresponding matlab commands to create the
complex envelope which is then fed to FFT block.

5. Conversion of time domain signal into frequency domain signal.
before_demod=fft(rx_signal,symbol_length);
This logic & corresponding command creates the complex envelope containing the
real as well as the imaginary data into the equivalent frequency domain signal which
will be further processed by the 16-QAM demodulation block.
6. 16-QAM Demodulation
To demodulate the symbols which were created at the transmitter of the ofdm link is
now demodulated . As per the assumptions it is known to the receiver the symbol
length, thus accordingly the bits are retrieved.
demod_object=modem.qamdemod('M', 16, 'PhaseOffset', 0, 'SymbolOrder',...
'binary', 'OutputType', 'bit', 'DecisionType',...
'hard decision');
after_demod=demodulate(demod_object,after_fft);








21
7. Binary to decimal values conversion & creating .wav file

The following matrix containing bits is converted into decimal values & then
wavwrite command is used to create corresponding .wav audio file. Command used
is bi2de.

The below is the received signal plot after OFDM demodulation :


Fig. 5.2 Recovered Signal containing Noise.


Which clearly indicates that awgn noise is there & has to be removed by using
filters.

















22




PROBLEMS TACKLED DURING THE TRANSMITTER &
RECEIVER DESIGNING
1. Conversion of floating point values to full integer values.
The input speech signal was loaded into matrix where the element values were like -
0.0234 , -1.546 , etc which directly cannot be converted to bits using de2bi.
Following logic was used :
A=wavrecord(4*fs);
bits=de2bi(32768*A+32768);
& correspondingly it was decoded at the receiver as
decimal_s=bi2de((R-32768)/32768);
2. Loss of data while transmitting When only the absolute or the real values are
transmitted as an ofdm signal , it is impossible to recover the original at the receiver
as there is no phase information . So it was critical to combine the phase data & the
magnitude data through concatenation & recovered by using pol2cart command.

Fig. 6.1 OFDM signal when only magnitude of complex envelope is transmitted. [6]

23
3. Signal Clipping while creating .wav file

Fig 6.2 Matlab .wav clipping error
The above figure shows that while writing the corresponding decimal as wav file it
clips the data. After searching out on the mathworks.com , it was found out that the
wavwrite takes values only from -1 to 1(excluding). So , we normalised the value to
make it less than 1 known as scaling & then corresponding .wav file is created.
%%Assigning the scaling factor to avoid clipping during wav file creation
scale=0.98; [5]
time_signal =time_signal*scale/max(ang_ifft);

4. Improper Recovery of the original message Appropriate SNR values had to be
taken so that .wav file is properly audible. Hit & trial had to be used to hear the
recovered voice message.
5. Long duration audio signal & signal compression For audio signal of long
durations & more than 80kb , it was found out that the signal compression
algorithms have to be used to compress the matrices to properly utilise the
bandwidth & maintaining the efficiency. Compressed sensing[6] is a very useful
approach that is capable of carrying out effective compression of signals.










24
CONCLUSIONS
A wireless OFDM link was created using MATLAB on windows operating system
for a speech signal with bandwidth of 3.5 KHz . With the OFDM modulation , more
than half of the bandwidth was saved during transmission as explained in the chapter
4. There many problems that were encountered during the designing of the OFDM
system which were solved with specific logics. The recovered signal was distorted
& to properly hear the sound , SNR values had to be varied from 10 db to 135 db for
to decently recover the transmitted voice signal. All the advantages of the OFDM
system were verified during the implementation & the link between the transmitter
& receiver was established. This is basic implementation of the OFDM link using a
speech signal with total 55 carriers whose results match with those expected.


FUTURE WORK

1. Simulating the OFDM system for PAPR removal.
2. Simulating for the AWGN & Multipath effects removal.
3. Implementing the diversity technique[8] by providing the 3 or more input .wav
files ,& using such a logic the one with high SNR is selected .
4. Channel Coding can be implemented to increase the efficiency , bit rate &
improve BER performance.








25

REFERENCES
[1]. Wireless & Cellular systems course by Dr .Vivek Bohara , IIIT Delhi , J an-Feb-
2014.
[2] Real Time Voice Transmission using OFDM modulation , Final year
thesis,2007 , R.Arshad , Usman khan , Deptt of EEE , NWFP UET , Pakistan.
[3]. PAPR Reduction techniques in OFDM systems by Sagar.S, Chaitanya.B,
Pranoti N,IJ EC , Volume 3 , Issue 4 , April,2014.
[4]. www.wikipedia.com/wiki/44,100Hz
[5] http://www.skydsp.com/publications/index.htm
[6] Behaviour of OFDM System using MATLAB Simulation,Volume 3, IJ ACR ,
J une 2013,S.Ghorpade , S.Sankpal.

[7] Introduction to Compressed sensing , by M Davenport , M.Duarte ,Y.Eldar ,
Stanford University , USA.

[8] Transmit /Receiver-Antenna Diversity Techniques for OFDM Systems
,A.Damman , S.kaiser , ICN , German Aerospace centre.