Sie sind auf Seite 1von 24

TSTE91 System Design

Communications System Simulation Using Simulink

Part V OFDM by IFFT Modulation

Sebastian Prot, Kent Palmkvist


Electronic Systems, Dept. EE, LiTH

020303
2

1 Abstract ................................................................................................. 1
2 Theory. .................................................................................................. 1
2.1 OFDM Principle ........................................................................... 1
2.2 Fourier Transform ....................................................................... 1
2.2.1 Complex Discrete Fourier Transform ..................................... 2
2.2.2 The inverse DFT..................................................................... 4
2.2.3 The Fast Fourier Transform .................................................... 5
2.3 IEEE 802.11a standard (frequency domain frame composition)
5
2.4 Sampling vs. signal spectrum....................................................... 6
3 Block descriptions................................................................................. 8
3.1.1 Transmitter ........................................................................... 10
3.1.1.1 Discrete constant ........................................................... 10
3.1.1.2 IFFT.............................................................................. 10
3.1.1.3 Unbuffer........................................................................ 11
3.1.2 Receiver................................................................................ 11
3.1.2.1 Buffer............................................................................ 11
3.1.2.2 FFT ............................................................................... 12
3.1.3 Measurement Tools .............................................................. 12
3.1.3.1 Short-Time FFT ............................................................ 12
3.1.3.2 Frequency Frame Scope ................................................ 13
3.1.3.3 Upsample ...................................................................... 13
4 The system basics................................................................................ 13
4.1 The system setup parameters .................................................... 14
4.1.1 Initial commands .................................................................. 15
4.2 The signals flow .......................................................................... 16
4.2.1 Measurement section ............................................................ 18
4.3 Transmission analyses................................................................ 18
4.3.1 The frequency domain frame composition ............................ 18
4.3.2 Received signal spectrum...................................................... 20
4.3.3 Transmission statistics .......................................................... 21
5 Bibliography: ...................................................................................... 22

2
OFDM by IFFT modulation

1 Abstract

The Matlab/Simulink implementation of the OFDM transmission scheme,


performed by IFFT modulation and FFT demodulation, is the main subject of
this laboratory. Thus, this manual introduces the theory on the Fast Fourier
Transform, and its application in the carrier modulation process.

2 Theory.

The basic information on the multicarrier transmissions was described in


the other manual introducing multicarrier transmission in basic form –
performed by parallel transmitters/receivers.

2.1 OFDM Principle


OFDM is a special type of multicarrier transmission, where several data
streams modulate different subcarriers. The subchannels spectrum overlap.
Figure 1b) presents an OFDM transmission example of three data
substreams with 1/3TB bit rate each. In this example data substreams are
produced by source signal demultiplexation (Fig.1a).
Comparing both FDM and OFDM signal bandwidth an conclusion can be
drawn that the later needs half the bandwidth when the number of channels is
much larger then one.

2.2 Fourier Transform


The hardware implementation of a multicarrier system, basing on the set of
transmitters and receivers, is impractical because of huge number of elements
needed. Fortunately, there exist an easy way to modulate a high number of
carriers and reversing this process using quite simple calculation algorithm and
applying it in DSP architecture.
The discrete fourier transform (DFT) is very well suited for performing
modulation and demodulation using multiple carriers. It contains also an inverse
transform called inverse discrete fourier transform (IDFT). The fast
implementation of the discrete fourier transform is called the Fast fourier
transform (FFT).

1
2

Fig.1. a) Single carrier transmission; b) orthogonal frequency division


multiplexing with ∆f = 1/(3TB).

If one or more of the terms: DFT, FFT, or IFFT are not known, it is
absolutely necessary to study references and other litterature before continuing
with this manual and attached Simulink model.
2.2.1 Complex Discrete Fourier Transform
If you are already familiar with Fourier transform, you should know that
complex DFT can be viewed as a way of determining the amplitudes and phases
of sine and cosine waves forming an analyzed signal. The equation (1) called
rectangular form of forward complex DFT, explains such signal decomposition
from a mathematical point of view:

1 N −1  kn kn 
X [k ] = ∑
N n =0
x[n] cos(2π ) − j sin( 2π ) 
 N N 
(1) ,

where the X[k] array stores N amplitudes of component frequencies, x[n]


array stores N samples of the time domain signal.

The kn/N signifies the frequency of the cosine/sine wave (for each k∈[0,N-
1], n varies between 0 and the total number of time domain samples). The
parameter k defines the number of complete cycles of sine/cosine wave that

2
3

occur over the N points of the time domain signal stored in the x[n] array. The
parameter n signifies the number of collected time domain sample.

Since (1) defines a complex Fourier transform, both: the time domain and
the frequency domain array store complex values.
The X[k] array includes both: positive and negative frequencies, where an
index between k=0 and k=N/2 defines positive frequencies, and an index
between k=N/2+1 and k=N-1 defines negative frequencies (Fig.2).
There are two main ways of applying complex DFT in electronic systems:
• the time domain signal is assumed to be totally real,
o the real part of frequency domain signal has an even symmetry and
imaginary part has an odd symmetry (fig.3);
• the time domain is assumed to be complex:
o positive and negative frequencies are independent of eachother.

The system of totally real time domain signal is for e.g., applied in ADSL
(Asynchronous Digital Subscriber Line) technology, and will not be discussed in
this manual.
The second above mentioned system is recommended by 802.11a IEEE
Standard in W-LAN (Wireless LAN) applications.
The last thing to note about the DFT is the frequency distance between each
sample in the frequency domain (the resolution). It depends on the sampling
frequency fS and FFT length N (2):

fS
∆F = (2)
N

3
4

Fig.2. Graphic presentation of complex forward and inverse DFT algorithm.


Dashed lines represent the forward DFT, and solid lines visualize inverse
discrete Fourier transform. The frequency array consists of positive and negative
frequencies. The positive frequencies run from 0 to N/2.

Fig.3. The example of the complex spectrum


representing an entirely real time domain signal.

2.2.2 The inverse DFT


The forward DFT decomposes signals into several component sinusoids,
equally spaced in the particular frequency range.
On the other hand, the inverse DFT summarizes all sine and cosine waves
of amplitudes stored in X[k] array, to form again the time domain signal to be
transmitted, as presented in figure 2 and as calculated in (3).
N −1
 kn kn 
x[ n ] = ∑
k =0
X [ k ]  cos( 2 π
 N
) + j sin( 2 π )
N 
(3).

X [ k ] = Re X [ k ] + j Im X [ k ] (4).

Putting (4) into (3):

4
5

N −1
 kn kn 
x[ n ] = ∑ (Re
k =0
X [ k ] + j Im X [ k ] ) cos( 2π
 N
) + j sin( 2π ) =
N 
N −1
 kn kn 
= ∑  Re X [ k ] cos( 2π ) + j Re X [ k ] sin( 2π ) +
k =0  N N 
N −1
 kn kn 
+ ∑  j Im X [ k ] cos( 2π ) − Im X [ k ] sin( 2π ) =
k =0  N N 
N −1
 kn kn 
= ∑  Re X [ k ] cos( 2π ) − Im X [ k ] sin( 2π ) +
k =0  N N 
N −1
 k k 
+ ∑ j  Im X [ k ] cos( 2π n ) + Re X [ k ] sin( 2π n) 
k =0  N N 

Substituting X[k] in (3) for ReX[k]+jImX[k] and carrying out the


calculations, an conclusion can be drawn that:
• each value of the real part in the frequency domain contributes to the
time domain:
o real cosine and imaginary sine wave, and
• each value of the imaginary part in the frequency domain contributes
to the time domain:
o real sine and imaginary cosine wave.

In other words, each frequency domain value produces both the real
sinusoid and the imaginary sinusoid in the time domain.
Adding all those signals reconstructs the output wave.
Cosine and sine waves in (1) and (3) can be understood as real signals
generated by the physical circuits

2.2.3 The Fast Fourier Transform


The direct calculation of the Discrete Fourier Transform is for large sizes of
N very time consuming. The computation time required grows as N2. There is
however a much more efficient way to calculate the DFT, called the Fast Fourier
Transform (chapter 12, [1]).

2.3 IEEE 802.11a standard (frequency domain frame composition)


The IEEE802.11a standard recommends that a 64 points inverse Fourier
transform should be applied in the process of carriers modulation. The
difference between the theory introduced in the previous chapters and its
practical implementation is slight but very important.
Reading the theoretical considerations in the chapter 2.2.2, a conclusion
could be drawn that in OFDM transmission system all 64 carriers could be used
for data transmission. This is not correct!
The justification of this misunderstanding lies in the theoretical vs. practical
boundaries conflict.

5
6

There is nothing to say about transmitting with use of all of the 64 carriers
modulated by applying the IFFT. But, the problems are encountered when it
comes to the signal reception.
According to Nyquist sampling theorem, the signal can be properly
sampled, only if it does not contain frequencies above one-half of the sampling
rate. If such requirement would not be fulfilled, frequency domain aliasing
would occur (ch.3 of [1]).
Thus, it is necessary to filter the part of the signal spectrum that could
destroy the information after aliasing (all frequencies above 0,5Fs). Such
filtering is performed using an analog filter (anitialias filter).
Antialias filter is a low-pass circuit designed to block all frequencies above
the cutoff frequency, while passing all frequencies below. The key parameters of
such circuit are: the stopband attenuation and of course the filter roll-off.
The best circuits offer roll-off of about 0,1 of sampling frequency, and
hundreds of decibels of stopband attenuation, what is of course far from ideal.
The consequences are obvious: the frequency band between about 0,4 and
0,5 of the sampling rate is simply a wasted resource due to the filters slow roll-
off and non ideal stopband attenuation.
Taking all into consideration, the frequency frame samples defining
amplitudes of signals between 0,4 and 0,5 of the sampling rate are not to
transmit any data since it would be lost anyway. Thus, the 802.11a standard
recommends only 521 of 64 carriers to be used for data transmission.
The other case is the DC component, which according to 802.11a is not to
be used either to avoid the degradation from carrier leakage or a DC offset
caused by the analog circuits.

2.4 Sampling vs. signal spectrum


From sampling theory, the analog to digital conversion can be performed by
signal multiplication by the sequence of delta impulses called unity amplitude
impulse train (fig.4). The resulting digital signal forms an impulse train.
Although in practice, it is difficult to achieve enough narrow delta signals.
Instead, ADCs (Analog to Digital Converters) hold the last value until the next
sample is received. This process is called zero-order hold. There exist a whole
family of such signal conversions e.g., first-order hold uses strait lines between
the points, second-order hold uses parabolas etc.
As was mentioned in the previous manual, the discrete signal in one domain
is cyclic in the other. Additionally, even if the original time domain signal is
infinite in length, it needs to be cut into finite frames. Each frame is considered
to be a single period (of an infinitely periodic signal) of the input DFT signal.

1
Cumulated around the DC component.

6
7

Fig.4. The sampling theory. The time domain signal multiplication


corresponds with the frequency domain convolution. Fs=1/T.

Thus, both sampling methods: with impulse train2 and zero-order hold,
generate cyclic but not identical spectrums. The frequency spectrum of unity
impulse train is also a unity amplitude impulse train, with the spikes occurring at
multiples of the sampling frequency, fs, 2fs, 3fs, 4fs, etc., (fig.4). Since the time
domain signal is a multiplication of the data and the impulse train, in the
frequency domain – due to the convolution – original spectrum is copied to the
location of each spike in the impulse train spectrum.
In the stairs signal case, the spectrum is additionally multiplied by the sinc
function (5).

2
Unity amplitude impulse train

7
8

sin( πf S )
f

H( f ) = πf
(5).
fS

Equation (5) describes high frequency amplitude reduction due to the zero-
order hold. The sampling frequency represents fs. For f=0 H(f)=1 (fig.5).

Fig.5. The comparison of the impulse train and zero-order hold sampled signal
spectrum.

3 Block descriptions

The Simulink model presents a simplified OFDM transmission system,


which introduces the application of the IFFT/FFT elements in the process of
data modulation/demodulation according to the IEEE802.11a standard.
In the same way as the other simulink models in this course, the system was
divided into three basic sections (fig.7):
• Transmitter,
• Receiver, and
• Measurement Tools.

8
Fig.7. The system introducing the OFDM transmission by IFFT modulation and FFT demodulation.

9
All of above mentioned sections introduce some new blocks, listed below:
• FFT,
• IFFT,
• Buffer,
• Unbuffer,
• Discrete constant,
• Baseband S-QASK demod,
• Frequency Frame Scope,
• Short-Time FFT,
• Upsample.

3.1.1 Transmitter

3.1.1.1 Discrete constant


Discrete constant block is applied in this model to generate the zeroed
samples, which are further converted to complex form (fig.6). Zeros are
included in the frequency frame to be converted to the time domain signal and
transmitted over the channel.

Fig.6. The discrete constant block dialog box (on the left) and Real-Imag to
complex block in single subsystem(on the right).

3.1.1.2 IFFT
The IFFT block (fig.8) computes the Inverse Fast Fourier Transform of
each Y complex input channels. The block assumes that the input is an X-by-Y
frame matrix and that each of the Y frames contains X sequential time samples
from an independent signal.

10
11

Fig.8. IFFT block dialog box.

3.1.1.3 Unbuffer
Unbuffer block is used in the system as parallel to serial converter (fig.9).

Fig.9. The Unbuffer block dialog box.

3.1.2 Receiver

3.1.2.1 Buffer
The buffer block is used as serial to parallel converter in this system. It fills
each buffer with 64 samples incoming form the channel and passes the frame to
farther processing. The number of samples forming the time domain frame is
determined by the 802.11a IEEE standard.
The block introduces a nonzero latency, which can be calculated by typing
the command rebuffer_delay(f,n,m) in the Matlab command window, where
f defines the input frame size – in this case 1, n is the Buffer size (fig.10)
parameter setting – in this case 64, and m is the Buffer overlap parameter setting
which in this case is 0. When executed, this command returns 64 – single, full
buffer latency (frame size).

11
12

Fig.10. Buffer block dialog box.

3.1.2.2 FFT
The FFT block computes the fast Fourier transform (FFT) of each input
frame, independently at each sample time (fig.11). Each input frame is called a
channel in the Simulink environment.

Fig.11. FFT block dialog box.

3.1.3 Measurement Tools

3.1.3.1 Short-Time FFT


From Matlab help file: “The block averages the squared magnitude of the
FFT computed over windowed sections of the input, and normalizes the spectral
average by the square of the sum of the window samples”.
The window function that shapes the input impulses can be set to any from
supplied list (fig.12).
Block dialog box allows setting several parameters. The most important are:
• FFT length,
• Number of spectral averages,

FFT length
The received signal is first buffered. Each frame consists of 256 time
domain samples, thus includes four OFDM symbols. Since the input frame does
not need to be zero padded, the frame size can be inherited from input frame

12
13

width. Input frame size was determined experimentally, so the center frequency
could be clearly identified as the not modulated part of signal spectrum.

Fig.12. ST-FFT model dialog box on the left.


Spectrum Calculation Subsystem, on the right.

Number of spectral averages


The higher value the more smooth spectrum envelope is presented on the
Frequency Frame Scope. However, more averages needs more computation
time, and more memory to be used by the system.
The value of this parameter was also determined experimentally so the
spectrum does not include to many peak values, and SNR parameter change,
effects in relatively fast plotted spectrum updating.

3.1.3.2 Frequency Frame Scope


This block allows the user to present the generated frequency frame, e.g., by
the power spectrum calculation systems. The input frame parameters are
identical to those described in chapter 2.3. The model dialog box is similar to
already known FFT Frame Scope, and does not need any further explanation.

3.1.3.3 Upsample
The Upsample block resamples the discrete input at a rate L times higher
than the input sample rate by inserting L-1 zeros between consecutive input
samples.

4 The system basics


Before starting the simulation, you should first analyze the system carefully
and try to understand dependencies between particular blocks, parameters, etc.

13
14

The following description explains the signals flow and tasks that are
realized by different system stages.

4.1 The system setup parameters


Before starting the simulation, it is necessary to set basic transmission
parameters (fig.13):
• M-ary data mapping,
• Signal to Noise Ratio in the transmission channel.

Fig.13. The system setup dialog box.

M-ary data mapping


The IFFT block accepts only complex signals on its input. Thus, the M-ary
real signal needs to be converted to complex form. Such conversion is nothing
more but simple baseband complex data mapping.
According to IEEE 802.11a standard - ch.17.3.5.7, one of four gray-coded
QASK maps (table.1) should be applied for OFDM transmission. In the
Simulink environment can the Square-map QASK modulator be used for this
purposes.
The parameter M can be altered while the simulation is running.

Baseband mapping modes recommended by


Table 1. IEEE 802.11a standard for OFDM transmission.
M Mapping Mode
2 BPSK
4 QPSK
16 16-QAM
64 64-QAM

14
15

SNR in the transmission channel


To achieve error free transmission in OFDM, the SNR needs to be higher
than 20 dB. The higher M value the higher SNR parameter value needed to
achieve error free transmission.
This parameter can also be altered while the simulation is running.

4.1.1 Initial commands


To prepare the system for optional future development and to visualize
some system dependencies, all the basic transmission parameters (table.2) are
collected in the initial commands section of the system mask editor (fig.14).

Fig.14. Mask editor with initial commands defined.

Table.2. System initial commands

%Subcarriers related parameters according to ch.17.3.2.3 of IEEE Std802.11a


%----------------------------------------
Nsd=48; % Number of data subcarriers
Nsp= 4; % Number of pilot subcarriers
Nst =Nsd+Nsp; % Number of subcarriers, total (52)
%------------------------------------------------------------------------------------------
% Parameters of names not following Std802.11a labeling
%----------------------------------------
BW=20e6; %Cumulative signal bandwidth (20Msamples/s)
ChTSamp=1/BW; % The time duration between samples in the channel
SubchannelBW=BW/64; %Subchannels signal bandwidth
Tbit=1/SubchannelBW; %Subchannel signal sample time

15
16

4.2 The signals flow


The IEEE 802.11a standard defines 52 total subchannels over which data is
to be transmitted. This includes 4 subchannels used for pilot signal transmission.
According to the mentioned standard, pilots are to be BPSK mapped and
modulated by special pseudorandom sequences.
Notice, that for simplification this model does not distinguish between data
and pilots signals. Thus, the data source generates 52 M-ary simultaneous data
streams (fig.15). Each substream is further mapped to complex form with use of
one of 52 QASK baseband modulators (fig.16).

Fig.15. The data source generates cyclically repeatable 1000 frames of M-ary
symbols. Each frame is Nst=52 samples wide, which corresponds to
52 simultaneous data substreams.

Fig.16. The QAM baseband modulators set.

16
17

The stream of complex numbers is divided into 2 groups of 26 samples.


One of them becomes negative frequency magnitudes, and the other positive
frequency magnitudes (fig.17).
To avoid difficulties in D/A and A/D converter or offsets and carrier
feedthrough in the RF systems, the 0-th subcarrier (DC frequency) is not used –
all transmitted samples are zeroed.
Since this system models baseband transmission, these mentioned problems
would not occur anyway. The model still follows the standard recommendation.

Fig.17. The frequency frame formation section.

Fig.18. The redundant samples discarding section.

17
18

According to Std802.11a, components close to half of the sampling


frequency are not used either.
The prepared frequency frame is further used for 64 carriers modulation by
calculating inverse Fast Fourier Transform.
Modulated and summed carriers are transmitted over the AWGN channel.
The user can modify the channel noise level by changing its SNR parameter
(fig.13).
Received signals are demodulated by the FFT calculation. The redundant
samples in the received frequency frame – zeros added as DC and other
frequencies – are simply discarded (fig.18).
Finely each subchannel data stream is demodulated with one of the 52
QAM demodulators.

4.2.1 Measurement section


The signal leaving the channel is sent over the goto - from pair straight to
the Spectrum analyzes section (fig.12). According to the subsystem setup, the
signal is upsampled by the zero-order hold block or the Upsample block.

4.3 Transmission analyses


The system allows student to analyze:
• the frequency domain frame composition;
• the transmitted signal spectrum depending on the sampling type;
• the channel SNR and applied mapping scheme influence on the
transmission statistics.

4.3.1 The frequency domain frame composition


The frequency domain frame presentation section includes a subsystem
consisting of the display block – set to present all the 64 data substreams
(fig.19).
The signal in the channel is a stair signal of the sampling time equal to the
ChTSamp. If the signal would be presented in the spectrum plot, only the
frequencies between DC and 1/ChTSamp would be included. To increase this
frequency region the sampling rate also needs increasing. It can be done by the
zero-order hold block or by Upsample block.
The former samples signal and holds the last value generating stairs, and the
later allows system to upsample the signal by the factor of N, placing N-1 zeros
after actual signal sample. In the second case, the output signal is of the
modulated impulse train form.

18
19

Fig.19. The frequency frame presentation section.

19
20

4.3.2 Received signal spectrum


The spectrum analysis section allows student to compare the discrete signal
spectrum depending on the applied sampling type, which can be set in the
subsystem dialog box (fig.20).

Fig.20. The spectrum analysis section dialog box.

The frequency frame scope presents the calculated signal spectrum


depending on the sampling type selection. Notice, that before changing this
parameter simulation needs to be stopped.

Fig.21. The OFDM signal spectrum (stairs signal).

The stairs signal spectrum is influenced by the high frequencies attenuation


(fig.21, ch.2.1), while the spectrum of tje modulated impulse train signal is
periodic in the whole analyzed frequency band (fig.22). High frequencies
attenuation of the stairs spectrum can be modeled as spectrum multiplication by
the sinc function (5).
The channel SNR parameter influence on the signal spectrum can also be
analyzed with the use of the frequency frame scope. When changing the SNR
parameter below 20dB, the noise level can be observed in the regions
representing not modulated frequencies (fig.23).

20
21

Fig.22. The OFDM signal spectrum (modulated impulse train).

Fig.23. The noise level related to the mean signal level.

4.3.3 Transmission statistics


The display block presents the Symbol Error Rate (fig.24).

Fig.24. SER presentation section.

21
22

5 Bibliography:

[1]. “The Scientist and Engineer's Guide to Digital Signal Processing”,


Steven W. Smith.

22

Das könnte Ihnen auch gefallen