0% found this document useful (0 votes)
47 views6 pages

Wireless Access Systems Exercise Sheet 2: Coded OFDM Modem: Oals of The Xercise

This document discusses simulating a coded OFDM modem. It describes implementing convolutional channel coding and an OFDM transceiver. The tasks involve generating data, encoding, interleaving, modulating, transmitting over a channel with AWGN, equalizing, decoding, and measuring BER.

Uploaded by

Rashed Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
47 views6 pages

Wireless Access Systems Exercise Sheet 2: Coded OFDM Modem: Oals of The Xercise

This document discusses simulating a coded OFDM modem. It describes implementing convolutional channel coding and an OFDM transceiver. The tasks involve generating data, encoding, interleaving, modulating, transmitting over a channel with AWGN, equalizing, decoding, and measuring BER.

Uploaded by

Rashed Islam
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

1

Wireless Access Systems Exercise Sheet 2: Coded OFDM Modem


I. G OALS
OF THE

E XERCISE

In this exercise, we simulate a complete coded OFDM (COFDM) modem. The implementation of channel coding and OFDM is divided among different groups, which will then combine their code at the combination task to obtain a complete system. Task 1 considers the simulation of channel coding, in this case, convolutional coding. The aim is to get familiar with convolutional codes, channel encoding, Viterbi decoding and bit-interleaved modulation. Task 2 considers the implementation of a basic OFDM transceiver. We will get familiar with OFDM modulation/demodulation, cyclic prex, and frequency selective channels. Moreover, we will estimate the channel matrix and use it for equalization after OFDM demodulation. In the following, we introduce the details of each task. II. TASK 1: C HANNEL C ODING - C ONVOLUTIONAL C ODES A. Introduction Channel coding enables the correction and/or detection of bit errors introduced by transmission of a modulated signal through a channel. Design of codes differ for AWGN and fading channels. For instance, codes designed for AWGN can not deal with long burst errors which may be introduced by fading channels. Hence, codes for fading channels incorporate AWGN-based channel codes and interleavers, which randomize the transmit bits. There are basically two types of channel codes: block codes and convolutional codes. The convolutional codes differ from block codes in that the encoder introduces memory, and the output at a given time depends not only on the current input, but also on previous input bits. A rate R = k/n convolutional encoder with constraint length K is a k -input,
n-output linear sequential circuit with memory depth m = K 1. The information sequence is divided into blocks

of length k and the codeword is divided into blocks of length n.

Fig. 1.

A rate 1/2 binary convolutional encoder with constraint length K = 4 and memory depth m = 3.

An example for a rate 1/2 convolutional encoder is given in Fig. 1. The encoder has k = 1 inputs, m = 3 delay elements and n = 2 mod-2-adders. Since mod-2 addition is a linear operation, the encoder is a linear feedforward shift register. The information sequence u = (u0 , u1 , u2 , ...) enters the encoder one bit at a time. The two encoder outputs v (0) = (v0 , v1 , v2 , ...) and v (1) = (v0 , v1 , v2 , ...) can be obtained as the convolution of u with the encoder impulse response. The impulse response is obtained by letting u = (1, 0, 0, ...). After encoding, the two streams are multiplexed and the codeword is obtained: v = (v0 v0 v1 v1 v2 v2 ...). The convolutional encoders have a natural trellis structure, and the Viterbi algorithm is the optimal decoding algorithm which reduces the complexity of maximum likelihood decoding by systematically removing paths from consideration that cannot achieve the highest path metric. Channel codes are designed for good performance in AWGN channels. In fading channels, when the channel is in deep fade, the errors usually occur in long bursts. To improve coding performance in fading channels, interleaving has been introduced. The basic idea behind the use of an interleaver is to spread error bursts, which occur due to deep fades, over many codewords. By doing so, the received codeword exhibits at most a few consecutive errors. The size of the codewords should be large enough to randomize the symbols such that fading is independent in a received codeword.
(0) (1) (0) (1) (0) (1) (0) (0) (0) (1) (1) (1)

Fig. 2.

A block N M (7 7) interleaver.

Combining coding and interleaving, we obtain the channel coding with interleaving structure for fading channels, as shown in Fig. 3. The information bits from the source are encoded with a given convolutional encoder, and then interleaved. The interleaved coded bits are mapped to modulated symbols and sent through a channel (e.g., AWGN, binary symmetric channel, fading channel). The received symbols are demapped, de-interleaved and then decoded by a Viterbi decoder.

Fig. 3.

The block diagram of channel coding with interleaving for fading channels.

B. Task: Channel encoding/decoding We simulate channel encoding/decoding for a given convolutional code. Basically, we will follow the blocks given in Fig. 3. In the following, we present a detailed recipe for the simulator. Please follow each step and write a MATLAB code to implement these steps.

Generate a bit sequence x, which consists of {0, 1} (use randint.m). Let us dene the following: Nb is the length of the input bit sequence, is the number of bits per symbol, N is the length of one block of symbols. We x the length of a block of symbols to N = 256, and choose Nb according to: Nb = N R m. E.g., if we use QPSK ( = 2), m = 5, and a rate R = 1/2 code, then Nb = 251. Encode x with one of the convolutional codes given in Table I. You need to implement a modular encoder which takes the impulse responses of the encoder as input and produces the channel encoded bits. For instance, let us focus on the m = 3 code. The g (0) is 13, which corresponds to [001011] in binary form (i.e., the rst impulse response is g(0) = [1011]). Likewise, g (1) corresponds to [001111] (i.e., the rst impulse response g(1) = [1111]). Using these polynomials we can draw the encoder as shown in Fig. 4.

Conv g

(0)

Mod 2

Conv g

(1)

Mod 2

Fig. 4.

The R = 1/2 convolutional code for [001011] and [001111].

 Draw the encoder diagrams for the convolutional codes given in Table I for m = 2, 4, 5. (Similar to the one for m = 3 in Fig. 4) The length of the encoded bitstream must be N . Design a 16 16 block interleaver and interleave the coded bits in every block. Map the bits to a symbol sequence s (use BPSK/QPSK/16-/64-QAM from Exercise 1). Add complex AWGN. Calculate the average symbol energy:
Es = 1 N
N

| s[ l ] | 2
l=1

(1)

Use

Eb N0 dB

= 10 log10

Eb 2 n

2. , where Eb = Es /, to calculate the noise variance n

Demap the symbol sequence into a bit sequence. Design a block de-interleaver and de-interleave the received bits. Decode the de-interleaved bits with a Viterbi decoder. Use MATLABs built-in function vitdec.m. Use the following code for the implementation of the decoder:
% Generate the trellis from the polynomials tr = poly 2trellis([m + 1], [g (0) g (1) ]); % Set the traceback length. If the code rate is 1/2, a typical value for tracebacklength is about ve times m. tracebacklength = 5m; % Call the vitdec function. decoded = vitdec(coded, tr, tracebacklength, term , hard ); % coded is the coded input bits. % The output of vitdec is the decoded block of bits including the trailing bits.

TABLE I O PTIMUM R = 1/2 CONVOLUTIONAL CODES (N OTE THAT THE NUMBERS ARE IN OCTAL FORM ) m 2 3 4 5 6 g (0) 5 13 27 53 117 g (1) 7 17 31 75 155

When using other codes, you need to change m, g (0) , g (1) , and tracebacklength correspondingly. Compute the bit error rate. Dont forget to exclude the trailing bits from the comparison. Note that to observe small BERs, you need to simulate around 1000 blocks and average the error rates. Repeat the same routine for different Eb /N0 |dB values and all modulation types. Plot BER versus Eb /N0 |dB curves. Repeat the same routine for all convolutional codes given in Table I. And plot all BER vs Eb /N0 |dB curves on one gure. Comment on the effect of m. Compare your curves for coded transmission with those for uncoded transmission. You can either simulate these curves or use the ones from Exercise 1. (Note: Take care that all curves are plotted against Eb /N0 |dB ). Now we will observe the relationship between interleaver length and burst errors. Burst errors occur in a fading channel when the channel is in deep fade. In this case, the different contributions of the signal add destructively at the receive antenna, and the received signal is many dBs weaker than the average received power. In practice, the received signal is buried in noise. To simulate such an event, we set a part of the signal to zero before adding noise at the receiver. Choose a code from Table I and x a modulation scheme. Set a block of berror consecutive symbols of s to zero (before the addition of AWGN). Vary the value of berror for a 16 16 interleaver and plot the BER curves. Choose berror such that the burst error affects the BER. Now, x some berror and try different sizes of interleavers. Plot the performance of different interleavers on the same plot. Choose berror such that the performance for different interleaver sizes varies. III. TASK 2: OFDM M ODULATION /D EMODULATION A. Introduction Please refer to the lecture notes for an introduction to OFDM. The block diagram of a simple OFDM transceiver is given in Fig. 5. The information bits are mapped to symbols by the modulator (mapper). Then, OFDM modulation is applied, which consists of an IFFT operation and the addition of a cyclic prex (CP). The OFDM modulated signal is sent through the channel. At the receiver, OFDM demodulation is applied to the received signal and the estimated bits are obtained after demapping the symbols into bits.

Fig. 5.

The block diagram OFDM transceiver.

B. Task: OFDM transceiver We simulate the simple OFDM transceiver structure given in Fig. 5. In the following, we present a detailed recipe for the simulator. Please follow each step and write a MATLAB code to implement these steps. Set the number of carriers to N = 256 (i.e., the length of the block of the modulated symbols). In general, the number of carriers and the FFT size does not need to be the same, but for this simulation let us assume that FFT size is also equal to N . Generate a block x of bits, which consists of {0, 1} (use randint.m). The length of the bit sequence is determined by the chosen symbol mapping in the next step. For example, since we x N = 256, the bit sequence length should be 256, 512, 1024, 1536 for BPSK, QPSK, 16-QAM, 64-QAM, respectively. Map the bit sequence to BPSK/QPSK/16-/64-QAM symbols (use existing code from Exercise 1). Apply N -point IFFT. Use the MATLAB function ifft.m. Pay attention at the implementation of the IFFT and FFT functions in Matlab. Scale the IFFT and FFT transformations properly such that the signal power is not modied. Add a CP of length Ncp = 6. The length of the CP should be chosen according to the length of the channel impulse response, L. We will set L = 5 in the next step, and we set the CP length to Ncp = 6. Send the OFDM signal through a multipath channel. We model the multi-path channel with a nite impulse response (FIR) lter as
L1

h=
i=0

hi (n i)

(2)

where hi is the gain of the ith path. Note that the delay of each path is a symbol wide. We set L = 5 and model hi as zero mean complex Gaussian random variable. We need to scale the variance of hi such that
L1 2 i=0 |hi |

= 1. Use the following deterministic channel in your simulations:

h = [0.1641 j 0.6395, 0.4582 + j 0.3840, 0.0916 + j 0.3695, 0.2131 + j 0.0902, 0.0796 j 0.0433]T Compute the frequency response of the channel and comment on the results. How is this channel characterized? Add complex noise. Calculate the average symbol energy:
Es = 1 M
M

| r[ l ] | 2
l=1

(3)

where M = N + Ncp is the length of your OFDM signal, and r is the channel output signal. Use SNR
2 expression to calculate 2 . = 10 log10 Es /n n

Remove the CP. Apply N -point FFT. Use the MATLAB function fft.m. After applying the FFT, we need to equalize the output in order to remove the effect of different frequency bin gains on the symbols. Consider the nth symbol yn after the FFT operation. You should equalize yn such that you obtain
y n = Hn yn /|Hn |2 ,

(4)

where Hn is the corresponding channel coefcient of the nth symbol in the frequency domain. Hence, the receiver must estimate the values of Hn . Estimate the frequency domain channel coefcients, Hn . In order to estimate the channel, use a pilot sequence containing only 1s, which triggers all frequency bins of the channel impulse response. Repeat such pilot transmission for 1, 2, 5 and 10 times, and estimate the channel by averaging the received symbols. Is this pilot the best choice for estimating the channel coefcients? How could you improve the efciency of the system? After estimating the channel coefcients and equalizing the symbols, map the symbol sequence to bits. Compute the bit error probability. Note that to observe low BERs, you need to simulate around 1000 blocks and take the average of these results. Repeat the routine for different SNR values and for other modulation types (e.g., BPSK, QPSK, 16/64 QAM). Plot BER versus SNR gures. Compute the BER for QPSK with different cyclic prex lengths, Ncp = 1, . . . , 6. What do you observe? IV. C OMBINATION TASKS : COFDM M ODEM The block diagram of the complete COFDM transceiver is given in Fig. 6. Combine channel coding with OFDM and implement the blocks in Fig. 6. Channel: You will simulate a block frequency-selective fading channel. Use L = 10 taps for the channel impulse response. The channel is given by
L1

h=
i=0

ai hi (n i).

(5)

The channel coefcients hi are i.i.d., drawn from a complex Gaussian distribution, with zero mean and variance equal to 1. Compute the coefcients ai such that the power delay prole of the channel follows an exponential decay function, with parameter = 1/5 and the average total power of the channel impulse response equals
1 (Hint: Place the rst tap at t = 0).

We assume a block fading channel model. This implies that the channel remains constant during a burst, and changes to an independent realization in the following burst. Use blocks of 10 OFDM symbols. During this burst, use 2 pilot symbols in order to estimate the channel, and transmit data with the remaining 8 symbols. Repeat BER simulations for all possible symbol modulation types (e.g., BPSK/QPSK/16-/64-QAM). Plot the channel-coded and uncoded BER results against Eb /N0 |dB and compare/observe the effect of coding. How does the interleaver help the transmission in coded OFDM system?
input bits Convolutional Encoder Interleaver Mapper IFFT CP

Channel

Estimated bits

Viterbi Decoder

DeInterleaver

Demapper

FFT

CP Removal

Fig. 6.

The block diagram COFDM transceiver.

You might also like