You are on page 1of 8

MKG: Design of an OFDM System

The objective of this exercise is to help you understand an orthogonal frequency division
multiplexing (OFDM) system by designing it using National Instruments LabVIEW. This lab
sheet contains two sections: Section 1 gives the introduction to the OFDM system and Section 2
presents the step-by-step instructions to implement it.

1 Introduction
OFDM is a multicarrier transmission scheme that employs a wideband channel consisting of
overlapping but orthogonal narrowband subcarriers to convey information in parallel in the
frequency domain. As shown in Figure 1.1, each subcarrier can be represented as a sinc function
spanning a bandwidth of 15 kHz in the frequency domain. The peak of a subcarrier is precisely
at the zero-crossings of its adjacent subcarriers, which ensures that the samples at the center
frequency of the subcarrier contain no interference from its neighbors.
To utilize this structure in the frequency domain, symbols in the time domain need to be
rectangular pulses before being modulated on the center frequencies of different subcarriers.
This can be easily achieved with the help of Fourier transforms (FTs) as illustrated by the block
diagram shown in Figure 1.2. The procedure of generating, transmitting and resolving an OFDM
symbol in an example scenario is described as follows.
On the transmitter side, the source generates a sequence of 600 bits within an OFDM period.
They are mapped to 300 symbols using the four quadrature amplitude modulation (4QAM)
scheme. These symbols can be written as a column vector
T
X = [X1 , . . . , X300 ] . (1.1)

2
Normalized voltage (V)

1
20 40 60 80 100
Frequency (kHz)

Figure 1.1: OFDM subcarriers

1

X Zero X x CP x
Source Mod. adding IFFT adding

Channel


X Y Y y y
Equali- Zero CP
Sink Demod. FFT
zation removal removal

Figure 1.2: Block diagram of an OFDM system

300 4QAM symbols X


Copy DC Copy

512 samples in the frequency domain X
IFFT
512 samples in the time domain x

Copy
An OFDM symbol of 640 samples x

Figure 1.3: Generation of an OFDM symbol

The 4QAM symbols X are then inserted with 106 zeros in the front, one zero in the middle as
the direct current (DC) and 105 zeros in the end to form an FT period of 512 samples
= X 512 T = 0T , X1 , . . . , X150 , 0, X151 , . . . , X300 , 0T T .
1, . . . , X
   
X 106 105 (1.2)

The samples X are multiplexed onto 512 subcarriers before being transformed to the time domain
using an inverse fast Fourier transform (IFFT) block
T .
512 ] = F 1 X

x x1 , . . . , x
= [ (1.3)
The last 128 samples of x are copied and padded in front of itself. The concatenated portion is
known as the cyclic prefix (CP). The reason of adding CP will be explained later. The CP and
the FT period constitute an OFDM symbol of 640 samples
T T
x = [x1 , . . . , x640 ] = [
x385 , . . . , x
512 , x
1 , . . . , x
512 ] . (1.4)
The above procedure of generating an OFDM symbol is also shown in Figure 1.3.1
The OFDM symbol x is now convolved with the channel impulse response, which is a vector
of length 64
T
h = [h1 , . . . , h64 ] . (1.5)
The convolution can be expressed using a channel convolution matrix h as
T
y = [y1 , . . . , y640+641 ] = hx + n (1.6)
h iT
. . . , J6401 h
with h = hT , 0T
 
where h = J0 h, 6401 and
 T 
0640+6411 0
J= (1.7)
I640+6411 0640+6411
1 The above parameters are only one configuration of the OFDM system. They in fact depend on the overall

bandwidth of the system and the type of CP used.

2
x[1] x[2] x[3]
Channel
Channel
y[1] Channel
y[2]
y[3]

Figure 1.4: Convolution with channel impulse response

and n is the zero mean complex additive white Gaussian noise (AWGN) vector with variance
being 2 for one dimension.
On the receiver side, the CP and the last 64 1 samples of y are removed first
T T
y = [
y1 , . . . , y512 ] = [y129 , . . . , y640 ] . (1.8)
Note that the last 64 1 samples of the current OFDM symbol, shown as the yellow parts in
Figure 1.4, can be discarded because they will be added to the CP of the next OFDM symbol if
the length of the channel impulse response is shorter than the CP. As a result, the CP helps to
eliminate the intersymbol interference. The CP-removed samples y are then transformed back
to the frequency domain using a fast Fourier transform (FFT) block
T
Y = Y1 , . . . , Y512 = F y .
 
(1.9)
After that, the zeros inserted on certain subcarriers are removed and the remaining samples are
concatenated T
T
Y = [Y1 , . . . , Y300 ] = Y107 , . . . , Y256 , Y258 , . . . , Y407 .

(1.10)
The transmitted symbols are then recovered from Y by zero forcing (ZF) or minimum mean
square error (MMSE) equalizers
X =W Y (1.11)
where W contains the weights of the equalizers and represents the element-wise product.
The equalization in an OFDM system is usually performed in the frequency domain. This is
less complex than in the time domain because the CP converts the channel convolution into a
circular convolution, which is equivalent to a multiplication in the frequency domain. Therefore,
(1.6) can be rewritten in the frequency domain as
Y =H X +N (1.12)
where H is the effective channel frequency response calculated as
h iT
= h 512 T = hT , 0T
1, . . . , h
 
h 448 (1.13)
T
= H 1, . . . , H
512 = F h
 
H (1.14)
T 107 , . . . , H
256 , H 407 T
258 , . . . , H
 
H = [H1 , . . . , H300 ] = H (1.15)
and N is the noise in the frequency domain with the same variance. The weights for ZF and
MMSE equalizers are respectively
(
H 1 ZF
W = 2
1 (1.16)
H H + 1300 H MMSE
1
where () means the element-wise inversion.

3
Figure 2.1: Source

Figure 2.2: OFDM transmitter

2 Instructions
2.1 LabVIEW
The first part of this lab is implemented in LabVIEW. The OFDM system can be divided into
five virtual instruments (VIs): Source, OFDM transmitter, channel, OFDM receiver and sink.

Source generates a sequence of bits and maps them to 4QAM symbols (Figure 2.1).

1. Use an MT Generate Bits (poly) VI (RF Communications Modulation Digital) to


randomly generate 600 bits. Configure the VI as Galois and PN Order using the drop-
down box. Set reset? to false.
2. Use an MT Generate System Parameters VI (RF Communications Modulation Digital
Utilities) to generate the 4QAM constellation. Configure the VI as QAM and M and
set the M-QAM input to 4. Wire the QAM system parameters cluster to an Unbundle
By Name Function and select the symbol map output.
3. Use an MT Map Bits to Symbols VI (RF Communications Modulation Digital
Utilities) to map the generated bits to 4QAM symbols. Configure the VI as QAM and
wire the symbol map to the VI.
4. Create other controls/indicators and wire all elements as Figure 2.1. Save this VI as
Source.vi. (This step will not be described in following instructions for brevity.)

OFDM transmitter inserts zeros to the 4QAM symbols, transforms them from the frequency
domain to the time domain using an IFFT and adds the CP (Figure 2.2).

4
Figure 2.3: Channel

1. Use a Split 1D Array Function to break the 4QAM symbols array into two halves. Use a
Build Array Function to insert the zeros as shown in Figure 1.3. Configure the function
as Concatenate Inputs.
2. Use an Inverse FFT VI (Signal Processing Transforms) to perform the 512-point IFFT.
shift? to true so that the DC component is at the center. Multiply the result by
Set
512 to preserve the energy of the transform.
3. Use a Delete From Array Function and a Build Array Function to pad the CP in the
front. Configure the latter function as Concatenate Inputs.

Channel convolves the transmitted samples with the channel impulse response, adds the zero
mean complex AWGN and calculates the channel frequency response using an FFT (Fig-
ure 2.3).

1. Use the given CIR VI to generate the channel impulse response for either the Pedes-
trian A channel or the Pedestrian B channel.
2. Use a Convolution VI (Signal Processing Signal Operation) to convolve the transmitted
samples with the channel impulse response.
3. Use an Array Subset Function to select the first 640 samples of the convolution output.
(The remaining 64 1 samples can be either discarded or stored and added to the
first 64 1 samples of the convolution output for the next OFDM symbol.)
4. Use two Gaussian White Noise VIs (Signal Processing Signal Generation) to generate
the real and imaginary parts of the AWGN. Merge them as a complex array and add
it to the output samples of the convolution. The standard deviation of the noise can
be calculated from the signal-to-noise ratio (SNR) at the transmitter as
 
1
SNR = 10 log10 (2.1)
2 2

if the average energy of the 4QAM symbols is unity (which is default for the con-
stellation generated by MT Generate System Parameters VI). Note that the variance is
doubled in the denominator because the noise for 4QAM symbols is two-dimensional.

5
Figure 2.4: OFDM receiver

Figure 2.5: Sink

5. Use an FFT VI (Signal Processing Transforms) to calculate the channel frequency re-
sponse from the channel impulse response. Set shift? to true so that the DC component
is at the center.

OFDM receiver removes the CP, transforms the samples back to the frequency domain, re-
moves the zeros and equalizes the channel using the ZF or MMSE equalizers (Figure 2.4).

1. Use an Array Subset Function to remove the CP.


2. Use an FFT VI (Signal Processing Transforms) to perform the 512-point FFT. Set
shift? to true so that the DC component is at the center. Divide the result by 512
to preserve the energy of the transform.
3. Use two Array Subset Functions and a Build Array Function to remove the zeros and
concatenate the two outputs. Configure the latter function as Concatenate Inputs.
4. Use the same functions to remove the samples in the channel frequency response that
correspond to subcarriers transmitting zeros.
5. Feed the zero-removed channel frequency response to the equalizer to calculate the
equalizer weights using (1.16). You need to implement the equalizer VI yourself.
6. Multiply the zero-removed samples and the weights to obtain the equalized 4QAM
symbols.

Sink maps the 4QAM symbols back to a sequence of bits (Figure 2.5).

1. Use an MT Generate System Parameters VI to generate the 4QAM constellation as


described for the source.

6
2. Use an MT Map Symbols to Bits VI (RF Communications Modulation Digital
Utilities) to map the 4QAM symbols to bits.

Having implemented these five VIs, create a main VI, place the five VIs in the main VI and
wire them in a sequence from the source to the sink. The spectral efficiency can be calculated
using the transmitted 4QAM symbols X (output of the source) and received 4QAM symbols X
(output of the OFDM receiver) as
!
C XH X
= log2 1 + H (2.2)
B D D

where C is the capacity, B is the bandwidth and D represents the interference and noise calculated
as the difference between the transmitted and received symbols D = X X.

2.2 LabVIEW FPGA (optional)


Field-programmable gate array (FPGA) is an integrated circuit comprising silicon chips. An
FPGA can be reconfigured for more than one time to achieve different functionalities. In contrast
to the processor in a computer that simulates the design by running a software application, the
FPGA itself implements the design so it executes much faster.
The second part of this lab is implemented in LabVIEW FPGA. Some hints are given as
follows to help you design your system on hardware.

The system is divided into two parts: The host and the target. The host VI consists of the
source and the sink on the high-level LabVIEW while the target VI consists of the OFDM
transmitter, the channel and the OFDM receiver on the low-level LabVIEW FPGA.
The target class used in this lab is PXIe-7966R. Since no hardware is connected to Lab-
VIEW, select Dev Computer to simulate the FPGA on the development computer.
The host VI generates 4QAM symbols and writes them to the target using a host-to-target
first-in first-out (FIFO). It then waits and reads the symbols transferred back from the
FPGA via a target-to-host FIFO and calculates the spectral efficiency.
FPGA cannot process complex numbers directly. There is a trick that enables the high
level to feed complex numbers to or access from the FPGA. Split a complex number into
two double-precision floating-point numbers on the high level, cast them to two fixed-point
numbers. Use two Number To Boolean Array Functions and two Boolean Array To Number
Functions to map the fixed-point numbers to two unsigned integers and use a Join Numbers
Function to join them as one unsigned integer and write the integer to the FIFO. Do the
reverse from one unsigned integer to two fixed-point numbers when retrieving complex
numbers from the FIFO on the target. The transfer from the target to the host can be
achieved in a similar fashion. This mapping between a complex number and an unsigned
integer enables the synchronous transfer of the real and imaginary parts between the host
and the target.
All VIs and functions in the target are enclosed in a single-cycle Timed Loop on the FPGA.
Remember to select the correct Execution Mode when using functions in the FPGA Math &
Analysis palette.

7
Multi-cycle nodes, e.g., FFT and IFFT, need more than one cycle to compute valid data,
but the single-cycle Timed Loop forces these nodes to return data every clock cycle. There-
fore, a handshaking protocol is required to ensure the input and output of valid data. The
protocol is called a four-wire handshaking protocol. It comprises four terminals: input
valid that specifies that the next data point has arrived for processing; output valid that
indicates that the current data point produced by the node is valid and ready to be used
by downstream nodes; ready for output that specifies whether the downstream node can
accept a new data point; ready for input that indicates whether the node can accept a new
data point during the next clock cycle. Carefully wire or design these terminals when you
need to use multi-cycle nodes in your system.

Implement your own counter on the FPGA to perform zero adding/removal and CP
adding/removal.
Use two White Noise Generator Express VIs (FPGA Math & Analysis Generation) to generate
the complex AWGN. The output from this VI is integers. You need to scale them to fixed-
point numbers according to the SNR.

More information can be found in the LabVIEW FPGA Module Help at http://zone.
ni.com/reference/en-XX/help/371599J-01/.

2.3 Deliverables
1. LabVIEW:

(a) Screenshots of the block diagrams for all VIs;


(b) Received symbols for Pedestrian A and Pedestrian B channels using ZF and MMSE
equalizers at input SNRs of 10 dB and 30 dB respectively (eight diagrams);
(c) Spectral efficiency curves averaged over 10 000 channels for Pedestrian A and Pedes-
trian B channels using ZF and MMSE equalizers at input SNRs ranging from 0 dB to
30 dB with 1 dB spacing (four curves in one diagram);
(d) Comments on all results.
2. LabVIEW FPGA (optional):
(a) Screenshots of the block diagrams for all VIs;
(b) Received symbols using ZF and MMSE equalizers at input SNRs of 10 dB and 30 dB
respectively (four diagrams);
(c) Comments on all results.

References
[STB11] Stefania Sesia, Issam Toufik, and Matthew Baker, editors. LTEThe UMTS Long
Term Evolution: From Theory to Practice. Wiley, Hoboken, NJ, second edition, July
2011.
[Zyr07] Jim Zyren. Overview of the 3GPP Long Term Evolution physical layer. White Paper
3GPPEVOLUTIONWP, Freescale Semiconductor, Austin, TX, July 2007.

You might also like