Professional Documents
Culture Documents
A Thesis
Presented to the
Faculty of
In Partial Fulfillment
with a Concentration in
by
Summer 2012
iii
Copyright 2012
by
Steven Charles Hemple
iv
DEDICATION
Paul Erdos
vi
The increase in the number of wireless devices and the requirement for higher data
rates places an increasing demand on bandwidth. This necessitates the need for
communication systems with increased throughput and capacity. Multiple input multiple
output orthogonal frequency division multiplexing (MIMO-OFDM) is one way to meet this
need. OFDM is used in many wireless communication devices and offers high spectral
efficiency and resilience to multipath channel effects. Though OFDM is sensitive to
synchronization errors, it makes the task of channel equalization simple. MIMO makes use of
multiple antennas to increase throughput without increasing transmitter power or bandwidth.
This thesis presents an introduction to the multipath fading channel and describes an
appropriate channel model. Several modulation schemes are presented that are often used in
conjunction with OFDM . Mathematical definitions and analysis of OFDM are given along
with a discrete implementation common to modern communication systems. Synchronization
errors are described mathematically and simulated, as well as techniques to estimate and
correct those errors at the receiver. Lastly, space time coding, spatial multiplexing, and
beamforming are presented as techniques used in (MIMO).
vii
TABLE OF CONTENTS
PAGE
ABSTRACT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vi
LIST OF TABLES. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . x
LIST OF FIGURES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
ACKNOWLEDGEMENTS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xv
CHAPTER
1 INTRODUCTION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 History . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Objective. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
1.3 Preview of Chapters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2
2 THE CHANNEL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1 Propagation Mechanisms . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.1 Large Scale Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.1.2 Mid-Scale Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.1.3 Small Scale Effects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.2 Electromagnetic Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
2.3 Impulse Response Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.4 Frequency Domain Channel Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
2.5 Implementation of Channel Model . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
3 MODULATION TECHNIQUES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1 Amplitude Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1.1 Double Side Band Amplitude Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 27
3.1.2 Double Side Band Suppressed Carrier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.1.3 Single Side Band . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29
3.1.4 Hilbert Transform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31
3.2 Pulse Amplitude Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
3.3 Phase Shift Keying/Quadrature Phase Shift Keying . . . . . . . . . . . . . . . . . . . . . . . . . . . 36
3.4 Quadrature Amplitude Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
4 ORTHOGONAL FREQUENCY DIVISION MULTIPLEXING . . . . . . . . . . . . . . . . . . . . 45
viii
4.1 Single Carrier Systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 45
4.2 Multicarrier System . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.3 Mathematical Description of OFDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
4.3.1 Modulation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 49
4.3.2 Demodulation of AWGN Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.3.3 Demodulation of Delay Dispersive Channel . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50
4.4 Implementing OFDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52
5 SYNCHRONIZATION ERRORS AND ESTIMATIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
5.1 Syncronization Errors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
5.1.1 Frequency Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
5.1.2 Sampling Clock Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
5.1.3 Frame Timing Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 73
5.2 Synchronization Error Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2.1 Preamble Structure of IEEE802.11a . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87
5.2.2 OFDM Frame Timing Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91
5.2.3 Frequency Offset Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94
5.2.4 Symbol Timing Estimation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 105
5.2.5 Channel Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 107
5.2.6 Residual Frequency Offset . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 108
6 MULTIPLE INPUT MULTIPLE OUTPUT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.1 Space Time Coding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112
6.1.1 Space Time Trellis Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113
6.1.2 Space Time Block Codes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
6.2 Viterbi Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
6.2.1 Hard Decision Viterbi Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 119
6.2.2 Soft Decision Viterbi Decoding . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.3 Spatial Division Multiplexing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
6.4 Beamforming . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
6.5 Channel Estimation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 125
7 CONCLUSION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 130
BIBLIOGRAPHY . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132
ix
APPENDICES
A MATLAB CODE FOR CHANNEL MODELING . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135
B MATLAB CODE FOR MODULATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 146
C MATLAB CODE FOR OFDM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 159
D MATLAB CODE FOR SYNCHRONIZATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
E MATLAB CODE FOR PREAMBLE AND SYNCHRONIZATION ER-
ROR ESTIMATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 187
F CORRELATION . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208
G PHASE LOCK LOOP . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 210
H MATLAB CODE FOR PLL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223
x
LIST OF TABLES
PAGE
Table 2.1. Relationship Between Channel Parameters and Model Parameters . . . . . . . . . . . . . . 20
Table 6.1. Alamouti Transmission Scheme . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
Table 6.2. Encoder Transition and Inputs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Table 6.3. Soft Decision Viterbi Decoder . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 121
xi
LIST OF FIGURES
PAGE
Figure 2.1. Free space model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
Figure 2.2. Free space path loss model for large and small distances. . . . . . . . . . . . . . . . . . . . . . . . 5
Figure 2.3. Doppler shift as a function of speed and angle relative to the transmit antenna. 7
Figure 2.4. Static reflection from wall and line of sight paths. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 8
Figure 2.5. Same phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9
Figure 2.6. 4
difference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Figure 2.7. 2
difference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
Figure 2.8. Isotropic antennas with Rx antenna movement.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 2.9. Fixed isotropic antennas with two paths. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Figure 2.10. Fixed transmit antenna and moving receive antenna with two paths. . . . . . . . . . 13
Figure 2.11. Channel transfer function with three paths and W = 1GHz, k =
0 and ak = 1 for k = 1, 2, 3, 4, 5. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Figure 2.12. Delay power spectrum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Figure 2.13. The frequency domain model. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21
Figure 2.14. Output of noise shaping filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Figure 2.15. Output of Hilbert transform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Figure 2.16. Simulated transfer function. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Figure 2.17. Simulated impulse response. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Figure 2.18. PDF of 3000 simulations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 26
Figure 3.1. Time series and frequency spectrum of message and carrier signal. . . . . . . . . . . . . 28
Figure 3.2. Time series and frequency spectrum of modulated signal. . . . . . . . . . . . . . . . . . . . . . . 29
Figure 3.3. Time series and frequency spectrum of DSB-SC. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30
Figure 3.4. Frequency spectrum of Hilbert transform. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 3.5. Frequency spectrum of modulated SSB. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 33
Figure 3.6. PAM-4 constellation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
Figure 3.7. PAM-4 signal with Gray coding. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35
Figure 3.8. Gray coding scheme for BPSK.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39
Figure 3.9. Gray coding scheme for QPSK. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40
xii
Figure 3.10. Constellation diagram for 16-QAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
Figure 3.11. Gray coding scheme for 16-QAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43
Figure 3.12. Receiver block diagram for M-QAM. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 44
Figure 4.1. Single carrier system block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
Figure 4.2. Single carrier system showing frequency response, power delay
spectrum and symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Figure 4.3. Multiple carrier system block diagram. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 47
Figure 4.4. Multiple carrier system showing frequency response, power delay
spectrum and symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 48
Figure 4.5. Cyclic prefix. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 51
Figure 4.6. Real part of IDFT output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
Figure 4.7. Imaginary part of IDFT output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 55
Figure 4.8. IFFT as a complex signal generator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
Figure 4.9. FFT as a complex signal demodulator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 57
Figure 5.1. Synchronization blocks in OFDM receiver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Figure 5.2. Effects of normalized carrier frequency offset = 0.05 and
SNR=20dB for 120 simulations. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 62
Figure 5.3. Effects of normalized carrier frequency offset = 0.05 and
SNR=20dB on the constellation for 120 OFDM Symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . 63
Figure 5.4. Effects of normalized carrier frequency offset = 0.05 and
SNR=20dB on the spectrum for 120 OFDM Symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64
Figure 5.5. ICI coefficients for = 0.5, 0.1, 0.05, 0.025. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Figure 5.6. Power of ICI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Figure 5.7. Carrier-to-interference power ratio.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67
Figure 5.8. Time series with 1% sample clock offset. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 68
Figure 5.9. Magnitude of attenuation and phase of 1% sampling period offset. . . . . . . . . . . . . 70
Figure 5.10. Effects of sample clock offset on spectrum. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
Figure 5.11. Effects of sample clock offset on constellation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72
Figure 5.12. ICI power. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74
Figure 5.13. Signal to ICI power ratio. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 75
Figure 5.14. Effects of symbol timing offset of = 8 for Nf f t = 64. . . . . . . . . . . . . . . . . . . . . . . . 77
Figure 5.15. Effects of symbol timing offset of = 8 for Nf f t = 256. . . . . . . . . . . . . . . . . . . . . . 78
Figure 5.16. Possible locations for frame start position. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79
xiii
Figure 5.17. Effects of symbol timing offset of = 8 for Nf f t = 64 with cyclic
prefix and ideal channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 80
Figure 5.18. Effects of symbol timing offset of = 8 for Nf f t = 64 with cyclic
prefix and multipath channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 81
Figure 5.19. Effects of symbol timing offset of = 8 for Nf f t = 64 with cyclic
prefix and multipath channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82
Figure 5.20. Effects of symbol timing offset of = 8 for Nf f t = 64 with no
cyclic prefix and ideal channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84
Figure 5.21. Effects of symbol timing offset of = 8 for Nf f t = 256 with no
cyclic prefix and ideal channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85
Figure 5.22. Power of ICI, ISI, and total interference for Nf f t = 64. . . . . . . . . . . . . . . . . . . . . . . . 86
Figure 5.23. Spectrum of short training symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 88
Figure 5.24. Time series of short training symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 89
Figure 5.25. Spectrum of long training symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
Figure 5.26. Time series of long training symbols. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 92
Figure 5.27. Time series of preamble. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Figure 5.28. Delay and correlate algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 93
Figure 5.29. Output of the cross-correlator, the auto-correlator, and the thresh-
old detector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 95
Figure 5.30. Received signal with 50 samples prepended. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96
Figure 5.31. Time series of preamble with SNR 7dB and frequency offset 200kHz. . . . . 97
Figure 5.32. Output of the cross-correlator, the auto-correlator, and the thresh-
old detector with SNR 7dB and frequency offset 200kHz. . . . . . . . . . . . . . . . . . . . . . . . . 98
Figure 5.33. Frequency estimation algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 100
Figure 5.34. Estimated phase. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101
Figure 5.35. Time series with and without frequency offset correction. . . . . . . . . . . . . . . . . . . . . . 102
Figure 5.36. Output of phase detector and loop filter. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 103
Figure 5.37. Accumulated phase and VCO output. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 104
Figure 5.38. Constellation with and without frequency offset correction. . . . . . . . . . . . . . . . . . . . 105
Figure 5.39. Cross-correlation of long training symbol. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
Figure 5.40. Effects of multipath channel on received constellation. . . . . . . . . . . . . . . . . . . . . . . . . 107
Figure 5.41. Channel estimation. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109
Figure 5.42. Received constellation after channel correction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110
Figure 5.43. Scrambler used to generate psuedo-binary pilot sequence. . . . . . . . . . . . . . . . . . . . . 110
xiv
Figure 5.44. Residual frequency tracking. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111
Figure 6.1. Rate 1/2 convolutional encoder with constraint length 7. . . . . . . . . . . . . . . . . . . . . . . . 113
Figure 6.2. Four state convolutional encoder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Figure 6.3. State diagram for encoder in Figure 6.2. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 114
Figure 6.4. Trellis diagram for convolutional encoder in Figure 6.2. . . . . . . . . . . . . . . . . . . . . . . . . 114
Figure 6.5. Alamouti for two transmit antennas.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Figure 6.6. Alamouti for one receive antenna. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 115
Figure 6.7. Channel for two transmit antennas and one receive antenna. . . . . . . . . . . . . . . . . . . . 116
Figure 6.8. Channel for two transmit antennas and two receive antennas. . . . . . . . . . . . . . . . . . . 118
Figure 6.9. Viterbi decoding algorithm. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 120
Figure 6.10. Input/output relationship for 3 bit quantizer.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122
Figure 6.11. Comparison of hard and soft Viterbi decoding.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
Figure 6.12. D-BLAST and V-BLAST layered transmission scheme. . . . . . . . . . . . . . . . . . . . . . . 124
Figure 6.13. Directing coverage area to intended users using beamforming. . . . . . . . . . . . . . . . 126
Figure 6.14. Three isotropic antenna configuration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 126
Figure 6.15. Signal strength for (a) three antennas, distance 10, and relative
phase delay 10, (b) three antennas, distance 10, and relative phase delay
40, (c) five antennas, distance 2, and relative phase delay 25, and (d) five
antennas, distance 5, and relative phase delay 40. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 127
Figure 6.16. MIMO channel. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 128
Figure 6.17. Alternate transmission of long preamble. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Figure 6.18. Alternating even and odd frequencies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 129
Figure G.1. Basic phase lock loop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Figure G.2. Phase lock loop. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211
Figure G.3. Dampened spring mass system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 212
Figure G.4. Undamped system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 213
Figure G.5. Damped system. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 214
Figure G.6. Proportional control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215
Figure G.7. Integral control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 216
Figure G.8. Proportional and integral control. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 217
Figure G.9. Input to PLL. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220
Figure G.10. Input and output phases to PLL, loop filter, and phase detector. . . . . . . . . . . . . . . 221
Figure G.11. PLL input and output time series. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 222
xv
ACKNOWLEDGEMENTS
I would like to thank Professors Stefan Hui, Roxana Smarandache and Fredric J.
Harris.
1
CHAPTER 1
INTRODUCTION
The year 2010 saw global mobile data usage increase by almost threefold [4]. This
increased data usage is from the rise in the number of consumer electronic devices that rely on
wireless standards such as IEEE802.11 (Wi-Fi), IEEE802.16 (WiMAX), and cell phones in
particular multi-function smart phones [27]. The rising number of devices that require high
data rates is placing increasing demands on bandwidth. One of the ways these challenges are
being met is with the use of orthogonal frequency division multiplexing (OFDM). OFDM is
not only spectrally efficient but resilient to the effects of the multipath wireless channel.
Another technique being used is multiple input multiple output (MIMO). MIMO has already
been incorporated into the IEEE802.11n, IEEE802.16e, and 4G cellular wireless standards.
The introduction of MIMO into these standards make possible the increased data throughput
and range required by many devices without increases in transmit power or bandwidth.
1.1 H ISTORY
The first use of a digital wireless electronic communication system was the wireless
telegraph. This was also the first use of multiple antennas which aided in the success of
transatlantic wireless communications. Since that time digital communications has become
the de facto standard in modern communications. Though many standards exist for the
different types of wireless digital communications we are most interested in those concerning
wireless local area networks (WLAN) also referred to as Wi-Fi. These are described by the
IEEE802.11 standard.
The first IEEE802.11 standard was released in 1997 and offered data rates of 1 and 2
Mbits/s [11]. In 1999, amendment a was released and increased the data rates to 54M bits/s
and introduced the use of OFDM as the modulation scheme [12]. The inclusion of OFDM
helped to achieve the higher data rate and also increased coverage area. 2003 saw the release
of the g amendment. This amendment also included OFDM but where 802.11a achieved 54
Mbits/s at the 5GHz the g standard achieves this rate at the lower 2.4GHz [14]. The latest
release, amendment n, also uses OFDM and operates at both 2.4 and 5 GHz but achieves
considerably higher data rates of up to 600 Mbits/s with the inclusion of MIMO [15]. MIMO
allows the use of multiple spatial streams to increase throughput, coverage, and even user
capacity.
2
1.2 O BJECTIVE
The goal for this thesis is to give the reader an introductory look into OFDM. Within
this goal, the three main topics presented are channel modeling, OFDM and synchronization,
and MIMO. It is important to give an accurate representation of the channel since it has the
largest impact on the parameters of any communication system. A mathematical description
of OFDM is given as well as the discrete implementation based on the IEEE802.11 standard.
The reader will become familiar with the synchronization difficulties that arise in
implementing OFDM as well as the estimation and correction of those errors. An introduction
to MIMO is also presented based on the IEEE802.11n standard. The reader is presented with
space time coding, spatial multiplexing, and beamforming.
CHAPTER 2
THE CHANNEL
The success of any communication system model resides with the accurate
representation of the channel. This is especially so with the wireless channel. Effects which
are non-existent or negligible in a wired communication system can render a wireless channel
unusable unless measures are taken to counteract them.
Variations in channel statistics, called propagation mechanisms, can be placed into
three categories: small, mid, and large scale effects [10]. These categories are described by
the effect that interact with the system based on the separation distance between the transmit
(Tx) and receive (Rx) antennas relative to the radio frequency (RF) wavelength. Each of these
variations can be modeled precisely with the electromagnetic wave equations but as we will
see later, their complexity make them impractical as useful models.
In this chapter we will look at the electromagnetic wave model as a way to gain insight
into the interferences in a wireless channel. This will lead us into the impulse response model.
In this model the channel is considered to be a linear time invariant filter making simulation
more achievable. Several methods have been proposed as to the technique to generate the
impulse response but we will consider one that is presented in [21].
the reciprocal of the distance squared. The path loss FL can be described, in positive terms, by
2
4r
FL =
2
4rf
= , (2.1)
c
where wavelength , frequency f , and the speed of light c are related by = c/f [24]. Free
space path loss is usually expressed in decibels,
4rf
FL = 20 log10 . (2.2)
c
This model does have is its limitations however. Note that as r 0 the free space loss
FL which clearly can not happen since this indicates an increase in power, greater than
that transmitted. Figure 2.2 demonstrates this anomaly with f = 900MHz and distance in
meters.
The second large scale propagation model is shadowing. This effect is caused by path
obstructions like buildings, vegetation, etc. Though models exist that use information from
geographical information systems (GIS) databases, they are used mainly for cell tower
placement[16]. Because of the difficulty in accounting for the voluminous causes of
shadowing and the distances involved, we will not consider this effect in our model.
5
90
0
80
10
70
20
60
Magnitude [dB]
Magnitude [dB]
30 50
40 40
30
50
20
60
10
70
0
80 10
0 50 100 0 0.02 0.04
Distance [m] Distance [m]
Figure 2.2. Free space path loss model for large and small distances.
6
300
200
100
Doppler Shift [Hz]
100
200
300
400
pi
pi/2 100
80
0 60
pi/2 40
pi 20
Angle [Radians] 0
Speed [m/s]
Figure 2.3. Doppler shift as a function of speed and angle relative to the transmit
antenna.
8
Figure 2.4. Static reflection from wall and line of sight paths.
Consider the IEEE 802.11 standard which has carrier frequencies of 2.4GHz or 5GHz
and wavelengths
c 2.99 108 m/s
= = = 0.125meters (2.4)
f 2.4 109 Hz
(2.5)
and
c 2.99 108 m/s
= = = 0.06meters. (2.6)
f 5 109 Hz
Thus, we have a complete cancellation of the received sinusoid if two paths have a phase
difference of 0.0625 meters for a 2.4GHz system or 0.03 meters for a 5GHz system. Unlike
the large scale effects, these occur at ranges well within the parameters for an indoor system,
which is why we will consider multipath fading in our model.
0.5
0.5
1.5
0.5
0.5
1.5
0.5
0.5
1.5
0.5
0.5
1.5
Figure 2.6. 4
difference.
where ~d represents the point (r, , ) for distance r and horizontal and vertical angles , and
the term s (, , f ) is the complex function describing the radiation pattern of the
transmitting antenna[7]. The magnitude of s accounts for the antenna loss and the phase
accounts for the change in phase due to the antenna and is dependent not only on horizontal
and vertical angles but frequency as well. From equation 2.7 we can see a phase shift in the
electric field of f r/c and is a result of the delay of r/c from the traveling sinusoid. The r in
the denominator is to be expected as we saw earlier a decrease in power by 1/r2 . We will
define the product of the Tx and Rx antenna patterns as (, , f ). Thus the received
waveform is r
2jf t
(, , f )e c
yf (t) = . (2.8)
r
Equation 2.7 describes the scenario when both Tx and Rx antennas are fixed. We now
consider the case when the receive antenna is moving and the transmit antenna is fixed as
shown in Figure 2.8.
11
0.5
0.5
1.5
0.5
0.5
1.5
Figure 2.7. 2
difference.
The point (r(t), , ) at which we observe the energy in the received waveform is now
a function of time and can be described by
v f r0
2j f 1 t
(, , f )e c c
~
E f, t, d(t) = . (2.9)
r0 + vt
As expected, there is a Doppler shift of f v/c caused by the movement. This
introduces a time variance and means that we can not use the easier linear time invariant
model (LTI) unless some assumptions are made [7].
The next case is where we account for the multipath caused by a reflection from a wall
as seen in Figure 2.9. It was stated earlier that it was difficult to simulate multipath with the
electromagnetic model and for that reason we will only consider two paths: the LOS and one
reflection.
Because both antenna are fixed, the received waveform can be described by
2d r
2jf t
(, , f )e2jf (t c )
r
(, , f )e c
yf (t) = , (2.10)
r 2d r
12
Figure 2.10. Fixed transmit antenna and moving receive antenna with
two paths.
Because the antenna separation is decreasing, the magnitude of the LOS path is
increasing as 1/(r0 vt). Likewise, the distance of the reflected path is increasing, so the
magnitude is decreasing as 1/(r0 + vt). The sinusoids for the LOS path has frequency
f (1 v/c) and the reflected path has frequency f (1 + v/c). Since the received waveform is
the addition of the two waveforms, the received waveform has frequency f v/c.
These last few models only account for movement along the LOS path for perfect
reflections, and only two paths. If we wish to implement this model to analyze, for example,
an indoor wireless communication system, it would prove very challenging. In the next
section we look at a different way to model the channel and after making a few reasonable
assumptions, we will see a more implementable simulation.
1
A more detailed explanation involving ray tracing can be found in [7] and [26].
14
where t is the observation time of the impulse, is the application time of the impulse, N ( )
is the number of multipath components, k (t) is the random time varying path amplitude,
k (t) is the arrival time and k (t) is the phase [17]. This model will describe the channel
completely and the received signal is just the convolution of the signal s(t) with h(t, ) and
the addition of noise. We stated earlier that an LTI model was desirable, thus we need the
phase, amplitude, and delay to not be time dependent. To justify this, we note that the symbol
time for 802.11a is 4s on a 2.4GHz RF [12]. This means that the wavelength = 0.125
meters, but the waveform propagates from the antenna at 2.99 108 m/s. Since we are
considering indoor uses only, it is unlikely that the channel parameters will change during
transmission for some length of time.
We can define the LTI complex impulse response for the channel as
N
k ( k ) ejk
X
h( ) = (2.13)
k=1
15
and the received signal is then
Z
y(t) = s(t)h( )d + n(t), (2.14)
where n(t) is the noise in the channel to be discussed later. We can also describe the channel
by its transfer function
Z
H(f ) = h( )e(j2f ) d
Z N
X
= k ( k ) e(jk ) e(j2f ) d
k=1
N
X
= k ej(2f k k ) . (2.15)
k=1
Earlier, we assumed for our simulation that k = (k 1)T where T = 1/W and W is the
bandwidth of the signal.
To illustrate the implementation of the transfer function in simulation, consider the
example where W = 1GHz and there are five paths present. Figure 2.11 shows the transfer
function with k = 0 and k = 1 for k = 1, 2, 3, 4, 5. Even though this example is very
simple, compared to an indoor wireless channel commonly seen and channel parameters were
chosen for ease, fading can still be seen in the channel.
We now turn our attention to the channel parameters , , and and their distributions.
The length of the path the signal travels from transmitter to receiver has a significant impact
on the phase of the received signal. Thus, any change in the position of the receive antenna (or
transmitter antenna) results in a change in the phase. We assumed earlier that the number of
paths was fixed but made no other restrictions. If we also assume a large number of paths, the
distribution of the phases along the paths generally follow a uniform distribution on the
interval [0, 2)2 [17]. This assumption is based on the short wavelengths and small indoor area
that we are considering.
The path amplitude distribution depends on the presence of a LOS path. For this
simulation we will assume that the LOS component is present and therefore use the Rician
model. This model assumes that in addition to the LOS path there are a large number of
independent smaller (in magnitude) paths. It is important to point out that the Rayleigh and
Rician models do not approximate the channel for an individual situation very well. They do
approximate the channel when all physical situations are averaged[7]. The Rician pdf is
2
A more detailed explanation and alternative distributions can be found in [17]
16
10
0
Magnitude2 [dB]
10
20
30
40
0.5 0.4 0.3 0.2 0.1 0 0.1 0.2 0.3 0.4 0.5
Normalized Frequency f/fsym [Hz]
Figure 2.11. Channel transfer function with three paths and W = 1GHz, k = 0 and
ak = 1 for k = 1, 2, 3, 4, 5.
17
described by
(r2 +2 )
" #
r 20 r
PR (r) = e I0 (2.16)
0 0
where 0 is the power of the scattered rays, 2 is the normalized power of the direct (LOS)
ray, and I0 (x) is the modified Bessel function of the first kind. A very important characteristic
of the channel is the Rician K factor,
2
i,max
K= 2
, (2.17)
0 i,max
which is the ratio of the powers of the dominant path to the scattered paths. This ratio
specifies the depth of the fades. For local areas a large K value has shallow fades because the
dominant paths power has a greater magnitude than the scattered paths and thus is not
affected by the lower magnitude interference.
Before discussing the channel parameter , the specific application of this model must
be established. The channel we are simulating is continuous but the implementation of any
simulation is discrete and therefore imposes restrictions on the delay. This means we must
sample the channel but to do this the channel bandwidth must be known. If we sample at an
interval Ts then we limit the channel bandwidth to 1/2Ts and any excess delay separation
< Ts will not be resolvable.
Mathematically, if we apply a rectangular window to the time varying channel transfer
function we have,
with
1 1
if |f | 2Ts
W (f ) = , (2.20)
0 1
if |f | > 2Ts
which can also be described by the convolution of the channel impulse response and the sinc
function
hW (, t) = h(, t) sinc (2.21)
Ts
X
ji (t) i (t)
= i (t)e sinc . (2.22)
i
Ts
where
X 2
m = i i for m = 1, 2. (2.26)
i
P0
The parameter rms is related to the average number of fades per bandwidth and the average
bandwidth of the fades [21].
If we assume that the channel correlation function is a wide sense stationary (WSS) process,
then H depends only on the difference f2 f1 and t2 t1 and thus
and since we are assuming that the channel is time invariant for some time interval,
H (f ) = H (f, 0) . (2.29)
We will base the channel model on the delay power spectrum, with delay spread
maximum max , which is the Fourier transform of the spaced frequency correlation function
with coherence bandwidth f . The coherence time is the time duration where the channel
impulse response is considered not varying or where the channel transfer function shows
significant correlation. The coherence bandwidth is the range of frequencies where the
19
channel is considered flat or where the channel transfer function shows significant correlation.
The usual related correlation value is 0.9 [21].
The delay power spectrum we will use to define the frequency selectivity has four
parameters, 2 is the normalized power of the dominant path, is the normalized power
density of the constant part, 1 is the duration of the constant level part, and is the decay
exponent of the exponentially decaying part. The equation for the delay power spectrum is
0 if < 0
2 ( )
if = 0
h ( ) =
if 0 < 1
e( 1 ) if >
1
Figure 2.12 shows the general case for the desired delay power spectrum with
constant level part and exponentially decaying part.
For most channels, a good approximation of the channel can be obtained by setting
1 = 0, giving an exponentially decaying delay power spectrum. Our model will contain a
dominant LOS path so the mean of the channel transfer function is not zero.
We now need to relate the parameters of the delay power spectrum {2 , , , 1 } to the
channel parameters, namely the normalized received power, P0 , the Rician-K factor, K, and
the RDS, rms . The normalized received power P0 is the sum of the delay power spectrum for
20
all or,
Z m
P0 = lim h ( )d
m 0
Z m Z m
2
= lim ( )d + lim e d
m 0 m 0
= 2 + lim em 1
m
= 2 + . (2.30)
The Rician K-factor is the ratio of the dominant path to the scattered path and so
2
K=
P0 2
2
= 2
+ 2
2
= . (2.31)
Table 2.1 lists the parameters of the channel and the model and their relationship.
Our model uses an exponentially decaying delay power spectrum and as such has an
infinite domain thus we need a maximum excess delay. Though any max can be used, we will
set the maximum where the attenuation has decreased by 43 dB [21]. The maximum excess
delay is then max = 10/ (for the case when 1 6= 0, max = 1 + 10/).
In terms of the channel parameters we have
1
max = 10
K +1
= 10 rms . (2.32)
2K + 1
21
The noise shaping filter needs to have a transfer function, G( ), similar to the delay
power spectrum. In general, the noise shaping filter transfer function is defined by
1 if | | 1
|G( )| = (2.33)
e(| |1 ) if | | >
1
S( ) = 2 f, (2.35)
where f is the sampled interval (note that f must satisfy the sampling theorem with
respect to max ). The PSD at the output of the noise shaping filter is
After adding the Hilbert transform, the PSD increases by a factor of four,
SH ( ) = 4 2 f |G( )|
= h ( ). (2.37)
22
10
Magnitude [dB]
20
30
40
50
60
400 300 200 100 0 100 200 300 400
Exces Delay [ns]
Figures 2.16 and 2.17 show the channel transfer function and impulse response. As
expected, we see some deep fades in the transfer function and the impulse response has an
exponential decay.
23
10
Magnitude [dB]
20
30
40
50
60
0 50 100 150 200 250 300 350 400
Excess Delay [ns]
60
65
70
|H(f)|2 [dB]
75
80
85
90
95
0 100 200 300 400 500 600 700 800 900 1000
Frequency [MHz]
65
70
75
80
|h()|2 [dB]
85
90
95
100
105
110
115
20 0 20 40 60 80 100 120 140 160
Excess Delay [ns]
1000
800
PDF (|H(f)|)
600
400
200
0
0 0.5 1 1.5 2 2.5 3
Amplitude |H(f)| x 10
3
CHAPTER 3
MODULATION TECHNIQUES
There are two types of modulation in wireless communication, analog and digital.
Analog modulation takes an analog message signal at baseband and moves the signal
spectrum in the frequency domain. Digital modulation maps bits in the data stream to analog
waveforms that can be transmitted [7]. Only analog waveforms can be transmitted. The code
for the simulations and figures presented in htis chapter are found in Appendix B.
1
Refer to [19] for a detailed explanation of the repeated spectrum of the modulated signal.
28
Message
1
0.5
Amplitude
0
0.5
1
0 0.05 0.1 0.15 0.2 0.25
Time [sec]
Message Spectrum
0.5
0.4
Amplitude
0.3
0.2
0.1
0
100 80 60 40 20 0 20 40 60 80 100
Frequency [Hz]
Carrier Signal
1
0.5
Amplitude
0.5
1
0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 0.05
Time [sec]
Carrier Spectrum
0.5
0.4
Amplitude
0.3
0.2
0.1
0
500 400 300 200 100 0 100 200 300 400 500
Frequency [Hz]
0.5
Amplitude
0
0.5
1.5
0 0.05 0.1 0.15
Time [sec]
0.4
Amplitude
0.3
0.2
0.1
0
100 120 140 160 180 200 220 240 260 280 300
Frequency [Hz]
0.5
Amplitude
0
0.5
1.5
0 0.05 0.1 0.15
Time [sec]
0.4
Amplitude
0.3
0.2
0.1
0
100 120 140 160 180 200 220 240 260 280 300
Frequency [Hz]
We will assume that x(t) is a real signal so that Equations 3.4 and 3.5 describe the real
and imaginary parts of the Fourier transform.
Z
ReX(j) = x(t) cos(t)dt (3.4)
Z
ImX(j) = x(t) sin(t)dt. (3.5)
From Equation 3.4 we can see that the real part of the Fourier transform of a real signal is an
even function. Further, if x(t) is real and even, then
Z
ReX(j) = x(t) cos(t)dt
Z
=2 x(t) cos(t)dt (3.6)
0
31
ImX(j) = 0. (3.7)
Because the frequency spectrum of the signal is even symmetric, the spectrum can be
completely reconstructed with just the positive (or negative) frequencies. The advantage of
transmitting only the positive (or negative) frequencies is seen in the previous example.
As stated earlier, since the spectrum is even symmetric, the signal can be reconstructed
with the use of only the positive (or negative) frequencies. Transmitting the modulated
positive (or negative) frequencies of the signal reduces the required bandwidth and power
used.
One technique to remove the lower (or upper) half of the bandwidth uses the Hilbert
transform. This technique is usually implemented digitally with a band bass filter. There is
another option called vestigial sideband modulation (VSB) which transmits one complete half
of the spectrum plus a selected bandwidth from the other side. For analysis of SSB we present
the Hilbert transform next.
A signal with this property is called an analytic signal. We assumed that x(t) is a real signal,
thus the amplitude spectrum is even and the phase spectrum is odd [2]. However, an analytic
signal does not have an even symmetric amplitude spectrum. Therefore, an analytic signal, xa ,
must be complex and of the form in Equation 3.9.
We are requiring that X (j) = 0 for s /2 < 0 so Equations 3.12 and 3.13 become
2Re {X (j)} for 0 < < /2
s
X (j) = (3.14)
0 for s /2 < 0
and
2jIm {X (j)} for 0 < < s /2
X (j) = (3.15)
0 for s /2 < 0.
From Equation 3.9,
X(j) = Re {X(j)} + jIm {X(j)} (3.16)
and from Equations 3.16, 3.14, and 3.15,
jRe {X (j)} for 0 < < /2
s
X (j) = (3.17)
jRe {X (j)} for s /2 < 0
which can be written as
X(j) = H(j)Re {X(j)} (3.18)
where
j for 0 < < s /2
H (j) = (3.19)
j for s /2 < 0
Another way to see this is to write the Fourier transform of the analytic signal xa (t) as
2X(j) for 0 < < s /2
X(j) = X(j) for = 0 (3.20)
0
for /2 < 0
s
0.8
0.8
0.6
0.6 0.4
0.2
Magnitude
Magnitude
0.4
0
0.2
0.2
0 0.4
0.6
0.2
0.8
0.4 1
500 0 500 500 0 500
Frequency[Hz] Frequency[Hz]
1.8
1.6
1.4
1.2
0.8
0.6
0.4
0.2
0
500 400 300 200 100 0 100 200 300 400 500
Frequency[Hz]
where the sk are the M -ary signals and p(t) is the pulse shape with period T . Figure 3.6 shows
the constellation of PAM-4 and Figure 3.7 shows the PAM-4 signal using rectangular pulses.
In general, any pulse shape can be used, but for analysis assume that the pulse shapes
form an orthonormal family. That is,
Z
p(t kT )P (t mT )dt = km . (3.25)
35
0 T 2T 3T 4T 5T 6T 7T 8T 9T 10T
Symbol Period
0 T 2T 3T 4T 5T 6T 7T 8T 9T 10T
Symbol Period
and because the pulses p(t kT ) are an orthonormal family, the energy for each symbol is s2k .
2 2
Considering the distances shown in Figure 3.6 the symbol energy would be d 4k where d is the
distance between symbols and k = { 3, 1, 1, 3 . . . }. The expected symbol energy is
then
2
1 d
12 + 32 + + (M 1)2
Es = (2) (3.27)
M 4
d2
12 + 32 + + (M 1)2
= (3.28)
2M
d2 (M 2 1)
= . (3.29)
12
Demodulation of the received signal, r(t), is straight forward since the pulse shapes
P
form an orthonormal family. To recover the sk , where s(t) = k sk p(t kT ), the following
needs to be evaluated
Z
r(t) = s(t)p(t mT )dt (3.30)
Z X
= sk p(t kT )p(t mT )dt (3.31)
k
= sm (3.32)
The probability of symbol error increases as the distance between the constellation
points decreases, thus a decrease in the expected probability of symbol error will increase the
expected value of the symbol energy. Expected probability of symbol error is
M 1 d 1
Pe = erfc (3.33)
M 2 2
where is the standard deviation of the Gaussian noise and erfc() is the complementary error
function.
are the orthogonal basis functions; 1 (t) is called the in-phase component and 2 (t) the
quadrature component. Because both components are separate signals, the probability of bit
and symbol error for each component is the same as BPSK. The probability of being corect is
the probability of being correct in the first and second coordinates. Thus,
Pe = 1 (1 Pbe )2 (3.50)
= 1 1 + 2Pbe Pbe2 (3.51)
r ! r !
Es 1 Es
= erfc erfc2 (3.52)
2N0 4 2N0
r !
Es
erfc (3.53)
2N0
r !
Eb
= erfc . (3.54)
N0
So, the error rate for BPSK and QPSK are approximately the same. Using the Gray coding
scheme, the symbol error rate can be minimized. A symbol error in this scheme will most
likely only give a one bit error, as seen in Figures 3.8 and 3.9. With this scheme, the
probability of bit error is reduced to
r !
1 Es
Pbe erfc . (3.55)
2 2N0
x(t) = 2Re {u(t)} cos (2fc t) 2Im {u(t)} sin (2fc t) . (3.57)
The constellation diagram for 16-QAM is shown in Figure 3.10 with the minimum
two-dimensional distance between points d.
3/2d
d/2
Quadrature
d/2
3/2d
The average energy per symbol Es is twice the energy per symbol for PAM
d2 (M 2 1)
Es = 2 (3.58)
12
42
d2 (M 2 1)
= . (3.59)
6
The probability of bit error for M-QAM depends on the constellation diagram. Here
we see the bit-error probability for rectangular M-QAM, where M = 2k and k is even, in a
Gaussian channel using a matched filter at the receiving end
1 u !
v
2(1 ( M ) ) t 3 log2 M 2Eb
u
Pb Q (3.60)
log2 ( M ) M 1 N0
where Q[x] is the complimentary error function and Eb is the average bit energy[24].
The mapping of the bit blocks to the M-QAM symbols can have an effect on the
bit-error rate. To minimize the bit-errors when a symbol error is present, Gray coding is
employed. Gray coding is a means by which neighboring symbols differ by only one bit, as
seen in Figure 3.11 for 16-QAM. Demodulation of M-QAM is the reverse of the transmitter.
The incoming signal is multiplied by cos(2fc t) on one path and by sin(2fc t) on the other
path as seen in Figure 3.12.
For the received signal r(t) the demodulated signal on the top path is
The last term in equations 3.64 and 3.68 have frequency 4fc , which is higher than the
baseband signal u(t). After applying a low pass filter, the remaining signals are Re {u(t)} and
Im {u(t)}.
43
1
Quadrature
4
4 3 2 1 0 1 2 3 4
InPhase
CHAPTER 4
ORTHOGONAL FREQUENCY DIVISION
MULTIPLEXING
Orthogonal frequency division multiplexing (OFDM) is the vehicle that drives modern
digital communications. Its high spectral efficiency and resilience toward multipath distortion
has made possible the increased data rates required in many devices. It is used in many
systems including DSL, IEEE802.11a,g,n (Wi-Fi), digital radio, digital TV, IEEE802.16
(WiMAX), and 3g, 4g, and LTE cell services. OFDM was described by Robert Chang in [3] in
1966 but it wasnt until Weinstein and Ebert [28] presented a practical approach in 1971 that
OFDM was seen as a viable option. What put OFDM into commercial use was the FFT chip.
Before the digital implementation of OFDM via the FFT, communication systems required
banks of signal generators to produce the orthogonal channels. While the analog approach to
OFDM is insightful in analysis, it is expensive and impractical in commercial products.
In this chapter we will first look at the conventional single carrier system to have a
basis of comparison for the multicarrier system. We then look at a mathematical description
of OFDM before considering the implementation of OFDM. While this chapter tries to
generalize the concepts of OFDM, it is helpful to have a standard for simulation and practical
applications. To this end, the IEEE802.11 standard will be a guide in the implementation of a
communication system using OFDM. MATLAB code for the simulation and figures is
presented in Appendix C.
than the maximum delay, max . Figure 4.2 shows how the frequency selectivity and the power
delay spread can affect the transmitted symbol. Note the deep fades in the channel frequency
response. These portions of the signal will be lost and hence, the symbol, unless the equalizer
can remove the effects.
Figure 4.2. Single carrier system showing frequency response, power delay spectrum
and symbols.
Figure 4.4. Multiple carrier system showing frequency response, power delay spectrum
and symbols.
49
4.3.1 Modulation
Let W be the channel bandwidth and N the number of subcarriers. Then the
subchannel bandwidth is f = W/N and the effective symbol time is Ts = 1/f = N/W .
The subcarrier frequencies are fn = nf = n(W/N ) where the subcarrier spacing is
f = W/N , for n = 0, 1, . . . , N 1. For this analysis we will assume that the input bit
stream is from a complex set of points generated by an IQ modulation scheme like M-QAM.
We will define the basic pulse waveform as
1 ej2fn t if 0 t Ts for n = 0, 1, . . . , N 1
Ts
(t) = (4.1)
0 otherwise
which is the normalized rectangular pulse at frequency fn . Note that the inner product has the
property
1 1
Z
hn (t), m (t)i = ej2fn t ej2fm t dt
Ts Ts
1 j2t(fn fm )
Z
= e dt
Ts
R
1 Ts ej2t(0) dt for m = n
= Ts R0T
1 s j2t(fn fm )
e dt for m 6= n
Ts 0
Ts
t1s t0
for m = n
=
T s
= m,n . (4.2)
where k is the k th OFDM symbol, n is the nth subchannel and Xn,k is the k th M-QAM symbol
in the nth subchannel. The transmitted signal is then
X
S(t) = sk (t). (4.4)
k=
Because the channel has an infinite impulse response (IIR), all past symbols will contribute to
the current symbol.
where (t) is an additive Gaussian random process. To demodulate the nth OFDM symbol,
the received signal is correlated with the matched filter n (t). Because the pulses are
orthonormal, the correlation will be 0 for m 6= n and 1 for m = n. To recover the k th symbol
on the nth subcarrier
Z Ts
Xn,k = rk (t) (t)dt
0
Z Ts
= [sk (t) + (t)] n (t)dt
0
Z Ts N
X 1 Z Ts
= Xm,k m (t)n (t)dt + n (t)(t)dt
0 m=0 0
N
X 1 Z Ts
= Xm,k m (t)n (t)dt + n
m=0 0
= Xn,k + n . (4.6)
h(t, ) h( ). (4.7)
51
With this model, the received signal becomes
Z max
rk (t) = h( )sk (t )d + (t). (4.8)
0
The maximum delay, max , is the smallest delay such that the impulse response is zero for any
delay greater than max . That is
This parameter is important as any adjacent symbol transmitted with time interval
< max will interfere with the adjacent symbol. This is referred to as inter symbol
interference (ISI) and makes symbols difficult to resolve. One way to avoid this is to put a
guard interval or empty space between the symbols. The disadvantage in doing this is that the
subcarriers loose their orthogonality and create inter channel interference.
To retain the orthogonality but still maintain a guard interval, a cyclic prefix is used.
This technique takes a portion of the end of the symbol and cyclically shifts it to the front as
seen in equation 4.10 and Figure 4.5.
Real Part of 25% Cyclically Extnded OFDM Symbol Imaginary Part of 25% Cyclically Extended OFDM Symbol
1 1
0 0
1 1
Z Ts
Xn,k = rk (t)n (t)dt
0
Z Ts Z Tg
= h( )sk (t )d + (t) (t)dt
0 0
Z Ts "Z Tg N
X 1
#
= h( ) Xm,k m (t )d (t)dt + n
0 0 m=0
N 1 Ts Z Tg
1 j2fn (t )
X Z
= Xm,k h( ) e d (t)dt + n
m=0 0 0 Ts
N 1 Ts Z Tg
1 j2fn t
X Z
= Xm,k e (t)dt h( )ej2fn d + n
m=0 0 Ts 0
N
X 1
= Xm,k m,n H(fn ) + n
m=0
Recall that the channel is in terms of delay which is why the convolution is from
0 < < Tg . So, we are able to preserve the orthogonality of the subcarriers despite the delay
dispersive channel because of the cyclic prefix. Thus, equalization has been reduced to a
multiplying by 1/H(fn ), which is just the sample of the channel at the subcarrier frequency.
By considering the complexity involved in equalizing N subchannels in a delay dispersive
channel, the advantage of using OFDM is clear. There is, of course, a disadvantage to adding
a cyclic prefix in terms of power efficiency, but this is negligible when compared to the
reduction in equalizer complexity [21].
where x(n) is a sequence of complex numbers and the inverse DFT (IDFT) as
N 1
1 X n
x(n) = X(k)ej2k N for n = 0, ..., N 1. (4.13)
N k=0
The DFT is a sampled version of the Fourier transform and makes a DSP based Fourier
transform possible. Recall that in Section 4.3 we defined one OFDM symbol as
N
X 1
sk (t) = Xn,k n (t kTs )
n=0
N 1
1 X
= Xn,k ej2kfn (tkTs )
Ts n=0
N 1
1 X
Xn,k ej2k( N )(tkTs ) .
W
= (4.14)
Ts n=0
= N k,l . (4.15)
54
Thus, the IDFT can be used to modulate the sub-channels where the sub-channel
frequency is an integer number of cycles as shown in Figure 4.6 and Figure 4.7. The
DFT/IDFT is computed in O(N 2 ) operations when using equations 4.12 and 4.13. The
number of operations can be reduced by using efficient algorithms, the most common of
which being the Cooley-Tukey fast Fourier transform (FFT), which is a rediscovery of an
algorithm by mathematician Carl Frederich Gauss.
0 0 0
1 1 1
0 0.5 1 0 0.5 1 0 0.5 1
0 0 0
1 1 1
0 0.5 1 0 0.5 1 0 0.5 1
0 0 0
1 1 1
0 0.5 1 0 0.5 1 0 0.5 1
Using this algorithm, the number of computations can be reduced to O(N log N ) and
O( N2 log N ) for N a power of 2. Figure 4.8 shows an example of exciting the third frequency
55
0 0 0
1 1 1
0 0.5 1 0 0.5 1 0 0.5 1
0 0 0
1 1 1
0 0.5 1 0 0.5 1 0 0.5 1
0 0 0
1 1 1
0 0.5 1 0 0.5 1 0 0.5 1
The demodulation of the OFDM symbol is then the FFT of the received symbol which
outputs a sequence of complex numbers as seen in Figure 4.9.
We continue with the assumption made in Chapter 2 that the channel is stationary
during the transmission of at least one OFDM symbol. Using the impulse response of the
channel h(t) as in equation 2.13, we can define the received signal as the convolution of the
transmitted signal and the channel
Z max
rk (t) = h( )sk (t )d + (t). (4.16)
0
We must keep in mind that a cyclic prefix still needs to be added to the OFDM symbol to
avoid ISI. Let sk [n] be the cyclically extended k th OFDM symbol. Then
for the nth sub-carrier with N sub-carriers and cyclic prefix length Ncp and the received signal
is
N
X 1
The cyclic prefix needs to be removed before demodulation, which amounts to simply
selecting the correct samples, namely n = Ncp , . . . , N + Ncp 1. If we let rk [n] be the
OFDM symbol after the cyclic prefix has been removed, then demodulation yields
N 1
n
X
Xk [l] = rk [n]ej2l N
n=0
Ncp 1
N 1
!
n
X X
= h[m]sk [n m] + [n] ej2l N
n=0 m=0
Ncp 1 N 1
n
X X
= h[m] sk [n m]ej2l N + [l]
m=0 n=0
Ncp 1 N 1
nm
j2l m
X X
= h[m]e N sk [n m]ej2l N + [l]
m=0 n=0
Ncp 1
m
X
= h[m]ej2l N Xk [l] + [l]
m=0
58
where H[l] are the samples of the channel transfer function and [l] are samples of the
additive random Gaussian noise introduced by the channel. This is, of course, what we
expect, as the results should be consistent with the continuous case.
59
CHAPTER 5
SYNCHRONIZATION ERRORS AND
ESTIMATIONS
The most challenging aspect of designing a communication system is the estimation
and correction of synchronization errors that occur during transmission. Synchronization of
the system in time and frequency is still the source of much research and yet is one of the
most often overlooked subjects in published papers [8].
This chapter is divided into two sections. The first gives mathematical descriptions of
the synchronization errors present on OFDM systems. The effects of these errors on the
received signals are analyzed and simulations of the errors are presented whose code can be
found in Appendix D and Appendix E.
The second section describes the estimation of the errors at the receiver. Figure 5.1
shows the block diagram of the synchronization process of a typical receiver. Simulations of
the error estimations are presented using the IEEE802.11 standard for the OFDM frame
structure
N 1 Nc 1 N 1
1 XX X kl nk k
X[n] = h[l] X[m]ej2m N ej2 N ej2 N ej0
N k=0 l=0 m=0
N 1 Nc 1 N 1
1 X j2 k X X nm ml
= e N h[l] X[m]ej2k N ej2 N ej0
N k=0 l=0 m=0
N 1 N 1 N c 1
1 X j2 k X j2k nm
X ml
= e N X[m]e N h[l]ej2 N ej0
N k=0 m=0 l=0
61
N 1 N 1
1 X j2 k X nm
= e N X[m]H[m]ej2k N ej0
N k=0 m=0
N 1 N 1
X 1 X j2k (mn+) j0
= X[m]H[m] e N e
m=0
N k=0
N 1 N 1 N 1
1 X j2k j0 1 X X (mn+)
= X[n]H[n] e Ne + X[m]H[m] ej2k N ej0
N k=0 N m=0,m6=n k=0
j2
1 1e
= X[n]H[n] ej0
N 1 ej2 N
N 1
1 ej2(mn+) j0
1 X
+ X[m]H[m] (mn+)
e
N m=0,m6=n 1 ej2 N
1 ej
j
ej
e
= X[n]H[n] ej0
N ej N ej N ej N
N 1
ej(mn+) ej(mn+) ej(mn+) j0
1 X
+ X[m]H[m] (mn+) (mn+) (mn+)
e
N m=0,m6=n ej N ej N ej N
1
ej(1+ N ) sin()
= X[n]H[n] ej0
N sin( N )
N 1 j(mn+)(1+ 1
)
X e N
sin((m n + )) j0
+ X[m]H[m] e . (5.3)
m=0,m6=n
N sin (mn+)
N
The first summand in equation 5.3 is the desired demodulated symbol on the nth sub-carrier
with attenuation (sin()/sin(/N )) and phase rotations ej(1+1/N ) /N and ej0 . The
second addend is the contribution of the remaining N 1 sub-carriers with attenuation
(sin((m n + ))/sin ((m n + )/N )) and phase rotation ej(mn+)(1+1/N ) /N and
ej0 . This second summand results in ICI. Figure 5.2 shows the effects of a normalized carrier
frequency offset of = 0.05 and SNR=20dB on the constellation for 120 simulations of
transmitting one OFDM frame.
Figure 5.3 shows the effect of = 0.05 and SNR=20dB on the constellation for the
transmission of 120 OFDM symbols and Figure 5.4 shows the effect on the spectrum.
The coefficients for the second summand are called the ICI coefficients and are
described for the k th sub-carrier index as
1
!
ej(k+)(1+ N ) sin((k + ))
ICIN (k) = (5.4)
N sin( (k+) )
N
62
0.5
0.5
1.5
1.5 1 0.5 0 0.5 1 1.5
Figure 5.2. Effects of normalized carrier frequency offset = 0.05 and SNR=20dB for
120 simulations.
63
0.5
0.5
1.5
1.5 1 0.5 0 0.5 1 1.5
Figure 5.3. Effects of normalized carrier frequency offset = 0.05 and SNR=20dB on
the constellation for 120 OFDM Symbols.
64
1.5
0.5
0.5
1.5
2
40 30 20 10 0 10 20 30 40
Bin
Imaginary Part
2
1.5
0.5
0.5
1.5
2
40 30 20 10 0 10 20 30 40
Bin
Figure 5.4. Effects of normalized carrier frequency offset = 0.05 and SNR=20dB on
the spectrum for 120 OFDM Symbols.
65
and are shown in Figure 5.5 with = 0.5, 0.1, 0.05, 0.025. The power of the ICI is defined[25]
as
N
X 1
|ICIN (k)|2 (5.5)
k=1
and is shown in Figure 5.6 for = 0.05 for equations 5.4 and 5.5. Another helpful description
is the carrier-to-interference power ratio[25] (CIR), which is analogous to SNR, is defined as
|ICIN (0)|2
CIR = PN 1 2
(5.6)
k=1 |ICIN (k)|
=0.5
0 =0.1
=0.05
=0.025
10
20
Power [dB]
30
40
50
60
0 10 20 30 40 50 60
Subcarrier Index
10
15
Power [dB]
20
25
30
35
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Normalized Carrier Frequency Offset
90
80
70
60
CIR [dB]
50
40
30
20
10
0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5
Normalized Carrier Frequency Offset
0.2
0.1
0
Magnitude
0.1
0.2
0.3
0.4
0 10 20 30 40 50 60 70
Sample
Let T and T be the transmitter and receiver sampling periods respectively and
= T T
T
be the sampling period offset. The continuous time transmitted signal is then
Nf f t 1
1 X j2l t
sk (t) = X[l]e Nf f t T (5.7)
Nf f t l=0
T T
and the sampled signal at the output of the ADC with sampling period offset = T
is
r[nT ] = s[nT ]
Nf f t
1 X j2l NnT T
= X[l]e f f t
Nf f t l=0
Nf f t
1 X j2l
n(1+)
= X[l]e Nf f t T . (5.8)
Nf f t l=0
69
n=0
N f f t
l=0
Nf f t Nf f t
1 XX j2l n j2l n j2 Nnm
= X[l]e Nf f t e Nf f t e fft
Nf f t n=0 l=0
Nf f t Nf f t
1 XX (lm)
j2n N j2l Nn
= X[l]e fft e fft
Nf f t n=0 l=0
Nf f t Nf f t
1 XX (l(1+)m)
j2n N f t
= X[l]e f
Nf f t n=0 l=0
Nf f t Nf f t Nf f t
1 X j2n
(m(1+)m)
1 X X (l(1+)m)
j2n N f t
= X[m]e Nf f t
+ X[l]e f
Nf f t n=0 Nf f t n=0 l=0,l6=m
Nf f t
! !
1 1 ej2m 1 X 1 ej2(l(1+)m)
= X[m] j2 m
+ X[l] (l(1+)m)
Nf f t 1 e Nf f t Nf f t l=0,l6=m j2 N
1e fft
!
1 ejm ejm ejm
= X[m] j m j m
Nf f t e Nf f t e Nf f t e
Nf f t
!
j(l(1+)m) j(l(1+)m) j(l(1+)m
1 X e e e
+ X[l] (l(1+)m) (l(1+)m) (l(1+)m)
Nf f t l=0,l6=m j j j N
e Nf f t
e Nf f t
e fft
1 jm(1+ N 1 ) sin(m)
= X[m]e fft
Nf f t sin m Nff t
Nf f t
1 X j(l(1+)m) 1+ N 1
sin((l(1 + ) m)
+ X[l]e fft . (5.10)
Nf f t l=0,l6=m sin (l(1+)m)
Nf f t
As with frequency offset, we have the desired demodulated sub-carrier X[m] with attenuation
jm(1+ N 1 )
factor sin(m)/ sin (m/Nf f t ) and phase rotation e f f t . The attenuation is
dependent on sub-carrier index, sampling offset, and the number of sub-carriers. This would
suggest that as the sub-carrier index increases, the attenuation decreases and the phase
increases as shown in Figure 5.9.
Figures 5.10 and 5.11 show the effect of sampling clock offset on the constellation and
the spectrum with no offset, with 1% offset but no ICI, and with 1% offset and ICI.
70
0.5
1
Magnitude [dB]
1.5
2.5
3.5
4
0 10 20 30 40 50 60
Subcarrier Index
th
Phase Offset on k Subcarrier
1.5
Phase [Rad]
0.5
0
0 10 20 30 40 50 60
Subcarrier Index
Figure 5.9. Magnitude of attenuation and phase of 1% sampling period offset.
71
1.5 1.5
1 1
Quadrature
Quadrature
0.5 0.5
0 0
0.5 0.5
1 1
1.5 1.5
2 2
2 1 0 1 2 2 1 0 1 2
InPhase InPhase
1.5
1
Quadrature
0.5
0.5
1.5
2
2 1 0 1 2
InPhase
Nf f t
1 X j(l(1+)m) 1+ 1
Nf f t
sin((l(1 + ) m)
ICI [m] = X[l]e (5.11)
Nf f t l=0,l6=m sin (l(1+)m)
Nf f t
where the ICI caused by the lth index is dependent on the desired sub-carrier index m and the
sampling offset. To find the the power of the ICI, we assume that the X[k] are independently
identically distributed (iid) so that
E[X ] = 0
k
(5.12)
E[X X ] = 2 ,
k r k,r x
where x2 is the expected value of the power in the data symbols. The power of the ICI for the
mth demodulated sub-carrier is then
2
Nf f t
1 X
sin((k(1 + ) m))
E [ICI (m)ICI (m)] = 2 E[X[k]X [k]]
(5.13)
Nf f t k=0,k6=m sin (k(1+)m))
Nf f t
2
Nf f t
x2 X sin((k(1 + ) m))
= . (5.14)
Nf2f t
(k(1+)m))
k=0,k6=m sin
N
fft
Figure 5.12 shows the power of the noise due to ICI for both from equation 5.14 and
the simulation resulting in figures 5.10 and 5.11.
The signal to ICI power ratio is given by
|sk (t)|
SIR = (5.15)
E [ICI (m)ICI (m)]
and is seen in Figure 5.13 for the simulation that resulted in figures 5.10 and 5.11.
ICI Power
0
Theoretical
Simulated
2
8
Power [dB]
10
12
14
16
18
20
0 10 20 30 40 50 60
Subcarrier Index
35
30
Power [dB]
25
20
15
0 10 20 30 40 50 60
Subcarrier Index
where Zm [l] is the FFT of the additive Gaussian noise. Let the correct frame start time be
= 0. We assume without loss of generality that > 0 so that the frame includes both the
mth and the (m + 1)th OFDM symbol. The selected samples for the FFT window are
ym = rm [1], rm [2], , rm [Nf f t 1] and with the frame timing offset the selected samples
are ym = rm [], rm [ + 1], , rm [Nf f t 1], rm+1 [1], rm+1 [2], , rm+1 [Nf f t 1 + ]. After
a similar derivation, as that presented in section 5.1.2, the demodulated lth symbol of the mth
frame is
Nf f t j2 l
Xm [l] = Xm [l]Hm [l]e Nf f t
Nf f t
Nf f t 1
1 X X k(n+)nl
j2 N
+ Xm [k]Hm [k] e fft
Nf f t k=0,k6=l n=0
Nf f t 1 Nf f t 1
1 X X j2
k(n+)nl
+ Xm+1 [k]Hm+1 [k] e Nf f t
. (5.21)
Nf f t k=Nf f t Nf f t
The first term is the desired demodulated sub-carrier, but with an attenuation factor as well as
a phase rotation. The second term is the ICI component and the third the ISI. Figures 5.14 and
5.15 show the effect of symbol timing offset of = 8 for Nf f t = 64 and Nf f t = 256
respectively.
77
1.5
0.5
Quadrature
0.5
1.5
2
2 1.5 1 0.5 0 0.5 1 1.5 2
InPhase
1.5
0.5
Quadrature
0.5
1.5
2
2 1.5 1 0.5 0 0.5 1 1.5 2
InPhase
Figure 5.17 shows the case where the start time for the OFDM symbol is within the
cyclic prefix. In comparison with figures 5.14 and 5.15, only a phase rotation is present.
80
0.5
Quadrature
0.5
1.5
1.5 1 0.5 0 0.5 1 1.5
InPhase
Figure 5.17. Effects of symbol timing offset of = 8 for Nf f t = 64 with cyclic prefix and
ideal channel.
81
Figure 5.18 shows the constellation with multipath channel, cyclic prefix and frame
timing offset = 8. Notice that the ISI and ICI are not present as in Figure 5.14 but the
rotation of the constellation points and channel effects are present. Figure 5.19 shows the
spectrum of Figure 5.18 revealing the effect that the channel has.
1.5
0.5
Quadrature
0.5
1.5
2
2 1.5 1 0.5 0 0.5 1 1.5 2
InPhase
Figure 5.18. Effects of symbol timing offset of = 8 for Nf f t = 64 with cyclic prefix and
multipath channel.
82
1.5
0.5
0.5
1.5
2
40 30 20 10 0 10 20 30 40
Sample
1.5
0.5
0.5
1.5
2
40 30 20 10 0 10 20 30 40
Sample
Figure 5.19. Effects of symbol timing offset of = 8 for Nf f t = 64 with cyclic prefix and
multipath channel.
83
As before (section 5.1.2) the power in the ICI, ISI, and the combination of the two can
be found by taking the expected value
(Nf f t )
= x2 (5.24)
Nf f t
x2
= (5.27)
Nf f t
Total interference power = E[(ICI (l) + ISI (l))(ICI (l) + ISI (l)) ] (5.28)
x2 (2Nf f t )
= (5.29)
Nf f t
where as before x2 is the expected power of the received sub-carrier symbols. Figures 5.20
and 5.21 show the effects of ICI, ISI, and the total interference on the constellation for
Nf f t = 64 and Nf f t = 256. Notice that as Nf f t increases, the contribution of ICI and ISI
decreases as expected from the term 1/Nf f t in equation 5.21.
Comparing figures 5.20 and 5.14 where the start position is within region A, the cyclic
prefix, it is clear that the addition of the cyclic prefix has removed the effects of ISI and ICI
resulting in a constellation that is only affected by an attenuation and a rotation as expected
from equaiton 5.21. Figure 5.22 shows the power of the ICI, ISI, and total interference as a
function of for Nf f t = 64.
84
1.5
2
1
1
Quadrature
Quadrature
0.5
0 0
0.5
1
1
2
1.5
2 3
2 1 0 1 2 3 2 1 0 1 2 3
InPhase InPhase
1
0.5
Quadrature
Quadrature
0.5
0 0
0.5
0.5
1
1.5
1
2
1 0.5 0 0.5 1 2 1 0 1 2
InPhase InPhase
Figure 5.20. Effects of symbol timing offset of = 8 for Nf f t = 64 with no cyclic prefix
and ideal channel.
85
1.5
2
1
1
Quadrature
Quadrature
0.5
0 0
0.5
1
1
2
1.5
2 3
2 1 0 1 2 3 2 1 0 1 2 3
InPhase InPhase
1
0.5
Quadrature
Quadrature
0.5
0 0
0.5
0.5
1
1.5
1
2
1 0.5 0 0.5 1 2 1 0 1 2
InPhase InPhase
Figure 5.21. Effects of symbol timing offset of = 8 for Nf f t = 256 with no cyclic prefix
and ideal channel.
86
8
5
10
Power [dB]
Power [dB]
12
10
14
16
15
18
20 20
0 10 20 30 40 0 10 20 30 40
Offset [] Offset []
Total Interference
0
4
Power [dB]
10
12
14
16
0 5 10 15 20 25 30 35
Offset []
Figure 5.22. Power of ICI, ISI, and total interference for Nf f t = 64.
87
The repetition seen in Figure 5.24 is from the IFFT of the zero packed sequence in
equation 5.30. The zero packing has the effect of decreasing the symbol time by four, or
Nf f t /4, thus yielding the four copies in the time series. Thus, the short training symbols have
2.5 Nf f t symbols. In our application of OFDM, IEEE 802.11a/g, the bandwidth is 20M Hz
and the sample time is 1/20M HZ = 0.05s. If we set Nf f t = 64, as in IEEE802.11a, there
are 16 samples in the short training symbol and so the symbol time is 16 0.05s = 0.8s.
There are ten short training symbols which gives a total time of 8s.
The last two frames of the preamble contain the long training symbols which are used
for channel estimation and fine frequency acquisition. Figure 5.25 shows the spectrum of the
long training symbols.
The long training symbols are generated by taking the IFFT of the sequence
L26,26 = [1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
88
0.5
0.5
1.5
30 20 10 0 10 20 30
Frequency Bin
Imaginary Part
1.5
0.5
0.5
1.5
30 20 10 0 10 20 30
Frequency Bin
0 1 2 3 4 5 6 7 8
Time [ s]
Imaginary Part
0 1 2 3 4 5 6 7 8
Time [ s]
0.5
0.5
1.5
30 20 10 0 10 20 30
Frequency Bin
Imaginary Part
1.5
0.5
0.5
1.5
30 20 10 0 10 20 30
Frequency Bin
1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]. (5.31)
The lack of copies in the OFDM frames is from the lack of zero packing in equation 5.31 and
so the symbols have length Nf f t and, along with the added cyclic prefix, the total length of the
long training symbols is 2.5 Nf f t . Again, we set Nf f t = 64 so that the long training symbol
is 64 samples long. With a sample time of 1/20M HZ = 0.05s the long training symbol
time is 64 0.05s = 3.2s. There are two long training symbols and a cyclic prefix of
length 32 so the total time for the long training symbols is 2 3.2s + 32 0.05s = 8s.
Figure 5.26 shows the time series for the long training symbols with the cyclic prefix.
Figure 5.27 shows the time series of the complete preamble with 320 samples and
length 16s.
where A[n] is the output, r[n] is the received sequence, L is the length of one short symbol
and the length of the delay. There are several algorithms for coarse timing but all use the
correlation properties of the short training symbols. In this analysis, the delay and correlate
algorithm presented in [23] and [9] is used. Figure 5.28 shows the block diagram for this
algorithm.
The top path, P (d), contains the cross-correlator and the bottom path, R(d), contains
the auto-correlator. The value in the bottom path is to avoid division by zero. The
auto-correlator computes the power in the samples and is used to normalize the decision at the
threshold detector. The cross-correlator takes advantage of the periodicity in the short training
92
0 1 2 3 4 5 6 7 8
Time [ s]
Imaginary Part
0 1 2 3 4 5 6 7 8
Time [ s]
0 2 4 6 8 10 12 14 16
Time [ s]
Imaginary Part
0 2 4 6 8 10 12 14 16
Time [ s]
where L is the length of the register in the moving average and r(d) is the dth sample of the
received signal. M (d) is the output of the correlator normalized by the received power and
then tested against a threshold level. Squaring helps mitigate the effects of large peak to
average power ratios common in OFDM. Figure 5.29 shows the output of the correlator, the
received power and the threshold detector for the received signal in Figure 5.30. The signal
starts after the first 50 samples and because a length of 16 was used for the moving average
filter, the maximum value of the correlation and the power is not reached for 16 samples. Also
note that the timing estimate M (d) reaches a maximum at the 51st sample, which is the
correct timing.
One might wonder why the auto-correlation is used in determining the frame start
since the cross-correlation shows the symbol boundaries. The received signal will have a
carrier frequency offset as well as multipath interference and Gaussian noise. Figure 5.31
shows the effect of a 200kHz frequency offset and 7dB SNR on the time series input to the
delay and correlate algorithm.
Figure 5.32 shows the output of the cross-correlator, auto-correlator, and threshold
detector for a 200kHz frequency offset and 7dB SNR.
In both Figures 5.29 and 5.32, the falling edge of the packet detection can be
determined. Notice, however, that while in an ideal channel, Figure 5.29, the cross-correlation
function can also detect this edge simply by looking at the peak values while in a non-ideal
channel as in Figure 5.32, the peak values have changed and determining the frame timing
becomes difficult. For this reason the auto-correlation function is used to normalize the input
to the threshold detector. Even with poor channel conditions the frame is still detected,
although with a sample error. This sample error will need to be corrected with fine timing, or
symbol timing estimation.
10 10
5 5
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Sample Sample
0.5
0
0 50 100 150 200 250
Sample
Figure 5.29. Output of the cross-correlator, the auto-correlator, and the threshold
detector.
96
0.15
0.1
0.05
0.05
0.1
0.15
0.2
0 50 100 150 200 250 300 350 400
Imaginary Part
0.2
0.15
0.1
0.05
0.05
0.1
0.15
0.2
0 50 100 150 200 250 300 350 400
0.15
0.1
0.05
0.05
0.1
0.15
0.2
0 50 100 150 200 250 300 350 400
Imaginary Part
0.2
0.15
0.1
0.05
0.05
0.1
0.15
0.2
0 50 100 150 200 250 300 350 400
Figure 5.31. Time series of preamble with SNR 7dB and frequency offset 200kHz.
98
10 10
5 5
0 0
0 50 100 150 200 250 0 50 100 150 200 250
Sample Sample
0.5
0
0 50 100 150 200 250
Sample
Figure 5.32. Output of the cross-correlator, the auto-correlator, and the threshold
detector with SNR 7dB and frequency offset 200kHz.
99
The maximum frequency offset allowed in the IEEE 802.11a standard (section
17.3.9.4) [12] is 20ppm for carrier frequencies between 5.15 5.825GHz. This means that
the maximum frequency offset between transmitter and receiver (for carrier frequency
5.825GHz) is
Hence any algorithm used to estimate and correct frequency offset needs to operate with this
amount of offset.
Suppose the received signal is
where x(t) is the transmitted signal and f is the frequency offset. As stated previously, the
short training symbols have a length of 16 samples or 0.8s. Then the output of the conjugate
product from the correlation of the signal and the delayed copy is
or about 107ppm at 5.825GHz, much greater than the allowable frequency offset. By
comparison, using the long training symbols, the detectable frequency offset is
f = 1
(5.46)
2(64) 20GHz
= (5.47)
2(3.2s)
= 156kHz (5.48)
100
or about 13ppm, much less than what is allowed. This is why the short training symbols are
used for the coarse estimation and correction before using the long training symbols for fine
frequency estimation and correction. Figure 5.33 shows the frequency estimation algorithm.
Consider the example where the frequency offset is 200kHz. Figure 5.34 shows the
estimated phase of the received signal using the short training symbols where a 16 sample
delay is seen in the output. The poor phase estimation in the long training symbol portion is
because the algorithm uses a delay length of 16 where the long training symbols have a length
of 64. Figure 5.34 also shows the phase estimation using the long training symbols where a
delay of 64 samples occurs. The effects of frequency offset and correction on the time series
is shown in Figure 5.35
The previous example did not incorporate a phase locked loop (PLL) but instead the
phase estimation of the entire preamble was computed and the average of the phase error was
applied to the entire series. This is an impractical implementation because of the delay in
waiting for the entire preamble to arrive. We now consider an example which uses a PLL with
the same 200kHz frequency offset. By trial and error the values n = 2/49 and = 2/2
were found making ki = 0.0594 and kp = 0.1638. The output of the phase detector and the
output of the loop filter are shown in Figure 5.36.
The accumulated phase of the variable controlled oscillator (VCO) and the VCO
output are shown in Figure 5.37. Notice that the frequency is correctly estimated but there is a
phase offset in the VCO output. This is referred to as residual frequency offset and is dealt
with using the pilot symbols.
Lastly, the constellation of the received signal with and without frequency offset
compensation is seen in Figure 5.38. The phase offset seen in the VCO output is also seen in
the corrected constellation.
101
0.5
0 50 100 150 200 250 300 350
Phase Estimation After Course Frequency Correction With Short Training Symbols
0.5
0.5
0 50 100 150 200 250 300 350
x 10
16 Phase Estimation of Long Training Symbols After Coarse Frequency Corretion
0
6
180 200 220 240 260 280 300 320
x 10
16 Phase Estimation After Fine Frequency Corretion With Long training Symbols
0
6
180 200 220 240 260 280 300 320
0.2
0 50 100 150 200 250 300 350
Recieved Signal With Frequency Offset of 200[KHz]
0.2
0.2
0 50 100 150 200 250 300 350
Received Signal After Course Frequency Correction
0.2
0.2
0 50 100 150 200 250 300 350
Received Signal After Fine Frequency Correction
0.2
0.2
0 50 100 150 200 250 300 350
Figure 5.35. Time series with and without frequency offset correction.
103
0.008
0.006
0.004
0.002
0
0 20 40 60 80 100 120 140 160
0.06
0.05
0.04
0.03
0.02
0.01
0
0 20 40 60 80 100 120 140 160
8
Radians
0
0 100 200 300 400 500 600 700 800 900 1000
1
0 100 200 300 400 500 600 700 800 900 1000
1
0 100 200 300 400 500 600 700 800 900 1000
0.5
The first peak corresponds to the end of the cyclic prefix and the other two peaks
correspond to the ends of the two long training symbols which have the same length as the
OFDM symbol.
107
0.5
Quadrature
0.5
1.5
1.5 1 0.5 0 0.5 1 1.5
InPhase
where Z is the noise. Here we take advantage of the property of Fourier transforms, that
convolution in the time domain corresponds to the product in the frequency domain. As stated
in Chapter 2, it is assumed that the channel is stationary during each transmitted packet. We
have then, setting Z[k] = 0,
Y [k]
H[k] = . (5.52)
X[k]
In this way, the channel can be estimated but only if the transmitted signal is known. To this
end, the long training symbols are used. Recall that the long training symbols use all
sub-carriers (except DC) so that all used sub-carrier equalizer gains are found. Equation 5.52
describes the channel frequency response for each sub-carrier but the inverse is needed to
counter its effects:
It is common to average the equalizer gains over the two long training symbols to help
mitigate the effects of the noise. Figure 5.41 shows the channel frequency response and the
channel estimation using the above method. Notice that the noise in the channel affects the
estimation. Figure 5.42 shows the received constellation after the channel estimation has been
applied to Figure 5.40.
10
20
|H[f]|2 [dB]
30
40
50
60
30 20 10 0 10 20 30
Frequency bin
0.5
Quadrature
0.5
1.5
1.5 1 0.5 0 0.5 1 1.5
InPhase
P0..126v = {1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1} (5.55)
The algorithm for tracking frequency is similar to that of course frequency estimation.
After baseband demodulation, the pilots are extracted and the phases of the pilots are
compared to the phases of the previous pilots. The phase offset is sent to a loop filter, then to a
VCO, and multiplied to the input of the FFT. Appendix G further discusses the phase lock
loop and Appendix H contains MATLAB code to simulate the PLL. Figure 5.44 shows one
possible residual phase tracking configuration.
CHAPTER 6
MULTIPLE INPUT MULTIPLE OUTPUT
One of the first uses of multiple antennas was in 1901 when Guglielmo Marconi used
multiple transmit antennas to transmit the Morse symbol S (three short dots) from Poldhu,
Cornwall, England, to Signal Hill in St. Johns Newfoundland, a distance of 2,200 miles. The
multiple antennas transmitted the same signal in a scheme called spacial diversity. In the
1940s, submarines began experimenting with active sonar. Multiple sound transmitters were
used with delays added, allowing certain areas to be covered. This is called beamforming and
is a type of space-time diversity.
Though multiple antennas have been used for some time, standards such as
IEE802.11n (Wi-Fi) and IEEE802.16 (WiMAX) have brought the technology to consumer
products. The technology has made possible the increased throughput required for many
applications and takes advantage of the ubiquitous wireless multipath channel. Multiple input
multiple output (MIMO)1 not only increases quality of service but can achieve data rates near
channel capacity, and thus using the bandwidth more efficiently. The increase in quality of
service means an increase in the coverage area via increased SNR.
In this chapter, we will explore MIMO using the IEEE802.11n standard for illustrating
the implementation in a realizable system. The three areas of interest that will be discussed
include space-time coding (STC), spatial division multiplexing (SDM), and transmit
beamforming.
The convolutional coder is a finite state machine with assumed initial null state and as
such, has two diagrams to show the state transitions. The four state convolutional encoder
114
shown in Figure 6.2 is described by the state diagram shown in Figure 6.3 and the trellis
diagram as seen in Figure 6.4. Unlike the state diagram, the trellis diagram adds a time
component showing the output and states for a given input; a red line represents an input of
one and a black line an input of zero. Each path of the trellis diagram corresponds to an
encoded sequence.
Both the state and trellis diagrams show two branches to and from each state and it can
be shown that for a convolutional encoder with m memory elements there are 2m branches at
each of the 2m states. Also note that not all state transitions are possible, hence only certain
paths can exist. It is this feature that will be exploited to decode the received bit stream.
115
Since two symbols are transmitted during two time periods, the coding scheme has
rate 1. Thus, for the antenna scheme in Figure 6.7, the received signals are
y1 = H 1 s 1 + H 2 s 2 + 1 (6.1)
y2 = H1 s2 + H2 s1 2 , (6.2)
where yk is the received signal for the k th antenna, Hk is the multipath channel from the k th
transmit antenna, and i is the additive noise for the ith symbol period.
At the receiver, the received signal is demodulated with the FFT after the removal of
the cyclic prefix and each subchannel undergoes decoding. The two received symbols for the
nth subchannel are
y 1 = a1 x 1 + a2 x 2 + 1 (6.3)
y2 = a1 x2 + a2 x1 + 2 , (6.4)
where yl is the received symbol on the nth subcarrier from the lth OFDM symbol, xm is the
mth symbol, ak is the flat fading channel gain for the nth subcarrier from antenna k, and is
117
as before. Rewriting as vectors we have
" #
h i x
1
y 1 = a1 a2 + 1 (6.5)
x2
" #
h i x
2
y 2 = a1 a2 + 2 (6.6)
x1
(6.7)
Thus, we have
" # " #
x1 1 y1
= AH A AH
(6.13)
x2 y2
" 1
# " # " #!
2 2 0 x1 1
= |h1 | +|h2 | 1
A H
A + (6.14)
0 |h1 |2 +|h2 |2
x2 2
" # " #
x1 1 1
+ AH A AH .
= (6.15)
x2 2
For the case of two receive antennas, as seen in Figure 6.8, the received symbols for
th
the n subcarrier on antenna 1 are
" # " #" # " #
y11 a11 a12 x1 n11
= + (6.16)
y21 a21 a22 x2 n12
118
Both schemes show the need for an accurate channel estimation to find the channel
inverse. This is discussed in section 6.5.
In Figure 6.9, the most likely path is the path whose metric is lowest, which is in red.
At each time interval the Hamming distance is computed as the number of bits in error from
the received bits and the output of the encoder between states. Note that for t 3, each state
has two previous states in common. This is where the branch metrics are compared and the
lowest is chosen. In the event that both branch metrics are the same, as is the case for state
(11) at t = 4 in Figure 6.9, the path can be chosen randomly or by a constant decision such as
the top or bottom path. The (10) state at t = 5 has the lowest accumulated error so starting
from this state the decoder traces back following the lowest branch metric. The progression of
states from t = 0 to t = 5 is 00, 10, 11, 11, 01, 10. Table 6.2 shows the state transitions and the
input to the convolutional encoder.
Thus, the most likely input sequence was 1, 1, 1, 0, 1 with one received error. In this
example the trellis diagram for the entire sequence was computed but in practice this is not
practical for long sequences as this will increase the amount of delay. The length of the trellis
used is called the traceback depth and it is clear from the example at t = 1 that too short of a
traceback depth causes errors in the decoding. The general rule is a traceback depth of five
121
times the constraint length and depths greater than this do not see much improvement in
performance. The exact traceback or decision depth is found by simulation in practice
although analytic traceback techniques exist based on the free distance. If puncturing is
applied, the traceback depth is increased to 7 to 9 times the constraint length.
Es
where N 0
is the symbol signal to noise ratio. The width of the decision regions is N 0 2k
where k is the bit precision and N0 is the noise PSD. The branch and path metrics are
computed with the three bit values and the add, compare, and select (ACS) algorithm of the
hard decision decoder is applied. Figure 6.11 shows a comparison of the hard and soft
decision decoders.
110>6
101>5
100>4
Output
011>3
010>2
001>1
000>0
3D 2D 1D 1D 2D 3D
Input decision level
Figure 6.10. Input/output relationship for 3 bit quantizer.
123
BER for Binary Convolutional Code with Viterbi decoding for BPSK in AWGN
Theoretical Uncoded
Simulation Hard Viterbi
Simulation Soft Viterbi
1
10
2
10
Bit Error Rate
3
10
4
10
5
10
0 1 2 3 4 5 6 7 8 9 10
Eb/No [dB]
As seen in Figure 6.12, both the D-BLAST and the V-BLAST encoders demultiplex
the incoming bit stream into parallel substreams using a serial to parallel conversion where
each substream is then encoded separately. For V-BLAST, the substreams are then transmitted
on separate antennas, but for D-BLAST, the substreams are distributed across the different
antennas in layers.
The decoding process for D-BLAST is more computationally intensive than that of
V-BLAST and increases in computational load with increasing number of transmit
antennas[6]. Notice that at t = 0 only one antenna is transmitting so receiving the symbol is
straight forward. At t = 1 the next symbol in the layer (substream) has interference from a
second antenna. Receiving the second symbol in the layer requires the use of minimum mean
square error (MMSE) or zero forcing nulling (ZF-nulling) to ignore the symbol interference
from the next layer [6]. The process continues until the layer has been received and then is
decoded. This decoded layer is then subtracted from the next layer and the process continues.
It is vital that the decoding of the layer is error free as it affects the decoding of the successive
layers. Because the layer cannot be decoded until all the symbols in the layer are received a
delay is introduced and there is a loss in capacity at the startup.
The decoding process for V-BLAST is less computationally intensive and involves
three basic steps: filtering, slicing, and cancellation. If channel coding is used in conjunction
125
with V-BLAST, then the demodulated symbols must be buffered until the block can be
decoded. Several other types of decoders that can be used such as the maximum likelihood
(ML) decoder, zero forcing (ZF), and minimum mean square error (MMSE). An iterative
method can also be applied by ordereing the spatial streams by SNR. The stream with the
highest SNR is decoded first, treating the others as noise and then is canceled so the next
highest SNR stream can be decoded [29].
6.4 B EAMFORMING
Some of the earliest examples of beamforming were seen in sonar where multiple
transmit arrays would employ delays to direct the coverage area to the intended target. By
directing the coverage area in wireless devices, the number of users can be increased as
coverage can be extended or shaped to include only certain users as needed and the
interference from multiple users can be reduced as seen in Figure 6.13. Beamforming is an
option in the IEEE802.11n standard [15] and other communication standards like IEEE802.16
(WiMAX). Future amendments to IEEE802.11 will include beamforming as a means to
achieving data rates in the multi Gbps [20].
There are several ways to achieve beamforming but here we consider a technique
where each transmit antenna transmits the same signal at the same frequency but with a phase
shift. As an example, suppose we have the three transmit antennas in the configuration seen in
Figure 6.14.
We want to find the contribution from each antenna to the point A in Figure 6.14:
q q
2 2 2 2
S(, r) = s0 (r) + s1 x1 + y1 + 1 + s 2 x2 + y2 + 2 (6.27)
q q
= s0 (r) + s1 (d r cos )2( r sin )2 + 1 + s2 (r cos 2d)2( r sin )2 + 1
(6.28)
(N 1)/2 p
X
= sn (r cos nd)2 + (r sin )2 + n . (6.29)
n=(N 1)/2
In equation 6.29, S(, r) is the signal strength at the point (, r) from the center antenna, sn ()
is the signal strength from the nth antenna, N is the number of antennas (here it must be odd),
and n is the time delay for the nth antenna. Figure 6.15 demonstrates the signal strength for
three and five antenna configurations. For convenience n = n1 , that is, the delays are
integer multiples of 1 .
3 Antennas, Distance = 10, Relative phase delay = 10 3 Antennas, Distance = 10, Relative phase delay = 40
90 90
1 1
120 60 120 60
0.8 0.8
0.6 0.6
150 30 150 30
0.4 0.4
0.2 0.2
180 0 180 0
270 270
5 Antennas, Distance = 5, Relative phase delay = 25 5 Antennas, Distance = 5, Relative phase delay = 40
90 90
1 1
120 60 120 60
0.8 0.8
0.6 0.6
150 30 150 30
0.4 0.4
0.2 0.2
180 0 180 0
270 270
Figure 6.15. Signal strength for (a) three antennas, distance 10, and relative phase delay
10, (b) three antennas, distance 10, and relative phase delay 40, (c) five antennas,
distance 2, and relative phase delay 25, and (d) five antennas, distance 5, and relative
phase delay 40.
128
estimate the channel, but this was for the single-input single-output case. Here we consider a
scheme also using training symbols for the multiple input multiple output case as seen in
Figure 6.16.
where X is the frequency domain symbol, H is the channel frequency response and Z is the
frequency response of the noise. The channel estimate is then
Y [k]
H[k] = (6.31)
X[k]
and the inverse of the channel estimate is then
2
H[k] = H[k]H [k] (6.32)
H [k]
H 1 [k] = . (6.33)
2
H [k]
As before, to find the estimate of the channel, the transmitted symbol must be known at the
receiver. Again, we use the long training symbols but there are two techniques to implement
them. The first is to transmit one training symbol on each transmitter as seen in Figure 6.17.
The procedure for extracting the channel estimates is then reduced to two SISO channel
estimates.
129
The second is to transmit the even frequency bins from antenna one and the odd
frequency bins from antenna two. Then in the next symbol period transmit the odd frequency
bins from antenna one and the even frequency bins from the antenna two, as seen in
Figure 6.18. To extract the channel estimates, the same procedure is employed as with the
SISO channel, with the exception that even and odd frequency bins need to be taken into
account.
CHAPTER 7
CONCLUSION
This thesis presented an introduction to MIMO-OFDM, specifically, the topics of the
channel, OFDM, synchronization, and MIMO. Mathematical descriptions of the channel,
OFDM, and synchronization, were given as well as MATLAB simulations to verify, illustrate
concepts, or present a practical implementation. Chapter two detailed the effects present in a
wireless multipath channel and the importance of the channel model. To that end, a frequency
domain channel model was given and simulated for the wireless multipath fading channel.
Chapter three briefly reviewed some of the modulation schemes used in digital
communications and used throughout this thesis. Chapter four gave a comparison of single
carrier systems and multicarrier systems as the motivation for OFDM. Mathematical
definitions were presented on modulation and demodulation in the presence of a channel. This
gave a basis for understanding the synchronization errors common to OFDM.
In Chapter five, a detailed discussion of synchronization errors was presented.
Mathematical descriptions of the errors and simulations of the errors were presented to
illustrate the effect that timing and frequency offsets have on the uncoded constellations. The
second half of Chapter five showed how the synchronization errors could be estimated at the
receiver and corrected. For each type of synchronization error, algorithms were presented and
implemented in a MATLAB simulation. As an extension to OFDM, Chapter six presented
MIMO as a way to increase performance in a communication system. Three topics were
showcased along with examples of each. Space time coding techniques such as convolutional
codes and the Alamouti algorithm were shown to increase the reliability by transmitting
multiple copies. Both had coding gains but the Alamouti scheme also introduced spatial gain.
A maximum likelihood detector, the Viterbi decoder, was also presented as a way to decode
the convolutional encoder. Two types of spatial multiplexing, D-BLAST and V-BLAST, were
shown to be an effective way to increase the overall data rate by transmitting multiple
independent streams. Lastly, beamforming was introduced as a way to direct the coverage
area. In this way, more users can be serviced by the reduction of interference from multiple
users. It is hoped that after reading this thesis the reader has a better understanding of channel
models, MIMO-OFDM, the effects of the channel on OFDM, and the ways in which errors
are estimated and corrected.
This thesis aimed to be an introductory look into OFDM. Future systems will include
MIMO-OFDM and, as such, there is a lot of research being done in this area. One of the
131
assumptions made about the channel was that it was static. While this assumption works well
for standards such as IEEE802.11, it does not work well for cell phones and other wireless
devices. In the future, we may see many devices that must be able to operate at speeds were
Doppler shifts affect data transmission.
Another consideration is the techniques used in space time coding. Turbo codes and
low density parity-check codes are now replacing convolutional codes. Also, only the 2x2
MIMO case was considered for STBCs.
132
BIBLIOGRAPHY
APPENDIX A
MATLAB CODE FOR CHANNEL MODELING
136
1 %% ---------------------------------------------------------
2 % Steven Hemple
3 % channel1.m
4 %
5 % This MATLAB script plots the recieved energy as a function
6 % of distance thus describing the effects of path loss.
7 %-----------------------------------------------------------
8 clear all;
9 close all;
10 clc;
11
12 Screen 0=[550,10,800,650];
13 Screen 1=[1400,10,800,650];
14 Screen 2=[1360,-310,1920,1024];
15 Position=Screen 0;
16 Plots=1;
17 %% ---------------------------------------------------------
18 % Parameters
19 % ----------------------------------------------------------
20 d1=0.026438:.001:100;
21 d2=0.000001:.001:.05;
22 c=2.99*108;
23 f=900*106;
24 lamda=c/f;
25 B=[1 1 1 1 1];
26 theta=[0 0 0 0 0];
27 W=1;
28 T=1/(W);
29 freq=0:.001:W;
30 H=zeros(1,length(f));
31 %% ---------------------------------------------------------
32 % Free space path loss model for large distances
33 % ----------------------------------------------------------
34 L1=20*log10(((4*pi.*d1*f)/c));
35 figure('position',Position)
36 subplot(1,2,1)
37 plot(d1,-L1)
137
38 grid on;
39 axis([-10 100 -80 10]);
40 title({['Free Space Path Loss'];...
41 ['as a Function of Distance']},'FontSize',16);
42 xlabel('Distance [m]');
43 ylabel('Magnitude [dB]');
44
45 %% ---------------------------------------------------------
46 % Free space path loss model for small distances
47 % ----------------------------------------------------------
48 L2=20*log10(((4*pi.*d2*f)/c));
49 subplot(1,2,2)
50 plot(d2,-L2)
51 grid on;
52 axis([-.005 0.05 -10 100]);
53 title({['Free Space Path Loss Model'];...
54 ['as a Function of Distance'];...
55 ['For Small Distances.']},'FontSize',16);
56 xlabel('Distance [m]','FontSize',12);
57 ylabel('Magnitude [dB]','FontSize',12);
58
59
60 %% ---------------------------------------------------------
61 % Doppler shift as a function of antenna speed and angle
62 % relative to the transmit antenna
63 % ----------------------------------------------------------
64 f c=900*106;
65 c=2.99*108;
66 v=[0:2.25:100];
67 angle=linspace(-pi,pi,length(v));
68 [X,Y]=meshgrid(v,angle);
69 Z=X/c* f c. *cos(Y);
70
71 figure('position',Position)
72 surf(X,Y,Z)%,'EdgeColor','none')
73 colormap(jet);
74 hold on
75 x=0:.01:100;
76 y=-pi/2*ones(1,length(x));
77 z=zeros(1,length(x));
78 plot3(x,y,z,'-.k','linewidth',2)
79 plot3(x,-y,z,'-.k','linewidth',2)
80 plot3(zeros(1,length(x)),y,linspace(-400,0,length(x)),...
81 '-.k','linewidth',2)
138
82 plot3(zeros(1,length(x)),-y,linspace(-400,0,length(x)),...
83 '-.k','linewidth',2)
84 title('Doppler Shift as a Function of Speed and Angle ...
85 Relative to Transmit Antenna'...
86 ,'FontSize',16)
87 xlabel('Speed [m/s]','FontSize',12);
88 ylabel('Angle [Radians]','FontSize',12);
89 zlabel('Doppler Shift [Hz]','FontSize',12)
90 set(gca,'YTick',-pi:pi/2:pi)
91 set(gca,'YTickLabel',{'-pi','-pi/2','0','pi/2','pi'})
92
93 %% ---------------------------------------------------------
94 % Generate the channel transfer function
95 %-----------------------------------------------------------
96 for i=1:length(B)
97 H=H+B(i)*exp(-1j*2*pi.*freq*(i*T)+theta(i));
98 end
99 figure('position',Position)
100 plot(freq/W-0.5,20*log10(fftshift(abs(H))))
101 hold on
102 plot([-0.5 0.5],...
103 [20*log10(max(abs(H))/2) 20*log10(max(abs(H))/2)],'r')
104 axis([-0.5 0.5 -40 20]);
105 hold off
106 grid on
107 title({['Channel Transfer Function for'];...
108 ['\beta k=1 and \theta k=0']},'FontSize',16)
109 xlabel('Normalized Frequency f/fsym [Hz]','FontSize',12)
110 ylabel('Magnitude2 [dB]','FontSize',12);
111 mTextBox = uicontrol('style','text');
112 set(mTextBox,'String','-6dB');
113 set(mTextBox,'Position',[380 450 60 30]);
114 set(mTextBox,'BackgroundColor','w');
115 set(mTextBox,'Fontsize',12);
116
117 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
119
126 % waveforms.
127 % ----------------------------------------------------------
128 clc;
129 clear all;
130 close all;
131
147 %% ---------------------------------------------------------
148 % Calculate superposition of waveforms for phase differences
149 % of {0, pi/8, pi/4, pi/2, 3pi/4, pi}.
150 % ----------------------------------------------------------
151 d=[0 pi/8 pi/4 pi/2 3*pi/4 pi];
152 for i=1:length(d)
153 if d(i)==0
154 a=('Full Wavelength');
155 elseif d(i)==pi/8
156 a=('1/16 Wavelength');
157 elseif d(i)==pi/4;
158 a=('1/8 Wavelength');
159 elseif d(i)==pi/2
160 a=('1/4 Wavelength');
161 elseif d(i)==3*pi/4
162 a=('3/8 Wavelength');
163 elseif d(i)==pi
164 a=('1/2 Wavelength');
165 else
166 a=('');
167 end
168
169 t=0:.01:10;
140
170 f=sin(2*pi*.5.*t);
171 g=sin(2*pi*.5.*t-d(i));
172 h=f+g;
173
174 figure('position',Position)
175 subplot(2,1,1)
176 plot(t,f,'LineWidth',3)
177 grid on
178 hold on
179 plot(t,g,'--r','LineWidth',2)
180 grid on
181 title({['Two Waveforms With Phase Difference ',a,'.']},...
182 'FontSize',16)
183 set(gca, 'XTick', [])
184 subplot(2,1,2)
185 plot(t,h,'k','LineWidth',2)
186 grid on
187 set(gca, 'XTick', [])
188 set(gca,'Ylim',[-2 2]);
189 title('The Received Waveform','FontSize',16)
190 end
191
192 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
193 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
194
195 %% ---------------------------------------------------------
196 % Steven Hemple
197 % Thesis Simulations
198 % FDmodel.m
199 %
200 % This MATLAB script usees the frequency domain channel
201 % model presented in Ramjee Prasad's text. Pararmeters were
202 % chosen from the texts observed data.
203 % ----------------------------------------------------------
204 clc;
205 clear all;
206 close all;
207
222 %% ---------------------------------------------------------
223 % Parameters of the channel
224 % Sim num = Number of simulations
225 % N = Length of transfer function
226 % W = Sampling frequency [Hz]
227 % P 0 dB = Normalized Received Power [dB]
228 % K dB = Rician K-factor [dB]
229 % tau RMS = RMS Delay Spread [s] (Second Central
230 % Moment or Standard deviation)
231 % tau 1 = End of constant part of DPS [s]
232 % ----------------------------------------------------------
233 Sim num=3000;
234 N=801;
235 W=1e9;
236 P 0 dB=-62.1;
237 K dB=-1.9;
238 tau rms=9e-9;
239 tau 1=0;
240
241 %%----------------------------------------------------------
242 % Convert channel parameters to simulation parameters
243 %
244 % P 0 = magnitude of P 0
245 % K = magnitude of K
246 % gamma = The decay exponent of the exponentially
247 % decaying part of DPS [Hz]
248 % PI = The normalized power density of constant part
249 % of DPS [Hz]
250 % f = frequency bin lengths [Hz]
251 % sigma sqrd= variance of real valued noise samples
252 % rho sqrd = Normalized power of the direct ray
253 % psi = Normalized power of scatterd components
254 % tau max = Maximum excess delay
255 % T = Sample time
256 % nTot = Number of samples in half bandwidth
257 % n1 = tau 1 the constant level edge of DPS
142
270
271 %% ---------------------------------------------------------
272 % Generate theoretical delay power spectrum
273 %
274 % { 1 | tau | | tau | tau 1
275 % G(tau)={
276 % { exp(-gamma ( | tau | -tau 1) | tau|>tau 1
277 %
278 % Simulation has TF and DPS with length N=801
279 %
280 % f =Normalized frequencies
281 % a =Theoretical delay power spectrum
282 % w =Weights for filter using least squares
283 % g =Filter using least squares
284 % ht =Filter for Hilbert transform
285 % ha =Channel impulse response
286 % H =Channel frequency response
287 %
288 % ----------------------------------------------------------
289 n end=(N-1)/2;
290 n 1=round(tau 1/ T)+1;
291 n 2=round(tau max/ T)+1;
292
306 g=firls(180,f,a,w);
307 g=g/sum(g);
308
309 G=fftshift((fft(g,N)));
310 if Plots
311 figure('name','Channel Simulation- Delay Power Spectrum',...
312 'position',Position')
313 plot(1:length(a),20*log10(a),'-.b','linewidth',4)
314 hold on
315 plot(-(N-1)/2:(N-1)/2,20*log10(abs(G)),'r',...
316 'linewidth',2)
317 axis([-400 400 -60 10]);
318 title('Delay Power Spectrum','FontSize',16)
319 xlabel('Exces Delay [ns]','FontSize',12)
320 ylabel('Magnitude [dB]','FontSize',12)
321 h=legend('Theoretical','Simulated');
322 set(h,'FontSize',12);
323 end
324 % Hilbert Transform by low pass filter
325 ht=firls(560,[0.007 .99],[1 1],'hilbert');
326
327 h=conv(ht,g*max(g)/.125);
328 H=fftshift(abs(fft(h,N)));
329
330 if Plots
331 figure('name',...
332 'Channel Simulation- Causal Noise Shapping Filter',...
333 'position',Position')
334 plot(1:length(a1),20*log10(a),'-.b','linewidth',4)
335 hold on
336 plot(-(N-1)/2:(N-1)/2,20*log10(([-H(1:(N-1)/2)...
337 H((N-1)/2+1:end)]+H)),'r','linewidth',2)
338 axis([-5 400 -60 10]);
339 title('Causal Noise Shapping Filter','FontSize',16)
340 xlabel('Excess Delay [ns]','FontSize',12)
341 ylabel('Magnitude [dB]','FontSize',12)
342 h=legend('Theoretical','Simulated');
343 set(h,'FontSize',12);
344 end
345
144
346 %% ---------------------------------------------------------
347 % Gnenerate noise with parameters from channel
348 % ----------------------------------------------------------
349 H f=zeros(Sim num,N);
350
361 end
362
367 if Plots
368 figure('name','Channel Simulation- Channel Transfer Function',...
369 'position',Position')
370 plot((0:length(h1)-1)/(length(h1)-1)*1000,...
371 20*log10(abs(H)))
372 title('Channel Transfer Function','FontSize',16);
373 xlabel('Frequency [MHz]','FontSize',12);
374 ylabel(' | H(f)|2 [dB]','FontSize',12);
375
376 figure('name',...
377 'Channel Simulation- Phase of Channel Transfer Function',...
378 'position',Position')
379 plot((0:length(h1)-1)/(length(h1)-1)*1000,angle(H))
380 title('Phase of Transfer Function','FontSize',16);
381 xlabel('Frequency [MHz]','FontSize',12);
382 ylabel('Phase of H(f)','FontSize',12);
383
384
390 hold on
391 plot((0:(N-1)/2)/(N*F)*109,...
392 20*log10(abs(channel((N-1)/2+1:end))))
393 axis([-25 160 -115 -60]);
394 title('Channel Impulse Response','FontSize',16)
395 xlabel('Excess Delay \tau [ns]','FontSize',12)
396 ylabel(' | h(\tau)|2 [dB]','FontSize',12)
397
398 figure('name',...
399 'Channel Simulation- Normalized PDF Of Transfer...
400 Function Amplitudes','position',Position')
401 bar(xout,n/(sum(n)*(xout(2)-xout(1))))
402 hold on
403 plot(xout,p/(sum(p)*(xout(2)-xout(1))),'r',...
404 'linewidth',2)
405 title('Normalized PDF of Transfer Function Amplitudes',...
406 'FontSize',16)
407 xlabel('Amplitude | H(f ) | ','FontSize',12)
408 ylabel('PDF \rho ( | H(f)|)','FontSize',12)
409 h=legend('Simulated','Theoretical');
410 set(h,'FontSize',12);
411 end
146
APPENDIX B
MATLAB CODE FOR MODULATION
147
1 %% -- AM.m -------------------------------------------------
2 % MATLAB Thesis Simulation
3 % Steven Hemple
4 %
5 % This MATLAB script will simulate double side band AM and
6 % double side band supressed crrier AM transmission.
7 % ----------------------------------------------------------
8 clc;
9 clear all;
10 close all;
11
27 %% ---------------------------------------------------------
28 % Parameters
29 %
30 % t =Time
31 % M =Amplitude of message
32 % fm =Frequency
33 % m =Message
34 % A =Carrier frequency amplitude
35 % fc =Carrier center frequency
36 % c =Carrier waveform
37 % tx =Modulated message
148
38 % ----------------------------------------------------------
39 t=0:1/4096:1-1/4096;
40 M=1;
41 fm=40;
42 m=M*cos(2*pi*fm.*t);
43 A=1;
44 fc=200;
45 c=cos(2*pi*fc.*t);
46 tx=(A+m).*c;
47
48 %% ---------------------------------------------------------
49 % Time series and spectrum of signal
50 % ----------------------------------------------------------
51 figure('position',Position)
52 subplot(2,1,1)
53 plot(t,m)
54 title('Message','FontSize',16)
55 xlabel('Time [sec]','FontSize',12)
56 ylabel('Amplitude','FontSize',12)
57 axis([0 0.25 -1.1 1.1])
58
59 Mfft=fftshift(abs(fft(m,4096)));
60 subplot(2,1,2)
61 plot(4096*(-0.5:1/4096:0.5-1/4096),Mfft/4096)
62 title('Message Spectrum','FontSize',16)
63 xlabel('Frequency [Hz]','FontSize',12)
64 ylabel('Amplitude','FontSize',12)
65 axis([-100 100 0 .55])
66
67 %% ---------------------------------------------------------
68 % Carrier time series and spectrum
69 % ----------------------------------------------------------
70 figure('position',Position)
71 subplot(2,1,1)
72 plot(t,c)
73 title('Carrier Signal','FontSize',16)
74 xlabel('Time [sec]','FontSize',12)
75 ylabel('Amplitude','FontSize',12)
76 axis([0 .05 -1.1 1.1]);
77
78 C=fftshift(abs(fft(c,4096)));
79 subplot(2,1,2)
80 plot(4096*(-0.5:1/4096:0.5-1/4096),C/4096)
81 title('Carrier Spectrum','FontSize',16)
149
82 xlabel('Frequency [Hz]','FontSize',12)
83 ylabel('Amplitude','FontSize',12)
84 axis([-500 500 0 .55])
85
86 %% ---------------------------------------------------------
87 % Double side band AM modulation time series and spectrum
88 % ----------------------------------------------------------
89 figure('position',Position)
90 subplot(2,1,1)
91 plot(t,tx)
92 title('Double Side Band Full Carrier (DSB-AM)','FontSize',16)
93 xlabel('Time [sec]','FontSize',12)
94 ylabel('Amplitude','FontSize',12)
95 axis([0 .15 -1.5 1.5]);
96
97 TX=fftshift(abs(fft(tx,4096)));
98 subplot(2,1,2)
99 plot(4096*(-0.5:1/4096:0.5-1/4096),TX/4096)
100 title('Modulated Signal Spectrum','FontSize',16)
101 xlabel('Frequency [Hz]','FontSize',12)
102 ylabel('Amplitude','FontSize',12)
103 axis([100 300 0 .55])
104
105 %% ---------------------------------------------------------
106 % Double side band supressed carrier AM modulation time
107 % series and spectrum
108 %
109 % A =Carrier amplitude (supressed)
110 % tx =Modulated signal (supressed carrier)
111 % ----------------------------------------------------------
112 A=0;
113 tx=(A+m).*c;
114 figure('position',Position)
115 subplot(2,1,1)
116 plot(t,tx)
117 title('Double Side Band Suppressed Carrier (DSB-SC)','FontSize',16)
118 xlabel('Time [sec]','FontSize',12)
119 ylabel('Amplitude','FontSize',12)
120 axis([0 .15 -1.5 1.5]);
121
122 TX=fftshift(abs(fft(tx,4096)));
123 subplot(2,1,2)
124 plot(4096*(-0.5:1/4096:0.5-1/4096),TX/4096)
125 title('Modulated Signal Spectrum','FontSize',16)
150
130 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
131 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
132
159 %% ---------------------------------------------------------
160 % Parameters
161 % b =Number of bits per symbol
162 % M =Number of symbols in PAM
163 % fs =Sampling frequency
164 % u =Random symbols
165 % s =Samples per bit
166 % Tb =Period of bit
167 % m =Counter
168 % fc =Carrier frequency
169 % ----------------------------------------------------------
151
170 b=2;
171 M=2b;
172 fs=8000;
173 u=zeros(1,fs);
174 s=800;
175 Tb=fs/s;
176 m=1;
177 fc=40;
178
179 %% ------------------------------------------------------------------------
180 % Constellation for PAM-M
181 %--------------------------------------------------------------------------
182 x1=-M/2:M/2;
183 x1(M/2+1)=[];
184 x1(1:M/2)=x1(1:M/2)+0.5;
185 x1(M/2+1:M)=x1(M/2+1:M)-0.5;
186 figure('position',Position)
187 h=plot(x1,zeros(1,length(x1)),'ok');
188 set(h,'MarkerSize',15);
189 set(h,'MarkerFaceColor','k');
190 mTextBox = uicontrol('style','text');
191 set(mTextBox,'String','10');
192 set(mTextBox,'Position',[635 280 30 30]);
193 set(mTextBox,'BackgroundColor','w');
194 set(mTextBox,'Fontsize',16);
195 mTextBox = uicontrol('style','text');
196 set(mTextBox,'String','11');
197 set(mTextBox,'Position',[477 280 30 30]);
198 set(mTextBox,'Fontsize',16);
199 set(mTextBox,'BackgroundColor','w');
200 mTextBox = uicontrol('style','text');
201 set(mTextBox,'String','01');
202 set(mTextBox,'Position',[323 280 30 30]);
203 set(mTextBox,'Fontsize',16);
204 set(mTextBox,'BackgroundColor','w');
205 mTextBox = uicontrol('style','text');
206 set(mTextBox,'String','00');
207 set(mTextBox,'Position',[165 280 30 30]);
208 set(mTextBox,'BackgroundColor','w');
209 set(mTextBox,'Fontsize',16);
210
211 hold on
212 plot([-M/2:M/2],zeros(1,M+1),'k')
213 plot(zeros(1,3),[-1:1],'k')
152
214 set(gca,'XTick',-1.5:2);
215 set(gca,'XTickLabel',{'-3d/2' '-d/2' 'd/2' '3d/2'})
216
217 set(gca,'YTick',[]);
218 title({'Constellation For Four Level PAM';...
219 'With Gray Coding'},'FontSize',16)
220 xlabel('Constellation Distance','FontSize',12);
221 %%-------------------------------------------------------------------------
222 % Generate random sequence of symbols
223 %--------------------------------------------------------------------------
224 for i=1:s:length(u)
225 data=randi([-M/2,M/2]);
226 while data==0 % Don't want zero as a symbol
227 data=randi([-M/2,M/2]);
228 end
229 if m>1
230 while data==u(m-1) | | data==0
231 data=randi([-M/2,M/2]);
232 end
233 end
234 u(m:m+s-1)=data;
235 m=m+s; % Skip s samples (samples per bit)
236 end
237
238 figure('position',Position)
239 subplot(2,1,1)
240 plot((0:length(u)-1)/800,u,'r')
241 grid on
242 set(gca,'XTick',0:10);
243 set(gca,'XTickLabel',...
244 {'0' 'T' '2T' '3T' '4T' '5T' '6T' '7T' '8T' '9T' '10T'})
245 set(gca,'YTick',-2:2);
246 ylabel('Signal Amplitude','FontSize',12);
247 xlabel('Symbol Period','FontSize',12);
248 axis([-0.25 10.25 -M/2-0.5 M/2+0.5]);
249 title({'Baseband PAM Signal';...
250 'With Rectangular Pulse Period T'},'FontSize',16)
251 subplot(2,1,2)
252 c=cos(2*pi*fc.*1/fs*(0:length(u)-1));
253 x=u.*c;
254 plot((0:length(u)-1)/800,x)
255 hold on
256 plot((0:length(u)-1)/800,u,'--r')
257 set(gca,'XTick',[0:10]);
153
258 set(gca,'XTickLabel',...
259 {'0' 'T' '2T' '3T' '4T' '5T' '6T' '7T' '8T' '9T' '10T'})
260 set(gca,'YTick',-2:2);
261 ylabel('Signal Amplitude','FontSize',12)
262 axis([-0.25 10.25 -M/2-0.5 M/2+0.5]);
263 grid on
264 title({'Bandpass PAM Signal With Rectangular Pulse...
265 Period T And';'Carrier Frequency 4 Cycles Per...
266 Period'},'FontSize',16)
267 xlabel('Symbol Period','FontSize',12);
268
269 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
270 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
271
299 %% ---------------------------------------------------------
300 % Parameters
301 %
154
311 %% ---------------------------------------------------------
312 % BPSK
313 % ----------------------------------------------------------
314 M=2;
315 m=1:M;
316 x=sqrt(e p/2)*cos(2*pi/M.*(m-1));
317 y=sqrt(e p/2)*sin(2*pi/M.*(m-1));
318 t=(0:256)*2*pi/256;
319
320 figure('position',Position)
321 plot( cos(t), sin(t),'r');
322 axis('square')
323 hold on
324 plot(x,y,'o','MarkerFaceColor','b','MarkerSize',12)
325 mTextBox = uicontrol('style','text')
326 set(mTextBox,'String','0')
327 set(mTextBox,'Position',[240 340 30 15])
328 mTextBox = uicontrol('style','text')
329 set(mTextBox,'String','1')
330 set(mTextBox,'Position',[560 340 30 15])
331 set(gca,'XTick',[]);
332 set(gca,'YTick',[]);
333 axis([-2 2 -2 2])
334
340
341 %% ---------------------------------------------------------
342 % QPSK
343 % ----------------------------------------------------------
344 M=4;
345 m=1:M;
155
349 figure('position',Position)
350 t=(0:256)*2*pi/256;
351 plot( cos(t), sin(t),'r');
352 axis('square')
353 hold on
354 plot(x,y,'o','MarkerFaceColor','b','MarkerSize',12)
355 mTextBox = uicontrol('style','text')
356 set(mTextBox,'String','00')
357 set(mTextBox,'Position',[280 230 30 15])
358 mTextBox = uicontrol('style','text')
359 set(mTextBox,'String','11')
360 set(mTextBox,'Position',[520 420 30 15])
361 mTextBox = uicontrol('style','text')
362 set(mTextBox,'String','01')
363 set(mTextBox,'Position',[280 420 30 15])
364 mTextBox = uicontrol('style','text')
365 set(mTextBox,'String','10')
366 set(mTextBox,'Position',[520 230 30 15])
367 axis([-2 2 -2 2])
368 set(gca,'XTick',[]);
369 set(gca,'YTick',[]);
370 line([0 0], [-2 2],'color','k')
371 line([-2 2], [0 0],'color','k')
372 title({'Signal Constellation for QPSK';...
373 'With Gray Encoding'},'FontSize',16);
374
375 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
376 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
377
395 %% ---------------------------------------------------------
396 % Parameters
397 %
398 % M =Number of symbols in constellation
399 % rc =Nummber of rows and columns in constellation
400 % b =Number of bits per symbol
401 % snr =Signal to noise ratio
402 % ----------------------------------------------------------
403 M=42;
404 rc=sqrt(M);
405 b=log2(M);
406 snr=8;
407
408 %% ---------------------------------------------------------
409 % Generate the row and column locations for the
410 % constellation
411 % ----------------------------------------------------------
412 x=[-rc+1:2:rc-1]; % Compute x-coords of the constellation
413 y=[-rc+1:2:rc-1]; % Compute y-coords of the constellation
414 x cor=x;
415 y cor=y;
416
417 %% ---------------------------------------------------------
418 % Generate the row vectors of the x and y coordinates of
419 % each symbol
420 %
421 % Create a length M vector of x and y coordinates for all
422 % constellation points
423 % ----------------------------------------------------------
424 for i=1:rc-1
425 x cor=[x cor; x];
426 y cor=[y cor; y];
427 end
428 X=reshape(x cor',1,M);
429 Y=reshape(y cor,1,M);
430
431 %% ---------------------------------------------------------
432 % Plot the constellation for M-QAM
433 % ----------------------------------------------------------
157
434 figure('name',...
435 'Thesis OFDM Simulation- Channel Transfer Function',...
436 'position',Position)
437 h=plot(X,Y,'ok');
438 axis([-rc-1 rc+1 -rc-1 rc+1]);
439 title({['Constellation Diagram For Rectangular ',...
440 num2str(M), '-QAM']},'FontSize',16);
441 xlabel('In-Phase','FontSize',12)
442 ylabel('Quadrature','FontSize',12)
443 set(h,'MarkerSize',15);
444 set(h,'MarkerFaceColor','k');
445 r=[225 350 475 600];
446 c=[185 300 415 530];
447 s=[2 6 14 10;3 7 15 11;1 5 13 9;0 4 12 8];
448
449 hold on
450 plot([0 0],[-5 5],'k')
451 plot([-5 5],[0 0],'k')
452 plot([-2 -2],[-5 5],'-.k')
453 plot([2 2],[-5 5],'-.k')
454 plot([-5 5],[-2 -2],'-.k')
455 plot([-5 5],[2 2],'-.k')
456 axis([-4 4 -4 4])
457 axis('square')
458 set(gca,'XTick',[-3 -1 0 1 3],'YTick',[-3 -1 0 1 3])
459 set(gca,'XTickLabel',{'-3/2d','-d/2', '0','d/2','3/2d'})
460 set(gca,'YTickLabel',{'-3/2d','-d/2', '0','d/2','3/2d'})
461 arrow([-3 1],[-1 1],'width',2)
462 arrow([-1 1],[-3 1],'width',2)
463 mTextBox=uicontrol('style','text');
464 set(mTextBox,'String','d');
465 set(mTextBox,'FontSize',16);
466 set(mTextBox,'Position',[252 415 15 25]);
467 set(mTextBox,'BackgroundColor',[1 1 1]);
468 arrow([-1 1],[-1 3],'width',2)
469 arrow([-1 3],[-1 1],'width',2)
470 mTextBox=uicontrol('style','text');
471 set(mTextBox,'String','d');
472 set(mTextBox,'FontSize',16);
473 set(mTextBox,'Position',[310 456 15 25]);
474 set(mTextBox,'BackgroundColor',[1 1 1]);
475
476 %% ---------------------------------------------------------
477 % Gray codingfor M-QAM
158
478 % ----------------------------------------------------------
479 figure('position',Position)
480 h=plot(X,Y,'ok');
481 axis([-rc-1 rc+1 -rc-1 rc+1]);
482 title({['Gray Coding For Rectangular ',...
483 num2str(M), '-QAM']},'FontSize',16);
484 xlabel('In-Phase','FontSize',12)
485 ylabel('Quadrature','FontSize',12)
486 set(h,'MarkerSize',15);
487 set(h,'MarkerFaceColor','k');
488 r=[90 225 350 475];
489 c=[185 320 455 585];
490 s=[2 6 14 10;3 7 15 11;1 5 13 9;0 4 12 8];
491 for i=1:length(r)
492 for ii=1:length(c)
493 mTextBox = uicontrol('style','text');
494 set(mTextBox,'String',dec2bin(s(ii,i),4));
495 set(mTextBox,'Position',[c(i) r(ii) 60 30]);
496 set(mTextBox,'BackgroundColor','w');
497 set(mTextBox,'Fontsize',18);
498 end
499 end
500 hold on
501 plot([0 0],[-5 5],'k')
502 plot([-5 5],[0 0],'k')
503 plot([-2 -2],[-5 5],'-.k')
504 plot([2 2],[-5 5],'-.k')
505 plot([-5 5],[-2 -2],'-.k')
506 plot([-5 5],[2 2],'-.k')
507 axis([-4 4 -4 4])
508 axis('square')
159
APPENDIX C
MATLAB CODE FOR OFDM
160
27 %% -- Parameters -------------------------------------------
28 %
29 % N =Transform length
30 % x =Input to IFFT (in serial to parallel form)
31 % g =Number of bin outputs to graph
32 % cp =Number of samples in cyclic prefix
33 % ----------------------------------------------------------
34 N=26;
35 g=9;
36 cp=floor(0.25*N);
37 x=diag(ones(1,N));
161
38
60 figure('name',...
61 'Thesis OFDM Simulation- Imaginary Part of IFFT Output',...
62 'position',Position)
63 for nn=1:g
64 subplot(sqrt(g),sqrt(g),nn);
65 plot(0:1/N:1-1/N,N*imag(Y(:,nn)));
66 title({[num2str(nn-1),' Cycles per Interval']});
67 axis([0 1 -1.1 1.1]);
68 axis('square');
69 set(gca,'YTick',[-1 0 1]);
70 end
71 figure(2)
72 [ax4,h3]=suplabel('Imaginary Part of 64-Point IFFT Output...
73 For Frequency Bins 0-8','t');
74 set(h3,'FontSize',16);
75
76 figure('name',...
77 'Thesis OFDM Simulation- Real Part of IFFT Output',...
78 'position',Position)
79
80 stem(0:N-1,N*real(Y(:,4)),'r','LineWidth',2)
81 hold on
162
101 figure('name',...
102 'Thesis OFDM Simulation- Imaginary Part of IFFT Output'...
103 ,'position',Position)
104 stem(0:N-1,N*imag(Y(:,4)),'LineWidth',2)
105 hold on
106 plot([0 0],[-.05 0],'k','LineWidth',3);
107 plot([63 63],[0 .05],'k','LineWidth',3);
108 plot([-1 64],[0 0],'k','LineWidth',3);
109 plot(0:N-1,N*imag(Y(:,4)),'-.k','LineWidth',2)
110 hold off
111 axis([-1 N -1.1 1.1])
112 set(gca,'YTick',[]);
113 set(gca,'XTick',[])
114 mTextBox=uicontrol('style','text');
115 set(mTextBox,'String','0');
116 set(mTextBox,'FontSize',14);
117 set(mTextBox,'Position',[100 355 15 20]);
118 set(mTextBox,'BackgroundColor','w');
119 mTextBox=uicontrol('style','text');
120 set(mTextBox,'String','63');
121 set(mTextBox,'FontSize',14);
122 set(mTextBox,'Position',[655 360 23 20]);
123 set(mTextBox,'BackgroundColor','w');
124 %% -- OFDM Demodulation ------------------------------------
125 x=fft(Y(:,4));
163
126 figure('name',...
127 'Thesis OFDM Simulation- Real Part of FFT Output'...
128 ,'position',Position)
129 stem(real(x'),'r')
130 set(gca,'XTick',[1 4 54 64])
131 set(gca,'XTickLabel',{'0','3','k','63'})
132 axis([0 65 -0.05 2])
133 set(gca,'cameraupvector',[-1 0 0]);
134 set(gca,'YTick',[]);
135
136 figure('name',...
137 'Thesis OFDM Simulation- Imaginary Part of FFT Output'...
138 ,'position',[685,85,750,740])
139 stem(imag(x'))
140 set(gca,'XTick',[1 4 54 64])
141 set(gca,'XTickLabel',{'0','3','k','63'})
142 axis([0 65 -0.05 2])
143 set(gca,'cameraupvector',[-1 0 0]);
144 set(gca,'YTick',[]);
145
146
160
166 plot(0,0,'w')
167 hold on
168 axis([-0.1 79.1 -1.2 1.2])
169 rectangle('Position',[N, -1.2, cp-1, 2.4],...
164
201 plot(0,0,'w')
202 hold on
203 axis([-0.1 79.1 -1.2 1.2])
204 rectangle('Position',[N, -1.2, cp-1, 2.4],...
205 'FaceColor',[0.9 0.9 0.9])
206 rectangle('Position',[0, -1.2, cp-1, 2.4],...
207 'FaceColor',[0.9 0.9 0.9])
208 plot(0:N+cp-1,64*imag(Y cp))
209 axis([-0.1 79.1 -1.2 1.2])
210 arrow([N 0],[cp-1 0],'Width',3)
211 arrow([cp-1 1.1],[N+cp-1 1.1])
212 arrow([N+cp-1 1.1],[cp-1 1.1])
213 arrow([0 1.1],[cp-1.1 1.1])
165
234
235
239 plot(0,0,'w')
240 hold on
241 axis([-0.1 79.1 -1.2 1.2])
242 rectangle('Position',[N, -1.2, cp-1, 2.4],...
243 'FaceColor',[0.9 0.9 0.9])
244 rectangle('Position',[0, -1.2, cp-1, 2.4],...
245 'FaceColor',[0.9 0.9 0.9])
246 stem(0:N+cp-1,N*real(Y cp),'r')
247
302 set(mTextBox,'FontSize',14);
303 set(mTextBox,'Position',[400 650 65 20]);
304 set(mTextBox,'BackgroundColor','w');
168
APPENDIX D
MATLAB CODE FOR SYNCHRONIZATION
169
27 %% -- Parameters -------------------------------------------
28 %
29 %
30 % ----------------------------------------------------------
31 frames=120;
32 Nfft=64;
33 bins=52;
34 cp=16;
35 M=16;
36 num=log2(M);
37 x4=[];
170
38
39 Epsilon=0.05;
40
41 SNR=20;
42 Theta=0.0;
43 x3save=[];
44 x4 save=[];
45
82 reg2a=fftshift(fft(reg1a))/4;
83 reg3=[reg2((-26:-1)+Nfft/2+1) reg2((1:26)+Nfft/2+1)];
84 reg3a=[reg2a((-26:-1)+Nfft/2+1) reg2a((1:26)+Nfft/2+1)];
85 reg4(nn,:)=reg2;
86 reg4a(nn,:)=reg2a;
87 reg5(nn,:)=reg3;
88 reg5a(nn,:)=reg3a;
89 end
90 figure('name','Thesis Frequency Offset Simulation- ...
91 Constellation Diagram With Offset','position',Position)
92 plot(reg5a,'ro')
93 grid on
94 title({['Constellation of ',num2str(M),...
95 '-QAM with Normalized CFO of \epsilon=',...
96 num2str(Epsilon)];['for ',num2str(frames),...
97 ' Simulations of Transmitting One Frame']},...
98 'FontSize',16)
99 axis([-1.5 1.5 -1.5 1.5])
100 axis('square')
101 hold on
102 plot(sqrt(2)*1/3*exp(1j*2*pi*(0:0.01:10)),'k')
103 plot(sqrt(10)/3*exp(1j*2*pi*(0:0.01:10)),'k')
104 plot(sqrt(2)*exp(1j*2*pi*(0:0.01:10)),'k')
105
120
124 subplot(2,1,1)
125 plot(-32:31,real(reg4),'rx')
172
126 grid on
127 xlabel('Bin','Fontsize',12)
128 title('Real Part','FontSize',12)
129
130 subplot(2,1,2)
131 plot(-32:31,imag(reg4),'bx')
132 grid on
133 xlabel('Bin','Fontsize',12)
134 title('Imaginary Part','FontSize',12)
135
170 Epsilon=0:0.01:0.5;
171 x=1:63;
172 ICI Power=[];
173 for nn=Epsilon
174 ICI Power=[ICI Power;sum(abs(exp(1j*pi*(x+nn)*...
175 (1+1/Nfft))/Nfft.*((sin(pi*(x+nn)))./...
176 (sin(pi*(x+nn)/Nfft)))).2)];
177 end
178 figure('name','Thesis Frequency Offset Simulation-...
179 ICI Coefficients','position',Position)
180 plot(Epsilon,10*log10(ICI Power))
181 hold on
182 plot(Epsilon,10*log10(((pi*Epsilon).2)/3),'-xr')
183 axis([0 0.5 -35 0])
184 grid on
185 xlabel('Normalized Carrier Frequency Offset','FontSize',12);
186 ylabel('Power [dB]','FontSize',12);
187 title('ICI Power Resulting From Frequency Offset',...
188 'FontSize',16);
189 legend('Theoretical','Approximation','location','northwest')
190
191 k=1:Nfft-1;
192 den=[];
193 num=[];
194 t=0.00001:0.001:0.5;
195 for nn=t
196 num=[num abs(exp(1j*pi*(nn)*(1+1/Nfft))/Nfft.*...
197 ((sin(pi*(nn)))./(sin(pi*(nn)/Nfft)))).2];
198 den=[den sum(abs((exp(1j*pi*(k+nn)*(1+1/Nfft))/Nfft)...
199 .*(sin(pi*(k+nn))./sin(pi*(k+nn)/Nfft))).2)];
200 end
201
214
215 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
216 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
217
258 (1-exp(1j*2*pi*k*epsilon/Nfft)));
259
260 atten(1)=1;
261 figure('name','Thesis Sample Clock Offset Simulation-...
262 Spectrum','position',Position)
263 hold on
264 for t=1:numSims
265 x1=(floor(num*rand(1,Nfft))-(num-1)/2)/((num-1)/2)...
266 +1j*(floor(num*rand(1,Nfft))-(num-1)/2)/((num-1)/2);
267
268
269 % Demodulate
270 y=ifft(x1);
271 y1=fs*ifft(x1,Nfft*fs);
272
273 y1=y1(1:sampOffset:end);
274 y1=[y1 zeros(1,Nfft-length(y1))];
275 Y=fft(y,Nfft);
276 Y1=fft(y1,Nfft);
277
278 ici=Y1-x1.*atten;
279 iciPower=iciPower+abs(ici/sqrt(2)).2;
280 sigPower=sigPower+abs(x1.*atten).2;
281
282
283
284 subplot(3,1,1)
285 plot(0:Nfft-1,real(Y),'rx')
286 grid on
287 hold on
288 subplot(3,1,2)
289 plot(0:Nfft-1,real(Y.*atten),'rx')
290 hold on
291 grid on
292 subplot(3,1,3)
293 plot(0:Nfft-1,real(Y1),'rx')
294 hold on
295 grid on
296 end
297
304 subplot(3,1,2)
305 title({['Sample Clock Offset of ',num2str(epsilon*100),...
306 '% With No ICI']},'FontSize',12)
307 axis([0 64 -1.5 1.5])
308
309 subplot(3,1,3)
310 xlabel('Sub-carrier Index','FontSize',12)
311 title({['Sample Clock Offset of ',num2str(epsilon*100),...
312 '% With ICI']},'FontSize',12)
313 axis([0 64 -3 3])
314 [ax,h3]=suplabel('Effects of Sample Clock Offset on Spectrum','t');
315 set(h3,'FontSize',16)
316
317
340 subplot(2,2,2)
341 plot(Y.*atten,'rx')
342 hold on
343 plot(Y,'bo')
344 xlabel('In-Phase','FontSize',12)
345 ylabel('Quadrature','FontSize',12)
177
351 subplot(2,1,2)
352 plot(Y1,'rx')
353 hold on
354 plot(Y,'bo')
355 xlabel('In-Phase','FontSize',12)
356 ylabel('Quadrature','FontSize',12)
357 title('Constellation With Offset and ICI','FontSize',12)
358 grid on
359 grid on
360 axis('square')
361 axis([-2 2 -2 2])
362
367
380 subplot(2,1,2)
381 plot(0:Nfft-1,angle(atten))
382 grid on
383 title('Phase Offset on k{th} Sub-carrier','FontSize',12)
384 xlabel('Sub-carrier Index','FontSize',12)
385 ylabel('Phase [Rad]','FontSize',12)
386 axis([0 64 0 2.2])
387
390 set(h3,'FontSize',16)
391
421
422 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
423 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
424
478
489
490
494 Interference=Interference+sum(abs(y1(nn,:)-X1).2);
495 end
496
522 subplot(2,2,1)
523 plot(x0 i,'bo')
524 hold on
525 plot(X1,'rx')
526 axis([-2 2 -2 2])
527 axis('square')
528 grid on
529 xlabel('In-Phase','FontSize',12)
530 ylabel('Quadrature','FontSize',12)
531 title('Attenuation and Rotation')
532
533 subplot(2,2,2)
534 plot(x0 i,'bo','MarkerSize',6,'LineWidth',2)
535 hold on
536 plot(ICI,'rx')
537 axis([-3 3 -3 3])
538 axis('square')
539 grid on
540 xlabel('In-Phase','FontSize',12)
541 ylabel('Quadrature','FontSize',12)
542 title('ICI contribution')
543
544 subplot(2,2,3)
545 plot(x0 i,'bo','MarkerSize',6,'LineWidth',2)
546 hold on
547 plot(ISI,'rx')
548 axis([-1.2 1.2 -1.2 1.2])
549 axis('square')
550 grid on
551 xlabel('In-Phase','FontSize',12)
552 ylabel('Quadrature','FontSize',12)
553 title('ISI Contributon')
554
555 subplot(2,2,4)
556 plot(x0 i,'bo','MarkerSize',6,'LineWidth',2)
557 hold on
558 plot(y1(numSims,:),'rx')
559 axis([-2 2 -2 2])
560 axis('square')
561 grid on
562 xlabel('In-Phase','FontSize',12)
563 ylabel('Quadrature','FontSize',12)
564 title('Symbols with Frame Offset')
565
182
566 if Nfft==64
567 [ax,h3]=suplabel('Effects of Frame Offset \zeta=8 Nfft=64','t');
568 set(h3,'FontSize',16)
569 else
570 [ax,h3]=suplabel('Effects of Frame Offset \zeta=8 Nfft=256','t');
571 set(h3,'FontSize',16)
572 end
573
582 subplot(2,1,2)
583 plot(-Nfft/2:Nfft/2-1,imag(y1),'rx')
584 grid on
585 title('Imaginary Part of Spectrum','FontSize',12)
586 xlabel('Sample','FontSize',12)
587
588 if Nfft==64
589 [ax,h3]=suplabel('Effects of Frame Offset \zeta=8 Nfft=64','t');
590 set(h3,'FontSize',16)
591 else
592 [ax,h3]=suplabel('Effects of Frame Offset \zeta=8 Nfft=256','t');
593 set(h3,'FontSize',16)
594 end
595 end
596
632
633
640 figure
641 subplot(2,1,1)
642 plot(1:Nfft,20*log10(abs(fftshift(fft(h1,Nfft)))))
643
644 subplot(2,1,2)
645 plot(1:Nfft,abs(ifft(fft(h1,Nfft))))
646 for nn=1:numSims
647 x0 i=(floor(num*rand(1,Nfft))-(num-1)/2)/((num-1)/2)...
648 +1j*(floor(num*rand(1,Nfft))-(num-1)/2)/((num-1)/2);
649 x0 ii=(floor(num*rand(1,Nfft))-(num-1)/2)/((num-1)/2)...
650 +1j*(floor(num*rand(1,Nfft))-(num-1)/2)/((num-1)/2);
651
654
666 y3(nn,:)=fftshift(fft(reg3));
667 y4(nn,:)=fftshift(fft(reg4));
668 end
669
685
695 subplot(2,1,2)
696 plot(-Nfft/2:Nfft/2-1,imag(y4),'rx')
697 grid on
185
705
721
722
732 subplot(2,1,2)
733 plot(-Nfft/2:Nfft/2-1,imag(y3),'rx')
734 grid on
735 title('Imaginary Part of Spectrum','FontSize',12)
736 xlabel('Sample','FontSize',12)
737
742
747 ICIpower=(Nfft-zeta).*zeta/Nfft2;
748 ISIpower=zeta/Nfft;
749 Total=(2*Nfft-zeta).*zeta/Nfft2;
750
761 subplot(2,2,2)
762 plot(zeta,10*log10(ISIpower))
763 grid on
764 title('Power in ISI','FontSize',12)
765 xlabel('Offset [\zeta]','FontSize',12)
766 ylabel('Power [dB]','FontSize',12)
767
768 subplot(2,1,2)
769 plot(zeta,10*log10(Total))
770 grid on
771 title('Total Interference','FontSize',12)
772 xlabel('Offset [\zeta]','FontSize',12)
773 ylabel('Power [dB]','FontSize',12)
774
APPENDIX E
MATLAB CODE FOR PREAMBLE AND
SYNCHRONIZATION ERROR ESTIMATION
188
1 %% -- Preamble.m -------------------------------------------
2 % MATLAB Thesis Simulation
3 % Steven Hemple
4 %
5 % This MATLAB script will simulate the preamble for OFDM as
6 % used in IEEE 802.11a. Both the short and long training
7 % symbols are hard coded and bseband modualted usign the
8 % IFFT.
9 % ----------------------------------------------------------
10 clear all;
11 close all;
12 clc;
13 % -- Simulation Parameters ---------------------------------
14 %
15 % Screen 0 =Size and position of plots for screen 0
16 % Screen 1 =Size and position of plots for screen 1
17 % Screen 1 =Size and position of plots for dual monitor
18 % Position =Plot screen variable
19 % Plots =Toggle to turn plots on(1) or off(0)
20 % Nfft =Number of subcarriers
21 % CP Length =Length of the cyclic prefix
22 % ----------------------------------------------------------
23 Screen 0=[550,10,800,650];
24 Screen 1=[1400,10,800,650];
25 Screen 2=[];
26 Position=Screen 0;
27 Plots=1;
28
29 Nfft=64;
30 CP Length=16;
31
51 %% -- Figures ----------------------------------------------
52 % Plots of the short and long training symbols' spectrum and
53 % time series.
54 % ----------------------------------------------------------
55 if Plots
56 % Figure 1
57 figure('name',...
58 'Thesis OFDM Simulation- OFDM Preamble Spectrum',...
59 'position',Position)
60 subplot(2,1,1)
61 stem(-32:31,real(STS),'r','LineWidth',2)
62 axis([-32 31 -1.5 1.5])
63 grid on
64 xlabel('Frequency Bin')
65 title('Real Part','FontSize',12)
66
67 subplot(2,1,2)
68 stem(-32:31,imag(STS),'b','LineWidth',2)
69 axis([-32 31 -1.5 1.5])
70 grid on
71 xlabel('Frequency Bin')
72 title('Imaginary Part','FontSize',12)
73
78 figure('name',...
79 'Thesis OFDM Simulation- OFDM Preamble Spectrum',...
80 'position',Position)
190
81 subplot(2,1,1)
82 stem(-32:31,abs(STS),'r','LineWidth',2)
83 axis([-32 31 -1.5 1.5])
84 grid on
85 xlabel('Frequency Bin')
86 title('Real Part','FontSize',12)
87
88 subplot(2,1,2)
89 plot(0:1/20:8-1/20,abs(x STS),'r')
90
105 subplot(2,1,2)
106 stem(-32:31,imag(LTS),'b','LineWidth',2)
107 axis([-32 31 -1.5 1.5])
108 grid on
109 xlabel('Frequency Bin')
110 title('Imaginary Part','FontSize',12)
111
116
117
118 % Figure 3
119 figure('name',...
120 'Thesis OFDM Simulation- OFDM Preamble Time Series',...
121 'position',Position)
122 subplot(2,1,1)
123 hold on
124 for nn=0:1.6:8
191
129 end
130 plot(0:1/20:8-1/20,zeros(1,160),'k','LineWidth',1)
131 plot([0 0],[-0.2 0.2],'k','LineWidth',1)
132 plot(4.0/80*(0:length(x STS)-1),real(x STS),'r',...
133 'LineWidth',2)
134 axis([0 8 -0.2 0.2])
135 set(gca,'YTickLabel',[])
136 xlabel('Time [\mu s]')
137 title('Real Part','Fontsize',12)
138
139 subplot(2,1,2)
140 hold on
141 for nn=0:1.6:8
142 plot([nn nn],[-0.2 0.2],'-.k')
143 rectangle('Position',[nn, -0.2, 0.8,0.5],...
144 'FaceColor',[0.9 0.9 0.9],'LineStyle','-.')
145
146 end
147 plot(0:1/20:8-1/20,zeros(1,160),'k','LineWidth',1)
148 plot([0 0],[-0.2 0.2],'k','LineWidth',1)
149 plot(4.0/80*(0:length(x STS)-1),imag(x STS),...
150 'LineWidth',2)
151 axis([0 8 -0.2 0.2])
152 set(gca,'YTickLabel',[])
153 xlabel('Time [\mu s]')
154 title('Imaginary Part','Fontsize',12)
155
160 % Figure 4
161 figure('name',...
162 'Thesis OFDM Simulation- OFDM Preamble Time Series',...
163 'position',Position)
164 subplot(2,1,1)
165 rectangle('Position',[0.025, -0.2, 32*0.05,0.5],...
166 'FaceColor',[1 1 .2],'LineStyle','-.')
167 hold on
168 rectangle('Position',...
192
175 plot(1/20:1/20:8,zeros(1,160),'k','LineWidth',1)
176 axis([0 8 -0.2 0.2])
177 set(gca,'YTick',[])
178 plot(4.0/80*(0:length(x LTS)-1),real(x LTS),'r',...
179 'LineWidth',2)
180 xlabel('Time [\mu s]')
181 title('Real Part','Fontsize',12)
182
183 mTextBox=uicontrol('style','text')
184 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
185 set(mTextBox,'Position',[120 580 100 20])
186 set(mTextBox,'BackgroundColor',[1 1 .2])
187
188 mTextBox=uicontrol('style','text')
189 set(mTextBox,'String','First Symbol','FontSize',12)
190 set(mTextBox,'Position',[300 580 100 20])
191 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
192
193 mTextBox=uicontrol('style','text')
194 set(mTextBox,'String','Second Symbol','FontSize',12)
195 set(mTextBox,'Position',[530 580 120 20])
196 set(mTextBox,'BackgroundColor',[0.9 0.9 0.9])
197
198
199
200
201 subplot(2,1,2)
202 rectangle('Position',[0.025, -0.2, 32*0.05,0.5],...
203 'FaceColor',[1 1 .2],'LineStyle','-.')
204 hold on
205 rectangle('Position',...
206 [32*0.05+0.025, -0.2, 63*0.05,0.5],'FaceColor',...
207 [0.95 0.95 0.95],'LineStyle','-.')
208 rectangle('Position',...
209 [96*0.05-.025, -0.2, 64*0.05,0.5],'FaceColor',...
210 [0.9 0.9 0.9],'LineStyle','-.')
211
212 plot(1/20:1/20:8,zeros(1,160),'k','LineWidth',1)
193
220 mTextBox=uicontrol('style','text')
221 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
222 set(mTextBox,'Position',[120 273 100 20])
223 set(mTextBox,'BackgroundColor',[1 1 .2])
224
225 mTextBox=uicontrol('style','text')
226 set(mTextBox,'String','First Symbol','FontSize',12)
227 set(mTextBox,'Position',[300 273 100 20])
228 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
229
230 mTextBox=uicontrol('style','text')
231 set(mTextBox,'String','Second Symbol','FontSize',12)
232 set(mTextBox,'Position',[530 273 120 20])
233 set(mTextBox,'BackgroundColor',[0.9 0.9 0.9])
234
235
240 % Figure 5
241 figure('name',...
242 'Thesis OFDM Simulation- OFDM Preamble Time Series',...
243 'position',Position)
244 subplot(3,1,1)
245 hold on
246 rectangle('Position',[0, -0.2, 0.8,0.6],'FaceColor',...
247 [1 1 0.2],'LineStyle','-.')
248 rectangle('Position',[0.8, -0.2, 0.8,0.6],'FaceColor',...
249 [1 1 0.2],'LineStyle','-.')
250 for nn=1.6:1.6:8
251 plot([nn nn],[-0.2 0.2],'-.k')
252 rectangle('Position',[nn, -0.2, 0.8,0.6],'FaceColor',...
253 [0.95 0.95 0.95],'LineStyle','-.')
254 rectangle('Position',[nn+0.8, -0.2, 0.8,0.6],...
255 'FaceColor',[0.89 0.89 0.89],'LineStyle','-.')
256 end
194
275 mTextBox=uicontrol('style','text')
276 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
277 set(mTextBox,'Position',[110 555 50 37])
278 set(mTextBox,'BackgroundColor',[1 1 .2])
279
280 mTextBox=uicontrol('style','text')
281 set(mTextBox,'String','Short Symbols','FontSize',12)
282 set(mTextBox,'Position',[230 570 120 20])
283 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
284
285 mTextBox=uicontrol('style','text')
286 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
287 set(mTextBox,'Position',[420 555 50 37])
288 set(mTextBox,'BackgroundColor',[1 1 .2])
289
290 mTextBox=uicontrol('style','text')
291 set(mTextBox,'String','Long Symbols','FontSize',12)
292 set(mTextBox,'Position',[550 570 100 20])
293 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
294
295
296
297 subplot(3,1,2)
298 hold on
299 rectangle('Position',[0, -0.2, 0.8,0.6],'FaceColor',...
300 [1 1 0.2],'LineStyle','-.')
195
328
329 mTextBox=uicontrol('style','text')
330 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
331 set(mTextBox,'Position',[110 362 50 37])
332 set(mTextBox,'BackgroundColor',[1 1 .2])
333
334 mTextBox=uicontrol('style','text')
335 set(mTextBox,'String','Short Symbols','FontSize',12)
336 set(mTextBox,'Position',[230 377 120 20])
337 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
338
339 mTextBox=uicontrol('style','text')
340 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
341 set(mTextBox,'Position',[420 362 50 37])
342 set(mTextBox,'BackgroundColor',[1 1 0.2])
343
344 mTextBox=uicontrol('style','text')
196
349 subplot(3,1,3)
350 hold on
351 rectangle('Position',[0, -0.2, 0.8,0.6],'FaceColor',...
352 [1 1 0.2],'LineStyle','-.')
353 rectangle('Position',[0.8, -0.2, 0.8,0.6],'FaceColor'...
354 ,[1 1 0.2],'LineStyle','-.')
355 for nn=1.6:1.6:8
356 plot([nn nn],[-0.2 0.2],'-.k')
357 rectangle('Position',[nn, -0.2, 0.8,0.6],'FaceColor'...
358 ,[0.95 0.95 0.95],'LineStyle','-.')
359 rectangle('Position',[nn+0.8, -0.2, 0.8,0.6],...
360 'FaceColor',[0.89 0.89 0.89],'LineStyle','-.')
361 end
362 rectangle('Position',[8, -0.2, 1.6,0.6],'FaceColor',...
363 [1 1 0.2],'LineStyle','-.')
364 rectangle('Position',[9.6, -0.2, 3.2,0.6],'FaceColor'...
365 ,[0.95 0.95 0.95],'LineStyle','-.')
366 rectangle('Position',[12.8, -0.2, 3.2,0.6],'FaceColor'...
367 ,[0.89 0.89 0.89],'LineStyle','-.')
368
379
380
381 mTextBox=uicontrol('style','text')
382 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
383 set(mTextBox,'Position',[110 164 50 37])
384 set(mTextBox,'BackgroundColor',[1 1 .2])
385
386 mTextBox=uicontrol('style','text')
387 set(mTextBox,'String','Short Symbols','FontSize',12)
388 set(mTextBox,'Position',[230 180 120 20])
197
391 mTextBox=uicontrol('style','text')
392 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
393 set(mTextBox,'Position',[420 164 50 37])
394 set(mTextBox,'BackgroundColor',[1 1 0.2])
395
396 mTextBox=uicontrol('style','text')
397 set(mTextBox,'String','Long Symbols','FontSize',12)
398 set(mTextBox,'Position',[550 180 100 20])
399 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
400
401
407 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
408 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
409
433 % ----------------------------------------------------------
434 Screen 0=[550,10,800,650];
435 Screen 1=[1400,10,800,650];
436 Screen 2=[];
437 Position=Screen 0;
438 Plots=1;
439
440 Nfft=64;
441 CP Length=16;
442 L=16;
443 % -- Short Training Symbols --------------------------------
444 STS=[zeros(1,6) 0 0 1+1j 0 0 0 -1-1j 0 0 0 ...
445 1+1j 0 0 0 -1-1j 0 0 0 -1-1j 0 0 0 1+1j 0 0 0 ...
446 0 0 0 0 -1-1j 0 0 0 -1-1j 0 0 0 1+1j 0 0 0 ...
447 1+1j 0 0 0 1+1j 0 0 0 1+1j 0 0 zeros(1,5) ];
448 STS IFFT Input=sqrt(13/6)*fftshift(STS);
449 STS IFFT Output=ifft(STS IFFT Input,Nfft);
450 x STS=[STS IFFT Output STS IFFT Output ...
451 STS IFFT Output(1:Nfft/2)];
452
475 =y(n*3);
476 Noise1=sigma*(rand(1,50)+1j*rand(1,50));
199
477 Noise2=sigma*(rand(1,320)+1j*rand(1,320));
478
481
489 subplot(2,1,2)
490 plot(1:length(Rx),imag(Rx));
491 title('Imaginary Part','FontSize',12)
492 grid on
493
521
552 subplot(2,2,2)
553 plot(1:length(R),(R))
554 title('Bottom Path (Received Power)','FontSize',12)
555 xlabel('Sample')
556 grid on
557 axis([0 270 0 15])
558
559 subplot(2,1,2)
560 plot(frame,'-.k','LineWidth',3)
561 hold on
562 plot(1:length(M),M,'LineWidth',1)
563 plot([start-5:start+5],ones(1,11)*0.5,'k','LineWidth',2)
564 xlabel('Sample')
201
565 grid on
566 axis([0 270 0 1.5]);
567 title('Output of Coarse Timing Estimator','FontSize',12);
568
569 if n==1
570 [ax,h3]=suplabel('Frame Timing Estimation With...
571 Ideal Channel','t');
572 set(h3,'FontSize',16);
573 else
574 [ax,h3]=suplabel('Frame Timing Estimation With...
575 Frequency Offset=200kHz, SNR=7dB','t');
576 set(h3,'FontSize',16);
577 end
578 end
579
580 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
581 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
582
609 Plots=1;
610
611
626
637 % -- Cross-correlation
638 r=conv(x Preamble,fliplr(conj(LTS IFFT Output)));
639 r=r/max(abs(r));
640
647 subplot(2,1,2)
648 stem(real(LTS))
649 title('Real Part of LTS')
650
651
652 figure('position',Position)
203
653 subplot(2,1,1)
654 hold on
655 rectangle('Position',[0, -0.2, 16,0.6],'FaceColor',...
656 [1 1 0.2],'LineStyle','-.')
657 rectangle('Position',[16, -0.2, 16,0.6],'FaceColor',...
658 [1 1 0.2],'LineStyle','-.')
659 for nn=32:32:160
660 plot([nn nn],[-0.2 0.2],'-.k')
661 rectangle('Position',[nn, -0.2, 16,0.6],'FaceColor',...
662 [0.95 0.95 0.95],'LineStyle','-.')
663 rectangle('Position',[nn+16, -0.2, 16,0.6],'FaceColor',...
664 [0.89 0.89 0.89],'LineStyle','-.')
665 end
666 rectangle('Position',[160, -0.2, 32,0.6],'FaceColor',...
667 [1 1 0.2],'LineStyle','-.')
668 rectangle('Position',[192, -0.2, 64,0.6],'FaceColor',...
669 [0.95 0.95 0.95],'LineStyle','-.')
670 rectangle('Position',[256, -0.2, 64,0.6],'FaceColor',...
671 [0.89 0.89 0.89],'LineStyle','-.')
672
684 mTextBox=uicontrol('style','text');
685 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
686 set(mTextBox,'Position',[110 555 50 37])
687 set(mTextBox,'BackgroundColor',[1 1 .2])
688
689 mTextBox=uicontrol('style','text');
690 set(mTextBox,'String','Short Symbols','FontSize',12)
691 set(mTextBox,'Position',[230 570 120 20])
692 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
693
694 mTextBox=uicontrol('style','text');
695 set(mTextBox,'String','Cyclic Prefix','FontSize',12)
696 set(mTextBox,'Position',[420 555 50 37])
204
699 mTextBox=uicontrol('style','text');
700 set(mTextBox,'String','Long Symbols','FontSize',12)
701 set(mTextBox,'Position',[550 570 100 20])
702 set(mTextBox,'BackgroundColor',[0.95 0.95 0.95])
703 title('IEEE 802.11a Preamble','FontSize',12)
704
705
706 subplot(2,1,2)
707 plot(1:length(r),real(r))
708 axis([1 324 -0.2 1.2])
709 grid on
710 set(gca,'XTick',[[0:16:160] 192 256 320],'YTick',[0 0.5 1])
711 title('Cross-Correlation of Known LTS and Received LTS',...
712 'FontSize',12)
713
717 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
718 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
719
741 % ----------------------------------------------------------
742 Screen 0=[550,10,800,650];
743 Screen 1=[1400,10,800,650];
744 Screen 2=[1360,-310,1920,1024];
745 Position=Screen 0;
746 Plots=1;
747
772
811 figure('position',Position)
812 plot(y1(),'rx')
813 title('Received Signal With Channel Distortion',...
814 'FontSize',12)
815 grid on
816 xlabel('In-Phase','FontSize',12)
817 ylabel('Quadrature','FontSize',12)
818
827 figure('position',Position)
828 plot(-Nfft/2+6:Nfft/2-6,20*log10(real(r(7:59))),'o')
207
829 hold on
830 plot(-Nfft/2+6:Nfft/2-6,20*log10(real([CHAN(7:32) 1+1j ...
831 CHAN(34:59)])) ,'rx')
832 grid on
833 legend('Channel Estimation','Channel Frequency Response')
834 title({['Multipath Channel with SNR=',num2str(SNR)]},...
835 'FontSize',16)
836 xlabel('Frequency bin','FontSize',12)
837 ylabel(' | H[f]|2 [dB]','FontSize',12)
838 % -- Demodulate with channel correction --------------------
839 y1=[];
840 for nn=3:Frames+2
841 reg=y((nn-1)*(Nfft+CP)+1:nn*(Nfft+CP));
842 reg1=reg(CP+1:end);
843 reg2=fftshift(fft(reg1))./r;
844 y1=[y1 reg2([-26:-1 1:26]+Nfft/2+1)];
845 end
846 figure('position',Position)
847 plot(y1(),'rx')
848 title('Received Signal With Channel Correction',...
849 'FontSize',16)
850 grid on
851 xlabel('In-Phase','FontSize',12)
852 ylabel('Quadrature','FontSize',12)
208
APPENDIX F
CORRELATION
209
CORRELATION
For our purposes, the cross-correlation measures the similarity between two comlplex
functions f (t) and g(t). In the case that the two functions are the same, we say
auto-correlation. The cross-correlation is defined as,
and equivalently Z
[f g](t) f( )g(t + )d. (F.5)
Let f (t) and g(t) be functions such that g = f (t ), is a shifted copy of f (t). The
cross-correlation of f and g essentially slides the function g along the t-axis and sums the
product of the two functions at each interval. The two functions are aligned with each other
when the product is at a maximum since we are essentially squaring the function f at that
point. The reason for taking the conjugate of f is so that the complex product will contribute a
positive quantity to the sum.
210
APPENDIX G
PHASE LOCK LOOP
211
The implementation of the PLL for this thesis is shown in figure G.2.
This system can be modeled using Newtons second law as the second order
differential equation
F = M x + cx + kx. (G.1)
0.2
0.15
Displacment
0.1
0.05
0
0 1 2 3 4 5 6 7 8 9 10
Time [s]
For a PLL system, the steady state corresponds to the phase error. We require that the
amount of time to reach steady state to be small. To accomplish this we introduce the
proportional gain kp to the system
X(s) kp
= . (G.5)
F (s) M s2 + cs + (k + kp )
Figure G.6 shows the output of the PLL with the proportional gain kp = 300
214
0.1
Displacment
0.05
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time [s]
1
Displacment
0.5
0
0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5
Time [s]
We can see that the proportional control helps the system rise quicker and attain
steady state in less time but increases the overshoot. We next add the integral control to the
system
X(s) ki
= (G.6)
F (s) M s + cs2 + k + ki
3
Figure G.7 shows the step response of the system with the added integral control
ki = 5.
216
1.8
1.6
1.4
1.2
Displacment
0.8
0.6
0.4
0.2
0
0 5 10 15 20 25 30 35 40 45 50
Time [s]
Notice that the rise time also decreases and overshoot increases but the time to settle
also increases. The advantage in using integral control is the elimination of error. The settling
time can be decreased but at the expense of rise time.
Combining proportional and integral control gives
X(s) kp s + k1
= 3 2
(G.7)
F (s) M s + cs + (k + kp )s + ki
Using the following parameters, the step response is shown in figure G.8
M =1 (G.8)
c = 10 (G.9)
k = 10 (G.10)
217
kp = 30 (G.11)
k1 = 70 (G.12)
0.8
Displacment
0.6
0.4
0.2
0
0 0.5 1 1.5 2 2.5 3
Time [s]
Notice that the quick rise is still retained, the overshoot is decreased and the error is
eliminated. To remove the overshoot, a derivative control can be added but this will increase
the complexity and is not necessary.
We now derive the equations that describe the PLL using the proportional integral
control. Let out be the phase of the PLL output and in the input phase. Then
out (s + kd kv F (s)) = in (kd kv F (s)) (G.13)
out kd kv F (s)
= , (G.14)
in s + kd kv F (s)
218
where kd is the phase detector gain, kv is the VCO gain, and F (s) is the loop filter transfer
function. The loop filter can be described by a low pass filter
1
F (s) = , (G.15)
1 + sRC
so that
k k
d v
out
= 1+sRCkd kv
(G.16)
in s + 1+sRC
kd kv
= 2
(G.17)
s + s RC + kd kv
kd kv
RC
= . (G.18)
s2 + s
RC
+ kRC
d kv
This has the same form as the harmonic oscillator previously discussed and therefore,
can be related to the second order system
wn2
H(s) = , (G.19)
s2 + 2swn + wn2
where is the dampening ratio and wn is the undamped angular frequency of the oscillator.
For the purposes of this paper, the PLL of interest has transfer function
(kp + ki ) z kpk+kp
i
H(z) = , (G.20)
z 2 2 1 kp +k
2
i
z + (1 kp )
where the numerator is the lead forward path and the denominator is the lag path. Using
Tustins method
2 1 z 1
s (G.21)
TS 1 + z 1
or equivalently
1 Ts z + 1
, (G.22)
s 2 z1
where Ts is the sampling time with equation G.19 we have that
wn2 s12
H(s) = (G.23)
1 + 2wn 1s + wn2 s12
2 z+1 2
wn2 T2s z1
H(z) = 2 z+1 2 (G.24)
Ts z+1
1 + 2wn 2 z1 + wn2 T2s
z1
z+1 2
n2 z1
Ts
= 2 , with n = wn (G.25)
z+1
+ n2 z+1 2
1 + 2n z1 z1
..
.
4n ( + n ) z +n
= 2 . (G.26)
1 + 2n + n2 z 2 2 1+n
2 z + 12n +n
2
1+2n +n 1+2n +n
219
Comparing equation G.20 with equation G.26, we obtain
4n ( + n )
kp + ki = (G.27)
1 + 2n + n2
1 2n + n2
1 kp = (G.28)
1 2n + n2
1 kp + ki 1 + n2
= . (G.29)
2 1 + 2n + n2
Hence
4n
kp = (G.30)
1 + 2n + n2
42
ki = (G.31)
1 + 2n + n2
Ts
n = w n , (G.32)
2
where kp , ki , and n are the proportional control, integral control, and digital undamped
natural frequency respectively.
As an example, let the first 100 samples of input to a PLL be 0.05 and the second 100
samples be 0.1 with = 2/2, n = 1/25 as shown in figure G.9.
220
Input Phases
15
10
Accumulated Phase
0
0 20 40 60 80 100 120 140 160 180 200
Sample Number
Figure G.10 shows the input and output phases to the PLL, as well as the output of the
loop filter and the phase detector.
221
10
0
0 20 40 60 80 100 120 140 160 180 200
Sample Number
Output of Loop Filter, DDS Control Frequency
0.2
0.15
Phase
0.1
0.05
0
0 20 40 60 80 100 120 140 160 180 200
Samlple Number
Phase Error, Output of ATAN (Phase Detector)
0.6
0.4
Error
0.2
0.2
0 20 40 60 80 100 120 140 160 180 200
Sample Number
Figure G.10. Input and output phases to PLL, loop filter, and phase detector.
Figure G.11 shows the real and imaginary parts of the input and output signal. Notice
that the system acquires a phase lock in about 60 samples which, for IEEE 802.11a
transmission standards is about 3s, well within the one OFDM frame.
222
0.5
0.5
1
0 20 40 60 80 100 120 140 160 180 200
Sample Number
0.5
0.5
1
0 20 40 60 80 100 120 140 160 180 200
Sample Number
APPENDIX H
MATLAB CODE FOR PLL
224
2 %% -- PLLtutorial.m ----------------------------------------
3 % MATLAB Thesis Simulation
4 % Steven Hemple
5 %
6 % This MATLAB script explores the phase lock loop
7 % ----------------------------------------------------------
8 clear all;
9 close all;
10 clc;
11
27 %% -- Parameters -------------------------------------------
28 %
29 %
30 % ----------------------------------------------------------
31 M=1;
32 C=10;
33 K=10;
34 Kp=[300 0 60];
35 Ki=60;
36 t=0:0.01:50;
37
225
38 figure('name',...
39 'Thesis Phase Lock Loop Simulation- Undampend open Loop System',...
40 'position',Position)
41 num=1;
42 den=[M 0 K];
43 [x]=step(num,den,t);
44 plot(t,x')
45 title('Undampend Step Response','FontSize',16)
46 xlabel('Time [s]','FontSize',12);
47 ylabel('Displacment','FontSize',12);
48 axis([0 10 0 0.25]);
49 grid on
50
51
52 figure('name',...
53 'Thesis Phase Lock Loop Simulation- Dampend open Loop System',...
54 'position',Position)
55 num=1;
56 den=[M C K];
57 [x]=step (num,den,t);
58 plot(t,x')
59 title('Open Loop Step Response','FontSize',16)
60 xlabel('Time [s]','FontSize',12);
61 ylabel('Displacment','FontSize',12);
62 axis([0 5 0 0.15])
63 grid on
64
65 figure('name',...
66 'Thesis Phase Lock Loop Simulation- Closed With ...
67 Loop System Proportional Control ',...
68 'position',Position)
69 num=[Kp(1)];
70 den=[M C (K+Kp(1))];
71 [x]=step (num,den,t);
72 plot(t,x')
73 title('Closed Loop Step Response With Proportional Control'...
74 ,'FontSize',16)
75 xlabel('Time [s]','FontSize',12);
76 ylabel('Displacment','FontSize',12);
77 axis([0 5 0 1.5])
78 grid on
79
80 figure('name',...
81 'Thesis Phase Lock Loop Simulation- Closed With ...
226
95
96 figure('name',...
97 'Thesis Phase Lock Loop Simulation- Closed With ...
98 Loop System Proportional an Integral Control ',...
99 'position',Position)
100 num=[Kp(3) Ki];
101 den=[M C (K+Kp(3)) Ki];
102 [x]=step (num,den,t);
103 plot(t,x')
104 title('Closed Loop Step Response With Proportional and ...
105 Integral Control','FontSize',16)
106 xlabel('Time [s]','FontSize',12);
107 ylabel('Displacment','FontSize',12);
108 axis([0 3 0 1.25])
109 grid on
110
111
114 % ----------------------------------------------------------
115 % Parameters
116 %
117 % theta 0 = Digital undamped natural frequency, theta 0=w 0 *T/2
118 % eta= Dampening factor
119 % k i= Integreal gain
120 % k p= Proportional gain
121 % ----------------------------------------------------------
122 theta 0=1/25;
123 eta=sqrt(2)/2;
124 k i=(4*theta 0 *theta 0)/(1+2*eta*theta 0+theta 0 *theta 0);
125 k p=(4*eta*theta 0)/(1+2*eta* theta 0+theta 0*theta 0);
227
126
127 % ----------------------------------------------------------
128 % Input
129 %
130 % dph 1= The input frequency for the first 100 samples.
131 % dph 1= The input frequency for hte second 100 samples.
132 % dph= The input frrequencies.
133 % ph 1= Output of first phase accumulator. Use filter
134 % 1/(1-z-1) for delay.
135 % s 1= The output of the DDS.
136 % ph 2 save= Angles from output of bottom phase accumulator
137 % int 1 save= Output of k i path
138 % dph save
139 % ----------------------------------------------------------
140 sim num 1=100;
141 sim num 2=100;
142 sim num=sim num 1+sim num 2;
143
158 %% ---------------------------------------------------------
159 % Simulation
160 % ----------------------------------------------------------
161 for n=1:length(ph) % Loop for number of input samples
162 prod=s 1(n)*exp(-1j*2*pi* int 2); % Product of two DDS
163 phi(n)=angle(prod)/(2*pi); % Output of ATAN
164
165 % ------------------------------------------------------
166 % Loop Filter
167 % ------------------------------------------------------
168 int 1=int 1+k i *phi(n); % Output of k i path
169 dph=k p *phi(n)+int 1; % Output of sum of k i and k p
228
172 % ------------------------------------------------------
173 % DDS
174 % ------------------------------------------------------
175 ph 2 save(n)=int 2; % Save previous output of phse acum
176 int 2=int 2+dph; % Next input to phase accumulator
177 end
178
179 figure('name',...
180 'Thesis Phase Lock Loop Simulation- Phase Locked Loop',...
181 'position',Position)
182 plot(1:length(ph),ph)% Input phase
183 grid on
184 title('Input Phases','FontSize',16)
185 ylabel('Accumulated Phase','FontSize',12)
186 xlabel('Sample Number','FontSize',12)
187
188 figure('name',...
189 'Thesis Phase Lock Loop Simulation- Phase Locked Loop',...
190 'position',Position)
191 subplot(3,1,1)
192 plot(1:length(ph),ph)% Input phase
193 hold on
194 plot(1:length(ph),ph 2 save,'r') % Output phase
195 hold off
196 grid on
197 title('Input and Output Phases','FontSize',16)
198 ylabel('Accumulated Phase','FontSize',12)
199 xlabel('Sample Number','FontSize',12)
200 legend('Input Phase','Output Phase','Location','SouthEast',...
201 'FontSize,',12);
202
203
204 subplot(3,1,2)
205 plot(1:length(ph),dph save)
206 hold on
207 plot([0 sim num 1],[dph 1 dph 1],'--r')
208 plot([sim num 1 sim num],[dph 2 dph 2],'--r')
209 grid on
210 title('Output of Loop Filter, DDS Control Frequency',...
211 'FontSize',16)
212 ylabel('Phase','FontSize',12)
213 xlabel('Samlple Number','FontSize',12);
229
214
215 subplot(3,1,3)
216 plot(1:sim num,ph-ph 2 save)
217 title('Phase Error, Output of ATAN (Phase Detector)',...
218 'FontSize',16);
219 xlabel('Sample Number','FontSize',12);
220 ylabel('Error','FontSize',12);
221 grid on;
222
223 figure('name',...
224 'Thesis Phase Lock Loop Simulation- Phase Locked Loop',...
225 'position',Position)
226 subplot(2,1,1)
227 plot(real(s 1),'linewidth',1)
228 hold on
229 plot(cos(2*pi* ph 2 save),'r','linewidth',1)
230 grid on
231 title('Real Part of Input and Output Signals','FontSize',16)
232 xlabel('Sample Number','FontSize',12)
233 ylabel('Magnitude','FontSize',12)
234 legend('Input Signal','Output Signal','FontSize',12)
235 ylim([-1.1 1.7])
236
237 subplot(2,1,2)
238 plot(imag(s 1),'linewidth',1)
239 hold on
240 plot(sin(2*pi* ph 2 save),'r','linewidth',1)
241 grid on
242 title('Imaginary Part of Input and Output Signals',...
243 'FontSize',16)
244 xlabel('Sample Number','FontSize',12)
245 ylabel('Magnitude','FontSize',12)
246 legend('Input Signal','Output Signal','FontSize',12)
247 ylim([-1.1 1.7])