ofdm project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  ·...

44
OFDM Project Final report 2E1367 - Project Course in Signal Processing and Digital Communication Black Team Jia Liu, Erik Bergenudd, Vinod Patmanathan, Romain Masson OFDM project Black Team OFDM project Project 2005 KTH, Stockholm,30th May 2005

Upload: dobao

Post on 15-Mar-2018

218 views

Category:

Documents


4 download

TRANSCRIPT

Page 1: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

OFDM Project

Final report2E1367 - Project Course in Signal Processing and Digital Communication

Black TeamJia Liu, Erik Bergenudd, Vinod Patmanathan, Romain Masson

OFDM

projectBlackTeam

OFDM

project

Project 2005

KTH, Stockholm,30th May 2005

Page 2: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Abstract

This report discusses the design and implementation of an OFDM modem for a simplex com-munication between two PCs over a frequency selective channel. First a brief introduction isprovided by explaining the backrground and the specification of the project. Then the reportdeals with the system model. Each block of the OFDM system is described (IFFT/FFT, cyclicprefix, modulation/demodulation, channel estimation, bit loading). In the following section, thesystem architecture is analysed. The transmission protocol, as well as the system parametersare explained in details. Then, the DSP implementation is discussed. Finally, the results areprovided in the last chapter.

1

Page 3: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Aknowledgment

We would like to thank our project assistant, Xi Zhang, for his help during the course.

2

Page 4: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Contents

Abstract 1

Aknowledgment 2

1 Introduction 71.1 Background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.2 Specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.3 Equipment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71.4 Project overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2 System Model 92.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9

2.1.1 Transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.1.2 Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.1.3 Receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

2.2 OFDM System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.1 Evolution of OFDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.2.2 Introduction to OFDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2.3 FFT and IFFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.2.4 Cyclic Prefix . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.2.5 Modulation and demodulation . . . . . . . . . . . . . . . . . . . . . . . . 142.2.6 Channel and Noise Estimation . . . . . . . . . . . . . . . . . . . . . . . . 152.2.7 Adaptive Bit Loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16

3 System Architecture 193.1 Frame structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.1.1 Transmission Protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.1.2 Training sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.1.3 Length Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.1.4 Pilots Frame . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21

3.2 Convolution Encoder and Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . 213.3 Mirror Operation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.4 Upsampling and pulse shaping . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223.5 Synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 233.6 Frequency offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

3

Page 5: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 0 Black TEAM

4 DSP implementation 264.1 Overview of the Board . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 264.2 Data Transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.3 Ping Pong Buffering with Linked EDMA transfers . . . . . . . . . . . . . . . . . 274.4 Implementation issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.5 DSP transmitter implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.6 DSP Receiver Implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.7 Changes compared to simulation . . . . . . . . . . . . . . . . . . . . . . . . . . . 31

5 Graphical User Interface 325.1 Communication between the Host and the DSP . . . . . . . . . . . . . . . . . . . 325.2 Transmitter GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325.3 Receiver GUI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

6 Simulation results 356.1 Channel estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.2 Bit loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 356.3 Bit error probability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 37

7 Real system results 387.1 Let’s follow a frame at the receiver . . . . . . . . . . . . . . . . . . . . . . . . . . 38

7.1.1 Received signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.1.2 Match filter, downsampling and FFT . . . . . . . . . . . . . . . . . . . . . 387.1.3 Channel compensation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39

7.2 Final results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

8 Future work 418.1 Increase the bit rate . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418.2 Peak to average ratio . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 418.3 Improving the system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41

Conclusion 42

Page 4

Page 6: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

List of Figures

1.1 Point to point communication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

2.1 OFDM system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92.2 Bits flow through an interleaver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.3 Basis functions in OFDM system . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.4 OFDM system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.5 Channel impulse response . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.6 Adding a cyclic prefix to a frame . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.7 Bits allocation in modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.8 4-QAM (left) and 16-QAM (right) . . . . . . . . . . . . . . . . . . . . . . . . . . 152.9 Block type channel estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.10 Adaptive bit loading . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1 Preambule of transmission . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 193.2 Transmission protocol . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.3 Structure of the training sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . 203.4 A 1/2 - rate Convolution encoder . . . . . . . . . . . . . . . . . . . . . . . . . . . 213.5 Trellis used in the Viterbi decoder . . . . . . . . . . . . . . . . . . . . . . . . . . 213.6 Mirror operation, producing a real valued output from IFFT . . . . . . . . . . . . 223.7 Impulse response of the root-raised-cosine filter . . . . . . . . . . . . . . . . . . . 233.8 The frames "slide" in the received buffer because of the sampling clock difference 233.9 The synchronization method uses correlation between the training sequence and

the ouput from the match filter . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243.10 The maximum of the correlation indicates the where the training frame starts . . 243.11 Channel estimation compensates the rotation of the constellation due to frequency

offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

4.1 Ping Pong Buffering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 274.2 Buffer handling at the receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . 284.3 State machine at the transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . 294.4 State machine at the receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 304.5 The bit allocation is constant over the transmission . . . . . . . . . . . . . . . . . 31

5.1 Interface at the transmitter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335.2 Interface at the receiver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33

6.1 Channel model in the Matlab simulation . . . . . . . . . . . . . . . . . . . . . . . 36

5

Page 7: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 0 Black TEAM

6.2 Channel estimation in two different cases (noise free and noisy channel) . . . . . 366.3 Bit allocation in two different cases (SNR=30dB, SNR =6dB) . . . . . . . . . . . 376.4 BER vs SNR for the coded simulated system . . . . . . . . . . . . . . . . . . . . 37

7.1 Received signal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.2 Signal after FFT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387.3 Constellation before channel compensation . . . . . . . . . . . . . . . . . . . . . . 397.4 Constellation after channel compensation . . . . . . . . . . . . . . . . . . . . . . 397.5 Received picture and results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

Page 6

Page 8: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 1

Introduction

1.1 Background

In a basic communication system, the data are modulated onto a single carrier frequency. Theavailable bandwith is then totally occupied by each symbol. This kind of system can lead tointer-symbol-interference (ISI) in case of frequency selective channel.The basic idea of OFDM isto divide the available spectrum into several orthogonal subchannels so that each narrowbandsubchannel experiences almost flat fading. With OFDM, it is possible to have overlappingsubchannels in the frequency domain, thus increasing the transmission rate. OFDM systemshave gained an increased interest during the last years. It is used in the European digitalbroadcast radio system, as well as in wired environment such as asymmetric digital subscriber-lines (ADSL). This technique is used in digital subscriber lines (xDSL) to provides high bitrateover a twisted-pair of wires. The project focuses on the latter application.

1.2 Specification

The goal of this project is to design and implement a point-to-point digital communicationbetween two PCs over a channel with similar characteristic as a telephone line. A feedbackchannel is used to estimate the channel and to adapt the bit rate of each subcarrier. We providethe possibility to transmit source files (pictures) and to display those on the screen at thereceiver. An graphical interface is implemented in order to be able to control the system.

1.3 Equipment

To complete our task the following equipment is available:

• Two laptops (Dell and IBM)

• Two DSP-cards (Texas Instruments DSK6713)

• Adjustable filter (ZePo95)

• Telephone line emulation hardware

• Noise generator

7

Page 9: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 1 Black TEAM

• Matlab, Code Composer Studio 1.12, Microsoft Visual C++, Frontpage, Illustrator 10.

1.4 Project overview

Our point-to-point communication system presents two sets of PCs, each equipped by a DSPcard. Even if in practice, a full-duplex system is used, we consider a simplex communication :one of the PCs is the transmitter whereas the other is the receiver. The two PCs communicatethrough a telephone line (modeled by emulation hardware in the project). Pictures shall betransmitted and displayed on the receiver’s screen. The receiver estimates the channel on eachcarrier and feeds back information to the transmitter through the feedback link. In practice thefeedback link has the same characteristicsas the direct link. In this project, we will use a simplecable as feedback link (as it is not the interesting part of the research).

TransmitterPC

ReceiverPCDSP DSP

Telephone line emulation

simple cable

Figure 1.1: Point to point communication

Page 8

Page 10: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2

System Model

2.1 Overview

In this section, an overview of the following system is described.

feedback

Channelestimation

Channelcompensation

match filter 4CP

FFTremove complex

mirror

Bit loading

TX Convolution encoder Interleaver Modulation CP 4

IFFTwith

complex mirror

pulse shaping

D/A

Channel

A/D

DemodulationDeinterleaverDecoderRX

Figure 2.1: OFDM system

2.1.1 Transmitter

• Convolutional encoder. In order to decrease the error rate of the system, a simple convo-lution encoder of rate 1/2 is used as channel coding.

• Interleaver. The interleaver rearranges input data such that consecutive data are splitamong different blocks. This is done to avoid bursts of errors. An interleaver is presentedas a matrix. The stream of bits fills the matrix row by row. Then, the bits leave thematrix column by column. The depth of interleaver can be adjusted.

• Modulation. A modulator transforms a set of bits into a complex number correspondingto a signal constellation. The modulation order depends on the subcarrier. A subcarrier

9

Page 11: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

input bits

...

output bits

...

Figure 2.2: Bits flow through an interleaver

with high SNR will be assigned more bits than a subchannel with low SNR. Modulationsimplemented here are QPSK, 16QAM and 64QAM.

• Symmetrical IFFT. Data are transformed into time-domain using IFFT. The total numberof subcarriers translates into the number of points of the IFFT/FFT. A mirror operationis performed before IFFT in order to get real symbols as output.

• Cyclic Prefix (CP). To preserve the orthogonality property over the duration of the usefulpart of signal, a cyclic prefix is then added. The cyclic prefix is a copy of the last elementsof the frame.

• D/A. Convert digital symbols to analog signals. This operation is done using the AICcodec inside the DSP.

2.1.2 Channel

The channel must have the same characteristics as the pair of twisted wires found in the telephonenetwork. In order to achieve this, we use a telephone line emulation hardware. Also, we havethe possibility to use the adjustable filter ZePo and the noise generator. This can be very usefulto test the system performance.

2.1.3 Receiver

• A/D. Convert analog signals to digital symbols for processing.

• Synchronization. Due to the clock difference between transmitter and receiver, a synchro-nization algorithm is needed to find the first sample in the OFDM frame.

• Remove cyclic prefix. This block simply removes the cyclic prefix added in the transmitter.

• Symmetrical FFT. Data are transformed back to frequency-domain using FFT. Then thecomplex conjugate mirror added in the transmitter is removed.

• Channel estimation. The estimation is achieved by pilot frames.

• Channel compensation. The channel estimation is used to compensate for channel distor-tion.

• Bit loading. The receiver computes the bit allocation and send it to the transmitter.

Page 10

Page 12: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

• Demodulation. Symbols are transformed back to bits. The inverse of the estimated channelresponse is used to compensate the channel gain.

• Deinterleaver (Interleaving inverse operation). The stream of bits fills the matrix columnby column. Then, the bits leave the matrix row by row.

• Convolution decoder. The decoder performs the Viterbi decoding algorithm to generatetransmitted bits from the coded bits.

2.2 OFDM System

This section introduces OFDM and key system aspects are considered.

2.2.1 Evolution of OFDM

Frequency Division Multiplexing (FDM)

Frequency Division Multiplexing (FDM) has been used for a long time to carry more than onesignal over a telephone line. FDM divides the channel bandwidth into subchannels and transmitsmultiple relatively low rate signals by carrying each signal on a separate carrier frequency. Toensure that the signal of one subchannel did not overlap with the signal from an adjacent one,some guard-band was left between the different subchannels. Obviously, this guard-band led toinefficiencies.

Orthogonal Frequency Division Multiplexing (OFDM)

In order to solve the bandwidth efficiency problem, orthogonal frequency division multiplexingwas proposed, where the different carriers are orthogonal to each other. With OFDM, it is pos-sible to have overlapping subchannels in the frequency domain, thus increasing the transmissionrate. The basis functions are represented in Figure 2.3. This carrier spacing provides optimalspectral efficiency.Chapter 3 - Theory

10

0.5 1 1.5 2 2.5 3 3.5 4 4.5 5-0.4

-0.2

0

0.2

0.4

0.6

0.8

1

Figure 3.1: Orthogonal basis functions in an OFDM system

3.3 Cyclic Prefix In order to maintain orthogonality through the transmission over the channel a cyclic prefix is added. This is done by taking the M last symbols of the frame and put a copy of them in the beginning of the frame. This will also make the output from the IDFT periodic. The signal will now appear as shown below. )( Nkx ! 0!"# kM

!)(ks (3.2)

!

!

"

!

1

0

2)()(

N

n

Nnj

enXkx!

10 !"" Nk

When the sent signal have been distorted by channel imperfections and noise the receiver will get a signal according to this:

)()()()( kekhkskr !"# (3.3) 10 !#" Nk where * denotes convolution. The N sub channels have to remain orthogonal towards each other through the transmission for them not to interfere with each other. This is fulfilled through the cyclic prefix that was added. The cyclic prefix simulates a cyclic structure in the OFDM signal, so that the received signal corresponds to a cyclic convolution. Through this IDFT and DFT can be used for modulation and demodulation and get right result.

)()()())(())(()(

))()())((())(()(

nenHnXkeDFTkhDFTnX

kekhnXIDFTDFTkyDFTnY

!"#

#"#

#"$#

##

(3.4)

Figure 2.3: Basis functions in OFDM system

Today, OFDM has grown to be the most popular communication system in high-speedcommunications.

Page 11

Page 13: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

2.2.2 Introduction to OFDM

ChannelChannel estimationBit loading

feedback

demodulation Channel compensation FFT CP

bits

Y(n) y(k)

modulation IFFT CPbits X(n) x(k)

s(k)

r(k)

Figure 2.4: OFDM system

The OFDM system studied in this paper has the block structure as shown in Figure 2.4.The system maps the input bits into complex-valued symbols X(n) in the modulation block,which determines the constellation scheme of each subcarrier. The number of bits assigned toeach subcarrier is based on the signal to noise ratio of each subcarrier on the frequency range.The adaptive bit loading algorithm will be detailed below. The IFFT block modulates X(n)onto N orthogonal subcarriers. A cyclic prefix is then added to the multiplexed output of IFFT.The obtained signal is then converted to a time continuous analog signal before it is transmittedthrough the channel. At the receiver side, an inverse operation is carried out and the informationdata is detected.

2.2.3 FFT and IFFT

The key components of an OFDM system are the inverse FFT at the transmitter and FFT at thereceiver. These operations performing linear mappings between N complex data symbols andN complex OFDM symbols, result in robustness against fading multipath channel. The reasonis to transform the high data rate stream into N low data rate streams, each experiencing a flatfading during the transmission. Suppose the data set to be transmitted is

X(1), X(2), ..., X(N)

where N is the total number of sub-carriers. The discrete-time representation of the signal afterIFFT is:

x(n) =1√N

N−1∑k=0

X(k).ej2πk nN , n = 0..N − 1 (2.1)

At the receiver side, the data is recovered by performing FFT on the received signal,

Y (k) =1√N

N−1∑n=0

x(n).e−j2πk nN , k = 0..N − 1 (2.2)

Page 12

Page 14: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

An N-point FFT only requires Nlog(N) multiplications, which is much more computationallyefficient than an equivalent system with equalizer in time domain.

2.2.4 Cyclic Prefix

In an OFDM system, the channel has a finite impulse response. We note tmax the maximumdelay of all reflected paths of the OFDM transmitted signal, see Figure 2.5.

channel impulse response

t0 tmax

Figure 2.5: Channel impulse response

Cyclic prefix is a crucial feature of OFDM to combat the effect of multipath. Inter symbolinterference (ISI) and inter channel interference (ICI) are avoided by introducing a guard intervalat the front, which, specifically, is chosen to be a replica of the back of OFDM time domainwaveform.

Figure 2.6 illustrates the idea.

FRAMECP

t

tc > tmax0

Figure 2.6: Adding a cyclic prefix to a frame

From above expressions the subcarrier waveforms are now given by

s(k) =

{x(k + N) −M ≤ k < 0x(n) = 1√

N

∑N−1k=0 X(k).ej2πk n

N 0 ≤ k < N − 1 (2.3)

The idea behind this is to convert the linear convolution (between signal and channel re-sponse) to a circular convolution. In this way, the FFT of circulary convolved signals is equivalentto a multiplication in the frequency domain. However, in order to preserve the orthogonalityproperty, tmax should not exceed the duration of the time guard interval. As shown below, oncethe above condition is satisfied, there is no ISI since the previous symbol will only have effect

Page 13

Page 15: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

CP Channel CPIFFT FFT

X(n) x(k) s(k) r(k) y(k) Y(n)

over samples within [0, tmax]. And it is clear that orthogonality is maintained so that there isno ICI.

r(k) = s(k)⊗ h(k) + e(k) (2.4)Y (n) = DFT (y(k)) = DFT (IDFT (X(n))⊗ h(k) + e(k)) (2.5)

= X(n).DFT (h(k)) + DFT (e(k)) (2.6)= X(n).H(n) + E(n) , 0 ≤ k ≤ N − 1 (2.7)

where ⊗ denotes circular convolution and E(n) = DFT (e(k)). Another advantage with thecyclic prefix is that it serves as a guard between consecutive OFDM frames. This is similarto adding guard bits, which means that the problem with inter frame interference also willdisappear.

2.2.5 Modulation and demodulation

Given the adaptive bit loading algorithm, the modulator has a number of bits and an energyvalue as input for each sub-carriers. The output for one sub-carrier is a constellation symbolwith a desired energy, corresponding to the number of bits on the input. The modulator is takento get either 2bits, 4bits, 6bits or 8bits available, which means that, respectively, only QPSK,16QAM, 64QAM and 256QAM are available for modulation on each sub-carrier.

01 0 1 1 0 0 1 0 1 1 1 0 0 1 0 1 0

Input buffer (bits)

BPSK QPSK BPSK 16-QAM QPSK QPSKBPSK

s1 s2 s3 s4 s5 s6 s7

bits allocation is provided by the receiver after bit loading algorithm

Figure 2.7: Bits allocation in modulation

Demodulation is performed using Maximum Likelihood (ML) approach, given knowledge ofthe flat fading channel gain for each subcarrier.

Furthermore, in order to reduce bit errors, gray-coded constellations are also employed foreach modulation order available. This gray coding ensures that if a symbol error occurs, i.e.the decoder selects an adjacent symbol to what the transmitter intended to be decoded, thereis only a single bit error resulting.

Page 14

Page 16: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

4 - QAM 16- QAM

Figure 2.8: 4-QAM (left) and 16-QAM (right)

Large performance improvement can be obtained in this adaptive modulation applicationwhere the modulator basis functions are designed as a function of measured channel character-istics. On good subchannel (high SNR), modulation methods, such as 64 QAM, are used toincrease the bit rate. And a lower modulation, such as QPSK, is performed on bad subchannelto keep the error rate in a low level.

2.2.6 Channel and Noise Estimation

The frequency response of channel has to be estimated to invert the effect of non-selectivefading on each subcarrier. Further, given full knowledge of channel and noise variance, thetransmitter and receiver can determine the channel gain at each tone of OFDM symbols, sothat the adaptive bit loading algorithm can proceed to calculate the optimal bit and energyallocation. This algorithm will be expounded in next section.

Since the channel transfer function is not changing very rapidly, a block type channel esti-mation has been developed, in which the pilot tones are inserted into all of the subcarriers ofOFDM symbols as shown in figure 2.9. Noise variance is estimated by the empty-pilot, i.e. thesymbols are all zero-valued.

If the channel is constant during the block, there will be little channel estimation error sincethe pilots are sent at all carriers.

The pilots are inserted to all subcarriers with a specific period, and extracted after DFTblock. The estimated channel H(n) is then obtained in channel estimation block. The receivedsignal can be presented as

Y (n) = X(n)H(n) + E(n) n = 1, 2, ..., N (2.8)

where E(n) is zero mean noise independent both in time and in frequency due to the linearproperties of FFT. The method we used to implement the channel estimation is based on theforgetting factor technique :

H(n) =α(L, n)β(L, n)

n = 1..127 (2.9)

where

α(n, L) = λXp(n, L)Yp(n, L) + (1− λ)α(n, L− 1) (2.10)β(n, L) = λXp(n, L)Xp(n, L) + (1− λ)β(n, L− 1) (2.11)

Page 15

Page 17: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

frequency

time

block of 20data frames

pilot on every subchannel

127subchannels

Figure 2.9: Block type channel estimation

and where Xp(n, l) is the transmitted pilot, Yp(n, l) is the received pilot, λ is the forgetting factor,L is the index of the current pilot frame and n is the subchannel index. In other words, X(n, l)is the transmitted symbol of the lth pilot on the nth subchannel. The use of the forgettingfactor will be explained in the Section 3.6.

The channel response at the subcarrier estimated from the pilots is then used to find theestimated transmitted signal X(n).

X(n) =Y (n)H(n)

(2.12)

The power spectrum of the white Gaussian noise added in the channel is estimated using theempty-pilot.

Ee(n) = Yo(n)− H(n).Xo(n) (2.13)

Here Xo(n) = 0, so the variance of N samples of noise is then calculated as

σ2N =

1N

N−1∑n=0

Yo(n)2 (2.14)

2.2.7 Adaptive Bit Loading

The adaptive bit loading algorithm is an efficient technique to achieve power and rate opti-mization based on knowledge of the subchannel gains. A subchannel with higher SNR is thenassigned more bits and energy than a subchannel with lower SNR.

There are two types of loading algorithms: those that try to maximize data rate and thosethat try to maximize performance at a given fixed data rate. The adaptive technique employedin this system is Rate-Adaptive (RA) loading criterion: a rate-adaptive loading procedure max-imizes (or approximately maximizes) the number of bits per symbol subject to a fixed energy

Page 16

Page 18: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

f

Channel gain

f

bit loading

2

4

6

Figure 2.10: Adaptive bit loading

constraint:

maxEn

b =N∑

n=1

log2

(1 +

En.gn

Γ

)(2.15)

subject to:NEx = N.En (2.16)

where bn and En are the bit allocation and the energy for the nth subchannel. Ex is theaverage energy per subchannel. Γ is the gap (parameter of the algorithm).

To initialize the bit allocation, the procedure is summarized as follows:

• Compute the subchannel signal to noise ratios gn.

• Sort the subchannel SNRs to be from largest to smallest. Compute the number of usablesubchannels as

Nuse = N − number of zerogain subchannels (2.17)

• Obtain the constant K and the energy in the worst subchannel based on the formula

K =1

Nuse

(N.Ex + Γ.

Nuse∑n=1

1gn

)(2.18)

Enmin = K − ΓgNuse

(2.19)

• Solve while Enmin is negative with Nuse → Nuse−1 and corresponding gn term eliminated.

• Determine the bits and energy on usable subchannels using the formula

Ei = K − Γgi

i = 0, 1, ...Nuse (2.20)

b(i) =12. log2(K.

gi

Γ) i = 0, 1, ...Nuse (2.21)

• Return values of bits and energy allocation to original index of unsorted subchannels andassign 0 bit to zero-gain and eliminated subchannels.

• Restrict b(i) to take value 0, 2, 4, 6 or 8 (this corresponds to available modulation orders).

Page 17

Page 19: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 2 Black TEAM

Since only five different signal constellations are available in our system, we require thesubchannel to have only 0, 2, 4, 6 or 8bits. Thus other number of bits are not supported. Inorder to take care of this, a restriction technique has to be used:

• Quantize the number of bits per symbol to nearest integer.

• Set bi = 8 if it is more than 8, and bi = 0 if it is less than 1.

• Round the value of bi down to bi − 1 if it is odd.

The advantage of OFDM is that each subchannel is relatively narrowband and has flat fad-ing. However, it is probable that a given subchannel has a low gain, resulting in a large BER.Conventional system without bit loading has to settle a low modulation to keep a relatively lowerror probability, but also low bit rate. Thus, it is desirable to take advantage of subchannelshaving relatively high performance. This is the motivation of bit loading and adaptive modula-tion. The bits and energy allocation is a function of channel property and noise PSD. Therefore,a new adaptation must be implemented each time the channel varies.

Page 18

Page 20: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3

System Architecture

3.1 Frame structure

There are different frames involved in this system. Beside the regular message frame, there arepilot frame, empty pilot frame, length frame and training sequence, which are described in thissection. "Frame" here denotes an OFDM frame, as described previously, consisting 256 OFDMsymbols and a cyclic prefix.

The following frame structure was used in the system model on Matlab but had to be changedwhen implementing the DSPs to achieve a reliable system. The real system protocol is describedin the next chapter.

3.1.1 Transmission Protocol

Figure 3.1 shows the format of OFDM preamble for transmission. The training sequence at thebeginning is used to synchronize and to estimate the channel. Since the length of message isrequired for decoding the message, a frame recording the length is inserted into the pilot blockand transmitted with most robust combination of BPSK modulation. Then a "zeros" frame istransmitted in order to estimate the noise in the channel. Finally, the transmitter has to waituntil it gets the first feedback from receiver. This is why it sends an empty frame before sendingthe actual data.

Trainingsequence

Lengthframe15 bits

Zeros(noise

estimation)Block of

20 data frames

Empty frame

(wait for feedback)

Figure 3.1: Preambule of transmission

When the transmitter has acquired the first feedback and started to transmit again, thesystem operates in stationary mode, specified as Figure 3.2. The message frames are grouped,20 at a time, into one block, and headed with a pilot frame. Each pilot frame is processed at thereceiver, estimating the channel response and noise power, and then fed back to the transmitter.In order to make the system more efficient, instead of letting the modem wait for the feedback,

19

Page 21: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3 Black TEAM

and thereby lose synchronization, the modem transmits the message block based on the feedbackfrom last pilot frame. The protocol is showed in the Figure 3.2.

Piloti

send block i of 20 framesusing update i-1

Piloti+1

send block i+1 of 20 framesusing update i

receive block iusing update i-1

receive block i+1using update i

process on pilot i process on pilot i+1

update i update i+1update i-1

TX

RX

Figure 3.2: Transmission protocol

3.1.2 Training sequence

The training sequence is divided into two distinct parts. First, the transmitter sends a sine wavefollowed by zero padding (without any upsampling or pulse shaping) and then it sends a pseudo-random sequence (the same as pilot frame). At the receiver side, a correlation between the sinewave (known at the receiver) and the content of the received buffer is proceeded continuously.When the receiver detects the sine wave, it has an estimation of the beginning of the pseudo-random sequence. Then the synchronization is done to get precisely the sampling time. thesynchronization method is explained in the next section.

Trainingsequence

Sine wave

Padding000...00

pseudorandom

complex mirror,IFFT,CP

4 Pulse shaping

{1,-1} real values

Pilot frame

Figure 3.3: Structure of the training sequence

3.1.3 Length Frame

The receiver has to know where the message ends, thus a length frame is transmitted to denotethe length. The length frame is mapped onto a BPSK constellation, and then follows the samesteps of symmetrical IFFT, cyclic prefix extension as message frame. In order to facilitate a

Page 20

Page 22: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3 Black TEAM

reliable detection, only the first 15 bits of length frame are used to represent the length, zerobits appended to form a frame.

3.1.4 Pilots Frame

Pilot frame is used for synchronization and channel estimation, while empty pilot frame is sentto estimate the noise power. As described in Figure 3.3 (see Pilot frame), the pilot frame ischosen as a random sequence, followed by symmetrical IFFT and cyclic prefix extension to bean OFDM frame. The empty pilot frame is set to be a zero valued frame. Since the channelis relatively stable, we assume the time offset and distortion caused by channel is invariableduring a block period. Thereby we send the two type pilot frames each block during the datatransmission, and apply the estimation on a whole block.

3.2 Convolution Encoder and Decoder

A simple convolution encoder, supporting code rate 1/2 is as shown below. For every 1 inputbit, the convolution encoder outputs 2 bits, thus having a 100 % redundancy.

D D

++

+

input

output 1

output 2

Figure 3.4: A 1/2 - rate Convolution encoder

The Viterbi decoding algorithm is used for decoding the coded bits so to generate the trans-mitted bits. The convolution decoder performs Maximum Likelihood decoding algorithm bymaking use of the input trellis, which reduces the computational load in the decoding process.The trellis according to the coding scheme is sketched bellow.

00

10

01

11

00

10

01

11

in-1 in-2

in = 1

in = 0

output =001111

00

1001

0110

Figure 3.5: Trellis used in the Viterbi decoder

3.3 Mirror Operation

According to the standards in ADSL and since the DSP D/A converter can only handle realvalued data, we performe a mirror operation before IFFT. In a sense, we construct a conjugatesymmetric signal in the frequency domain in order to get a real signal in the time domain.

Page 21

Page 23: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3 Black TEAM

f

Signal in frequency domain

complex mirror

flip and conjugate

Real signalin the time domain

Since we use 127 subcarriers, the output of the modulation block contains 127 complexsymbols. Then we compute their conjugate and map the IFFT input as illustrated in the figurebellow.

IFFT

nullX1X2

X127nullX127*X126*

X1*X2*X3*

Realvalues

Figure 3.6: Mirror operation, producing a real valued output from IFFT

We can notice that the 0 (dc) and the 128 input, are set to zero. Indeed, we do not transmitat the zero frequency. A drawback of this manipulation is the requirement of more IFFTcomputations. However, it does not introduce any deterioration in the system performance

3.4 Upsampling and pulse shaping

Before the digital to analog converter, the symbols are upsampled and pulse shaped. This isperformed to permit the synchronization at the reciver side. The upsampling operation consistsin adding zeros between the symbols. In our system the upsampling rate is 4. This meansthat we add 3 zeros between each symbols. Then the signal is filter by the pulse shape. In oursystem, the impulse response of this filter is a root raised cosine of length 40. The responsein provided in the Figure 3.7. We first tried with a rectangular shape but it was less efficient.Indeed, the properties of the root raised cosine in the frequency domain are better for our system.The frequency response of the root-raised-cosine filter is narrow band and each symbol must betransmitted through a norraw bandwith.

Page 22

Page 24: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3 Black TEAM

0 10 20 30 40 50 60 70 80 90−0.1

−0.05

0

0.05

0.1

0.15

0.2

0.25

0.3

0.35

0.4

Figure 3.7: Impulse response of the root-raised-cosine filter

3.5 Synchronization

Synchronization is a big hurdle in OFDM. Synchronization usually consists of two parts:1. Frame detectionFrame detection is used to determine roughly the beginning of the pilot sequence. It is done

by using the sine wave.2. Time offset estimation correctionBecause the sampling clock difference between the transmitter and receiver, each signal

sample is off from its correct sampling time by a small amount which is linearly increasing withthe index of the sample. The phenomenon is illustrated in the Figure 3.5.

received buffer

Frame

Frame

Frame

t

beginning of transmission

middle

end

The time index given by the synchronization varies with time

Figure 3.8: The frames "slide" in the received buffer because of the sampling clock difference

Then, the sampling time must be estimated and compensated before removing cyclic prefixat the receiver since otherwise the orthogonality between subcarriers are lost.

In wireless systems, the synchronization has to be done for every frame. This is why asynchronization with cyclic prefix is performed. But this method is not very reliable. In ourcase (telephone line), the system is quite stable. In this way, we can synchronize every 20 frames.

Page 23

Page 25: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3 Black TEAM

As we use a pilot frame to estimate the channel, the synchronization is done using the samepilot.

50 100 150 200 250 300 350 400

!1

0

1

2

0 5 10 15 20 25 30 35 40

!1!0.50

0.51

Output of the match filter

Training sequence

The synchronization gives the sampling time

Figure 3.9: The synchronization method uses correlation between the training sequence and theouput from the match filter

The synchronization algorithm used herein is based on the complex-valued pilot frames.During the pilot frames, it is known to the receiver what the transmitter is transmitting. Hence,one possible way of recovering the symbol timing is to cross-correlate the complex-valued samplesafter the matched filter with a locally generated time-shifted replica of the pilot sequence. Bytrying different time-shifts in steps of T / Q, where Q is the number of samples per symbol,the symbol timing can be found with a resolution of T / Q. Put into mathematical terms, ifmf(n) is the output of the match filter, pilot(n) the pilot sequence of length L, and [tstart; tend]represents the search window, the timing can be found as :

tsamp = arg maxt

L−1∑i=0

pilot(i).mf(Q.i + t) t = tstart..tend

An example of what the correlation look like is shown in Figure 3.10

0 50 100 150 200 250 300 350 4000

5

10

15

20

25

30

35

40

45

Result from the correlation

Sampling time

Figure 3.10: The maximum of the correlation indicates the where the training frame starts

Page 24

Page 26: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 3 Black TEAM

The correlation properties of the training sequence are important as they affect the estimationaccuracy. Ideally, the autocorrelation function for the pilot frame should equal a delta pulse, i.e.,zero correlation everywhere except at lag zero. Therefore, the pilots frame should be carefullydesigned. However, it is simply chosen as a random sequence since usually it works fairly wellwhen the length is large enough.

3.6 Frequency offset

Due to a slight difference between the clock frequencies, the system experiences a frequencyoffset. This phenomenon makes the angles of points in the constellation to change linearly overtime. If the variation is to fast, the demodulation becomes unreliable. Then, for large files, wehave to compensate the frequency offset. This is done using a forgetting factor closed to 1.

When estimating the channel every 20 frames, we weight higher the current estimation thanthe previous. In this way, the angle due to frequency offset is estimated every 20 frames andcompensated all over the transmission.

Channel estimation with high forgetting

factor

Time

compensation

Figure 3.11: Channel estimation compensates the rotation of the constellation due to frequencyoffset.

Page 25

Page 27: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 4

DSP implementation

This section follows up from the previous and explains how the algorithms simulated in Matlabwere implemented on the DSP board. A brief overview of the DSP board used is presented first.In the following sections we explain the implementation of the transmitter and receiver.

4.1 Overview of the Board

In this course we worked with the TI C6713 DSK (DSP Starter Kit). This board was equippedwith a 225 MHz TMS320C6713 Floating Point DSP and has 265Kbytes of internal memory. Onboard peripherals include two multi-channel buffered serial ports (McBSPs) and an enhancedDMA controller (EDMA). It also has 16 Mbytes of on board SDRAM.

With its significant amount of internal memory we managed to load our whole programwithin it, without using any of the SDRAM. The SDRAM was used exclusively for the data tobe transmitted.

For signal transmission and audio processing, the DSP board is equipped with an on-boardcodec called the AIC23. Codec stands for coder/decoder, the job of the AIC23 is to code analoginput samples into a digital format for the DSP to process, and then decode data coming out ofthe DSP to generate the processed analog output. Digital data is sent to and from the codec onMcBSP1. We use both channels of the codec for the transmitting and the feedback part. Thesignal is sampled as 16-bit elements at a rate of 96 kHz. To speed up the task of copying databetween the CPU and audio codec, the EDMA (Enhanced Direct Memory Access) is used tocopy one frame between the codec and memory and interrupt the DSP.

The DSK has 4 light emitting diodes (LEDs) and 4 DIP switches that allow users to interactwith programs through simple LED displays and user input on the switches.

The 6713 DSK includes a special device called a JTAG emulator on-board that can directlyaccess the register and memory state of the 6713 chip through a standardized JTAG interfaceport. When a user wants to monitor the progress of his program, Code Composer (the develop-ment environment) sends commands to the emulator through its USB host interface to check onany data the user is interested in. We also use this interface together with the GUI to downloadthe file from the host computer to the DSP board for transmission.

The DSP implementation followed closely the model implemented in Matlab. We had tomake sure however that the system complied with real time constraints. Also, we had to verifythat memory constraints were met. The programming was implemented in C and care had tobe taken to define precise memory allocation. Fortunately, Code composer Studio compiler does

26

Page 28: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 4 Black TEAM

a lot of code optimization, and in our case we did not have to work too hard on optimizing thecode manually. We took steps to avoid calling functions within loops as well vector operations.

4.2 Data Transfer

Audio signals are transferred back and forth from the codec via McBSP2, a bi-directional serialport. The EDMA is configured to take every 16-bit signed audio sample arriving on McBSP1and store it in a buffer in memory to be processed by the DSP. At the same time the EDMA isused to transfer data from memory to the McBSP1 to be sampled and transmitted.

The codec is configured and controlled via the McBSP0, a second serial port. The commandsare used to configure parameters on the codec (sample rate, gain, audio path).

4.3 Ping Pong Buffering with Linked EDMA transfers

Using a single buffer for receiving and transmitting data can be tricky and timing dependantbecause new data constantly overwrites present data being transmitted. Ping Pong bufferingis a technique where two buffers are used for data transfer instead of only one. The EDMA isconfigured in our case to fill the Ping buffer first, and then the Pong Buffer. While the Pongbuffer is being filled, the Ping buffer can be processed with the knowledge that the currenttransfer won’t overwrite it. In our system we use Ping and Pong Buffers for both transmittingand receiving.

copy

proccessingdata codec

sending

ping

pong

next interrupt

processingdata

copy

codec

sending

ping

pong

whenproceeded

whenproceeded

Figure 4.1: Ping Pong Buffering

The EDMA controller is configured slightly differently for each buffer. After filling up abuffer, the EDMA controller generates an interrupt. Typically the interrupt handler must thenreload the configuration for the next buffer before the next audio sample arrives. A feature thatspeeds up this process is called EDMA linked transfers that is used here, that makes this processless time critical. The configurations are created in advanced and the EDMA controller simplylinks to the next configuration after the present one is finished. An interrupt is still generated,

Page 27

Page 29: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 4 Black TEAM

but only to signal to the processor that it can process the data. Hence, the only time constraintis that audio data must be processed before the next buffer is filled.

4.4 Implementation issues

Synchronization

It is possible to determine the start index of frame by calculating the cross correlation of thereceived and known sinusoid. The receiver calculates the correlation with the received signal,sifting in time, and keeping the maximum value and the corresponding index. If the maximumvalue is higher then a predefined threshold, the sine is considered to be found. If no sine isfound, the frame is considered as empty and noise estimation is performed. From the sampleright after the sine the first training sequence starts.

Assembling frame

On the receiver side, the frame can start at any point in the buffer since it’s not possible tomake the cards work completely synchronously. To solve this, the received part of the frame isstored in a temporary buffer. When the next buffer is filled, the frame can be assembled andprocessed, a semaphore is set to keep in mind that there is still unprocessed data in the receivebuffer.

received buffer next received buffer1st part of the frame

1st part of the frame

2nd part of the frame

2nd part of the frame

temporary buffer

Figure 4.2: Buffer handling at the receiver

Memory considerations

Mostly, the computational power consumption is very low for this implementation. More lim-iting is the memory usage on the board. Even if the physical amount of memory is sufficient,there have been problems with allocating memory in the functions. Only very small arrays werepossible to declare in the functions. No dynamic memory allocation worked either. The solutionwas to declare large buffers globally in the beginning and then reuse them. Especially the mod-ulation and demodulation functions caused problems. The Matlab function for modulation usedcomplete predefined tables to encode the signal. But due to the gray coding of the modulationthe complexity could be reduced significantly.

Feedback

The feedback is a basic communication system. The bit allocation is encoded as 4 bits persub-carrier and then modulated with QPSK. Each symbol is repeated twice. The transmissionis performed through a perfect channel using a coaxial cable.

Page 28

Page 30: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 4 Black TEAM

4.5 DSP transmitter implementation

end

synchronization frame

host starts DSP programm

initialization of buffers, codec, EDMA.

wait for feedback

10 training frames

if no feedback

send 20 data frames

send 1 training frame

get the bit allocation

if feedback

if the file is not totally sent

Figure 4.3: State machine at the transmitter

• The host loads the DSP program, and writes the signal to be transmitted (sine wave/picture) into the SDRAM on the DSP board.

• The DSP initializes buffers codec and EDMA. Training sequence is set up.

• A pilot tone (sinusoid) is sent for synchronization. It is used to calculate the start theapproximate index in the buffer of the first frame.

• 10 training frames are subsequently sent to obtain an accurate index of the start of theframes in the buffer. In addition, it is used in estimating the channel impulse responsewhich is averaged over the 10 training frames.

• The DSP board waits for feedback containing the bit allocation for each sub-carrier.

• If no feedback is available the DSP board goes back to state 3. If feedback is availablethen the bit allocation is received, and used in the first data frame.

Page 29

Page 31: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 4 Black TEAM

• Based on the bit allocation the right amount of data is extracted from the sequence to betransmitted. Next it is modulated and the IFFT is performed. Then it is pulse shapedand up sampled. It is then sent to the codec to be transmitted.

• The previous step is repeated for every 10 frames after which a training frame is sent.

• After all the frames are sent an empty frame is transmitted and the program exits.

4.6 DSP Receiver Implementation

end

host starts DSP programm

initialization of buffers, codec, EDMA.

receive synchronization frame and get the time index

compute the bit allocation and

send it

estimate the channel with

10pilots

receive the pilot and update the

channel estimation

if the file is not totally received

receive 20 data frames

Figure 4.4: State machine at the receiver

• The host loads the DSP program.

• The DSP initializes buffers codec and EDMA.

Page 30

Page 32: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 4 Black TEAM

• An empty frame is used to estimate the noise variance. Then the receiver correlationdetection on the sinusoid.

• The received sinusoid is used to determine a rough index of the start of frame.

• 10 training frames are used to estimate the channel and a weighted average of past andpresent estimations is used. In addition to determining the correct index of the start offrame.

• With the channel estimate the bit allocation is computed and sent to the transmitter,along with a sinusoid for synchronization.

• The receiver waits for the frame to be received and bit allocation detected. Subsequently,20 data frames are received.

• After every 20 data frames, a training frame is received to correct the frequency offsetin sampling frequency of the clocks on both DSPs. It is also used to update the channelestimation.

• After all the frames are received, the program exits.

4.7 Changes compared to simulation

In order to achieve a functional system, the original system had to be adapted. In this way,simplifications have been done to obtain a reliable modem. Here are the differences between themodel and the real system :

• The convolution coder and the interleaver have not been integrated. The functions weretoo slow and did not meet the real-time deadlines.

• The bit allocation is constant over the transmission. We only compute the bit allocationat the beginning, send back the result to the transmitter and keep the result all over thetransmission. However we still estimate the channel every 20 frames.

Pilot send block 1 of 20 frames Pilot send block 2 of

20 frames

receive block 1 receive block 2

estimate the channel,

computation of the bit allocation

channelest.

TX

RX

wait

wait

bitallocation

Figure 4.5: The bit allocation is constant over the transmission

• The length is fixed and known on both sides. Each picture that we send has the samelength. In this way, we do not have to send the length, and we avoid a probable failure oftransmission.

Page 31

Page 33: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 5

Graphical User Interface

The Host graphic user interface (GUI) is developed in Microsoft Visual C++ 6.0 and calls RTDXfunction to interact with the DSP. There are two different GUIs running independently at thetransmitter and receiver end (Transmitter GUI and Receiver GUI). The user can select whichimage (*.bmp) to send at the Transmitter GUI and start the transmission with a button click.The receiving begins when the user press the receive button at the Receiver GUI. Once thetransmission is done the received picture is displayed along with signal to noise ratio (SNR), bitallocation and bit error probability (BER). During the process at both ends, the user is informedabout the current progress.

5.1 Communication between the Host and the DSP

The Real Time Data Exchange (RTDX) is a standard component of the TI DSP, which permitsusers to transfer data between a Host and a target DSP without interfering with their appli-cations. Since the DSP target can only handle integers, the picture to be sent is written to amemory buffer as an array of integers within the transmitter RTDX Host Library. When theRTDX Host Library receives a request for data from the target application, the data in the hostbuffer is sent to the requested location on the target via the JTAG interface. The host notifiesthe RTDX Target Library when the operation is complete. In a similar way, the receiver Hostrecords the target-send data into a memory buffer, and retrieve the picture from the receivedintegers. The Host can then read or write the whole file directly from or to the DSP on theboard memory. Specific RTDX syntaxes are inserted into Host and Target application to utilizethe RTDX Host Library and RTDX Target Library.

5.2 Transmitter GUI

Once the user starts the Transmitter GUI program transmitter.exe, the CCS is launched andthe DSP program "dsk_app.out" is loaded. When the picture is chosen, it is displayed in thedisplay area and written to a memory buffer as an array of integers. The user clicks the sendbutton to start the DSP program and the data transfer from Host to DSP. As shown in Figure5.1, while the whole array of the integers is transferred to the target DSP, the text-area windowbecomes visible and display "The DSP is processing!" to let the user know the status.

32

Page 34: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 5 Black TEAM

Figure 5.1: Interface at the transmitter

5.3 Receiver GUI

Figure 5.2: Interface at the receiver

Similarly, the corresponding DSP program at the receiver is loaded once the user begins theReceiver GUI program receiver.exe. While the user clicks the receive button, the DSP program islaunched to start receiving, then transfers the data from DSP to Host when receiving is completeon DSP. It is important to guarantee that the receiving is run before the transmission so that the

Page 33

Page 35: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 5 Black TEAM

receiver is able to detect the beginning of the data. The Receiver GUI, see Figure 5.2, displaysthe received image, the SNR and the bit allocation when the transmission is accomplished. Thereis also a text-area window that displays "Data processing complete!" to indicate the status. BERis then calculated by comparing the received file with a copy of the original file.

Page 34

Page 36: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 6

Simulation results

In this chapter, the performance of the system model is treated. We recall the parameters ofthe Matlab model:

• number of subchannels : 127

• size of the IFFT/FFT : 256

• length of the cyclic prefix : 32 symbols

• upsampling factor : 4 , pulse shaping : rectangular

• 10 pilots sent at the beginning to estimate the channel

• 1 pilot sent every 20 frames to improve the estimation

We first show the performance of the channel estimation, then the bit loading results aredisplayed and finally, the bit error probability as a function of the SNR is plotted. Here theSNR corresponds to the symbol energy divided by the noise power.

SNR =Eb

σ2N

6.1 Channel estimation

In the simulation, the channel is a low pass filter with additive white gaussian noise. It isillustrated in the Figure 6.2. We provide a plot of the channel estimation in a noisy channel(SNR = 6dB) and in a noiseless channel. We can notice that the channel estimation is noisesensitive. In the simulation, the message is not very large and averaging is not proceeding somuch. But since the files that we use in the real system are very large, and since the estimationis improved every 20 frames, the channel estimation is efficient and gives good results.

6.2 Bit loading

The bit allocation depends on the SNR computed on each sub-channel. We provide the plot ofthe bit allocation for two values of the SNR.

35

Page 37: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 6 Black TEAM

channel

low passfilter +

n(k)

Figure 6.1: Channel model in the Matlab simulation

0 20 40 60 80 100 120 1400

0.5

1

1.5

2Channel estimation

0 20 40 60 80 100 120 1400

0.5

1

1.5

2Channel estimation

noisy channelSNR = 6 db

noise free channel

Figure 6.2: Channel estimation in two different cases (noise free and noisy channel)

Page 36

Page 38: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 6 Black TEAM

0 20 40 60 80 100 120 1400

1

2Channel estimation

0 20 40 60 80 100 120 1404

6

8Bit allocation

0 20 40 60 80 100 120 1400

2

4Bit allocation

SNR=30dB

SNR=6dB

Figure 6.3: Bit allocation in two different cases (SNR=30dB, SNR =6dB)

6.3 Bit error probability

In order to plot the SNR vs bit error probability (BER), we did a Monte Carlo simulation. Werandomly generated the input to the simulation (a bit stream) and then transmit this signalthrough the system. At the very end, we compute the BER. We repeat this operation severaltimes for several values of the SNR. Then, we obtain statistics of the system. Our results areprovided in the Figure 6.4. For a low SNR, errors occur very often. Indeed, the synchronization is

−1 0 1 2 3 4 5 6 7 810

−4

10−3

10−2

10−1

100

Figure 6.4: BER vs SNR for the coded simulated system

very sensitive to noise and the system is very dependent on the performance of synchronization.This makes the system unreliable for low SNR.

Page 37

Page 39: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 7

Real system results

7.1 Let’s follow a frame at the receiver

7.1.1 Received signal

This is what we obtain just after the A/D converter.

Figure 7.1: Received signal

7.1.2 Match filter, downsampling and FFT

The signal is filtered, downsampled and the FFT is performed.

Figure 7.2: Signal after FFT

38

Page 40: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 7 Black TEAM

7.1.3 Channel compensation

One problem when implementing the system was the frequency offset. As explained in Section3.6, the angles of points in the constellation change linearly over time and we have to compensatefor this rotation. We provide the plot of a frame constellation before and after compensation.The channel was flat, and the modulation scheme is 64-QAM in each subchannel.

Figure 7.3: Constellation before channel compensation

Figure 7.4: Constellation after channel compensation

After this demodulation is performed and we finally get the final data.

Page 39

Page 41: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 7 Black TEAM

7.2 Final results

We provide a picture of what we obtain at the receiver. The channel was taken noisy andfrequency selective. The bit loading algorithm is efficient and the bit error rate is low.

Figure 7.5: Received picture and results

Page 40

Page 42: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Chapter 8

Future work

This chapter contains a list of suggested future work.

8.1 Increase the bit rate

The maximum bit rate for our system is equal to 64kbits/s, which is low for an OFDM system.This is due to some of our choices in the system design. In order to increase this bit rate, wecould have change some parameters. We could have reduced the upsampling factor, used another modulation scheme (higher order) and reduce the size of the cyclic prefix.

8.2 Peak to average ratio

One major difficulty about OFDM is its large peak-to-average ratio (PAR). This means thatthe OFDM signal has a large variation between the average signal power and the maximumsignal power. The large dynamic range of the OFDM system can lead to some problems whenconverting from digital to analog. A D/A converter has both linear and non-linear regionswhere the non-linear regions occur for large output powers (i.e., near saturation). To reduce theamount of distortion, the symbols need to be as much as possible in the linear region. In thisway, we have to lower the output power, which leads to unefficiency.

Methods to reduce the PAR can be implemented in an OFDM system. They use someconstraints on the modulation sequences and seem quite complex.

8.3 Improving the system

Some blocks of the system can be improved. Some algorithms like synchronization, bit loadingand channel estimation can be improved and optimized to obtain better performence and afaster system. Also, an algorithm to track the frequency offset could have been implemented.

41

Page 43: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Conclusion

The key building blocks of an OFDM Modem conforming to the course requirements has beendesigned and implemented. The functionality of the modem is verified at the simulation level,and the system performance is measured under real operation condition. We found that theOFDM modem leads to better BER performance than conventional systems. Further, the OFDMsystem with adaptive algorithm outperforms the OFDM systems having fixed modulation, givinghigher bit rate. In conclusion, OFDM is a very promising technology, and practical adaptiverate algorithm serves well to improve performance.

42

Page 44: OFDM Project - search read.pudn.comread.pudn.com/downloads80/doc/310943/ofdm_report.pdf ·  · 2007-07-23OFDM Project Final report ... 6 Simulation results 35 ... nization algorithm

Bibliography

[1] Advanced Digital Communication, John M. Cioffi, course reader in EE379C, Stanford Uni-versity, 2000.

[2] High Performance OFDM Modem Robust Against Channel Imperfections, Shen et al.,Project report, Royal Institute of Technogy, 2002.

[3] Full Duplex OFDM Modem over a Frequency Selective Channel, Gustavsson et al., Projectreport, Royal Institute of Technology, 2001.

[4] DSP baserat OFDM system över akustisk kanal, Bellander et al., Project report LuleaUniversity of Technology, 1997.

[5] An Introduction to Orthogonal Frequency-Division Multiplexing, Edfors et al., Tech. reportLulea University of Technology, 1996.

[6] Estimation of Synchronization Parameters, Jan-Jaap van de Beek, Licentiate thesis LuleaUniversity of Technology, 1996.

[7] Lecture notes from graduate course in OFDM, Katie Wilson, Royal Institute of Technology,2003

[8] J. G. Proakis and D. G. Manolakis, Digital Signal Processing, Prentice Hall, 1996.

43