LohTuckKeong_FYP

advertisement
SIM UNIVERSITY
SCHOOL OF SCIENCE AND TECHNOLOGY
OFDM BASED WIRELESS COMMUNICATION SYSTEM
STUDENT
SUPERVISOR
PROJECT CODE
: H0704928 (PI NO.)
: MR WILSON OON
: JUL2010/ENG/056
A project report submitted to SIM University
in partial fulfilment of the requirements for the degree of
Bachelor of Electronics
May 2011
Done by Loh Tuck Keong
Student PI: H0704928
Page 1 of 55
1.
ACKNOWLEDGMENT
I would like to thanks my project supervisor, Mr Wilson Oon for his guidance throughout my
whole project. Sharing his reading materials and experience allow me to understand on the subject
and refer relevant books for my in-depth study. In the past 10 months, Mr Wilson has been
encouraging and directs me to the success of this project. I would sincerely grateful for his time
and effort as well as constant discussion to ensure I am on my schedule.
Done by Loh Tuck Keong
Student PI: H0704928
Page 2 of 55
2.
ABSTARCT
Wireless communication refers to sending information without cable connection and most
common technique is through radio frequency. This transmission technique is commonly used in
many devices such as, wireless modem, mobile phone, etc. As the demand on high bit rate
transmission increases, air traffic increases as well and create signal interference which causes loss
of information at the receiver. Other than air traffic interference, mobile channel do affect
receiving information.
In this thesis, I will discuss on OFDM which is widely used in wireless communication due to
high bit rate transmission, a multi-carrier transmitter and transmits data in parallel channel
compare to other series transmission technique that is low transmission rate and require larger
bandwidth.
OFDM transmitter convert serial data to parallel data and feed into parallel channels and
modulated individually. There are several modulation schemes, PSK, QAM, etc and in this thesis,
QPSK is used to modulate signals. QPSK modulate 2 bits/symbol and sqrt(2) is used to
normalized QPSK data. Modulated data is in frequency domain, therefore will pass through IFFT
circuit to convert to time domain. OFDM had its disadvantage as well, for example, Inter
Symbolic Interference (ISI) that causes distort received signal, thus guard interval is inserted to
eliminate ISI by adding addition bits in front of the signal.
AWGN, one path fading and multipath fading effects is added in the received signal to evaluate
OFDM performance. Signal is converted from time domain back to frequency domain in FFT
circuit and guard interval will be removed. Parallel data will converted back to serial data to revert
back to original signals.
OFDM is simulated using MATLAB, BER is generated with AWGN, one path fading, multipath
fading effects individually. BER is calculated theoretically and comparison between simulated
BER and theoretical calculated to understand the difference. In the simulation, there is no
significant different in BER comparison and the value shift is due to guard interval.
In this thesis, I will explain on the characteristic, problems and methods of basic OFDM
transmission and follows by detailed description on transmitter; how serial data converted to
parallel, modulated, IFFT, guard interval, etc and receiver; how received signals are de modulated,
FFT and revert back to transmitter signal.
OFDM transmission is simulated by Matlab. In the source codes, a random serial data is generated
in transmitter module and this serial will convert to parallel data. w detailed explanations on how
signal transmit and receive based on source code.
QPSK modulation is used in this simulation with AWGN, one path fading and multipath fading
effects. Thus, theoretical calculated and simulated BER are generated to evaluate performance of
OFDM.
Done by Loh Tuck Keong
Student PI: H0704928
Page 3 of 55
3.
LIST OF FIGURES
Figure 4.1: Different Transmission Technique; Multi Carrier, OFDM, Single Carrier
Figure 5.1: Different Modulation
Figure 5.2: QPSK modulation waveforms at different stages
Figure 5.3: 16 QAM constellation diagram
Figure 5.4: 16 QAM modulated waveforms at different stages
Figure 5.5: IFFT and FFT conversion
Figure 5.6: Relation between Amplitude, Time and Frequency
Figure 6.1: Sample of Receive power after attenuation
Figure 6.2: Example of AWGN Channel
Figure 6.3: Flat Fading (top) and Frequency Selective Fading (bottom)
Figure 6.4: Reflected signal cause delay spread
Figure 6.5: Delay spread waveforms
Figure 6.6: No guard interval insertion
Figure 6.7: Guard interval insertion
Figure 6.8: Guard interval insertion with cyclic prefix
Figure 7.1: Block Diagram of OFDM System
Figure 7.2: Serial to Parallel
Figure 7.3: Conversion in IFFT Circuit
Figure 7.4: Frame Structure of Guard Interval
Figure 7.5: Conversion for FFT circuit
Figure 7.6: Parallel convert o Serial Data
Figure 8.1: Simulink OFDM block diagram
Figure 8.2: OFDM Transmitter (Top) and Receiver (Bottom)
Figure 8.3: Input Data
Figure 8.4: Serial to Parallel
Figure 8.5: QPSK Mod for Ich and Qch
Figure 8.6: Normalized Data for Ich and Qch
Figure8.7: Guard Interval Insertion Ich (Top) and Qch (Bottom)
Figure 8.8: Received Signal with AWGN Ich (Top) and Qch (Bottom)
Figure 8.9: Guard Interval Removal Ich (Top) and Qch (Bottom)
Figure 8.10: De-normalized Data Ich (Top) and Qch (Bottom)
Figure 8.11: Demodulated Data
Figure 8.12: Parallel to Serial
Figure 9.1: OFDM Transmitter and receiver signal with AWGN effect
Figure 9.2: QPSK with AWGN BER comparison between Theoretical and Simulated data
Figure 9.3: OFDM Transmitter and receiver signal with fading effect
Figure 9.4: QPSK with fading BER comparison between Theoretical and Simulated data
Figure 9.5: BER with Multipath Fading effects
Figure 10.1: OFDM QPSK BER Comparison
Figure 10.2: Pilot Symbol insertion
Done by Loh Tuck Keong
Student PI: H0704928
Page 4 of 55
Table of Contents
1.
ACKNOWLEDGMENT ...................................................................................... 2
2.
ABSTARCT ........................................................................................................ 3
3.
LIST OF FIGURES ............................................................................................. 4
4.
INTRODUCTION ............................................................................................... 7
4.1
4.2
4.3
4.4
5.
CHARACTERLISTIC OF OFDM ..................................................................... 10
5.1
5.2
5.3
5.4
5.5
5.6
6.
Introduction on Wireless Communication ..................................................................... 7
Objective......................................................................................................................... 8
Report overview ............................................................................................................. 8
Outline of Thesis ............................................................................................................ 9
Theory ...........................................................................................................................10
Advantages and Disadvantages of OFDM ....................................................................10
Modulation ....................................................................................................................11
Phase Shift Keying ........................................................................................................11
Quadrature Amplitude Modulation (QAM) .................................................................12
Fast Fourier Transform / Inverse Fast Fourier Transform .........................................13
MOBILE CHANNEL ........................................................................................ 14
6.1
6.2
6.3
6.4
6.5
6.6
6.7
Attenuation ....................................................................................................................14
Additive White Gaussian Noise (AWGN) .....................................................................14
Flat and Frequency Selective Fading ............................................................................15
Doppler Effect ...............................................................................................................16
Delay Spread .................................................................................................................16
Inter Symbolic Interference ..........................................................................................17
Guard Period and Cyclic Extension ..............................................................................17
7.
IMPLEMENTATION OF OFDM ...................................................................... 19
8.
SIMULATION .................................................................................................. 22
8.1
8.2
8.3
8.4
8.5
9.
SIMULATION RESULTS ................................................................................. 38
9.1
9.2
9.3
9.4
10.
OFDM System for Matlab Simulation ..........................................................................23
Transmitter with AWGN ..............................................................................................24
Receiver with AWGN ....................................................................................................31
Transmitter with Fading effects ....................................................................................36
Receiver with Fading effects .........................................................................................37
Confident Level on Simulation......................................................................................38
OFDM QPSK Mod with AWGN ..................................................................................38
OFDM QPSK Mod with One Path Fading ...................................................................40
OFDM QPSK Mod with Multipath Fading ..................................................................42
CONCLUSION AND RECOMMENDATIONS ................................................. 43
Done by Loh Tuck Keong
Student PI: H0704928
Page 5 of 55
11.
REVIEW AND REFLECTION ......................................................................... 44
12.
REFERENCE ................................................................................................... 45
13.
GLOSSARY ...................................................................................................... 46
14.
APPENDIX ....................................................................................................... 47
Done by Loh Tuck Keong
Student PI: H0704928
Page 6 of 55
4.
INTRODUCTION
4.1
Introduction on Wireless Communication
There is other form of wireless communication techniques used in many years, for instant, smoke
signals, lighthouse, etc. Wireless communication refers to accessing information without need of
cable connection. Wireless communication grow rapidly as the need for reaching data anywhere
at any time rises and increase of demand for high rate data services along with requirement for
reliable connectivity requires novel technologies. [1]
Wireless communication systems are usually interference limited, thus, new technologies are
developed to handle the interference. Interference can be form by devices/owners own signal
[example; Inter-symbol Interference (ISI)] or other users [example; Adjacent
Channel Interference (ACI)]. [1]
High data rate communication has ISI problem which is treated with equalizers in conventional
single carrier systems. Thus, high data rate transmissions involve more complex equalizers due to
smaller symbol time and large number taps needed for equalization. This problem is important for
large delay spreads [1]
Multi-carrier modulation is one of the transmission schemes which is less sensitive to time
dispersion (frequency selectivity) of the channel. In multi-carrier systems, the transmission
bandwidth is divided into several narrow sub-channels and data is transmitted parallel in these
sub-channels. Data in each sub-channel is modulated at a relatively low rate so that the delay
spread of the channel does not cause any degradation as each of the sub-channels will experience
a at response in frequency. Orthogonal Frequency Division Multiplexing is one of the multi
carrier modulation techniques.
The concept of using parallel data transmission and frequency division multiplexing was
published in the mid-1960s [2, 3]. Some early development is traced back to the 1950s [4]. A U.S.
patent was filed and issued in January 1970 [5].
In the 1960s, the OFDM technique was used in several high-frequency military systems such as
KINEPLEX, ANDEFT, and KATHRYN. For example, the variable-rate data modem in
KATHRYN was built for the high-frequency band. It used to 34 parallel low-rate phasemodulated channels with a spacing of 82Hz [6]
In the 1980s, OFDM was studies for high-speed modems, digital mobile communications, and
high density recording. One of the systems realized the OFDM techniques for multiplexed
quadrature amplitude modulation (QAM) using DFT; also, by using pilot tone, stabilizing carrier
and clock frequency control and trellis coding could also be implemented. Moreover, variousspeed modems were developed for telephone networks. [6]
In the 1990s, OFDM was exploited for wideband data communications over mobile radio FM
channels, high-bit-rate digital subscriber lines(HDSL;1.6 Mbs), asymmetric digital subscriber
lines(ADSL; up to 6 Mbps), very high speed digital subscriber lines (VDSL; 1000 Mbps), digital
audio broadcasting(DAB), and high-definition television(HDTV) terrestrial broadcasting. [6]
Done by Loh Tuck Keong
Student PI: H0704928
Page 7 of 55
4.2
Objective
The goal of this project is to study the fundamentals of OFDM based wireless communication
system and understands its performance and limitation through literature survey and simulation.
Develop an improvement design of OFDM transmitter and receiver models using MATLAB and
evaluate performance in AWGN, flat and frequency selective fading channels.
4.3
Report overview
This report consist of following,
 Study and understanding of OFDM and modulation scheme; QPSK, QAM, etc
 Model channel for instant AGWN, selective fading, multipath, etc
 Using Matlab to simulate OFDM in different modulation scheme and channel
 Analyze the simulation results
Done by Loh Tuck Keong
Student PI: H0704928
Page 8 of 55
4.4
Outline of Thesis
This thesis consists of six major chapters and summary of each chapter as follows:Chapter 5 – This chapter explains basic OFDM techniques, modulation and IFFT/FFT.
Chapter 6 – This chapter explains on mobile channels such as AWGN, fading, guard interval, etc
Chapter 7 – Explanation of OFDM based on block diagram
Chapter 8 – Simulatin by Matlab and detailed explanation on source codes
Chapter 9 – Simulation results
Chapter 10 – Conclusion and Recommendations
Done by Loh Tuck Keong
Student PI: H0704928
Page 9 of 55
5.
CHARACTERLISTIC OF OFDM
5.1
Theory
Orthogonal Frequency Division Multiplexing (OFDM) is a multi-carrier transmission, where a
single data stream is transmitted over a number of lower rate subcarriers. OFDM consist of both
multiplexing and modulation
Multiplexing is a process of transmitting multiple streams of information at the same time on a
carrier and de multiplexing at receiver.
Below figure is a comparison of multi carrier, single carrier and OFM transmitting signals
Figure 4.1: Different Transmission Technique; Multi Carrier, OFDM, Single Carrier
From above figure, OFDM overlapping modulation technique can save almost 50% of bandwidth
compare to non-overlapping multicarrier which allows more users. However, this technique
causes other problems such as interference, etc.
Inter symbol interference is defined as crosstalk between signals within same sub channel of
consecutive of FFT frames, which is eliminated almost completely by introducing a guard time in
every OFDM symbol. This means that in the guard time, the OFDM symbol is cyclically extended
to avoid inter carrier interference. It is also a technique that can overcome many problems that
arise with high bit rate communication
The other problem is relative amount of dispersion in time caused by multipath delay spread is
decreased because the symbol duration increases for lower rate parallel subcarriers.
5.2
Advantages and Disadvantages of OFDM
There are several advantages on OFDM technique;
 easily adapt to severe channel conditions without complex equalization
 robust against narrow band co channel interference
 eliminates ISI and ICI though use of guard interval with cyclic prefix
Done by Loh Tuck Keong
Student PI: H0704928
Page 10 of 55
 efficient implementation using FFT
 low sensitive to time synchronization
 possible to use maximum likelihood decoding with reasonable complexity
There are disadvantages to consider using OFDM technique,
 Sensitive to frequency synchronization problems
 High peak to average power ratio requiring linear transmitter circuitry, which suffers from
poor power efficiency
 Loss of efficiency caused by cyclic prefix/guard interval
5.3
Modulation
There are three major modulation scheme, Frequency Modulation (FM), Amplitude Modulation
(AM) and Phase Modulation (PM).
Frequency Modulation is changing frequency and
remain the amplitude of the signal.
Amplitude Modulation is changing amplitude and
remain the frequency of the signal
Phase Modulation changes the phase of the signal
By +180° or -180°
Figure 5.1: Different Modulation
5.4
Phase Shift Keying
Phase Shift Keying modulation scheme conveys data by changing the phase of the reference signal.
Quadrature Phase Shift Keying (QPSK) uses both sine and cosine at carrier frequency to transmit
two separate signals. Whereas sine signals is called quadrature phase channel or Qch and cosine
signals is called in phase channel or Ich. Basically it shifts phase states which separated by 90°.
QPSK signal can represent by
Input signal is first converted into parallel data to ich and qch. Both channel are filtered using a
pulse-shaping filter to generate a pulse shaped signal. Then the signal is converted into an analog
by D/A convertor and multiply by cos2πfct or sin2πfct to ich or qch respectively. Ich and qch are
combined together before transmitted to air.
At receiver, signal will by pass a Bandpass-Filter to eliminate spurious signals. The filtered signal
will multiply with RF carrier frequency to down converted to baseband. Using cos2πfct + θ(t) or
sin2πfct + θ(t) whereas θ(t) is phase noise of the frequency source, for ich or qch respectively.
Then both ich and qch signals by pass A/D convertor and fed into DSPH to be filtered by pulse
shaping filter to eliminate inter-symbolic interference. The signal is recovered as initial
transmitted data. Figure 5b shows QPSK modulated waveforms at different stages
Done by Loh Tuck Keong
Student PI: H0704928
Page 11 of 55
Figure 5.2: QPSK modulation waveforms at different stages
5.5
Quadrature Amplitude Modulation (QAM)
Quadrature amplitude modulation (QAM) is a modulation technique which consist two sinusoidal
carriers, one exactly 90 degrees out of phase with another, are used to transmit data over a given
physical channel. In QAM system, there are two amplitude modulated signals combined into one
single signal and result its efficiency in power and bandwidth. Figure 5c is constellation diagram
of 16 QAM, represent complex envelop of each possible symbol state.
Figure 5.3: 16 QAM constellation diagram
Figure 5.4: 16 QAM modulated waveforms at different stages
Done by Loh Tuck Keong
Student PI: H0704928
Page 12 of 55
5.6
Fast Fourier Transform / Inverse Fast Fourier Transform
Forward FFT takes a random signal, multiplies it successively by complex exponentials over the
range of frequencies, sums each product and plots the results as a coefficient of that frequency.
The coefficients are called a spectrum and represent “how much” of that frequency is present in
the input signal. The results of the FFT in common understanding is a frequency domain signal.
Equation for IFFT:
Here x(n) are the coeffcients of the sines and cosines of frequency 2π k / N , where k is
the index of the frequencies over the N frequencies, and n is the time index. x(k) is the
value of the spectrum for the kth frequeny and x(n) is the value of the signal at time n.[10]
Equation for FFT:
The difference between FFT and IFFT equation is the type of coefficients the sinusoids are taking,
and the minus sign, and that’s all. The coefficients by convention are defined as time domain
samples x(k) for the FFT and X(n) frequency bin values for the IFFT. [10]
IFFT and FFT are linear pair, thus using both equations will convert back to original signal.
Figure 5.5 :IFFT and FFT conversion
Figure 5.6 shows the signals plotted with amplitude against time and frequency. This allows us to
understand the relation between these three factors.
Figure 5.6: Relation between Amplitude, Time and Frequency
Done by Loh Tuck Keong
Student PI: H0704928
Page 13 of 55
6.
MOBILE CHANNEL
6.1 Attenuation
When there is drop of signal power at the receiver, there is attenuation occurred during
transmission. Attenuation can be caused by obstruction insignal path, transmission length path and
multipath effects. Objects that obstruct the line of sight(LOS) from transmitter to receiver can
cause attenuation.
Shadowing of signal occurred when an obstruction between transmitter and receiver. It is the most
important environmental attenuation factor. As the heavily built up areas, as such CBD, has the
most severe shadowing issue. Other than buildings, hills or other tall/huge obstructions produce
large shadow which cause large problem as well.
Below is an example of attenuation effects, transmitter transmit 100dBm with 30dBm attenuation
and result receiver receive 70dBm
Figure 6.1: Sample of Receive power after attenuation
6.2 Additive White Gaussian Noise (AWGN)
AWGN is commonly used as background noise to simulate noise interference. Following is an
example of AWGN channel. [1]
Figure 6.2: Example of AWGN Channel
Done by Loh Tuck Keong
Student PI: H0704928
Page 14 of 55
6.3
Flat and Frequency Selective Fading
In a mobile communication, the Radio Frequency (RF) signal from the transmitter may be
reflected from objects such as vehicles, hills, or buildings. These reflected signals will be potential
cause of multiple transmission paths at the receiver.
There are two different fading, term as fast fading and slow fading.
As the phase of multiple reflected signals can be positive or negative interference over at the
receiver. Usually this happen over a short distance; most likely at half wavelength distance,
thereby this is descript as fast fading.
When there is an object such as hills, building, and etc in between of transmitter and receiver will
cause shadowing of signal. Large shadow areas affect changes in signal power and result to be
slow rate. Thus this is term as slow fading.
Reflected signals do cancel certain frequencies at receiver and this cause dips or fades in channel
spectral response. Result to the response is not flat. Multipath signals from reflections has similar
signal strength as direct signal causes negative interference and this can result in deep nulls at
receiving signal power.
Entire signal can be lost for narrow bandwidth transmission id frequency response at transmission
frequency is null. There are two solutions to overcome this issue.
First is to transmit a wide bandwidth signal so any dips in the response only result a small loss of
signal strength than losing the entire signal. Another method is to transmit the signal in to many
sub-carriers, an example of such technique is OFDM transmission. The input signal will distribute
over wide bandwidth and if there is any nulls in the response, it will not affect all sub carrier. Thus,
there is only lost in some of the carrier than complete signal. Information in lost carrier may
recovered provided there is enough forward error corrections send.
The magnitude of the change in amplitude vary when there is a vary at the carrier frequency of a
signal. The coherence bandwidth measures the separation in frequency after which two signals
will experience uncorrelated fading.
In flat fading, all frequency components of a signal will experience same magnitude of fading
because of the coherence bandwidth of the channel is wider than the bandwidth of the signal.
Whereas for frequency-selective fading, different frequency components of the signal experience
decorrelated fading because of the coherence bandwidth of the channel is smaller than the
bandwidth of the signal
Done by Loh Tuck Keong
Student PI: H0704928
Page 15 of 55
Example of Flat and Frequency Selective Fading.
The signal dispersion manifestation of the fading channel is analogous to the signal spreading that
characterizes an electronic filter.Top Figure 6c (Top) depicts a wideband filter (narrow impulse
response) and its effect on a signal in both time domain and the frequency domain. This filter
resembles a flat-fading channel yielding an output that is relatively free of dispersion. Figure 6c
(bottom) shows a narrowband filter (wide impulse response). The output signal suffers much
distortion, as shown both time domain and frequency domain. Here the process resembles a
frequency-selective channel. [3]
Figure 6.3: Flat Fading (top) and Frequency Selective Fading (bottom)
6.4
Doppler Effect
Doppler effect is the change of frequency of a wave, for instant, two moving vehicles are on
transmission to one another and the received signal will not be same as transmitted signal.
The frequency of received signal is higher than transmitted signal as they are moving
towards each other. The frequency decrease when both vehicles are approaching each other.
6.5
Delay Spread
When transmitter transmit a signal to receiver, receiver will received various signals such as
direct signal, reflections of objects such as hills, buildings and other structures. At most time,
reflected signals arrived at a later time than direct signal because of the extra path length.
There is a slight different on the arrival time of the transmitter pulse and thus spreading the
received energy. Delay spread is the time between the arrival of first and last multipath signal
received at receiver as shown in Figure 6e .
Figure 6.4: Reflected signal cause delay spread
Done by Loh Tuck Keong
Student PI: H0704928
Page 16 of 55
In a digital system, the delay spread can lead to inter-symbol interference. This is due to the
delayed multipath signal overlapping with the following symbols. As the transmitted bit rate is
increased the amount of inter-symbol interference also increases. The effect starts to become very
significant when the delay spread is greater than approximate 50% of the bit time.
Figure 6.5: Delay spread waveforms
6.6
Inter Symbolic Interference
This interference happens when one symbol interferes with another symbol in the data stream.
There is loss of some symbol during data transfer and result the rounding of pulse and following
pulse is affected due to slower response rate compare transmission rate.
Transmission rate gets higher and the effect gets greater until the error reaches to a limit, the lost
of data occurred. This interference can be eliminated by implementing cyclic extension.
6.7
Guard Period and Cyclic Extension
Multipath delay spread is one of the most important problems in wireless communications. OFDM
is capable dealing multipath delay spread. The parallel transmission imply that the input data
stream is divided in total number of subcarriers and the symbol duration is made the subcarrier
times smaller, which also reduces the relative multipath delay spread, relative to the symbol time,
by the same factor. [2]
The inter-symbolic interference is almost completely eliminated by introducing a guard time for a
each OFDM symbol. The guard time is chosen larger than the expected delay spread such that
multipath components from one symbol cannot interfere with the next symbol. This guard time
could be no signal at all but the problem of inter carrier interference (ICI) would arise. Then, the
OFDM symbol is cyclically extended in the guard time. Using this method, the delay replicas of
the OFDM symbol always have an integer number of cycles within the FFT interval, as long as the
delay is smaller than the guard time. Multipath signals with delays smaller than the guard time
cannot cause ICI. [2]
Done by Loh Tuck Keong
Student PI: H0704928
Page 17 of 55
Figure 6.6: No guard interval insertion
Figure 6.7: Guard interval insertion
Figure 6.8: Guard interval insertion with cyclic
prefix
Done by Loh Tuck Keong
Student PI: H0704928
Page 18 of 55
7.
IMPLEMENTATION OF OFDM
Figure 7.1: Block Diagram of OFDM System
Serial to Parallel
Each channel of OFDM system can be broken into various sub carriers and these sub carriers
makes optimal use out of the frequency spectrum. The transmitter will first convert the input data
from a serial bit stream to parallel sets and divided among individual carriers.
Figure 7.2: Serial to Parallel
Modulation
Each set of data contains one symbol for each subcarrier and each subcarrier is modulated
individually. QPSK is 2bits/symbol and 16QAM is 4bits/symbol. Then these sub carriers
combined and transmitted in parallel as a whole.
IFFT
An Inverse Fourier transform converts the frequency domain data set into samples of the
corresponding time domain representation of this data. Specifically, the IFFT is useful for
OFDM because it generates samples of a waveform with orthogonal frequency components.
Done by Loh Tuck Keong
Student PI: H0704928
Page 19 of 55
Figure 7.3: Conversion in IFFT Circuit
Guard Interval with cyclic prefix
As system is susceptible to multi-path channel reflections and inter-symbolic interference(ISI) is
one of the interference occurred. To eliminate or reduce inter-symbolic interference, cyclic prefix
is added in the system. A cyclic prefix is a repetition of the first section of a symbol that is
appended to the end of the symbol. In addition, it is important because it enables multi-path
representations of the original signal to fade so that they do not interfere with the subsequent
symbol. Below figure 4f explain as maximum excess delay (Tmax) is smaller than the length of
cyclic extension(Tg), the distorted signal will remain within guard interval which will remove
later.
Figure 7.4: Frame Structure of Guard Interval
Attenuation and Noise
The channel simulation will allow examination of the effects of attenuation, noise, multipath, etc.
By adding random data to the transmitted signal, simple noise can be simulated. Multipath
simulation involves adding attenuated and delayed copies of the transmitted signal to the original.
This simulates the problem in wireless communication when the signal propagates on many paths.
IFFT / FFT
The Fast Fourier Transform (FFT) converts the time domain samples back into a frequency
domain representation.
Figure 7.5: Conversion for FFT circuit
Done by Loh Tuck Keong
Student PI: H0704928
Page 20 of 55
Parallel to Serial
After all, parallel to serial block converts parallel data into a serial bit stream to revert the original
input data
Figure 7.6: Parallel convert o Serial Data
Done by Loh Tuck Keong
Student PI: H0704928
Page 21 of 55
8.
SIMULATION
In the beginning of the project, Simulink is selected for simulation module as Simulink process
with all necessary design tools; filter, modulation, AWGN, fading, etc. With these tools,
transmitter and receiver module can be simulated. Below is a sample of Simulink block diagram,
Run "Parameters.m" in the Workspace before simulation
C
1
Re(u)
Random
Convolutional
int
Block
interleave
Encoder
MATLAB
Function
MATLAB
A-QASK
Function
Complex to
Time
Real
Scope
Random Data
Generator
Convolutional
Encoder
Interleave
PIlot Insertion
Mapping
Window
IQ M odulator Subsystem
blackman
Out1
Im(u)
Add cyclic
Extension
Parallel to serial
Function
Pulse
zeropad
Serial to parallel
IFFT
MATLAB
In1
Complex to
IFFT
Function
Time
Imag
Scope1
Transmitter
B-FFT
Buffered FFT
Frame Scope
Complex
Rayl Fading
Complex
Rician Noise
AWGN
Additive Rician Noise
Complex Rayleigh fading
AWGN
channel
Channel
MATLAB
Function
Commutator2
MATLAB
FFT
Remove zeros
Out1
Function
Remove cyclic
FFT
Serial
to parallel1
IQ Demodulator Subsystem
Extension1
simout1
C1
In1
1
Constellation
A-QASK
A-map QASK
demod baseband
To
Workspace
Block
interleave
Viterbi Decoder
Pulse
Interleave1
Receiver
Viterbi Decoder
Errors
In1
Out1
In1
Out1
In2
Error counter Subsystem
Delay Subsystem
The following routines must be included in the path:
zeropad.m
Run "constellation" after the simulation
in the workspace to watch the received constellation
zerounpad.m
cyclic.m
remcyc.m
Figure 8.1: Simulink OFDM block diagram
Matlab & Simulink Student Version is implemented for the simulation. In the middle of
programming, there is certain toolbox not included in Student version and one of the toolbox is
Communication System Toolbox. Thus, OFDM simulation unable to proceed further using
Simulink.
Alternative solution is Matlab programming. Matlab is capable to design a full OFDM module
including modulation, IFFT/FFT, AWGN, fading, demodulation, etc.
Advantage and disadvantage between Matlab and Simulink.
Done by Loh Tuck Keong
Student PI: H0704928
Page 22 of 55
0
Matlab
Advantage – Flexible in programming and capable to program various formulas
Disadvantage – Several source codes; modulation, parallel to serial convertor, etc and
programming in source code
Simulink
Advantage – Preset toolbox, view in block diagram and easy to understand
Disadvantage – Require different tool box and additional purchase for tool box.
Therefore, this project will present simulation using Matlab.
8.1
OFDM System for Matlab Simulation
Figure 8.2: OFDM Transmitter (Top) and Receiver (Bottom)
Done by Loh Tuck Keong
Student PI: H0704928
Page 23 of 55
8.2
Transmitter with AWGN
For explanation purpose, following parameters are assign,
para=4; % Number of parallel channel to transmit (points)
fftlen=4; % FFT length
noc=1; % Number of carrier
nd=1;
% Number of information OFDM symbol for one loop
ml=4;
% Modulation level : QPSK
sr=100000; % Symbol rate
br=sr.*ml; % Bit rate per carrier
gilen=1; % Length of guard interval (points)
aloop=11; % Number of Eb/N0
Thus input data will generate as follow, 1 by 8 (4 x 1 x 2), total of 8bits data as shown below.
8 bits Serial Data: 1110 1001
Input Data
This is to generate a random series 1 by (data number of parallel channel * number of OFDM
symbol * modulation level)
seldata=rand(1,para*nd*ml)>0.5; % Generate data randomly
For eg: 8 bits Serial Data: 1110 1001
Figure 8.3: Input Data
Serial to Parallel
Convert high speed data from serial to parallel is to counter the problems caused by multipath
fading environment, for instant; distorted waveforms and spectrum, variation at receiver power
and signal interference, etc.
paradata=reshape(seldata,para,nd*ml);
OFDM transmit data in parallel channel, thus this is to convert serial data into parallel data.
Done by Loh Tuck Keong
Student PI: H0704928
Page 24 of 55
Using seldata to convert into matrix of 4 by 2; matrix depend on the parameter of “number of
parallel channel” and “bits per parallel channel”
1110
1001
1
1
◄ these columns indicate 4 parallel channels
1
0
◄ these columns indicate 4 parallel channels
1
0
◄ these columns indicate 4 parallel channels
0
1
◄ these columns indicate 4 parallel channels
▲
▲
Number of bits per parallel channel
Nd x ml = 1 x 2 = 2
Figure 8.4: Serial to Parallel
Modulation
Parallel data will modulated by PSK/QAM based modulation and these modulated data are fed
into inverse fast Fourier transform (IFFT) circuit to generate OFDM signal. Function qpskmod is
used in this command
[ich,qch]=qpskmod(paradata,para,nd,ml); %QPSK modulation
Function qpskmod
Input data to qpskmod function
1
1
◄ these columns indicate 4 parallel channels
1
0
◄ these columns indicate 4 parallel channels
1
0
◄ these columns indicate 4 parallel channels
0
1
◄ these columns indicate 4 parallel channels
▲
▲
Number of bits per parallel channel
Done by Loh Tuck Keong
Student PI: H0704928
Page 25 of 55
These data will convert into “1” or “-1” as shown below
Data
11
10
10
01
[(data*2]-1]
►
22
►
20
►
20
►
02
Result
►
►
►
►
1 1
1 -1
1 -1
-1 1
There are one main loop and one sub loop in qpsk function.
Number of main loop will based on number of bit/symbol; for example, 4 bits/symbol so there
will be 2 main loops as one sub loop will modulate 2bits/symbol.
In sub loop, data are modulated on 2bits/symbol per loop and split into ich and qch accordingly.
For jj=1:nd
for ii = 1 : m2
end
end
Let take isi as example and elaborate step by step,
isi = isi + 2.^( m2 - ii ) .* paradata2((1:para),ii+count2);
Parameters
isi assign as temp data storage for ich
m2 = ml./2  QPSK is 2bits/symbol so m2 is 1
ii assign as sub loop and number of loop is based on m2
count2 assign set of bit/symbol. Alternate set of bit/symbol is modulated and fed to same ich/qch.
isi ► [0;0;0;0]
2.^( m2 - ii ) ► 2 ^(1-1) ► 1
paradata2((1:para),ii+count2) % elaborate as below
Paradata2
paradata2((1:4)
paradata2((1:4),1)
1 1
►
1
►
1
1 -1
►
1
►
1
1 -1
►
1
►
1
-1 1
►
-1
►
-1
2.^( m2 - ii ) .* paradata2((1:para),ii+count2); ► 1.* [1; 1; 1; -1]
isi = isi + 2.^( m2 - ii ) .* paradata2((1:para),ii+count2);► [0;0;0;0]+[1;1;1;-1]=[1;1;1;-1]
Thus, paradata is modulated and split into ich and qch.
Ich = [1;1;1;-1] and Qch = [1;-1;-1;1]
Done by Loh Tuck Keong
Student PI: H0704928
Page 26 of 55
If there are 4bits/symbol paradata, qpskmod function execute as follows, and return result to main
program ofdm.m
[1;1;1;1] ► modulate in first main loop ► store ich
[1;0;1;0] ► modulate in first main loop ► store qch
[0;0;0;1] ► modulate in second main loop ► store ich
[1;0;0;1] ► modulate in second main loop ► store qch
Ich = [1;1;1;1], [0;0;0;1]
Qch = [1;0;1;0], [1;0;0;1]
Figure 8.5: QPSK Mod for Ich and Qch
Normalized QPSK
Ich and Qch data required to normalize by 1/sqrt(2) to ensure average energy over all symbols is
one.
kmod=1/sqrt(2); % sqrt : built in function
ich1=ich.*kmod; %normalise the value
qch1=qch.*kmod; %normlaise the value
For example; Ich = [1;1;1;-1]
Ich1=ich.*kmod;
Thus, 1/sqrt(2) multiply to ich individual bit and result [0.707; 0.707; 0.707; -0.707]
Done by Loh Tuck Keong
Student PI: H0704928
Page 27 of 55
Figure 8.6: Normalized Data for Ich (Top) and Qch (Bottom)
IFFT circuit
IFFT is to convert frequency domain to time domain
Qch1 multiply with i to imaginary then sum up with Ich1
x=ich1+qch1.*i;
Equation for IFFT as mention in Chpt 5.7
y=ifft(x);
% ifft : built in function
ich2=real(y); % real : built in function
qch2=imag(y); % imag : built in function
Done by Loh Tuck Keong
Student PI: H0704928
Page 28 of 55
Guard time insertion with cyclic prefix
As there are multiple carrier signals with same frequency, intersymbol interference(ISI) and
intercarrier interference(ICI) occurred. Thus, OFDM signal go through guard interval to increase
symbol duration or number of carriers.
Function giins is used in main program.
[ich3,qch3]= giins(ich2,qch2,fftlen,gilen,nd);
Ich2 and Qch2 are fed into sub program giins. This is to insert Guard Interval.
For example, Ich2 = [0.353; 0.353; 0.353; -0.353] and following explains giins program,
idata1=reshape(idata,fftlen,nd);
fftlen = 4 and nd =1 so idata1 after reshape from ich3 is [0.353; 0.353; 0.353; -0.353].
idata2=[idata1(fftlen-gilen+1:fftlen,:); idata1];
This commend will take the last bit of idata1 and insert in front of idata1 and result in idata2.
Figure8.7: Guard Interval Insertion Ich (Top) and Qch (Bottom)
Done by Loh Tuck Keong
Student PI: H0704928
Page 29 of 55
iout=reshape(idata2,1,(fftlen+gilen)*nd);
idata2 convert to 1 by 5 matraix and result back to main program
Increase Length of FFT
Back in the main program, the length of the symbol had increase with guard interval insertion,
new FFT length is declared. For this example, new FFT length is 4+1 = 5
fftlen2=fftlen+gilen;
Attenuation Calculation
To show a graph on Eb/N0 against BER, we have to assign a variable “attn” so calculation of
attenuation changes according to Eb/N0. We have to define signal power per carrier per symbol
(spow) in order to calculate attenuation. Spow had to be dividend by number of parallel channels
for OFDM system.
Equation of spow/ noise power density as below,
Ich3 and qch3 are in voltages, thus spow of to convert from power to voltage,
%Attenuation
spow=sum(ich3.^2+qch3.^2)/nd./para;
attn=0.5*spow*sr/br*10.^(-ebn0/10); %
attn=sqrt(attn);
Done by Loh Tuck Keong
Student PI: H0704928
Page 30 of 55
8.3
Receiver with AWGN
Receiver received signal combine with AWGN effect. Function “comb” to added attenuation into
received signal.
%AWGN
[ich4,qch4]=comb(ich3,qch3,attn);
Following will elaborate on sub program “comb”, take ich3 for an example.
iout = randn(1,length(idata)).*attn;
We have to ensure attenuation data had the same length as received data. Thus, we generate a
random 1 by length of data, and multiply by calculated attenuation formula.
iout = iout+idata(1:length(idata));
Add attenuation effect onto received signal (idata) and the length of both attenuation and idata are
the same. Received signal with attenuation effect return to main program and below figure shows
signal before and after attenuation.
Figure 8.8: Received Signal with AWGN Ich (Top) and Qch (Bottom)
Done by Loh Tuck Keong
Student PI: H0704928
Page 31 of 55
Guard interval remover
Received signal is added with guard interval, thus in the receiver module, we have to remove
guard interval before converting from time domain to frequency domain.
[ich5,qch5]= girem(ich4,qch4,fftlen2,gilen,nd);
idata2=reshape(idata,fftlen2,nd);
This is to convert ich4 data to fftlen2 by nd and store in idata2.
iout=idata2(gilen+1:fftlen2,:);
gilen+1 ► signal after guard interval
idata2(gilen+1:fftlen2,:); ► signal are stored into idata2 after guard interval
iout ► signal return back to back program.
Figure 8.9: Guard Interval Removal Ich (Top) and Qch (Bottom)
Done by Loh Tuck Keong
Student PI: H0704928
Page 32 of 55
FFT circuit
Signal transmits and received in time domain. After removing guard interval, signal will convert
from time domain to frequency domain in FFT circuit.
rx=ich5+qch5.*i;
Equation for IFFT as mention in Chpt 5.7
ry=fft(rx); % fft : built in function
ich6=real(ry); % real : built in function
qch6=imag(ry); % imag : built in function
De-normalized Data
ich7=ich6./kmod;
qch7=qch6./kmod;
Figure 8.10: De-normalized Data Ich (Top) and Qch (Bottom)
Done by Loh Tuck Keong
Student PI: H0704928
Page 33 of 55
Demodulation
Signal will demodulated by QPSK before convert from parallel to serial data. Function
“qpskdemod” is used for demodulation.
[demodata]=qpskdemod(ich7,qch7,para,nd,ml);
Following explanation on function “qpskdemod” on in phase channel
demodata=zeros(para,ml*nd);
This is to ensure demodata are clear and assign to zeros and reshape according to initial data in
parallel condition.
Demodata
0
0
◄ these columns indicate 4 parallel channels
0
0
◄ these columns indicate 4 parallel channels
0
0
◄ these columns indicate 4 parallel channels
0
0
◄ these columns indicate 4 parallel channels
▲
▲
Number of bits per parallel channel
demodata((1:para),(1:ml:ml*nd-1))=idata((1:para),(1:nd))>=0;
idata((1:para),(1:nd))>=0; ► all negative value will convert to 0
demodata((1:para),(1:ml:ml*nd-1)) ► select bit by bit from below data
0
0
0
0
0
0
0
0
As for quadrature channel,
demodata((1:para),(2:ml:ml*nd))
0
0
0
0
0
0
0
0
Idata and qdata had converted to ‘0’ and ‘1’ and store in demodata. Results as follow,
1
1
◄ these columns indicate 4 parallel channels
1
0
◄ these columns indicate 4 parallel channels
1
0
◄ these columns indicate 4 parallel channels
0
1
◄ these columns indicate 4 parallel channels
▲
▲
Number of bits per parallel channel
Figure 7l: Demodulated Data
Done by Loh Tuck Keong
Student PI: H0704928
Page 34 of 55
Figure 8.11: Demodulated Data
Parallel to Serial
Convert serial data to parallel
demodata1=reshape(demodata,1,para*nd*ml);
demodata
1
1
1
0
1
0
0
1
reshape(demodata,1,para*nd*ml);
►
11101001
demodata1
►11101001
Figure 8.12: Parallel to Serial
Bit Error Rate
noe2=sum(abs(data1-demodata)); % sum: built in function
nod2=length(data1); % length: built in function
noe=noe+noe2;
nod=nod+nod2;
Done by Loh Tuck Keong
Student PI: H0704928
Page 35 of 55
8.4
Transmitter with Fading effects
Transmitter module will remain the same as Unit 8.2, we will initialized fading parameters for one
path fading/multipath fading.
One-Path Fading Parameter
tstp=1/sr/(fftlen+gilen); % Time resolution
itau = [0]; % Arrival time for each multipath normalized by tstp
dlvl = [0]; Mean power for each multipath
n0=[6]; % Number of waves to generate fading
th1=[0.0]; % Initial Phase of delayed wave
itnd0=nd*(fftlen+gilen)*10; % Number of fading counter
itnd1=[1000]; % Initial value of fading counter
now1=1; % Number of directwave + Number of delayed wave
fd=320; % Maximum Doppler frequency [Hz]
flat =1; % flat fading
Multipath Fading
4 reflected waves with different delay time, amplitude, etc is generated.
tstp=1/sr/(fftlen+gilen);
% Time resolution
itau = [0,2,3,4];
% Arrival time for each multipath normalized by tstp
dlvl = [0,10,20,25];
% Mean power for each multipath normalized by direct wave.
n0=[6,7,6,7];
% Number of waves to generate fading for each multipath.
th1=[0.0,0.0,0.0,0.0];
% Initial Phase of delayed wave
itnd0=nd*(fftlen+gilen)*10; % Number of fading counter to skip
itnd1=[1000,2000,3000,4000];% Initial value of fading counter
now1=4;
% Number of directwave + Number of delayed wave
fd=320;
% Maximum Doppler frequency [Hz]
flat =1;
% flat fading
Serial to Parallel  Modulation  IFFT circuit  Guard time insertion with cyclic prefix 
Attenuation calculation
Fading
[ifade,qfade]=sefade(ich3,qch3,itau,dlvl,th1,n0,itnd1,now1,length(ich3),tstp,fd,flat); % Generated
data are fed into a fading simulator
itnd1 = itnd1+ itnd0; % Updata fading counter
In sefade program, delay.m and fade.m is called to generate delays and fading, thus I will explain
on delay.m and fade.m
Delay.m, to include delay time onto sample bits;
iout(idel+1:nsamp) = idata(1:nsamp-idel); % delay added to ich
qout(idel+1:nsamp) = qdata(1:nsamp-idel); % delay added to qch
idata
1111
(1:nsamp-idel)
► 1111
Done by Loh Tuck Keong
Student PI: H0704928
iout(idel+1:nsamp) = idata(1:nsamp-idel);
► 0111
Page 36 of 55
Fade.m to generate fading using equation
cwn = cos( cos(2.0.*pai.*nn./n).*ic.*wmts );
%Generate
xc = xc + cos(paino.*nn).*cwn;
xs = xs + sin(paino.*nn).*cwn;
cwmt = sqrt(2.0).*cos(ic.*wmts);
xc = (2.0.*xc + cwmt).*ac0;
xs = 2.0.*xs.*as0;
ramp=sqrt(xc.^2+xs.^2);
rcos=xc./ramp;
rsin=xs./ramp;
8.5
Receiver with Fading effects
Receiver will be the same as Chpt 8.3 amd the only different is input data with additional of
fading effect
AWGN and Fading effects
[ich4,qch4]=comb(ifade,qfade,attn);
Guard interval removal  FFT circuit  Demodulation  Parallel to Serial  Bit Error Rate
Done by Loh Tuck Keong
Student PI: H0704928
Page 37 of 55
9.
SIMULATION RESULTS
9.1
Confident Level on Simulation
To simulate and achieve a confident level, a certain number of transmitted data is required. Below
equation allow us to calculate number of transmitted data required according to confident level.
9.2
OFDM QPSK Mod with AWGN
Let’s take Eb/N0 11, theoretical BER 3.87E-06 and CL = 0.95. We have calculated a total
simulated bit is ~78000. 6500 loops [(78000/(nd*ml)] is assign to simulate 78000 bits based on
following parameters.
para=128; % Number of parallel channel to transmit (points)
fftlen=128; % FFT length
noc=128; % Number of carrier
nd=6;
% Number of information OFDM symbol for one loop
ml=2;
% Modulation level : QPSK
sr=250000; % Symbol rate
br=sr.*ml; % Bit rate per carrier
gilen=32; % Length of guard interval (points)
aloop=11; % Number of Eb/N0
Below graph shows data from transmitter to receiver and revert back to original data
Done by Loh Tuck Keong
Student PI: H0704928
Page 38 of 55
Figure 9.1: OFDM Transmitter and receiver signal with AWGN effect
BER of QPSK with AWGN data are theoretical calculated as following equation,
AWGN
EbNo
(dB)
0
1
2
3
4
5
6
7
8
9
10
Number
1
1.258925
1.584893
1.995262
2.511886
3.162278
3.981072
5.011872
6.309573
7.943282
10
BER
7.78E-02
5.57E-02
3.70E-02
2.24E-02
1.23E-02
5.81E-03
2.31E-03
7.36E-04
1.78E-04
3.39E-05
3.91E-06
Theoretical
7.86E-02
5.63E-02
3.75E-02
2.29E-02
1.25E-02
5.95E-03
2.39E-03
7.73E-04
1.91E-04
3.36E-05
3.87E-06
Table 9.1 : BER with AWGN Theoretical and Simulated Data
Figure 9.2: QPSK with AWGN BER comparison between Theoretical and Simulated data
Done by Loh Tuck Keong
Student PI: H0704928
Page 39 of 55
9.3
OFDM QPSK Mod with One Path Fading
Let’s take Eb/N0 11, theoretical BER 1.87E-02 and CL = 0.95. We have calculated a total
simulated bit is ~200. We will still loop 1000 times for simulation based on following parameters
para=128; % Number of parallel channel to transmit (points)
fftlen=128; % FFT length
noc=128; % Number of carrier
nd=6;
% Number of information OFDM symbol for one loop
ml=2;
% Modulation level : QPSK
sr=250000; % Symbol rate
br=sr.*ml; % Bit rate per carrier
gilen=32; % Length of guard interval (points)
aloop=11; % Number of Eb/N0
tstp=1/sr/(fftlen+gilen); % Time resolution
itau = [0]; % Arrival time for each multipath normalized by tstp
dlvl = [0]; Mean power for each multipath
n0=[6]; % Number of waves to generate fading
th1=[0.0]; % Initial Phase of delayed wave
itnd0=nd*(fftlen+gilen)*10; % Number of fading counter
itnd1=[1000]; % Initial value of fading counter
now1=1; % Number of directwave + Number of delayed wave
fd=320; % Maximum Doppler frequency [Hz]
flat =1; % flat fading
Below graph shows data from transmitter to receiver and revert back to original data
Figure 9.3: OFDM Transmitter and receiver signal with fading effect
Done by Loh Tuck Keong
Student PI: H0704928
Page 40 of 55
BER of QPSK with fading data are theoretical calculated as following equation
Fading
EbNo
(dB)
0
1
2
3
4
5
6
7
8
9
10
Number
1
1.258925
1.584893
1.995262
2.511886
3.162278
3.981072
5.011872
6.309573
7.943282
10
BER
1.18E-01
1.02E-01
9.13E-02
7.42E-02
5.80E-02
5.01E-02
4.38E-02
3.33E-02
2.75E-02
1.80E-02
1.46E-02
Theoretical
1.46E-01
1.27E-01
1.08E-01
9.19E-02
7.71E-02
6.42E-02
5.30E-02
4.35E-02
3.55E-02
2.88E-02
2.33E-02
Table 9.2 : BER with fading Theoretical and Simulated Data
Figure 9.4: QPSK with fading BER comparison between Theoretical and Simulated data
Done by Loh Tuck Keong
Student PI: H0704928
Page 41 of 55
9.4 OFDM QPSK Mod with Multipath Fading
Let’s take Eb/N0 11, theoretical BER 1.87E-02 and CL = 0.95. We have calculated a total
simulated bit is ~200. We will still loop 1000 times for simulation based on following parameters
para=128; % Number of parallel channel to transmit (points)
fftlen=128; % FFT length
noc=128; % Number of carrier
nd=6;
% Number of information OFDM symbol for one loop
ml=2;
% Modulation level : QPSK
sr=250000; % Symbol rate
br=sr.*ml; % Bit rate per carrier
gilen=32; % Length of guard interval (points)
aloop=16; % Number of Eb/N0
4 reflected waves with different delay time, amplitude, etc is generated.
tstp=1/sr/(fftlen+gilen);
% Time resolution
itau = [0,2,3,4];
% Arrival time for each multipath normalized by tstp
dlvl = [0,10,20,25];
% Mean power for each multipath normalized by direct wave.
n0=[6,7,6,7];
% Number of waves to generate fading for each multipath.
th1=[0.0,0.0,0.0,0.0];
% Initial Phase of delayed wave
itnd0=nd*(fftlen+gilen)*10; % Number of fading counter to skip
itnd1=[1000,2000,3000,4000];% Initial value of fading counter
now1=4;
% Number of directwave + Number of delayed wave
fd=320;
% Maximum Doppler frequency [Hz]
flat =1;
% flat fading
Multipath Fading
EbNo (dB)
BER
0
1.64E-01
1
1.45E-01
2
1.30E-01
3
1.11E-01
4
1.05E-01
5
8.93E-02
6
8.66E-02
7
7.92E-02
8
7.38E-02
9
6.69E-02
10
5.72E-02
11
4.94E-02
12
5.43E-02
13
5.50E-02
Figure 9.5: BER with Multipath Fading effects
Table 9.3 : BER with multipath fading Simulated Data
Done by Loh Tuck Keong
Student PI: H0704928
Page 42 of 55
10.
CONCLUSION AND RECOMMENDATIONS
OFDM transmitter and receiver with QPSK modulation had successfully implemented using
Matlab. Input signal was modulated by QPSK and transmitted in transmitter module. Thereafter,
signal received was de modulated by QPSK in receiver and revert to original signal.
Understanding on basic OFDM transmission was achieved; OFDM transmit data in parallel
channels to achieve faster bit rate transmission and guard interval is implemented to eliminate ISI
due to the characteristic of OFDM.
To evaluate the system performance, AWGN and Fading effects are added in the simulation and
BER are calculated based simulated data. Comparison of simulated and theoretical calculated
BER to understand the data difference. As we can see, there is a data shifted between simulated
and calculated BER and this is due to the cutting off of guard interval power from received signal.
As we can see, there is higher error rate on multipath fading effects as compare to one path fading
and AWGN. Lets take Eb/N0 10 as reference,5.72E-02, 2.33E-02 and 3.87E-06 BER to multipath
fading, one path fading and AWGN effects respectively (refer to figure 10.1)This is because of
additional delay wave is added in the transmission and increase the error rate. This can be
compensated by implementing Pilot Symbol.
Figure 10.1: OFDM QPSK BER Comparison
In future simulation, comparison of BER with compensation and without compensation.
Fluctuation of amplitude and phase do occurred due to fading and to compensate the fluctuation.
Pilot symbols are inserted in both transmitter as well as receiver. At transmitter, pilot symbol are
inserted at a fixed time interval in each sub carrier channel. As for receiver, pilot symbol are used
to estimate channel characteristics.
Thus, individual sub carrier with known fluctuation time period to insert pilot symbol and recover
loss data by using estimation of channel characteristics. [9]
Figure 10.2: Pilot Symbol insertion
Done by Loh Tuck Keong
Student PI: H0704928
Page 43 of 55
11.
REVIEW AND REFLECTION
Beginning / Basic understanding of OFDM,
1) Facing difficulty on understanding OFDM. There are valid and invalid online reference which
confuse my study in the beginning
Solution:
Manage to find paper and reference as well as helps from supervisor, Mr Wilson Oon.
Mr Wilson helps to identify basic and intermediate references, this is to ensure the materials is
based on my level of understanding.
Programming Languages
2) Limited access to Simulink software in school
Solution:
Purchase and install Matlab & Simulink Student Version 2010a in personal computer.
3) Problems on developing programs using Simulink as there is tools box not included in Matlab
Student 2010a version and unable to generate certain block diagram.
Solution:
Use Matlab for programming instead of Simulink.
4) Add on multipath fading effect in simulation
There are various factors in multipath fading, from number of delay waves, delay time of each
reflected wave, amplitude, phase, etc
Solution:
One path fading effect had simulated, consider of number of fading, start time for delayed fading,
amplitude, phase, etc and insert the factors and create more reflected waves
5) 16 QAM modulation
Unable to integrate 16QAM modulation to main program.
Solution:
Based on main program, QPSK mod data was normalized by 1/sqrt(2) and 16QAM mod data was
normalized by 1/sqrt(10)
Schedule
There is major delay on the schedule compare between initial planning with revise planning.
6) Phase one project schedule delay due to unforeseen work load and did not consider other activity
running con-currently.
For eg: quiz revision, in-camp training(reservist) and increase of work load due to company
financial year end close on September.
Solution:
Minimize my exam module to 5cu only on yr2011 semester to have more time focus on final year
project.
Done by Loh Tuck Keong
Student PI: H0704928
Page 44 of 55
12.
REFERENCE
[1] Tevfik Yücek, “Self-interference Handling OFDM Based Wireless Communication System”,
University of South Florida, p1-2
[2] Chang R. W., Synthesis of Band Limited Orthogonal Signals for Multichannel Data Transmission,
Bell Syst. Tech. J., Vol. 45, pp. 1775-1796, Dec. 1996.
[3] Salzberg, B. R., Performance of an efficient parallel data transmission system, IEEE Trans.
Comm., Vol. COM- 15, pp. 805 - 813, Dec. 1967.
[4] Mosier, R. R., and Clabaugh, R.G., A Bandwidth Efficient Binary Transmission System, IEEE
Trans., Vol. 76, pp. 723 - 728, Jan. 1958.
[5] Orthogonal Frequency Division Multiplexing, U.S. Patent No. 3, 488,4555, filed November 14,
1966, issued Jan. 6, 1970.
[6] Ramjee Prasad, OFDM for Wireless Communications Systems, chapter p1-16
[7] Santa Barbara, “Orthogonal Frequency Division Multiplexing for Wireless Networks”,
University of California, p11-12, Dec 2000
[8] Sebastian Prot, Kent Palmkvist, “Communication System Simulation Using Simulink”, Dept. EE,
LiTH, Feb 2002
[9] Hiroshi Harada & Ramjee Prasad, Simulation and Software Radio for Mobile Communication
[10] Charan Langton, “Orthogonal Frequency Division Multiplex(OFDM) Tutorial”,
www.complextoreal.com
Done by Loh Tuck Keong
Student PI: H0704928
Page 45 of 55
13.
Glossary
OFDM
 Orthogonal Frequency Division Multiplexing
ISI
 Inter Symbolic Interference
ICI
 Inter Carrier Interference
TX
 Transmitter/Transmit
RX
 Receiver/Received
RF
 Radio Frequency
BER
 Bit Error Rate
AWGN
 Additive White Gaussian Noise
QPSK
 Quadrature Phase Shif Keying
QAM
 Quadrature Amplitude Modulation
FFT
 Fast Fourier Transform
IFFT
 Inverse Fast Fourier Transform
MATLAB & SIMULINK: A widely use soft codes platform for simulation, design, plotting, etc
Done by Loh Tuck Keong
Student PI: H0704928
Page 46 of 55
14.
APPENDIX
Refer below to main programs and refer to Blackboard for other sub programs
%OFDM QPSK with AWGN effects
%********************** preparation part ***************************
para=128;
fftlen=128;
noc=128;
nd=6;
ml=2;
sr=250000;
br=sr.*ml;
gilen=32;
aloop=11;
%
%
%
%
%
%
%
%
%
Number of parallel channel to transmit (points)
FFT length
Number of carrier
Number of information OFDM symbol for one loop
Modulation level : QPSK
Symbol rate
Bit rate per carrier
Length of guard interval (points)
Number of Eb/N0
%************************** Create data file ***********************
fid = fopen('BER_AWGN.xls','a');
fprintf(fid,'ebn0\tBER\tCalculation\n\tAWGN\tAWGN\n');
fclose(fid);
%************************** main loop part **************************
for iiii=1:aloop
ebn0=iiii
berawgn=0.5*erfc(sqrt(10^((ebn0-1)/10))) % BERAWGN Theoretical Calculation
nloop=6500;
noe = 0;
nod = 0;
fnoe = 0;
fnod = 0;
eop=0;
nop=0;
% Number of simulation loops
% Number of error data
% Number of transmitted data
% Number of error data
% Number of transmitted data
% Number of error packet
% Number of transmitted packet
for iii=1:nloop
%************************** transmitter *********************************
%************************** Data generation ****************************
seldata=rand(1,para*nd*ml)>0.5;
%
rand : built in function
%****************** Serial to parallel conversion ***********************
paradata=reshape(seldata,para,nd*ml); %
reshape : built in function
%************************** QPSK modulation *****************************
[ich,qch]=qpskmod(paradata,para,nd,ml);
kmod=1/sqrt(2); % sqrt : built in function
ich1=ich.*kmod;
qch1=qch.*kmod;
%******************* IFFT ************************
x=ich1+qch1.*i;
Done by Loh Tuck Keong
Student PI: H0704928
Page 47 of 55
y=ifft(x);
ich2=real(y);
qch2=imag(y);
%
%
%
ifft : built in function
real : built in function
imag : built in function
%********* Gurad interval insertion **********
[ich3,qch3]= giins(ich2,qch2,fftlen,gilen,nd);
fftlen2=fftlen+gilen;
%********* Attenuation Calculation *********
spow=sum(ich3.^2+qch3.^2)/nd./para;
attn=0.5*spow*sr/br*10.^(-ebn0/10);
attn=sqrt(attn);
%
sum : built in function
%*************************** Receiver *****************************
%***************** AWGN addition *********
[ich4,qch4]=comb(ich3,qch3,attn);
%****************** Guard interval removal *********
[ich5,qch5]= girem(ich4,qch4,fftlen2,gilen,nd);
%******************
FFT
******************
rx=ich5+qch5.*i;
ry=fft(rx);
% fft : built in function
ich6=real(ry); % real : built in function
qch6=imag(ry); % imag : built in function
%***************** demodulation *******************
ich7=ich6./kmod;
qch7=qch6./kmod;
[demodata]=qpskdemod(ich7,qch7,para,nd,ml);
%**************
Parallel to serial conversion
*****************
demodata1=reshape(demodata,1,para*nd*ml);
%************************** Bit Error Rate (BER) ****************************
% instantaneous number of error and data
noe2=sum(abs(demodata1-seldata)); % sum : built in function
nod2=length(seldata); % length : built in function
% cumulative the number of error and data in noe and nod
noe=noe+noe2;
nod=nod+nod2;
end
%********************** Output result ***************************
Done by Loh Tuck Keong
Student PI: H0704928
Page 48 of 55
ber=noe/nod;
fprintf('%f\t%e\t%e\n',ebn0-1,ber,berawgn);
fid = fopen('BER_AWGN.xls','a');
fprintf(fid,'%f\t%e\t%e\n',ebn0-1,ber,berawgn);
fclose(fid);
figure(20)
semilogy(ebn0, ber,'sr', ebn0, berawgn, 'py', 'LineWidth', 2);
ylabel('BER')
xlabel('Eb/N0 (dB)')
legend('AWGN', 'AWGN Theoretical','Location','NorthEastOutside');
title('BER for QPSK with AWGN')% Plot one curve.
grid on
drawnow; % Update the plot instead of waiting until the end.
hold on; % Make sure next iteration does not remove this curve
end
%Plot Graph%
figure(1)
stem(seldata,'LineWidth',3)
title('Input Serial Data')
grid on
figure(2)
plot(paradata,'LineWidth',3)
title('Serial to Parallel')
grid on
figure(3)
plot(ich,'LineWidth',3)
title('QPSK Mod (Ich)')
grid on
figure(4)
plot(qch,'LineWidth',3)
title('QPSK Mod (Qch)')
grid on
figure(5)
plot(ich1,'LineWidth',3)
title('Normalized Data (Ich)')
grid on
figure(6)
plot(qch1,'LineWidth',3)
title('Normalized Data (Qch)')
grid on
figure(7)
plot(ich3,'LineWidth',3)
title('Guard Interval Insertion (Ich)')
grid on
figure(8)
plot(qch3,'LineWidth',3)
title('Guard Interval Insertion (Qch)')
grid on
Done by Loh Tuck Keong
Student PI: H0704928
Page 49 of 55
figure(9)
plot(ich4,'LineWidth',3)
title('Rx Signal with Fading (Ich)')
grid on
figure(10)
plot(qch4,'LineWidth',3)
title('Rx Signal with Fading (Qch)')
grid on
figure(11)
plot(ich5,'LineWidth',3)
title('Guard Interval Removal (Ich)')
grid on
figure(12)
plot(qch5,'LineWidth',3)
title('Guard Interval Removal (Qch)')
grid on
figure(13)
plot(ich7,'LineWidth',3)
title('Data Denormalized (Ich)')
grid on
figure(14)
plot(qch7,'LineWidth',3)
title('Data Denormalized (Qch)')
grid on
figure(15)
plot(demodata,'LineWidth',3)
title('Demodulated Data')
grid on
figure(16)
plot(demodata1,'LineWidth',3)
title('Parallel to Serial')
grid on
figure(18)
subplot(411);plot(seldata);
title('Input Serial Data');grid on
subplot(412);plot(paradata);
title('Input Parallel Data');grid on
subplot(413);plot(ich1);
title('Ich De-Normalized');grid on
subplot(414);plot(qch1);
title('Qch De-Normalized');grid on
figure(19)
subplot(411);plot(ich7);
title('Ich De-Normalized');grid on
subplot(412);plot(qch7);
title('Qch De-Normalized');grid on
subplot(413);plot(demodata);
title('Output Parallel Data');grid on
subplot(414);plot(demodata1);
title('Output Serial Data');grid on
%******************** end of file ***************************
Done by Loh Tuck Keong
Student PI: H0704928
Page 50 of 55
%OFDM QPSK with Fading
%********************** preparation part ***************************
para=128;
fftlen=128;
noc=128;
nd=6;
ml=2;
sr=250000;
br=sr.*ml;
gilen=32;
aloop=11;
%
%
%
%
%
%
%
%
%
Number of parallel channel to transmit (points)
FFT length
Number of carrier
Number of information OFDM symbol for one loop
Modulation level : QPSK
Symbol rate
Bit rate per carrier
Length of guard interval (points)
Number of Eb/N0
%************************** Create data file ***********************
fid = fopen('BER_Fading.xls','a');
fprintf(fid,'ebn0\tBER\tCalculation\tCalculation\n\tFading\tFading\t\n');
fclose(fid);
%******************* Fading initialization ********************
tstp=1/sr/(fftlen+gilen);
% Time resolution
itau = [0];
% Arrival time for each multipath normalized by tstp
dlvl = [0];
% Mean power for each multipath normalized by direct wave.
n0=[6];
% Number of waves to generate fading for each multipath.
th1=[0.0];
% Initial Phase of delayed wave
itnd0=nd*(fftlen+gilen)*10; % Number of fading counter to skip
itnd1=[1000];
% Initial value of fading counter
now1=1;
% Number of directwave + Number of delayed wave
fd=320;
% Maximum Doppler frequency [Hz]
flat =1;
% (1->flat (only amplitude is fluctuated),0->nomal(phase
and amplitude are fluctutated)
%************************** main loop part **************************
for iiii=1:aloop
ebn0=iiii
berfading=0.5*(1-(1/(sqrt(1+(1/(10^((ebn0-1)/10))))))) %BERFading Theoretical
Calculation
nloop=1000;
noe = 0;
nod = 0;
eop=0;
nop=0;
%
%
%
%
% Number of simulation loops
Number of error data
Number of transmitted data
Number of error packet
Number of transmitted packet
for iii=1:nloop
%************************** transmitter *********************************
%************************** Data generation ****************************
seldata=rand(1,para*nd*ml)>0.5;
%
rand : built in function
%****************** Serial to parallel conversion ***********************
paradata=reshape(seldata,para,nd*ml); %
reshape : built in function
%************************** QPSK modulation *****************************
Done by Loh Tuck Keong
Student PI: H0704928
Page 51 of 55
[ich,qch]=qpskmod(paradata,para,nd,ml);
kmod=1/sqrt(2); % sqrt : built in function
ich1=ich.*kmod;
qch1=qch.*kmod;
%******************* IFFT ************************
x=ich1+qch1.*i;
y=ifft(x);
%
ich2=real(y);
%
qch2=imag(y);
%
ifft : built in function
real : built in function
imag : built in function
%********* Gurad interval insertion **********
[ich3,qch3]= giins(ich2,qch2,fftlen,gilen,nd);
fftlen2=fftlen+gilen;
%********* Attenuation Calculation *********
spow=sum(ich3.^2+qch3.^2)/nd./para;
attn=0.5*spow*sr/br*10.^(-ebn0/10);
attn=sqrt(attn);
%
sum : built in function
%********************** Fading channel **********************
% Generated data are fed into a fading simulator
[ifade,qfade]=sefade(ich3,qch3,itau,dlvl,th1,n0,itnd1,now1,length(ich3),tstp,fd,flat);
% Updata fading counter
itnd1 = itnd1+ itnd0;
%*************************** Receiver *****************************
%***************** AWGN addition *********
[ich4,qch4]=comb(ifade,qfade,attn);
%****************** Guard interval removal *********
[ich5,qch5]= girem(ich4,qch4,fftlen2,gilen,nd);
%******************
FFT
******************
rx=ich5+qch5.*i;
ry=fft(rx);
% fft : built in function
ich6=real(ry); % real : built in function
qch6=imag(ry); % imag : built in function
%***************** demoduration *******************
ich7=ich6./kmod;
qch7=qch6./kmod;
[demodata]=qpskdemod(ich7,qch7,para,nd,ml);
%**************
Parallel to serial conversion
*****************
demodata1=reshape(demodata,1,para*nd*ml);
%************************** Bit Error Rate (BER) ****************************
Done by Loh Tuck Keong
Student PI: H0704928
Page 52 of 55
% instantaneous number of error and data
noe2=sum(abs(demodata1-seldata)); % sum : built in function
nod2=length(seldata); % length : built in function
% cumulative the number of error and data in noe and nod
noe=noe+noe2;
nod=nod+nod2;
end
%********************** Output result ***************************
ber=noe/nod;
fprintf('%f\t%e\t%e\n',ebn0-1,ber,berfading);
fid = fopen('BER_Fading.xls','a');
fprintf(fid,'%f\t%e\t%e\n',ebn0-1,ber,berfading);
fclose(fid);
figure(22)
semilogy(ebn0, ber, 'o',ebn0, berfading,'h','LineWidth', 2);
ylabel('BER')
xlabel('Eb/N0 (dB)')
legend('Fading', 'Fading Theoretical','Location','NorthEastOutside');
title('BER QPSK Mod with Fading')% Plot one curve.
grid on;
drawnow; % Update the plot instead of waiting until the end.
hold on; % Make sure next iteration does not remove this curve
end
%******************** end of file ***************************
%Plot Graph%
figure(1)
stem(seldata,'LineWidth',3)
title('Input Serial Data')
grid on
figure(2)
plot(paradata,'LineWidth',3)
title('Serial to Parallel')
grid on
figure(3)
plot(ich,'LineWidth',3)
title('QPSK Mod (Ich)')
grid on
figure(4)
plot(qch,'LineWidth',3)
title('QPSK Mod (Qch)')
grid on
figure(5)
plot(ich1,'LineWidth',3)
title('Normalized Data (Ich)')
grid on
figure(6)
Done by Loh Tuck Keong
Student PI: H0704928
Page 53 of 55
plot(qch1,'LineWidth',3)
title('Normalized Data (Qch)')
grid on
figure(7)
plot(ich3,'LineWidth',3)
title('Guard Interval Insertion (Ich)')
grid on
figure(8)
plot(qch3,'LineWidth',3)
title('Guard Interval Insertion (Qch)')
grid on
figure(20)
plot(ifade,'LineWidth',3)
title('Fading Data (Ich)')
grid on
figure(21)
plot(qfade,'LineWidth',3)
title('Fading Data (Qch)')
grid on
figure(9)
plot(ich4,'LineWidth',3)
title('Rx Signal with Fading (Ich)')
grid on
figure(10)
plot(qch4,'LineWidth',3)
title('Rx Signal with Fading (Qch)')
grid on
figure(11)
plot(ich5,'LineWidth',3)
title('Guard Interval Removal (Ich)')
grid on
figure(12)
plot(qch5,'LineWidth',3)
title('Guard Interval Removal (Qch)')
grid on
figure(13)
plot(ich7,'LineWidth',3)
title('Data Denormalized (Ich)')
grid on
figure(14)
plot(qch7,'LineWidth',3)
title('Data Denormalized (Qch)')
grid on
figure(15)
plot(demodata,'LineWidth',3)
title('Demodulated Data')
grid on
figure(16)
plot(demodata1,'LineWidth',3)
Done by Loh Tuck Keong
Student PI: H0704928
Page 54 of 55
title('Parallel to Serial')
grid on
figure(18)
subplot(411);plot(seldata);
title('Input Serial Data');grid on
subplot(412);plot(paradata);
title('Input Parallel Data');grid on
subplot(413);plot(ich1);
title('Ich De-Normalized');grid on
subplot(414);plot(qch1);
title('Qch De-Normalized');grid on
figure(19)
subplot(411);plot(ich7);
title('Ich De-Normalized');grid on
subplot(412);plot(qch7);
title('Qch De-Normalized');grid on
subplot(413);plot(demodata);
title('Output Parallel Data');grid on
subplot(414);plot(demodata1);
title('Output Serial Data');grid on
Done by Loh Tuck Keong
Student PI: H0704928
Page 55 of 55
Download