Sie sind auf Seite 1von 34

Full Duplex OFDM Modem Over a Frequency Selective Channel

2E1366 - Project Course in Signal Processing and Digital Communication Royal Institute of Technology, May 2001

0.8

0.6

0.4

0.2

-0.2

-0.4

0.5

1.5

2.5

3.5

4.5

Project Lightbrown: Calle Gustavsson Christian Henriksson Mrten Sander Peter Sidn Roland Standert Andreas Vedin

ABSTRACT
This report discusses the design and implementation of a DSP-based OFDM modem for full duplex communication between two PCs over a frequency selective channel. The report considers the features that make OFDM (OFDM is acronym for Orthogonal Frequency Division Multiplexing) an efficient modulation scheme for frequency selective channels, e.g. how intersymbol interference (ISI) can be avoided using orthogonal subcarriers. Furthermore, the report evaluates the performance of the modem and suggests further improvements. The implemented system uses 16-quadrature amplitude modulation (16QAM) on each subcarrier and operates with time division duplex (TDD), where one frame of data is transmitted in each direction every other timeslot. The system is not equipped with any higher level of error control, such as acknowledgements and retransmissions. A user interface controls the system. The interface makes it possible to transmit and to receive images and text. Parameters, such as channel estimator memory depth, can be adjusted. The interface also displays the behaviour of the system in real-time by plotting the channel frequency response. The implemented system performs well with a sampling frequency of 22050 Hz, when no channel distortion or noise is present. The synchronization algorithm is noise sensitive and requires a signal to noise ratio (SNR) of about 4 dB. The header used for identification of text or image data is located at the lower frequencies; hence channel attenuation at these frequencies might cause loss of data.

ACKNOWLEDGEMENT
We would like to thank our project assistant, Ph.D. student George Jngren, for his constructive comments on our work and for advising us while we were writing this report.

CONTENTS
1 INTRODUCTION............................................................................................................... 4 1.1 Background .................................................................................................................. 4 1.2 Overview ...................................................................................................................... 5 1.3 Problem Specification .................................................................................................. 5 1.4 Previous Work.............................................................................................................. 6 1.5 Project Members........................................................................................................... 6 1.6 Report Outline .............................................................................................................. 6 2 SYSTEM MODEL .............................................................................................................. 7 2.1 Channel Model ............................................................................................................. 7 3 THEORY............................................................................................................................. 9 3.1 Advantages of a Multicarrier System ........................................................................... 9 3.2 OFDM ........................................................................................................................ 10 3.2.1 Obtaining and Maintaining Orthogonality using the IDFT and a CP ................. 11 3.2.2 Frame Synchronization Using the CP ................................................................. 11 3.2.3 Pilots and Channel Estimation ............................................................................ 13 4 SYSTEM DESIGN............................................................................................................ 17 4.1 Overview .................................................................................................................... 17 4.2 System Model............................................................................................................. 17 4.2.1 QAM Modulation ................................................................................................ 18 4.2.2 The OFDM Frame ............................................................................................... 19 4.2.3 Channel................................................................................................................ 19 4.2.4 Synchronization................................................................................................... 20 4.2.5 Channel Estimation ............................................................................................. 20 4.3 Transmission Protocol................................................................................................ 21 4.3.1 Transmission Set-up ............................................................................................ 21 4.3.2 Continuous Transmission .................................................................................... 23 4.3.3 Clock Frequency Difference ............................................................................... 24 4.4 DSP Implementation .................................................................................................. 24 4.4.1 Program Structure................................................................................................ 25 4.4.2 Memory Structure................................................................................................ 25 4.4.3 Performance......................................................................................................... 25 4.5 User Interface Implementation ................................................................................... 25 4.5.1 Buttons................................................................................................................. 26 4.5.2 Adjustable Parameters ......................................................................................... 26 4.5.3 Communication between PC and DSP................................................................ 27 5 RESULTS.......................................................................................................................... 28 5.1 System Performance and Limitations......................................................................... 28

Contents

6 FUTURE WORK .............................................................................................................. 30 7 APPENDIXES................................................................................................................... 31 A Dictionary ..................................................................................................................... 31 B Equipment..................................................................................................................... 32 8 REFERENCES.................................................................................................................. 33

1 INTRODUCTION
1.1 Background
There is an increasing demand for high data rate services in modern society. One way to meet this demand is to expand the existing infrastructure, e.g. by connecting all users of bandwidth-consuming applications to fibre optic networks. However, this solution is not financially viable. Developing alternative techniques, that make use of the existing infrastructure, is therefore an interesting option for broadband providers. As a part of the project course in signal processing and digital communication at the Royal Institute of Technology, this work considers how an alternative technique, orthogonal frequency division multiplexing (OFDM), can be used for high data rate transfers over the ordinary telephone network. The OFDM modulation technique has special features that make it especially robust against so-called intersymbol interference (ISI), which is one of the limiting factors when data is transferred over a wired transmission medium. OFDM is a so-called multicarrier system. The principle of a multicarrier system is to divide the available bandwidth into subchannels, as depicted in figure 1.1, and to transmit the information in parallel on these. An example of a system that uses OFDM to transmit data at a high speed over the access network is the asymmetric digital subscriber line (ADSL). (The access network is the part of the telephone network between the outlet and the nearest exchange office.)

frequency response

frequency

frequency response

frequency

Figure 1.1: Dividing the bandwidth.

Chapter 1 - Introduction

1.2 Overview
For testing and evaluating the performance of an OFDM system, a modem was implemented on a digital signal processor (DSP). Furthermore, a Windows compliant user interface was implemented for adjusting system parameters and displaying results.
APPLICATION/ USER INTERFACE APPLICATION/ USER INTERFACE

MODEM

CHANNEL

MODEM

DSP impl. PC impl.

Figure 1.1: System overview. Figure 1.1 shows a schematic overview of the implemented system. The user controls and observes the behaviour of the system through the user interface. Another function of the user interface is to feed and receive data to and from the DSP during transmission. The user interface is implemented on a PC. In the following when the term application appears, it should be interpreted as the part of the user interface program that handles the communication between PC and DSP. The core of the system is the DSP-implemented modem. When the modem is in transmitter mode, it transmits the data from the user interface over the channel using OFDM. In receiver mode, the modem detects an incoming transmission, demodulates the data, and gives an estimate of the transmitted bits.

1.3 Problem Specification


The objects of this project are as follows: Design a digital OFDM communication system for full duplex point-to-point communication between two PCs. Implement a modem with real time functionality on a DSP board. Make the system capable of coping with a slowly time-varying frequency selective channel. Display the channel frequency response in real time on a user interface.

Chapter 1 - Introduction

1.4 Previous Work


A full duplex OFDM modem was developed at the Royal Institute of Technology in 2000 [4]. There was no requirement for the system to cope with a time-varying channel. Therefore, an estimate of the channel only had to be calculated once per transmission, using a training sequence. Furthermore, a lot of emphasis was put on acknowledgements and retransmissions, of which our system has none. Another major difference is that the system in [4] was only partially implemented, whereas our system can transmit both images and text. In 1997, an OFDM modem operating over an acoustic channel was developed at Lule University of Technology [5]. This system was designed for one-way communication, meaning that there was no need for a protocol handling data collisions. However, some of the characteristics of the acoustic channel resemble the characteristics of the wire-line channel considered in the present work, in the sense that both channels are time-varying and require continuous estimation. Furthermore, the Lule project used subchannel extinguishing, which is also used in the present work.

1.5 Project Members


The project members are six students at the end of their M.Sc. EE education, following a project course in signal processing and digital communication at the Royal Institute of Technology.

1.6 Report Outline


The second chapter of this report describes the system model. It discusses in general the building blocks of the system. Also, a model of the channel is described. Chapter three covers the theory of OFDM. Chapter four covers the system design, explaining in detail the functionality of the different building blocks. This chapter also discusses the transmission protocol and specific implementation issues. Chapter five discusses the performance and limitations of the system. In chapter six, suggestions are made for future work. Chapter seven contain appendixes and chapter eight a reference list.

2 SYSTEM MODEL
The purpose of this chapter is to discuss in general the different building blocks required for the system to work, see figure 2.1. The channel model is given a separate subsection.
Data from appl. Data to appl.

Data processing

OFDM modulation

Channel

Syncronization

OFDM demodulation

Data processing

Channel estimator

Figure 2.1: Overview of modem functionality. The building blocks are as follows: Data processing. To increase the bit rate, bits are mapped onto symbols. OFDM modulation and demodulation. These blocks perform the signal processing specific for OFDM. Synchronization. Since the system is asynchronous, i.e. there is no common clock, a synchronization algorithm is needed. Channel estimator. The distortion introduced by the channel has to be compensated for. The following functionality is also required: A well specified transmission protocol. Compensation for difference in clock frequency between the two PCs. This problem is discussed further in section 4.3.3. A data identification method. When transmission starts, a pre-amble sequence has to be transmitted to ensure that no data is lost. Therefore, the user interface must be able to determine the content of the data received.

2.1 Channel Model


The transmission medium is a wire. By using so-called 4-to-2 wire hybrids, in conjunction with an adjustable filter and a noisegenerator (see figure 2.2), the channel mimics the be-

Chapter 2 System Model

haviour of an ordinary twisted-pair copper wire (found in e.g. the access network of an ordinary telephone network). By connecting the filter and the noise-generator, the channel can be made frequency selective with an arbitrary signal to noise ratio (SNR).
e(k)

h(k)

DSP Hybrid Channel

ZePo 95

Noise gen. Hybrid

DSP

Figure 2.2: The channel model and the physical channel. Figure 2.2 shows a model of the channel and how the two DSPs are connected. The term e(k) in the channel model is additive white Gaussian noise (AWGN) with variance e2. The channel impulse response h(k) has n coefficients. The box labelled ZePo95 in the physical channel is the adjustable filter.

3 THEORY
This chapter covers the theory of an OFDM system. It introduces the concept of using the inverse discrete Fourier transform (IDFT) to modulate the signal on orthogonal subcarriers. It also discusses how to maintain orthogonality over the channel by adding a so-called cyclic prefix (CP). Furthermore, a method for obtaining frame synchronization using the redundancy introduced by the CP is treated. Finally, it explains how the channel frequency response can be estimated.

3.1 Advantages of a Multicarrier System


In a classic communication system, the information to be transmitted is modulated onto a single carrier. To obtain high bit rates, the symbols have to be transmitted fast and thereby they occupy the entire bandwidth. When the channel is frequency selective, consecutive symbols will interfere with each other, and thus make it harder to recognize the transmitted symbol. Thus, in a classic communication system, ISI causes severe degradation of the system performance. One approach to the problem of eliminating ISI is to introduce a multicarrier system by splitting the available bandwidth into several orthogonal subchannels (see figure 1.1), and to transmit information slowly in parallel on these. In the frequency domain each subchannel will occupy only a small frequency interval where the channel frequency response will be almost constant and each symbol will hence experience an approximately flat fading channel. By using orthogonal subcarriers, the interchannel interference (ICI) will be eliminated, and the symbols transmitted on the different subchannels will not interfere. Multicarrier modulation is the technique behind several applications, e.g. the European digital audio/video broadcast (DAB/DVB) systems and Hiperlan/2.

Chapter 3 - Theory

10

3.2 OFDM

cyclic prefix

cyclic prefix dropped

X(0) X(1)

x(0) x(1)

s(k)

r(k)

y(0) y(1)

Y(0) Y(1)

Parallel/Serial

Serial/Parallel

data symbols

Channel

X(N-2) X(N-1)

x(N-2) x(N-1)

y(N-2) y(N-1)

Figure 3.1: A discrete time OFDM system. Figure 3.1 shows a block diagram of a discrete time OFDM system, where N complex-valued data symbols X(n) modulate N orthogonal carriers using the IDFT forming x(n). The transmitted OFDM signal, s(k), multiplexes N low-rate data streams, each experiencing an almost flat fading channel when transmitted. By adding a cyclic prefix (CP), the interchannel interference (ICI) within an OFDM frame can be avoided. The cyclic prefix is simply a copy of the M last symbols of the N samples placed first, making the signal appear as periodic in the receiver, see figure 3.2. The received signal, r(k), consisting of y(n) and the cyclic prefix, is demodulated using the DFT forming Y(n).

Cyclic prefix

x(0), x(1),...

..., x(N-2-M), x(N-1-M)

..., x(N-2), x(N-1)

Time
-M 0 N-1-M N-1

Figure 3.2: The cyclic prefix, CP.

to decision device
Y(N-2) Y(N-1)

.....

.....

.....

.....

IDFT

DFT

Chapter 3 - Theory

11

3.2.1 Obtaining and Maintaining Orthogonality using the IDFT and a CP


The N complex-valued symbols X(n), 0 n N-1, modulate N orthogonal carriers using the IDFT: x(k ) = X (n)e
n =0 N 1 + j 2 k n N

,0 k < N 1

(3.1)

As is well known, the basis functions of the IDFT are orthogonal [3]. By adding a cyclic prefix, the transmitted signal will appear periodic: , M k < 0 x(k + N ) n N 1 + j 2k s (k ) = N x ( k ) = X ( n )e ,0 k < N 1 n=0 The received signal can be written as: r (k ) = s (k ) h(k ) + e(k ) ,0 k < N 1 where denotes convolution. If the cyclic prefix added is longer than the impulse response of the channel, the linear convolution in the channel will, from the receivers point of view, appear as a circular convolution. This is shown below for any subchannel n, 0 n N-1. Y(n) = DFT(y(k)) = DFT(IDFT(X(n)) h(k) + e(k)) =X(n)DFT(h(k)) + DFT(e(k)) = X(n)H(n) + e(n) , 0 k N-1 (3.4) (3.3)

(3.2)

Equation (3.4), where denotes circular convolution and e(n) = DFT(e(k)), shows that there is no interference between the subchannels, i.e. the ICI is zero. Hence, by adding the cyclic prefix, orthogonality is maintained through transmission. Another advantage of using a cyclic prefix is that it acts as a guard space between adjacent OFDM frames, thus making the problem with interframe interference disappear. This holds as long as the cyclic prefix is at least as long as the length of the channel impulse response. The obvious drawback of using a cyclic prefix is that the amount of data that has to be transmitted increases.

3.2.2 Frame Synchronization Using the CP


Since the transmitter and receiver work asynchronously, i.e. without a common clock, the receiver has to know where each frame starts to be able to extract the data. Due to the fact that, when the CP is added, the first M samples are copies of the last M samples, there is a

Chapter 3 - Theory

12

strong correlation between these parts of the frame. This correlation can be used for detecting where each frame starts. Assume that we observe T consecutive samples of the OFDM signal r(k), which for a straightforward derivation of an estimator is modelled as white noise, and that these samples contain one entire OFDM frame (N+M samples) , cf. figure 3.3. The position of this frame within the observed block of samples is unknown, because the channel delay is
Observation interval of length T

Frame i-1

Frame i

Frame i+1

Cyclic prefix

1 +N+M-1 k T

Figure 3.3: Frame synchronization. unknown to the receiver. In [1], an algorithm for obtaining the Maximum Likelihood (ML) estimate of , given the above assumptions, is described and the results are simply stated here. The ML estimate of is as follows:

ML = arg max{ ( ) ( )}

,1 < T N M + 1

(3.5)

where

( ) =

+ M 1
k =

r (k )r (k + N )

(3.6)

( ) =

1 + M 1 2 2 r (k ) + r (k + N ) 2 k =

(3.7)

Chapter 3 - Theory

13

SNR SNR + 1

(3.8)

SNR =

x (k )
2

N 1

e (k )
2 k =0

k =0 N 1

(3.9)

Note that 1 when the SNR is large. Taking the N-point DFT of r(k) for k = ML+M, ML+M+1, , ML+M+N-1, produces the original symbol sequence X(k), if ML = and no noise and channel distortion is present. However, when noise is present in the channel, the synchronization algorithm will not always give ML = . If ML < , the N samples fed to the DFT will be a shifted version of X(k). This corresponds to a phase rotation of the original sequence, which can be compen sated for in the channel estimator. When ML > , the sequence r(k) for k = ML+M, ML+M+1, , ML+M+N-1, will not consist of N symbols belonging to the same frame, and thus taking the DFT of this sequence will not produce the wanted result, X(k). A method for dealing with this problem is to subtract an offset, , from the estimated time delay. By choosing a so that ML - + M > , the N samples of r(k) for k = ML-+M, ML-+M+1, , ML-+M+N-1, will belong to the same frame. By introducing the time offset, a phase rotation is also introduced. This rotation should be compensated for manually, thus relaxing the complexity of the channel estimator.

3.2.3 Pilots and Channel Estimation


The distortion introduced in the channel has to be estimated and compensated for, if the system is to achieve an acceptable level of performance. In the following, a minimum mean square error (MMSE) estimate of the channel in the time-domain is derived.

Chapter 3 - Theory

14

Assume the following model:


Data from appl. Data to appl.

y(k,l) + e(k,l) X(n,l) Data processing OFDM modulation x(k,l) Channel h y(k,l) + Syncronization

Y(n,l) + e'(n,l)

OFDM demodulation

Data processing

e(k,l)

Channel estimator

Figure 3.4: System model with signals. In figure 3.4 l is the index of an OFDM frame (i.e. frame number l), n is the frequency index and k is the time index. Under the assumption that the channel is time invariant, the received signal in the frequency domain, using equation 3.4, can be written as:
Y (n, l ) = X (n, l ) H (n) + e' (n, l )

n = 0, 1, 2, ..., N-1, l = 0, 1,...

(3.10)

where e' (n, l ) is, because of properties of the DFT, zero mean noise independent both in time and in frequency. From equation (3.10), where H(n) can be seen as a constant for each subchannel n, it is possible to estimate H(n) by minimizing the mean square error :

= E (Y (n, l ) X (n, l ) H (n)) (Y (n, l ) X (n, l ) H (n))*


= ( H (n) RYX RXX ) RXX ( H (n) RYX RXX )* + RYY RYX RYX RXX
* 1 1 1

]
(3.11)

where ()* denotes complex conjugate, E is the expectation operator and R XX = E X (n, l ) X (n, l ) * RYY = E Y (n, l ) Y (n, l ) *

(3.12) (3.13) (3.14)

] ]

RYX = E Y (n, l ) X (n, l ) *

Chapter 3 - Theory

15

This minimization gives the best estimate of H(n) in an MMSE sense:


1 H (n) = E [Y (n, l ) X (n, l ) *] E [X (n, l ) X (n, l ) *]

(3.15)

The estimate of H(n) can, by replacing the expectation operators with their corresponding sample estimates, be approximated as:

H (n ) =

X (n, l ) X (n, l ) *
l =0

l =0 L 1

Y (n, l ) X (n, l ) *

L 1

,n = 0,1,2,..., N 1

(3.16)

In equation (3.11), Y(n,l) is the received symbol on each subchannel and X(n,l) is the transmitted (unknown) symbols. To obtain an estimate, knowledge of X(n,l) is needed. In OFDM a concept called pilots is often used, meaning that known symbols are transmitted on predefined subchannels at predefined time instants.
pilot symbols pilot tones scattered pilots

frequency

frequency

...

...

frequency

...

...

...

...

...

...

...

...

...

time

time

time

Figure 3.4: Three different pilot placing patterns. Each column in the timefrequency grid is one OFDM frame. Each black square corresponds to a known pilot symbol and each white square corresponds to an (unknown) information symbol.

...

Chapter 3 - Theory

16

Figure 3.4 illustrates three different pilot placing patterns. In the first case, pilot symbols resemble training sequences. One frame consists entirely of known data. Pilot symbols give an estimate of the channel at all subchannels, i.e. at all frequencies. The estimate is kept until the next pilot frame is transmitted. In the second case, pilot tones use certain subchannels to transmit known information. The receiver measures the attenuation at the pilot subchannels and then uses this information to continuously estimate (interpolate) the complex-valued attenuation of the data symbols at the other subchannels. This pilot pattern works with the channel estimator derived above. In the third case, scattered pilots require interpolation both in time and in frequency. However, this channel estimator is generally too complex for a practical implementation [1].

4 SYSTEM DESIGN
In the previous chapter, the theory of an OFDM system is treated. This chapter covers the design aspects of the system. It explains the different building blocks of the system and also how the different system parameters are chosen. For two-way communication, a transmission protocol is specified for handling transmission set-up as well as continuous transmission.

4.1 Overview
The system consists of two PC implemented user interfaces and two DSP implemented modems. The same programs are executed on both sides. However, the modem receivers will differ, depending on whether the modem is assigned the function of master or slave. The modem is designed as an interrupt driven state machine, with the two superstates, transmit and receive, see figure 4.1. The interface operates irrespective of whether its modem is master or slave.

Receive

Transmit

Figure 4.1: Modem superstates.

4.2 System Model


This section discusses the different building blocks of the system. The main emphasis is put on the functionality of the modem. Figure 4.2 shows a block diagram of the modem functions in simplex mode.

Chapter 4 System Design

18

Bits in

QAM modulation

IDFT

Add cyclic prefix

Pilots

Channel

Pilots

Bits out

QAM demodulation

Channel estimation

DFT

Remove cyclic prefix

Synchronization

Figure 4.2: Modem model.

4.2.1 QAM Modulation


To increase the data rate, the system uses 16-quadrature amplitude modulation (16QAM) on each subcarrier, mapping four bits onto one complex-valued symbol. Gray coding is also used, making adjacent symbols differ in only one bit. The square signal constellation used, see figure 4.3, is not optimal with respect to the minimum Euclidian distance. However, the constellation is easy to implement by modulating two bits at a time using 4-pulse amplitude modulation (4PAM), and then taking two consecutive 4PAM symbols as the in-phase and quadrature component of one 16QAM symbol. The system uses soft maximum a posteriori (MAP) decisions to demodulate the received 16QAM symbols.
4 3 2 1 0 -1 -2 -3 -4 -4

-3

-2

-1

Figure 4.3: Signal constellation for 16QAM.

Chapter 4 System Design

19

4.2.2 The OFDM Frame


The DSP D/A-converter can only be fed real-valued symbols. To achieve a real-valued output from the IDFT the system uses a technique based on mirroring and complex conjugates. Assume that we have N complex-valued 16QAM symbols. By adding a reversed and complex conjugated copy of the N symbols according to figure 4.4, the output from the IDFT will be real-valued. The two extra zeros are added due to properties of the FFT [3]. By using this technique, the number of points in the IDFT calculation will be increased from N to 2N+2. Note that this manipulation does not introduce any deterioration in the system performance.
X0 X1 ... XN-2 XN-1 0 X0 X1 ... XN-2 XN-1 0 X*N-1 X*N-2 ... X*1 X*0

Figure 4.4: Producing a real-valued output from the IDFT. X* denotes complex conjugate.

4.2.3 Channel
The system operates over a time-varying frequency selective channel. By placing pilots at certain frequencies, the behaviour of the channel can be examined. Figure 4.5 shows an estimated frequency response of the channel when the filters are not connected. As seen in figure 4.5, the frequencies close to half the sampling frequency are strongly attenuated. This attenuation is due to the anti-alias filter in the DSP. Consequently, the subchannels close to half the sampling frequency are not suitable for transmission.

Figure 4.5: Channel attenuation.

Chapter 4 System Design

20

To address this problem, subchannel extinguishing is used. That is, zeros are transmitted on the attenuated channels. The obvious disadvantage of this method is that the effective datarate decreases and some allocated bandwidth is not used.

4.2.4 Synchronization
Apart from synchronization at start-up, described in section 4.3.1, the modem uses the synchronization algorithm (with the approximation 1, cf. equation (3.8)) for detecting the location of the frame in each timeslot when it is in receiver mode.

4.2.5 Channel Estimation


Our system uses pilot tones, i.e. certain subchannels only transmit pilot information. The reason for choosing this method is that we wanted a continuous channel estimate and had to cope with a time-varying channel. Furthermore, pilot tones is the suitable method when the channel is time-varying [2]. Because the attenuations are complex-valued and the DSP treats the real and imaginary part separately, the interpolation between the estimates has to be calculated separately for the real and the imaginary part, and then combined. The interpolator used is linear. A number of other interpolation schemes, e.g. cubic interpolation and various splines, were examined. However, the minor increase in performance obtained by using these schemes did not motivate the major increase in complexity. The channel estimate, for each subchannel n, can be implemented as:
Y ( n, l ) X ( n, l ) * + (n) H (n, l ) = X ( n, l ) X ( n , l ) * + ( n )

n = 0, 1, 2, , N-1. l = 0,1,2,...

(4.1)

where

(n) = Y (n, l ) Y (n, l ) *


l =1

L 1

(4.2)

(n) = X (n, l ) X (n, l ) *


l =1

L 1

(4.3)

In equation 4.1, is a number between 0 and 1 (forgetting factor), depending on how fast the channel is changing. The forgetting factor, , can be chosen close to one if the channel is changing at a slow rate, otherwise it can be chosen close to zero. The forgetting factor is set manually from the interface. In equations 4.2 and 4.3, L is the number of received frames. If the current synchronization value, , differs from the previous value, a phase rotation of the received frame will be the result. Since the channel estimator remembers

Chapter 4 System Design

21

previous estimates, it will recognize this phase rotation as if the channel is changing. Therefore, this rotation must be compensated for manually so that the channel estimator will see the channel as time-invariant. When the signal is affected by AWGN, the MMSE estimate of the channel attenuations occurs when pilot tones are placed at equal distances. Furthermore, the pilot symbols should be chosen so that the SNR on the pilot subchannels is maximized, i.e. selected from the outer points in the signal constellation. This is treated in [2].

4.3 Transmission Protocol


For any communication system to work properly, a transmission protocol has to be well specified. As previously mentioned, our system operates with timeslots; where every other timeslot in each direction is used to transmit one OFDM frame, i.e. TDD. Each OFDM frame is padded on each side with zeros, see figure 4.6. The function of the padding is to make it possible to cope with a difference in clock frequency between the two PCs. This issue is discussed in section 4.3.3.
Padding One frame, 2N +2+M samples Padding

One timeslot

Figure 4.6: Padding of frame.

4.3.1 Transmission Set-up


Since the system is asynchronous, there is a possibility of data collisions if the system is not synchronized. To solve this problem and to reduce the complexity of the system, a masterslave constellation is used. When the system is started, one modem is assigned the function of master and the other slave; this is done manually from the user interface, i.e. the modems do not exchange any information about states. (It is assumed that the master modem has data to transmit.) The reason for this assignment is to initialize the transmission from the master, leaving the synchronization to the slave. The slave does not start transmitting its data until synchronization is acquired.

Chapter 4 System Design

22

Master flowchart
Transmit data

Slave flowchart
Listen

Receive data

Energy detected?

No

Yes

No

Energy detected?

Syncronize

Yes No Continuous mode Sync. acquired?

Yes

Wait for next receive timeslot

Continuous mode

Figure 4.7: Master and slave flowcharts in the set-up mode. The master starts to transmit and receive data in every other timeslot, see figure 4.7. To avoid loss of data while the system is not synchronized, the master application adds header data (consisting of pre-amble frames) to ensure that the slave acquires synchronization before the actual data starts. While the slave is obtaining synchronization, it will not transmit anything in its timeslot. This requires that the master has to recognize when its input buffer is filled with meaningful data, indicating that the slave has acquired synchronization. For detecting when a buffer contains data, a simple energy detection algorithm is used. The algorithm calculates the quadratic sum of all the samples in the buffer and compares the result with a pre-defined threshold. (How the threshold should be chosen depends on frame-size, timeslot-size etc.) After start-up, the slave starts receiving data in every timeslot, searching for energy, see figure 4.7. The energy detector in the slave operates on segments of the received buffer to minimize the amount of pre-amble frames that has to be transmitted.
Segment 1 Segment 2 Segment 3

Energy detection = 0

Energy detection = 0

Energy detection = 1

Figure 4.8: Segment wise energy detection.

Chapter 4 System Design

23

When energy is detected in one segment in a timeslot (see figure 4.8), the slave adjusts the next received timeslot, based on which segment that contained energy, so that it matches one frame. (The adjustment is made by writing earlier or later in the receive buffer so that the received timeslot matches a transmitted one, which can be seen as if the sampling start point is delayed or advanced, see figure 4.9.) The location of this frame within the timeslot can then be found using the synchronization algorithm described in 3.2.2. This knowledge can then be used to place the next frame in the middle of the next timeslot. The system is now synchronized and the slave can start transmitting its information. If no information is available, it uses its timeslots to transmit pre-amble frames to maintain synchronization. The pre-amble frames will appear as ordinary data-frames to the master modem, but will be recognized as nonsense by the master application and discarded.

Frame

Timeslot

Slide

Read

Write

Write

Figure 4.9: Adjusting the frame to the timeslot, compensation for sliding of frame.

4.3.2 Continuous Transmission


When the slave has acquired synchronization and started to transmit information, the system operates in stationary mode, see figures 4.10, 4.11. This mode holds until the system is shut down.
Transmit timeslot Receive timeslot Transmit timeslot Receive timeslot Transmit timeslot Receive timeslot

Figure 4.10: Continuous transmission. However, two problems can occur and some measurements have to be made to deal with these. The first problem is that the user interface might not have fed new data to the modem (if another program is running on the PC, resources have to be shared which slows down the user interface). This problem is solved as follows: instead of letting the modem wait for new data, and thereby loose synchronization, the modem transmits a pre-amble frame. This pre-amble frame will be treated as an ordinary framed but recognized by the receiver

Slide

Read

Chapter 4 System Design

24

application as a nonsense frame - and discarded. The second problem is due to the uncertainties in clock frequencies in the PCs. The solution to this problem is described in the following subsection.
Master flowchart
Transmit data / demodulate latest

Slave flowchart
Receive data / modulate next Transmit data / demodulate latest

Receive data / modulate next

Syncronize

No

Sync. acquired?

Yes

Set-up mode

Figure 4.11: Master and slave flowcharts in the stationary mode.

4.3.3 Clock Frequency Difference


As previously mentioned, the difference in clock frequency between the two PCs will give a slight difference in sampling frequency between the two DSPs. This difference causes the frame to slide in the buffer. To prevent the frame from sliding out of the buffer, each frame is padded with zeros. The padding acts as a guard space, allowing for the sliding to be compensated for in the next timeslot and placing the frame in the middle of the timeslot. The resynchronization due to this phenomenon is only done in the slave. The compensation can be seen as if the sampling start point is delayed or advanced, depending on which way the frame is sliding, see figure 4.9.

4.4 DSP Implementation


The system model developed in Matlab is implemented on a Texas Instruments C6701 EVM PCI card. This DSP card is a powerful tool to implement computationally complex signal processing algorithms. In addition to a powerful processing unit, the EVM card offers the input and output devices needed for a communication system. The program is developed in Code Composer Studio provided by Texas Instruments. All code is written in C. A few functions, e.g. FFT, were downloaded from the Texas Instruments homepage. In the following subsections, a brief description of the DSP implementation is presented.

Chapter 4 System Design

25

4.4.1 Program Structure


The program is implemented as an interrupt driven state machine, according to the flow charts in figures 4.7 and 4.11. The DMA controller generates the interrupts. This also means that the DMA sees to that the timeslots are fixed. The transmitting and receiving modes both uses one DMA channel each.

4.4.2 Memory Structure


To ensure that the processing unit always has data to process, the DSP uses a double buffering mechanism in the communication between PC and DSP. But double buffering is not used while transmitting and receiving data, due to the fact that the system uses timeslots, as described in section 4.3. This means that the memory requirements of the system are low, since the buffers used in the communication with the PC are relatively small. The whole program resides in the internal program memory (64kbyte), when using 512 subcarriers.

4.4.3 Performance
Although no optimized assembler code is written for the program, it only uses approximately ten percent of the available calculation time. All the math functions have limited precision. This introduces noise in both transmitter and receiver. This noise has not been measured but is assumed to have little or no effect compared to the noise introduced by the channel.

Chapter 4 System Design

26

Figure 4.12: The user interface. The interface is implemented in Visual C++, version 6.0.

4.5 User Interface Implementation


The user starts the program OFDM2.exe by double clicking on the file in Windows Explorer.

4.5.1 Buttons
Start button: The Start button initializes the communication between the PC and the DSP. The communication is established through a handshake procedure. The PC retrieves buffer addresses from the DSP and sends initial modulation mode to the DSP. Also, the PC sends adjustable parameters to the DSP. If no parameters are chosen before the start button is pressed, default values are used. The Stop button stops a thread, which makes it possible to adjust parameters.

Stop button:

Apply button: The Apply button sets the adjustable parameters in predefined registers in the DSP without interrupting the PC program. Image X: Image to transmit. When an image radio button is pressed, a version of the chosen picture is displayed below the button. The user chooses a picture and presses transmit. If no picture is chosen and transmit is pressed, the program transmits a default image. In receive mode, the received picture gradually emerges in the top right-hand corner as it is received over the channel. The Exit button is positioned in the bottom right-hand corner.

Transmit button:

Exit button:

4.5.2 Adjustable Parameters


Adjustable parameters are set in the top left-hand corner of the interface. See figure 4.12. The parameters are as follows: Master or slave mode: Sets the function of the modem. The master modem initiates the transmission without any concerns about synchronization, leaving this functionality to the slave. The slave modem does not start transmitting data until synchronization is acquired.

Chapter 4 System Design

27

Forgetting Factor (FF):

FF is the forgetting factor. The forgetting factor is the depth of memory in the channel estimator, see chapter 4.2.5. A forgetting factor of one corresponds to a full memory, whereas zero corresponds to no memory. Interval: 0 FF 1. Default value: 0,5.

Furthermore, the channel frequency response is displayed in the lower left-hand corner.

4.5.3 Communication between PC and DSP


After set-up, the DSP controls the PC. A mailing system is used for passing orders from the DSP to the PC. Depending on which mailbox message is retrieved, the PC reads from or writes to buffers in the DSP. The PC confirms the retrieval of a message by writing to a predefined register in the DSP. A sequence chart of the communication between the PC and the DSP is shown in figure 4.12 below.

Initializing parameters and addresses

Set parameters

Retrieving mailbox message

Send mailbox message

Read from or Write to DSP

Apply button pressed? Yes

No

Figure 4.12: Sequence chart for communication between PC and DSP in the OFDM modem.

5 RESULTS
This chapter describes the performance and the limitations of the system.

5.1 System Performance and Limitations

Figure 5.1: BER vs. SNR plot for different forgetting factors. Figure 5.1 is a plot of the bit-error rate (BER) vs. SNR for different forgetting factors and a pilot spacing of ten symbols. The result is produced by using the DSP transmitter and a simulated receiver in Matlab; the channel filter and the noise generator are not connected. The BER is about 0.5 for low SNRs and then drops sharply at about 4dB. This is due to the fact that the synchronization algorithm used is sensitive to noise and low SNRs cause the receiver to detect frames erroneously. Thus, the system requires an SNR of about 4dB to perform well. Furthermore, when using a full channel memory, i.e. a forgetting factor of one, the difference in sampling frequency (discussed in 4.3.3) will become more noticeable and give a worse estimate of the channel. Without channel filter and noise generator, the implemented system works satisfactory if the sampling frequency is limited to 22050 Hz. When a higher sampling frequency is used, the functions used for plotting the channel frequency response in the interface do not adequately update the data. However, if the channel response is plotted with lower resolution, the transmitter and receiver can transmit and receive text and images using sampling frequencies up to 48 kHz, which is the limit for the DSP-card.

Chapter 5 Results

29

The frame header added by the PC interface for identification of text and image data, is located in the low frequency range. Thus, the transmission of data is very sensitive to distortion causing bit errors in these frequencies. For example, if the channel attenuation is severe at low frequencies, the interface will discard most of the frames, presenting neither images nor text to the user. The current version of DSP code requires roughly 1 ms to demodulate each frame, resulting in a theoritical upper limit for the sampling frequency of 1 Mhz. For higher data rates, the code used in the DSP will not be capable of processing the data in real time.

6 FUTURE WORK
This chapter lists suggested future work. Algorithm refinement. Most of the algorithms used, e.g. the channel estimator, are not chosen because they have better performance compared to others; there was simply not enough time for a comparison. A thorough evaluation of different algorithms should be a prioritized area in future work. Coding and interleaving. By introducing coding and interleaving the biterror rate of the system would decrease. Most papers discussing coding and interleaving, e.g. [6] and [7], suggest a concatenated code, with an outer Reed-Solomon code, an interleaver and an inner convolutional code. Higher level of protocol. By establishing a higher level of protocol, acknowledgements and retransmissions could be handled. Furthermore, the protocol could be used by the modems to exchange information about parameter settings. Bitloading. Each subchannel can be assigned an individual number of transmitted bits, i.e. the higher the SNR on the subchannel, the more bits transmitted [6]. The principle of bitloading is depicted in figure 6.1 below.
SNR # Bits

Subcarrier

Subcarrier

Figure 6.1: Bitloading. User interface development. The user interface could be further developed so that more parameters can be adjusted and more results, e.g. received signal constellation, displayed.

7 APPENDIXES
A Dictionary
Appendix A is a dictionary of occurring abbreviations and acronyms. ADSL AWGN CP BER DAB DFT DMA DSP DVB FFT ICI IDFT ISI MAP ML MMSE OFDM PAM QAM SNR TDD Asymmetric Digital Subscriber Line Additive White Gaussian Noise Cyclic Prefix Bit Error Rate Digital Audio Broadcast Discrete Fourier Transform Direct Memory Access Digital Signal Processor Digital Video Broadcast Fast Fourier Transform Interchannel Interference Inverse Discrete Fourier Transform Intersymbol Interference Maximum a Posteriori Maximum Likelihood Minimum Mean Square Error Orthogonal Frequency Division Multiplexing Pulse Amplitude Modulation Quadrature Amplitude Modulation Signal to Noise Ratio Time Division Duplex

Chapter 7 Appendixes

32

B Equipment
Appendix B is a list of equipment (hardware and software) used when solving the problem. Three PCs. Pentium III, 933 MHz. Two DSP boards. Texas Instruments C6701. ZePo 95 channel filter. Two 2-to-4-wire hybrids. Noise generator. Matlab R12. Microsoft Visual C++, version 6.0. Code Composer Studio.

8 REFERENCES
[1] J.J. van de Beek, Synchronization and Channel Estimation in OFDM Systems, PhD Thesis, Division of Signal Processing, Lule University of Technology, 1998. [2] Rohit Negi and John Cioffi, Pilot Tone Selection for Channel Estimation in a Mobile OFDM System, IEEE Transactions on Consumer Electronics, vol. 44, no. 3, August 1998. [3] J. G. Proakis and D. G. Manolakis, Digital Signal Processing, Prentice Hall, 1996. [4] M. Hollner et al, Full Duplex OFDM Modem, Project Report, Department of Signal Processing, Royal Institute of Technology, 2000. [5] N. Bellander et al, DSP baserat OFDM system ver akustisk kanal, Project Report, Division of Signal Processing, Lule University of Technology, 1997. [6] O. Edfors et al, An introduction to orthogonal frequency-division multiplexing, Research Report, Division of Signal Processing,Lule University of Technology, 1996. [7] D. Bengtsson and D. Landstrm, Coding in a Discrete Multitone Modulation System, MSc Thesis, Division of Signal Processing, Lule University of Technology, 1996.