Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
5 ofdm
1. 5 OFDM
In the last chapter we introduced the multipath propagation and its influence on the
transmission. In sec. 4.4 OFDM is mentioned as one possible solution for mitigating the
influence of delay spread and to increase the robustness of the transmission.
Transmitting digital signals with high data rates using single carrier results in a lot of
difficulties because of the multipath propagation. Due to the short symbol time and the
long channel response time for it, this results in very high requirements for the equaliser.
Dividing the data rate in N subcarriers results in an N times longer symbol duration. In
spite of this improvement there are still some inter-symbol-interferences due to the dif-
ferent runtimes of the signals in the multipath environment. To reduce the inter-symbol-
interference a guard interval is introduced. This guard interval provides some time for the
symbols to raise and decay.
The following paragraph explains some special features of OFDM compared to other multi
carrier systems. One of the most advantages is the abdication of complex filter banks due
to the use of digital signal processing. A characteristic of an OFDM system is the equidis-
tant subchannel order. The distance between different subchannels is chosen in a way that
they do not disturb each other. To obtain this, the carriers of two adjacent subchannels
are orthogonal. This results in the distance of two subchannels
∆f =
1
Ts
. (5.1)
Rectangular pulses are used for calculating the magnitude spectrum. In fig. 5.1 the known
form of the function si(x) = sin(x)
x is shown.
Fig. 5.2 shows the spectrum of an OFDM signal as a composition of frequency shifted
subcarriers. If the frequency shift is exactly an integer multiple of 1/T (refering to 5.1),
the interference of adjacent cariers is equal to zero. There are no inter-carrier-interferences
in spite of an overlapping spectrum.
5.1 Overview about an OFDM system
In this section we are going to shortly discuss the elements which can be found in an
OFDM system. Some elements have been already discussed in previous chapters. In the
following sections each of the new elements will be descriped in detail.
Looking at our simulation chain so far, we notice that we have already discussed the
OFDM system up to the encoder element. First new element we want to introduce is the
interleaver. The interleaver is used to increase the performance gain by changing the bit
order within the bitstream to avoid errors in adjacent bits caused by interferences on adja-
cent subchannels. How an interleaver is working is explained in sec. 5.2. The next element
57
2. 5 OFDM
−5pi −4pi −3pi −2pi −1pi 0 pi 2pi 3pi 4pi 5pi
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
1.2
Figure 5.1: Sinc function
−5pi −4pi −3pi −2pi −1pi 0 pi 2pi 3pi 4pi 5pi
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
1.2
Figure 5.2: OFDM spectrum as a composition of frequency shifted subcarriers.
58
3. 5 OFDM
Figure 5.3: OFDM-System overview
is a serial to parallel converter (S/P). This converter translates our encoded serial data
stream into N parallel data streams. These N data stream are in the next step mapped
to the different subchannels. The mapping process itself is described in sec. 2.2. After
the mapping we have with the IFFT the second new element. The IFFT is a method in
digital signal processing and converts our subchannel signals from the frequency domain
into a time domain signal. After the conversion into time domain the guard interval is
inserted to eliminate inter-symbol-interference and the signal is send over the channel.
At the receiver the first step is to have syncronisation of the OFDM symbols using cyclic
extension. At this point the additional guard interval is removed. In a second step the
FFT of the signal is calculated. A further explanation about the FFT can be found in
sec. 2.7.2 and in sec. 5.3. With the FFT the signal is converted back from time domain
into frequency domain. As a result we obtain the N different subcarriers. In the parallel
to serial converter the different subchannels are converted back to one single data stream.
The rest of the OFDM system is the same as we had already introduced and discussed in
sec. 3 and 2.
5.2 Interleaving
From the basic principles of OFDM, we know that in the frequency and time selective
transmission environment, the channel does not change significantly in one OFDM sym-
bol or one OFDM sub-carrier, however it changes from sub-carrier to subcarrier in the
frequency domain and symbol to symbol in the time domain. When the channel has a
deep fading, some sub-carriers and some OFDM symbols will suffer from strong noise
interference, which causes a degrading SNR at these positions resulting in excessive burst
errors at the receiver.
To overcome this problem, coding and interleaving are employed in OFDM system. As we
see in the diagram, the block of coding could be done by implementing the convolutional
encoder that we discussed in chapter 3. In the rest of this section, we would focus on the
block of interleaving.
As mentioned above, interleaving is an efficient way to combat burst error, which is
achieved by rearrange the order of the transmit bits. For example, fig. 5.4 shows how
a certain type of interleaver works. This interleaver simply writes the coded bits into the
matrix by rows and then reads them out afterwards by columns. The deinterleaver at the
receiver side performs the reverse procedure, i.e., the bits are written by columns and read
out by rows. The bits in the figure are written row-by-row into a 6×8 matrix and reading
out column-by-column. We define the number of rows B = 6 as the interleaving depth,
59
4. 5 OFDM
(b0, b1, b2, · · · , b7)
b0 b1 . . . b7
b8 b9 . . . b15
b16 b17 . . . b23
b24 b25 . . . b31
b32 b33 . . . b39
b40 b41 . . . b47
Write bits
Read bits
(b0, b8, b16, · · · , b40)
Figure 5.4: Block Interleaver 8 × 6
and the number of columns N = 8 as the interleaving length.
After this kind of interleaving, the fading processes that affect N successive symbols will be
uncorrelated. Therefore, it makes the burst errors appear as ’random errors’, which can be
corrected by coding. Since the interleaver requires memory and deinterleaver causes extra
delay (because deinterleaving takes place only after all the interleaved data is received),
the dimension of the interleaver is a compromise between the delay and the performance
of the system.
Frequency interleaving is usually employed in IEEE802.11a standard, which is to interleave
the information across the sub-carriers prior to transmissions. By implementing frequency
interleaving in OFDM systems, the local deep fading is averaged over the whole bandwidth
of the system. It is implemented for all the data symbols in a single OFDM symbol. The
interleaving pattern shows us how to rearrange the order of the data symbols, which should
be chosen according to the channel and the coding technique used. The following matlab
code describe the interleaving pattern used in HIPERLAN type 2:
cBitsPerBlock = nrDataCarriers*log2(length(map));
bitBlock = 0 : cBitsPerBlock-1;
perm1 = (cBitsPerBlock/16)*rem(bitBlock, 16)+floor(bitBlock/16)+1;
s2 = max([log2(length(map))/2 1]);
perm2 = s2*floor((1/s2)*bitBlock)+rem(bitBlock+cBitsPerBlock-...
floor((16/cBitsPerBlock)*bitBlock), s2)+1;
perm = perm2(perm1);
As shown above, all coded data bits shall be interleaved by a block interleaver with a
block size corresponding to the number of bits in a single OFDM symbol, ’cBitsPerBlock’.
’bitBlock’ represents the index of the coded bit. The interleaver is defined by a two step
permutation. The first ensures that adjacent coded bits are mapped onto nonadjacent
sub-carriers, which is described in the third line. The second permutation ensures that
adjacent coded bits are mapped alternately onto less and more significant bits of the con-
stellation, which is implemented in the 5th and 6th line.
60
5. 5 OFDM
Task:
With the defined interleaving pattern, the frequency interleaver can be imple-
mented as following:
if (~isempty(perm))
for ii = 0 : cBitsPerBlock : length(enc)-cBitsPerBlock
enc(1, perm+ii) = enc(1, ii+1:ii+cBitsPerBlock);
end
end
where enc is the vector of encoded bits. The for-loop rearranges the coded bits
according to the interleaving pattern described in perm. Try to understand how
the code of interleaver works above, and explain it.
Task:
Based on the understanding of the interleaver, try to write a function of dein-
terleaver
Y = deinterleaver(X,cBitsPerBlock,perm) nonumber
where X is the vector of input bits to the deinterleaver, cBitsPerBlock is the
number of bits in a single OFDM symbol and perm represents the interleaving
pattern discussed before.
5.3 Fast Fourier Transform
The complex baseband OFDM signal is the inverse Fourier transform of as many QAM
input symbols as number of subcarriers are utilized. This is done by using the inverse
fast Fourier transform (IFFT), which represents a very quick algorithm to shorten the
calculation of an inverse discrete Fourier transform (IDFT). For best performance, the
number of FFT/IFFT input samples has to be N = 2n with n is a positive integer.
When using the FFT algorithm, it has to be taken in account, that the N output samples
are arranged as follows: index 0 ≤ n ≤ N/2 represents the values for positive frequencies
and index N/2 < n < N represents the values for negative frequencies. Hence, the spec-
trum for positive and negative frequencies has to be flipped (rearranged) before applying
the IFFT (see sec. 2.7.2).
In this lab course, the MATLAB functions fft(), ifft(), fftshift() and ifftshift()
will be utilized to do the transformation between time and frequency domain.
5.4 Cyclic Extension
Multipath propagation introduces delayed copies of the transmit OFDM symbols, which
leads to inter symbol interference (ISI) at the receiver, since the end of the previous symbol
interferes with the beginning of the current symbol. To avoid ISI, a so called guard interval
seperates two adjacent OFDM symbols. Of course, only ISI caused by delays not longer
61
6. 5 OFDM
−.5pi 0 .5pi pi 1.5pi 2pi
−3
−2
−1
0
1
2
3
Figure 5.5: Cyclic extension (red) is copied before the OFDM symbol in time domain
than the guard interval can be avoided by this method.
Since the output of the IFFT (the OFDM symbol) is a periodic function, the guard interval
is a copy of the last part of the OFDM symbol and pasted in front of this symbol. Fig. 5.5
shows the input of the cyclic extension.
5.5 OFDM Modulator/Demodulator
Task
Write an m-file ofdm mod(in, numcarrier, guard) to build up an OFDM
modulator. Calculate the number of OFDM symbols that can be created by
distributing the elements of the QAM symbol stream in to the different car-
riers. Find out the appropriate length of the IFFT, which has to be a power
of two. Rearrange the input stream vector to form a matrix, in which each
column consists of one OFDM symbol. What is the dimension of this matrix.
Preventing FFT inverts the spectrum, cut out the last half of the rows of
the matrix and paste it before the first half. In between these two halfs insert
a block of zeros, thus the number of rows increases to the value of the FFT
length. Now, apply the function ifft() to the matrix, hence the result is
a matrix containing the time representation of the OFDM symbols (column
wise).
Adding the guard interval to each OFDM symbol is simply copying the last
guard rows and pasting them in front of the first row of the matrix.
Task
Write an m-file ofdm demod(in, numcarriers, guard) to build up an OFDM
demodulator. Calculate the necessary FFT length, as it is done in the modu-
lator part. Define the variable symleng for the sum of FFT length and guard
62
7. 5 OFDM
interval, which results in the OFDM symbol length. Calculate the total num-
ber of OFDM symbols in the input stream. Rearrange the input vector in
to a matrix with as many columns as number of OFDM symbols and with a
number of rows corresponding to symleng. Crop the submatrix not belonging
to the guard intervall and apply a FFT. After this, shift the second half of
rows in front of the first half and delete the frequency samples which do not
belong to the used carriers.
5.6 OFDM Chain
In previous sections, we have discussed the elements which are included in a OFDM sys-
tem. In the following, we would start to build a OFDM chain with the functions we
implemented before. In the end of this section, we should have a complete OFDM chain
built in a m function in Matlab, which allows us to do some performance evaluation later.
Follow the descriptions below , which would define the parameters that we use for the
OFDM chain and also would help you to build the signal chain step by step.
Assume we want to transmit 100 bursts of information signal, and each burst contains
24 OFDM symbols. The number of sub-carriers is set to 48, and we use 16QAM mapping
here. The encoder employs a convolutional code of rate equals to 1/2 without any punc-
turing.
Based on the description of the parameters above, try to calculate the number of bits
that need to be generated by the source, and then use the function ’sig gen’ you have
implemented in sect.2.1 to generate the amount of bits we want to transmit.
As shown in fig. 5.3, after the signal source there follows a block of coding, which we use
here is a convolutional code of rate 1/2, and generator polynomials are G1 = 133, G2 =
171. Use the function ’convcode’ that we built before to implement the block of encoding
here.
The interleaving part is described in sect. 5.2, please use the interleaving pattern men-
tioned exactly as in that section.
The bits are mapped to symbols through the block of mapping, which we have also imple-
mented before. Check the function ’mapping’, and make sure 16QAM scheme is adopted
here.
After mapping, there is a IFFT operation which is explained in sect.5.3, and then fol-
lows the operation of inserting the guard interval described in sect.5.4. What we use here
is a guard interval of the length of 16 bits.
The transmission channel employed here is the multipath channel which is described and
implemented in sect.4.1,and at the receiver side comes the FFT operation, demapping
(function ’demapping’),deinterleaving(function ’deinterleaver’), and decoding(function ’con-
decoder’).
63
8. 5 OFDM
5.7 OFDM performance analysis
In this performance chapter you should not only measure some parameters. Furthermore
you are expected to think about some enhancements, that could be made to optimize an
OFDM system.
Task
Run the simulation for different values of the guard interval and analyse the
influence on the BER performance. Try to calculate the throughput of the
system and explain the influence of the guard interval on the achievable max-
imum throughput. Make a comparison to the simulation chain of chapter 4.
Think about some limitations of the presented OFDM system. How can the
OFDM system as we have presented it be improved?
64
9. Bibliography
[1] Proakis, J. G.: Digital Communications. 4th ed. McGraw-Hill, 2001. – ISBN
0–071–18183–0
[2] The MathWorks: Communications Toolbox 3 User’s Guide. http://www.
mathworks.com/access/helpdesk/help/pdf_doc/comm/comm.pdf, March 2007
[3] ETSI EN 300 744 V1.5.1 (Hrsg.): Digital Video Broadcasting (DVB); Framing
structure, channel coding and modulation for digital terrestrial television. ETSI EN
300 744 V1.5.1, November 2004
[4] Kattenbach, Ralph: Charakterisierung zeitvarianter Indoor-Funkkan¨ale anhand
ihrer System- und Korrelationsfunktionen, Universit¨at Kassel, Diss., 1997
[5] Bello, P.: Characterization of Randomly Time-Variant Linear Channels. In: Com-
munications, IEEE Transactions on [legacy, pre - 1988] 11 (1963), Nr. 4, S. 360–393
65