Abstract The concept of OFDM is not new but receiver designs are constantly improved. With new advances in DSP technologies, OFDM has become popular for the reasons of efficient bandwidth usage and ease of synthesis with new DSP technology. However, it is sensitive to synchronisation error and has a relatively large peak to average power ratio. This thesis will provide an over all look into OFDM systems and its developments. It will also look into the challenges OFDM faces and concentrate on two main aspects of an OFDM receiver design, channel estimation and equalization.
i
ii
CHAPTER 0. ABSTRACT
Acknowledgements We would like to thank Dr Choi for providing our team with guidance and sharing his wisdom in learning with us, and especially for introducing us to our thesis topic. We have really enjoyed learning about OFDM. Many thanks to Stephen with his great help in encouragement, LaTeX and signal processing concepts. Thanks also to Alfred and Buu for support in the thesis labs which were at times stressful and frustrating but the more worthwhile in the end. Last but definitely not least, we would like to thank Du. We wish you the very best and know you will do well in the future.
iii
iv
CHAPTER 0. ACKNOWLEDGEMENTS
Forward James Shen This thesis was difficult to do, particularly from scratch. My goal was to get a thorough understanding of the fundamentals of OFDM and it’s underlying intricacies. It is hard to come by materials which explain concepts without needing a high degree of prior knowledge. I have waged through much material only to have them become much clearer towards the end of this thesis. In such, I have tried to layout this thesis from first principles. I believe the basic principals are most important. One cannot design a good OFDM system without having a great deal of understanding and a feeling for the how it all works. It is most important to ask yourself quality questions to get quality answers. I enjoyed this thesis and have learnt much, more than just the maths too.
Mathew Liu At the beginning of this thesis, I had no idea what OFDM was. From studying this thesis, I have been able to witness its widespread application to telecommunications engineering. Along this journey to discovering OFDM, I have also learn a lot of useful concepts in maths and signal processing that I should have learnt already during my 5 years here at university. I have found that this thesis has provided the perfect opportunity to really actually learn something before you graduate. Also i would just like to mention our website at http://www.geocities.com/ofdm99. v
vi
CHAPTER 0. FORWARD
This website was started as a means of communication between group members and contains a comprehensive list of references, as well as a diary of our tasks for this thesis. I hope you will enjoy and learn much about OFDM from reading this thesis.
Contents Abstract
i
Acknowledgements
iii
Forward
v
1 Introduction
1
2 Background 2.1 DFT . . . . . . . . . . . . . . . 2.2 Convolution . . . . . . . . . . . 2.3 Zero Padding . . . . . . . . . . 2.4 Nyquist and Shannon . . . . . . 2.5 Nyquist Condition for Zero ISI . 2.6 Random Processes . . . . . . . 2.6.1 Time Averages . . . . . 2.7 Linear Prediction . . . . . . . . 2.8 Wiener Filtering . . . . . . . . . 2.9 Multipath Channels . . . . . . . 2.9.1 Power Delay profile . . . 2.9.2 RMS Delay Spread . . . 2.9.3 Coherence Bandwidth . 2.9.4 Coherence Time . . . . . 2.9.5 Doppler Spectrum . . . 2.9.6 Fading in Multipath . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
. . . . . . . . . . . . . . . .
3 3 5 6 6 8 10 11 12 13 14 15 15 15 16 16 16
3 OFDM basics 3.1 Introduction . . . . . . . . . 3.2 Advantages / Disadvantages 3.3 Multicarrier vs Single carrier 3.4 Orthogonality . . . . . . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
. . . .
19 19 20 20 21
. . . .
vii
. . . .
viii
CONTENTS
. . . . . . . .
21 22 23 24 24 24 25 25
4 OFDM Simulation Model 4.0.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4.0.2 The Simulation . . . . . . . . . . . . . . . . . . . . . . 4.0.3 Summary . . . . . . . . . . . . . . . . . . . . . . . . .
27 27 28 36
5 Channel Estimation 5.1 Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2 System Environment . . . . . . . . . . . . . . . . . . . . . . . 5.2.1 Wireless . . . . . . . . . . . . . . . . . . . . . . . . . . 5.2.2 Multipath Fading . . . . . . . . . . . . . . . . . . . . . 5.2.3 Fading Effects due to Multi-path Fading . . . . . . . . 5.2.4 White noise . . . . . . . . . . . . . . . . . . . . . . . . 5.3 Channel Model . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.1 Rayleigh Distribution . . . . . . . . . . . . . . . . . . . 5.3.2 Power Delay Profile . . . . . . . . . . . . . . . . . . . . 5.3.3 AWGN . . . . . . . . . . . . . . . . . . . . . . . . . . . 5.3.4 Channel Synchronisation . . . . . . . . . . . . . . . . . 5.3.5 Assumptions on channel . . . . . . . . . . . . . . . . . 5.4 Pilot Based Channel Estimation . . . . . . . . . . . . . . . . . 5.5 Least Squares Estimator . . . . . . . . . . . . . . . . . . . . . 5.6 Linear Minimum Mean Square Error Estimator . . . . . . . . 5.7 Wiener Optimum Filters . . . . . . . . . . . . . . . . . . . . . 5.8 Optimal Rank Reduction using Singular Value Decompositions 5.8.1 Singular Value Decompositions . . . . . . . . . . . . . 5.9 Simulation Results and Comparisons . . . . . . . . . . . . . . 5.10 Conclusion . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
41 41 42 42 42 42 43 43 45 46 47 47 48 48 48 49 51 51 52 52 52
6 Equalization 6.1 Introduction to Equalization 6.2 Linear Equalization . . . . . 6.3 Zero-Forcing Equalizer . . . 6.3.1 Introduction . . . . .
55 55 56 57 57
3.5
3.6 3.7 3.8
3.4.1 OFDM sub-carriers . . . 3.4.2 OFDM Spectrum . . . . Cyclic Prefix / Guard Interval . 3.5.1 Inter symbol Interference 3.5.2 Inter carrier Interference IDFT . . . . . . . . . . . . . . . OFDM Transmitter Block . . . OFDM Receiver Block . . . . .
. . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . . . . . .
. . . .
. . . .
CONTENTS
6.3.2 Implementation and Results 6.4 LMMSE . . . . . . . . . . . . . . . 6.4.1 Introduction . . . . . . . . . 6.4.2 Implementation and Results 6.5 Adaptive Equalization . . . . . . . 6.6 Method of Steepest Descent . . . . 6.7 LMS . . . . . . . . . . . . . . . . . 6.7.1 Adaptation Algorithm . . . 6.7.2 Implementation and Results 6.8 RLS . . . . . . . . . . . . . . . . . 6.8.1 Least Squares . . . . . . . . 6.8.2 Adaptation Algorithm . . . 6.8.3 Implementation and Results 6.9 Comparison . . . . . . . . . . . . . 6.10 Summary . . . . . . . . . . . . . .
ix
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
. . . . . . . . . . . . . . .
59 62 63 65 66 66 67 68 69 73 73 74 76 77 78
7 Synchronisation
81
8 Further Research
83
9 Conclusion
85
Appendix A
91
Appendix B
97
Appendix C
103
Appendix D
109
Appendix E
115
Appendix F
119
Appendix G
123
Appendix H
127
x
CONTENTS
List of Figures 2.1 2.2 2.3 2.4
DFT axes mapping. . . . Zero padding in the time Inter-symbol interference Scatter graph depiction. ceived Symbols. . . . . .
. . . . . . . . . . domain. . . . . . in eye patterns. . (a) Transmitted . . . . . . . . . .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Symbols, (b) Re. . . . . . . . . .
. . .
5 7 8
.
9
3.1 3.2
Harmonics which are summed to create sub-carriers. . . . . . . 22 OFDM symbol spectrum. . . . . . . . . . . . . . . . . . . . . . 23
4.1 4.2 4.3 4.4 4.5 4.6 4.7 4.8 4.9
OFDM simulation block diagram. Signal at (B). . . . . . . . . . . . Signal at (E). . . . . . . . . . . . Signal at (F). . . . . . . . . . . . Signal at (G). . . . . . . . . . . . Signal at (G)/(H). . . . . . . . . Signal at (G)/(H). . . . . . . . . Signal at (J). . . . . . . . . . . . Signal at (N). . . . . . . . . . . .
5.1 5.2
. 43
5.3 5.4
Parallel Gaussian channels. . . . . . . . . . . . . . . . . . . . Resampling a non-sample-spaced channel extends the channel length. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . An example of block based pilot information. . . . . . . . . . Block diagram of the rank-p channel estimator. . . . . . . .
6.1 6.2 6.3 6.4 6.5 6.6 6.7
Linear transversal filter. . . . . . . . . . . . . . . . . . . . Zero-forcing equalizer block diagram. . . . . . . . . . . . . OFDM Zero-forcing equalizer block diagram. . . . . . . . . OFDM Zero-forcing equalizer block diagram for simulation. Diagram of 3 types of symbol sequences. . . . . . . . . . . Error of Zero-forcing equalizer over 10 OFDM symbols. . . OFDM Zero-forcing equalizer BER vs SNR (dB). . . . . .
. . . . . . .
xi
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . . . .
. . . . . . .
. . . . . . . . .
29 30 32 33 34 36 37 38 39
. 47 . 49 . 53 56 58 60 60 61 62 63
xii
LIST OF FIGURES
6.8 6.9 6.10 6.11 6.12 6.13 6.14 6.15
LMS equalizer block diagram. . . . . . . . . . . . . . . . LMS equalizer tracking over first symbol. . . . . . . . . . Error sequence over the first OFDM symbol. . . . . . . . Error sequence of LMS tracking over 10 OFDM symbols. RMS equalizer block diagram. . . . . . . . . . . . . . . . RLS tracking over first OFDM symbol. . . . . . . . . . . Error sequence of RLS tracking over first OFDM symbol. LMS vs RLS in tracking 5 OFMD symbols. . . . . . . . .
. . . . . . . .
. . . . . . . .
. . . . . . . .
69 70 71 72 77 78 79 80
Chapter 1 Introduction Where did it begin? In 1966 Robert W. Chang published a paper on the synthesis of bandlimited orthogonal signals for multichannel data transmission [7]. It describes a method in which signal can be simultaneously transmitted through a bandlimited channel without ICI (Interchannel Interference) and ISI (Intersymbol Interference). The idea of dividing the spectrum into several channels allowed transmission at a low enough data rate to counter the effect of time dispersion in the channel. As the subchannels are orthogonal they can overlap providing a much more efficient use of the available spectrum. In 1971, S.B. Weinstein and P.M. Ebert introduced the DFT (Discrete Fourier Transform) to perform the baseband modulation and demodulation [9]. This replaced the traditional bank of oscillators and multipliers needed to create and modulate onto each subcarrier. In 1980, A.Peled and A. Ruiz introduced the cyclic prefix [8].This takes the last part of the symbol and attaches it to the front. When this extension is longer than the channel impulse response, the channel matrix is seen as cirulant and orthogonality of the subcarriers is maintained over the time dispersive channel. OFDM is currently used in European Digital Audio Broadcasting (DAB). OFDM is used in DSL (Digital Subscriber Line) where it is know as DMT (Discrete Multitone). It is used in the European standard Hyperlan/2 and in IEEE 802.11a. This thesis will explore concepts and designs which have already been established and look into some newer technologies. However, we will concentrate on what really makes an OFDM system work, for which a certain degree of knowledge and understanding of signal processing and digital communications is necessary. From here, we will launch into important background information which did take a somewhat long time to understand. I hope you 1
2
will find the explanation clear and insightful!
CHAPTER 1. INTRODUCTION
Chapter 2 Background This chapter explains the main concepts needed to understand an OFDM system. The principles behind OFDM are quite simple but it is important to thoroughly understand these. It is the basics we have spent most time to understand. The following background sections are not frequently referenced as they are mostly basic open knowledge which we attempt to insightfully explain.
2.1
DFT
The DFT is no doubt one of the most important components of the OFDM system. It replaces the need for the large carrier banks of traditional multicarrier systems. Refer to Chapter 3. One cannot hope to understand any further concepts without a thorough understanding of the foundations, particulary in the DFT. I will attempt to explain the DFT in an intuitive and insightful way. Music notes are made up of sinusoids of harmonics of a fundamental frequency. In wireless communications, carriers are sinusoids. The motivation of the DFT is to project a signal onto a basis that is made up of such harmonics. This provides great insight into why the DFT matrix looks like it does. Further more, sinusoids of different harmonics are orthogonal to each other. This is a very important characteristic for the basis of the DFT. This orthogonal criterion is as follows ( Z T T (k = l and k, l 6= 0) 2πlt 2πkt ) sin( ) dt = 2 sin( (2.1) T T 0 (k 6= l and k, l 6= 0) 0 It is not usually conventional, but let us first take a look at the DFT matrix. The DFT matrix is made up complex exponentials and is common and 3
4
CHAPTER 2. BACKGROUND
conveniently defined as 1 1 1 −j2π/N −j2π/N 1 e e −j4π/N −j8π/N 1 e e WN = .. .. .. . . . −j2π(N −1)/N −j2π(N −1)/N 1 e e
··· ··· ··· .. .
1 e−j2π(N −1)/N e−j2π2(N −1)/N .. .
···
e−j2π(N −1)(N −1)/N
(2.2)
where N is the size of the DFT. Noting that WNk = (ej2π/N )k = ej2πk/N
(2.3)
where k is the frequency index and that {WNk }k=0,1,...,N −1 are the N complex roots of unity. So now let us define wk [n] = WNnk = ej
2πnk N
(2.4)
This allows us to express the DFT as
and the inverse as
X[k] = hx, wk i
(2.5)
N −1 1 X X[k]wk x= N k=0
(2.6)
This formulation provides great insight into the DFT operation! We can see that the vectors wk form the basis of the set of the N input sequence x. As mentioned before, the basis is orthogonal as hwi , wj i = 0 for i 6= j. We can even define orthonormal basis sets but we will not do that at this stage. So in all, the DFT is conventionally expressed as X[k] =
N −1 X
x[n]e−j
2πnk N
,
0≤k
(2.7)
n=0
x[n] =
N −1 2πnk 1 X X[k]ej N , N k=0
0≤n
(2.8)
Since DFT has only finite support, 0 ≤ n < N , it is a sampling of the true Fourier Transform xˆ(ω) of the input sequence x(t). Let us now finish off by describing how the samples in the time domain map to the samples in the frequency domain. See Figure 2.1 As you can see above that the highest positive frequency is the Nyquist frequency at
2.2. CONVOLUTION
5
x[k]
DFT ⇐⇒
X[k] +f
0
k N −1 t
0
−f
0
N/2
k N −1 f
0
T f = N/2T
f = −1/T f = −2/T
Figure 2.1: DFT axes mapping.
sample number N/2. Note that in M atlab, when mapping the frequency axis, if you put an array [f1 f2] defined as f1 = 1/T:1/T:N/(2*T); f2 = -N/(2*T):1/T:-1/T; what you will actually see in the graph is a correct mapping but M atlab will just simply reorder the axes from negative to positive. The point is, as long as you map the axes correctly, you will avoid much trouble.
2.2
Convolution
The concept of convolution is important because the property of circular convolution will come into play. We all know that a property of the Fourier transform is that multiplication in the frequency domain has the effect of convolution in the time domain. Meaning ˆ x(ω) ⇐⇒ y[n] = (h ? x)[n] yˆ = h(ω)ˆ
(2.9)
where convolution is defined as (h ? x)[n] =
∞ X
x[i]h[n − i]
(2.10)
−∞
Convolution of two discrete sequences of length M and N results in a sequence of length M + N − 1. The DFT has a similar but different property. Multiplication in time results in a circular convolution in the frequency domain and produces a sequence of length N for a DFT defined by 0 ≤ n < N . This is a property
6
CHAPTER 2. BACKGROUND
important in the use of the Cyclic Prefix that will be described in greater detail in Section 3.5. So we have ˆ x(ω) ⇐⇒ y[n] = (h ⊗ x)[n] yˆ = h(ω)ˆ
(2.11)
where convolution is defined as (h ⊗ x)[n] =
N −1 X
x[k]h[(n − k)modN ]
(2.12)
k=0
As you can see, what basically happens is that the summation is wrapped around by the mod function. When we start summing at indexes greater than N , we just go back to the start. This makes perfect sense as otherwise there would be a loss of information if we were to chop off convolutions in at N with which the DFT supports.
2.3
Zero Padding
Zero padding has interesting properties which are used in our system. The importance of zero padding in relation to the DFT is that the DFT is discrete and finitely supportive. Thus we need at times, we may need to increase sampling rates for better resolutions of signals. Sampling rates can be changed u by a rational factor M . This can be done by first interpolating at Mu and Md then decimating at Md . It could be done in the reverse but that would lead to a loss of too much information. Zero padding can be used in achieve the same effect when a higher resolution is needed in the frequency domain. Zero padding in the time domain gives what is called spectral interpolation. In the time domain, zero padding at the end of a signal results in the increase in spectral samples which are samples of the true Fourier transform. This provides higher resolution. An example is shown in Figure 2.2 Zero padding in the frequency domain has two distinct differences. Firstly, we zero pad after the Nyquist frequency at N/2 samples. This is because it is the highest positive frequency and we can maintain spectral symmetry in doing so. Secondly, we obtain a time domain sequence which has a reduced amplitude. This easily be fix by a multiplication of a constant gain of Mu .
2.4
Nyquist and Shannon
Here’s a bit of history to lead us into the next section. Nyquist set out to find the optimum pulse shape bandlimited to W Hz which maximized the
2.4. NYQUIST AND SHANNON
7
32 point Hanning window amplitude
1
0.5
0
0
5
10
15
20
25
30
35
25
30
35
100
120
140
100
120
140
amplitude dB
20 32 point FFT 10
0
0
5
10
15
20
amplitude
1 132 point Hanning window 0.5
0
0
20
40
60
80
amplitude dB
20 132 point FFT 10
0
0
20
40
60
80
Figure 2.2: Zero padding in the time domain.
bit rate over a bandlimited telegraph channel without ISI (Inter Channel Inteference). His findings led him to what is now called the N yquist rate, that is the maximum pulse rate 2W pulses/s. This pulse rate was found to be achieved by sinc interpolation, that is using a pulse (sin2πW t)/2πW t. This is also how we may obtain f (t) from x[n], where f (t) is the true Fourier transform of x[n]. This is called the Nyquist Cycle. Shannon derived limits for digital communications systems and established foundations in information transmission. He incorporated transmission power, bandwidth and noise into what is called the channel capacity. An ideal band-limited channel with white Gaussian noise and bandwitdh W has a caapcity C given by C = W log2 (1 +
P ) W No
bits/s
(2.13)
8
CHAPTER 2. BACKGROUND
Here, P is the average transmitted power and No is the PSD (Power Spectral Density) of the white noise.
2.5
Nyquist Condition for Zero ISI
The amount of inter-symbol interference can be viewed through what is commonly called eye patterns, shown in 2.3. Two dimensional digital eye patterns are commonly known as scatter graphs, shown in Figure 2.4. They compare the constellation of the original transmitted symbols to that of the received ones. Sampling time Timing error sensitivity
Peak distortion
Noise margin
Figure 2.3: Inter-symbol interference in eye patterns. Let’s now have a look at an expression for inter-symbol interference[3, p.554]. I first hesitated to put this in because the maths is not very insightful but the formulas in its form will be seen again. When we receive a signal it can be expressed as ∞ X y(t) = xn g(t − nT ) + v(t) (2.14) n=∞
where g(t) represents the overall channel filter, xn the input sequence and v(t) a noise sequence. If y(t) is samples now at t = kT + τ0 , k = 0, 1, ..., then we have ∞ X y(kT + τ0 ) ≡ xn g(kT − nT + τ0 ) + v(kT + τ0 ) (2.15) n=0
2.5. NYQUIST CONDITION FOR ZERO ISI
9
(a)
(b)
Figure 2.4: Scatter graph depiction. (a) Transmitted Symbols, (b) Received Symbols.
which can be written simply as, yk ≡
∞ X
xn gk−n + vk ,
k = 0, 1, ...
(2.16)
n=0
here τ0 is the delay through the channel. We can now re-write this as à ! ∞ 1 X yk = g0 xk + xn gk−n + vk , k = 0, 1, ... (2.17) g0 n=0, n6=k For the sake of convenience, we now set g0 = 1 and we get yk = xk +
∞ X
xn gk−n + vk ,
k = 0, 1, ...
(2.18)
n=0, n6=k
And finally, this is the form we want to arrive at because the first term xk represents the desired symbol and more importantly the second term ∞ X
xn gk−n
(2.19)
n=0, n6=k
represents the ISI. vk is the additive noise at the sampling instant k. The condition for no inter-symbol interference is ( 1 (n=0) p(t = nT ) ≡ xn = (2.20) 0 (n = ±1, ±2, ..) for a pulse shape p(t) and a sampling period of T . There are long mathematical proofs that provide further insight. But the principal is really quite simple and intuitive.
10
CHAPTER 2. BACKGROUND
Picture sampling a signal at period T . To change this discrete signal into an analog signal, we can introduce a convolution with a pulse shape. This pulse shape obviously needs to have nulls at all other sampling points other than the current sampling point for which we are shaping. Otherwise we will be interfering with other symbols. This condition is know as the N yquist pulse − shaping criterion or the N yquist condition f or zero ISI. What has been shown is p(t)
∞ X k=−∞
δ(t − kT ) =
∞ X
p(kT )δ(t − kT ) = δ(t)
(2.21)
k=−∞
This just demonstrates the recovery of the samples as explained earlier. It basically follows the previous criteria. From here, we can do a Fourier transform to obtain ∞ X m P (f − ) = T (2.22) T m=−∞ So it follows that the smallest theoretical bandwidth to obtain 0 ISI is W = 1/2T . This would obtained by using the ideal bandlimited sinc-pulse. In the frequency domain, it is always symmetrical with respect to 1/2T .
2.6
Random Processes
This section has been included because our signals, channel and interferences need to be characterized in some statistical sense and standard notation. So let’s define some of the terms to get us familiar with the underlying statistics behind our OFDM system. Firstly, what is a stochastic process? A stochastic process is a random process that generates a random variable at any given instant of time. A random variable is only but a single realization of all the possible samples or sample functions. The entire set of all possible sample functions is termed the ensemble. This is in general often assumed to be infinite in size and all we can do is to estimate this for which there are statistical averages to do so. We will always denote random variables in capitals. Now let’s take a sequence of random variables Xt , t = n, n + 1, ..., m from a stochastic process X(t). If we take another sequence of an arbitrary time shift k and if the joint PDFs Xt and Xt+k are identical, then we say that original stochastic process is stationary. What is a PDF? Well, the P robability Distribution F unction can be characterized by a funciont F (x) of the random variable X where we consider
2.6. RANDOM PROCESSES
11
X ≤ x where x ² <. Then we can write F (x) = P (X ≤ x),
2.6.1
−∞
(2.23)
Time Averages
Now that we have said that these ensembles are generally infinitely large, how can estimate them? Let’s first take a look at some definitions that require averaging over the infinite length ensemble and then refine it to its estimates. We shall restrict our attention to WSS random processes. Wide-Sense Stationary (WSS) is just the property of having stationary mean and autocorrelation functions. You most probably will come across the term mean ergodic, so let’s quickly define this. If for realizations x[n] of a random process X[n], the time average mx is always be found to be equal to the ensemble average µX , then the random process is said to be mean-ergodic. The time average of a specific realization can be defined as N X 1 mx = lim x[n] N →∞ 2N + 1 n=−N
(2.24)
Now the autocorrelation for realizations x[n] of process X[n], can be defined as N X 1 rxx [m] = lim x[n]x[n − m] (2.25) N →∞ 2N + 1 n=−N This is the correlation ergodic random process which will always result in the same sequence for the underlying random process. Note here that rxx [n] is calculated from a single realization whereas RXX [m] is a statistical property of the underlying random process. Now we are able to look at what is called Biased and Unbiased estimates of RXX [m]. For a sequence x[n] for 0 ≤ n < N , the unbiased estimate is as follows unbiased rxx [m]
1 = N − |m|
N −1−m+max(0,m)
X
x[n]x[n − m], |m| < N
(2.26)
n=max(0,m)
This is said to be unbiased because the average is taken over all outcomes x[n]. Another estimate can be formed and that is of the biased estimate biased [m] rxx
1 = N
N −1−m+max(0,m)
X
n=max(0,m)
x[n]x[n − m], |m| < N
(2.27)
12
2.7
CHAPTER 2. BACKGROUND
Linear Prediction
I believe this section is worth talking about since it leads directly into Wiener filters and all other filters we will deal with. We will see the famous normal equations which is really just a solution to a second order problem of minimising mean square errors. Hence, this solution and its many forms are basically seen everywhere! The aim of linear prediction is to predict a future sample of a random process. How is this possible? We try to find a set of coefficients a1 , a2 , ..., aN of past values which will minimize the prediction error e[n]. Let’s write some equations p X x¯[n] = ai xn−i (2.28) i=1
here x¯[n] is the prediction of the actual value of x[n]. The prediction error sequence e[n] is commonly known as the innovations sequence as it has fundementally new information. e[n] = x[n] − x¯[n]
(2.29)
What we now want to do is to minimize expected squared prediction error. We will use X[n] since we want to find coefficients that work for the underlying random process X[n]. Ã !2 N X 2 ¯ (2.30) E[(X[n] − X[n]) ] = E X[n] − ai X[n − i] i=1
Now what is called the normal equations is found by differentiating with respect to ap for each p. The derivative set to zero gives à !2 N X ∂ 0= E X[n] − ai X[n − i] ∂ap i=1 " à !# N X = 2E X[n − p] X[n] − ai X[n − i] = 2E[X[n − p]X[n]] − 2
i=1 N X
E[ai X[n − p]X[n − i]]
i=1
= 2RXX [p] − 2
N X i=1
ai RXX [p − i],
1≤p≤N
(2.31)
2.8. WIENER FILTERING
13
If we write this out in matrix form, we can see that RXX has a particular structure known as toeplitz for which robust algorithm for its inverse exist. RXX [1] a1 RXX [0] RXX [0] · · · RXX [N − 1] RXX [1] RXX [1] · · · RXX [N − 2] a2 RXX [2] = .. . .. .. .. ... .. . . . . RXX [N ] aN RXX [N − 1] RXX [N − 2] · · · RXX [0] using the notation representaion RXX a = r for which we can solve for the coefficients a = R−1 XX r
2.8
(2.32)
Wiener Filtering
We are actually not talking about sausages here but something just as interesting. In linear prediction, we assume we have access to the sequence y[n − i], 1 ≤ i < N where N is the filter order, for which we predict y¯[n]. But in most real cases we do not have access to the original sequence. It is usually corrupted by noise or interference when received. So what we do now is we predict y¯[n] from another sequence x[n] which comes from the process X[n]. For this to work, the random processes Y [n] and X[n] must be correlated in some way otherwise the prediction would be of no use. Like Linear prediction, we will try to find the optimal coefficients a0 , .., aN to predict y¯[n]. N X y¯[n] = ai xn−i (2.33) i=0
Again, we try to minimize the expected power of the error e[n] = y[n] − y¯[n]. That is we try to minimize à !2 N X 2 ¯ E[(Y [n] − X[n]) ] = E Y [n] − ai X[n − i] (2.34) i=0
At this point, we can differentiate or apply the orthogonality principle with which we can say that an optimal linear predictor will provide an innovation E[n] which is uncorrelated with the source random variables. Note that E[n]
14
CHAPTER 2. BACKGROUND
here should not be confused with an expectation of n. It is the random process from which the realization e[n] is made. 0 = E[E[n]X[n − p]] "Ã ! # N X =E Y [n] − ai X[n − i] X[n − p] i=0
= RY X [p] −
N X
ai RXX [p − i],
0≤p≤N
(2.35)
i=0
In matrix from, the expression is as follows. This should look familiar
RXX [0] RXX [1] .. .
RXX [0] RXX [1] .. .
··· RXX [N ] a1 RXX [0] · · · RXX [N − 1] a2 RXX [2] = .. . .. .. .. . . .
RXX [N ] RXX [N − 1] · · ·
RXX [0]
aN
RXX [N ]
The coefficients a0 , .., aN form an FIR filter. When we filter the source sequence x[n], we will obtain y¯[n]. This is simply what is known as the N th order Wiener filter!
2.9
Multipath Channels
The concept of multipath propagation is very simple, there is no need for a diagram. Whenever a signal is transmitted and there are obstacles and surfaces for reflection, multiple reflected signals of the same source can arrive at the receiver at different times. Such “echoes” will no doubt effect other incoming signals. These echoes are directly influenced by the material properties of the surface it reflects or permeates. These can be relative to dieletric constants, permeability, conductivity, thickness, etc. These echoes can contain useful information but we will not concern ourselves with that field of study in this thesis. Multipath propagation in indoor environments are traditionally modeled using ray tracing which just calculates all the reflections. If no measure are taken to counter the echoes, then these echoes will interfere with other signals causing ISI. We will now describe multipath with some mathematical terminology.
2.9. MULTIPATH CHANNELS
2.9.1
15
Power Delay profile
The PDP is defined as the square absolute value of the channel impulse response. N −1 X P (t) = a2k δ(t − τk ) (2.36) k=0
P (t) is the PDP as a function of t, k is the filter tap index and τ is the time delay. The PDP represents the relative received power in excess delay with respect to the first path. Power delay profiles are usually found by averaging instantaneous PDP measurements. With indoor RF channels, the PDP of the channel is most usually an exponentially decaying function. And of course the instantaneous frequency response of a channel can be calculated from the PDP.
2.9.2
RMS Delay Spread
The RMS delay spread τrms , follows directly from PDP so let’s quickly define what it is sR R (t − τ¯)2 P (t)dt tP (t)dt R τrms = where τ¯ = (2.37) P (t)dt P (t)dt The value τrms can be used as a rough indication of the maximum data rate that can be reliably supported by the channel without equalization.
2.9.3
Coherence Bandwidth
The coherence bandwidth Bcoh gives a measure of the statistical average bandwidth for which the channel characteristics are correlated. Let us start by defining the autocorrelation of a channel frequency response from its statistical expectation. According to [1, p.21] 1 (2.38) R(∆f ) = E[H(f )H ∗ (f + ∆f )] = 1 + j2πτrms ∆f and 1 R(∆f ) = E{|H(f )||H ∗ (f + ∆f )|} = (2.39) 1 + (2πτrms ∆f )2 Now Bc is defined as the value of ∆f for which RA (∆f ) has decreased with 3 dB 1 R(∆f ) = f or which ∆f = Bc (2.40) R(0) 2 It is useful to note that for exponential delay spread channels, Bc = 1/(2πτrms ).
16
2.9.4
CHAPTER 2. BACKGROUND
Coherence Time
The coherence time Tc is the time for which the correlation of the channel responses decrease by 3 dB. The time correlation function is defined as Z R(∆t) = h(t)h∗ (t + ∆t)dt (2.41) As the time between two channel responses increase, the correlation generally declines.
2.9.5
Doppler Spectrum
The Doppler spectrum can be obtained from the Fourier transform of the time correlation function. Z Ph (f ) = R(∆t)e−j2πf t d∆t (2.42) The Doppler bandwidth is defined as the 3dB bandwidth of the Doppler spectrum.
2.9.6
Fading in Multipath
The terminology we have so far defined allows us to conveniently characterize different types of channels. The first two are characterised in the frequency domain and the latter two are characterised in the time domain. Let’s first look at Non-Frequency Selective (Flat) Fading. It basically means what it’s name says. This channel type has linear phase which means constant group delay. How this fading affects communication is determined by the relation between the bandwidth of the signal Bs and the coherence bandwidth Bc . Bs ¿ Bc (2.43) This channel type is particularly evident on OFDM systems with narrow band subcarriers. Because each resides over a small bandwitdh, the cannel response can be considered constant and thus flat. As opposed to the above, Frequency Selective Fading is usually referred to as wideband channel because the bandwidth of the signal is wider than bandwidth of the channel’s frequency response. In frequency selective fading, the spectral component of the signal undergoes a non constant gain
2.9. MULTIPATH CHANNELS
17
and non linear phase distortion as such the signal spectra is not preserved. That is Bs > B c (2.44) Let us now turn to analysing channels in the time domain. In Slow Fading channels, the impulse response changes slowly compared to that of the symbol period Ts . That is Ts ¿ Tc (2.45) Fast Fading on the other hand just means the opposite. That is Ts > T c
(2.46)
This means that during a single symbol period, the impulse response of the channel may have changed more than once.
18
CHAPTER 2. BACKGROUND
Chapter 3 OFDM basics 3.1
Introduction
OFDM is a modulation technique in that it modulates data onto equally spaced sub-carriers. The information is modulated onto the sub-carrier by varying the phase, amplitude, or both. Each sub-carrier then combined together by using the inverse fast fourier transform to yield the time domain waveform that is to be transmitted. To obtain a high spectral efficiency the frequency response of each of the sub-carriers are overlapping and orthogonal. This orthogonality prevents interference between the sub-carriers (ICI) and is preserved even when the signal passes through a multipath channel by introducing a Cyclic Prefix, which prevents Inter-symbol Interference (ISI) on the carriers. This makes OFDM especially suited to wireless communications applications.
19
20
CHAPTER 3. OFDM BASICS
3.2
Advantages / Disadvantages
OFDM has the following advantages[5, p.23-24]: • OFDM is an efficient way to deal with multipath; implementation complexity is significantly lower than single carrier with equalizer. • In relatively slow time-varying channels, performance can be enhanced by the adaptability of the data rate according to the SNR ratio of that sub-carrier. • OFDM is robust against narrowband interference, because such interference affects only a small number of sub-carriers. • OFDM makes single-frequency networks possible, which is especially attractive for broadcasting applications. On the other hand, OFDM has the following disadvantages compared to single-carrier modulation: • OFDM is more sensitive to frequency offsets and phase noise. • OFDM has a relatively large peak-to-average power ratio, which reduces the power efficiency of the RF amplifier.
3.3
Multicarrier vs Single carrier
This table compares the advantages of single carrier and multi carrier modulation[2, p.204]: Issue Performance in Gaussian Noise Sensitive to impulse noise Sensitive to narrowband noise Sensitive to clipping Sensitive to timing jitter and phase noise Latency Computations per unit time Cost and power usage in analog sections Adaptability of bit rate
Single
Multi
Equivalent x
x x x x x x x x
Table 3.1: Advantages of single and multi-carrier modulation.
3.4. ORTHOGONALITY
3.4
21
Orthogonality
Two periodic signals are orthogonal when the integral of their product over one period is equal to zero. For the case of continuous time: Z T cos(2πnf0 t)cos(2πmf0 t)dt = 0, (m 6= n)
(3.1)
0
For the case of discrete time: µ ¶ µ ¶ N −1 X 2πkn 2πkm cos cos dt = 0, (m 6= n) N N k=0
(3.2)
To maintain orthogonality between sub-carriers, it is necessary to ensure that the symbol time contains one or more multiple cycles of each sinusoidal carrier waveform. In the case of OFDM, the sinusoids of our sub-carriers will satisfy this requirement since each is a multiple of a fundamental frequency. Orthogonality is critical since it prevents inter-carrier interference (ICI). ICI occurs when the integral of the carrier products are no longer zero over the integration period, so signal components from one sub-carrier causes interference to neighbouring sub-carriers. As such, OFDM is highly sensitive to frequency dispersion caused by Doppler shifts, which results in loss of orthogonality between sub-carriers.
3.4.1
OFDM sub-carriers
Each sub-carrier in an OFDM system is a sinusoid with a frequency that is an integer multiple of a fundamental frequency f0 . Each sub-carrier is like a Fourier series component of the composite signal, an OFDM symbol. In Figure 3.1, all the sub-carriers have the same amplitude and phase, but in practice these will be modulated separately through the use of Quadrature Amplitude Modulation (QAM). The sub-carrier waveform can be expressed as the following equation: s(t) = cos(2πfc t + θk ) = an cos(2πnf0 t) + bn sin(2πnf0 t) p = a2n + b2n cos(2πnf0 t + φn ), where φn = tan−1 ( abnn )
(3.3)
The sum of the sub-carriers is then the baseband OFDM signal: sB (t) =
N −1 X
{an cos(2πnf0 t) − bn sin(2πnf0 t)}
n=0
(3.4)
22
CHAPTER 3. OFDM BASICS
Harmonics Summed To Create Parralel Data Signals. 2 1 0 0 1
200
400
600
800
1000
1200
200
400
600
800
1000
1200
200
400
600
800
1000
1200
200
400
600
800
1000
1200
200
400
600
800
1000
1200
200
400
600
800
1000
1200
0 −1 0 1 0 −1 0 1 0 −1 0 1 0 −1 0 1 0 −1
0
Figure 3.1: Harmonics which are summed to create sub-carriers.
3.4.2
OFDM Spectrum
Our OFDM symbol is a sum of sinusoids of a fundamental frequency and its harmonics in the time domain. The rectangular windowing of the transmitted OFDM symbol results in a sinc function at each sub-carrier frequency in the frequency response. Thus, the frequency spectrum of an OFDM symbol is as shown below: The Figure 3.2 is not the actual spectrum of OFDM. The spectrum of each sub-carrier has been superimposed to illustrate the orthogonality of the sub-carriers. Although overlapping, the sub-carriers do not interfere with each other since each sub-carrier peak corresponds to a zero crossing for all other sub-carriers.
3.5. INTER SYMBOL INTERFERENCE
23
OFDM Symbol Spectrum 10
9
8
7
6
5
4
3
2
1
0 −1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
0.6
0.8
1
Figure 3.2: OFDM symbol spectrum.
3.5
Inter symbol Interference
Inter symbol interference (ISI) is when energy from one symbol spills over to the next symbol. This is usually caused by time dispersion in multi-path when reflections of the previous symbol interfere with the current symbol. In OFDM, because each sub-carrier is transmitting at a lower data rate (longer symbol duration), this will negate the effects of time dispersion, which results in ISI.
3.6
Inter carrier Interference
Inter carrier interference (ICI) is occurs when the sub carriers lose their orthogonality, causing the sub carriers to interfere with each other. This can arise due to doppler shifts and frequency and phase offsets.
24
CHAPTER 3. OFDM BASICS
3.7
Cyclic Prefix / Guard Interval
The Cyclic Prefix is a periodic extension of the last part of an OFDM symbol that is added to the front of the symbol in the transmitter, and is removed at the receiver before demodulation. The Cyclic Prefix has two important benefits: • The Cyclic Prefix acts as a guard space between successive OFDM symbols and therefore prevents Inter-symbol Interference (ISI), as long as the length of the CP is longer than the impulse response of the channel. • The Cyclic Prefix ensures orthogonality between the sub-carriers by keeping the OFDM symbol periodic over the extended symbol duration, and therefore avoiding Inter-carrier Interference (ICI). Mathematically, the Cyclic Prefix / Guard Interval converts the linear convolution with the channel impulse response into a cyclic convolution. This results in a diagonalised channel, which is free of ISI and ICI interference. (see part ??) The disadvantage of the Cyclic Prefix is that there is a reduction in the Signal to Noise Ratio due to a lower efficiency by duplicating the symbol. This SNR loss is given by: µ ¶ Tcp SN Rloss = −10log10 1 − (3.5) T where Tcp is the length of the Cyclic Prefix and T = Tcp + Ts is the length of the transmitted symbol. To minimise the loss of SNR, the CP should not be made longer than necessary to avoid ISI and ICI.
3.8
IDFT
OFDM modulation is applied in the frequency domain. The complex QAM data symbols are modulated onto orthogonal sub-carriers. But in order to transmit over a channel, we need a signal in the time domain. To do this, we apply the Inverse Discrete Fourier Transform (IDFT) in the transmitter to convert the signal from frequency domain to an OFDM symbol in the
3.8. IDFT
25
time domain. Because the IDFT is a linear transformation, the DFT can be applied at the receiver to convert the data back into the frequency domain. This section will provide an explanation of the IDFT / DFT and why it is a key component of an OFDM system. To implement the multi-carrier system using a bank of parallel oscillators and modulators would not be very efficient in analog hardware. However, in the digital domain, multicarrier-modulation can be done very efficiently with the current DSP hardware and software. To do this modulation we exploit the properties of the Discrete Fourier Transform (DFT) and the Inverse DFT (IDFT). From Fourier, we know that when the DFT of a sampled time signal is taken, the frequency domain results are the components of the signal with respect to the Fourier Basis which are multiples of a fundamental frequency as a function of the sampling period and the number of samples. The IDFT performs the opposite the DFT. It takes the signal defined by the frequency components and converts them to a time signal. In OFDM, we compose the signal in the frequency domain. Since the Fourier Basis is orthogonal, we just take the IDFT of the N inputs which are our frequency components to convert to a time domain equivalent for transmission over the channel. In practice, the Fast Fourier Transform (FFT) and IFFT are used instead of the DFT and IDFT because of their lower hardware complexity. All further references will be to FFT and IFFT.
26
CHAPTER 3. OFDM BASICS
Chapter 4 OFDM Simulation Model There have been a few implementations of OFDM systems done in past theses. All of which do not really provide any insight into the system and how it works. All are done in baseband with simple IFFT and FFT modulation and simple Cyclic extensions and removal to obtain the original signal. This may be due to a lack of understanding in the basics of digital modulation. I say this because personally, I have spent many hours getting over hurdles which were rather basic. Some of these problems and their solution are already documented in Chapter 2 and I will not reiterate on those. Before we look into the bandpass OFDM, a basic skeleton OFDM can be found in Appendix A. This model does not provide great insight into the workings of OFDM but is used as a structure for our other simulations. From here on we will look at an OFDM simulation model that provides greater insight in taking its symbols into the bandpass.
4.0.1
Introduction
My motivation was to use the parameters of the European standard Hyperlan/2 and see how they affect an OFDM system. The Hiperlan/2 standard for wireless LAN transmissions in the 5.2 GHz frequency band makes use of OFDM modulation with a TDMA access scheme to efficiently exploit time dispersive channels with frequency selective fading. The use and advantages of narrowband subcarrier multi-carrier transmissions have been explored in Chapter 3. Looking at OFDM formulas in text books and papers intrigued me to find what these signals actually look like in bandpass transmission. This is what this simulation will show. There was no real reason for choosing Hyperlan/2 over 802.11a, which is also another standard for wireless LAN transmissions. Their parameters are 27
28
CHAPTER 4. OFDM SIMULATION MODEL
quite similar but they work on different frequencies, have different synchronisation protocol and others. The main purpose of the simulation is to see what these signals look like at various stages in the transmission process. Important OFDM parameters for Hiperlan/2 [16] are summarized in Table 4.1. These parameters are incorporated into our OFDM model which can be found in Appendix B. Parameter Sampling rate F0 = 1/T Carrier central frequency fc FFT size N Useful symbol part duration TU Cyclic prefix duration TCP Symbol interval T S = TU + TCP Number of data sub-carriers NSD Number of pilot sub-carriers NSP Total sub-carriers NST = NSD + NSP Sub-carrier spacing F = 1/TU Nominal bandwidth B = NST F Data symbol constellations
Value 20 MHz 5.2 GHz 64 64T = 3.2µs 16T = 0.8µs (optional 8T = 0.4µs) 80T = 4.0µs (optional 72T = 3.6µs) 48 4 52 0.3125 MHz 16.25 MHz BPSK, QPSK, 16-QAM, 64-QAM
Table 4.1: OFDM parameters for Hyperlan/2. So, here I will present my OFDM model based on Hyperlan/2 paramaters, modulating baseband QAM symbols onto a carrier at the 2.4GHz frequency. Hyperlan/2 actually runs at on 5.2GHz but that would mean I had to sample at more than 10.4GHz which had taken considerable time and strained my computer. Let’s take a look at what I have done then!
4.0.2
The Simulation
To begin, we should look at a diagram of the implementation to get a general idea of what is begin simulated. Figure 4.1 shows the exact model of our simulation. Each part will be explained carefully in all its intricacies. At this point I should also mention that two downconversion methods were implemented. Downconversion is done to take a signal from the bandpass to the baseband. This can be done in many ways but the two implemented techniques are the LPF method and the Hilbert. Both will be discussed later. Please take note of the letters in Figure 4.1. Each letter corresponds to the signal at that time. These will be used to make our model clearer as we discuss signals and their Figures.
29
A binary input
B QAM modulation
C IFFT
D
fc
E Transmit Filter
GII
P/S
F
G
uknown channel ˆ h(w)
BER calcuation
H
binary output
I
QAM demodulation and detector
P/S
P O
S/P
FFT
N
M
Sampler
GIR
L
K
LPF
J
fc
Figure 4.1: OFDM simulation block diagram.
First on the diagram is the QAM modulation block. The code for this can be found in Appendix A. It just basically takes in an arbitrary number of bits to encode a symbol, a bit stream of data and outputs a sequence of QAM symbols. In all our simulations, we have used 4 bits per symbol. This constellation pattern can be seen in Figure 4.2. The QAM modulator performs a serial to parallel (S/P) conversion automatically to feed the signal into the IFFT which is the next block. This operation of feeding signals in parallel is because the FFT operates on samples simultaneously. The principal of using the DFT was brought up in [9] and discussed previously in section 3.6. I would also like to mention the use of adaptive loading in variable SNR environments. This is discussed in [11] and would be interesting for further research. This concerns the QAM modulator which in our case is static as always encodes 4 bits per symbol no matter the channel quality on the subcarrier. [11] also describes the power spectra of multi-carrier systems which we will look into later. Assigning data onto the sub-carriers is also subject to much debate. Hyperlan/2 only uses 48 data carrying carriers for an FFT of size 64. 4 subcarriers are used for pilot tones and the remaining are left unused. In our simulation, we use all 64 carriers to carry data. The spacing between these sub-carriers is determined by the sampling frequency. To understand this, please refer to Section 2.1. It is a basic principal of the DFT which is explained in detail.
30
CHAPTER 4. OFDM SIMULATION MODEL
4 bit QAM constellation 3
2
Imaginary
1
0
−1
−2
−3
−3
−2
−1
0
1
2
3
Real
Figure 4.2: Signal at (B).
Now the IFFT outputs a signal (C) which is then passed into the P/S block. This may seem trivial but it has many implications. At first I thought that the signal (D) which is period in the frequency domain could be bandpass windowed at the carrier frequency to obtain a train of sinc functions in the time domain. This signal would be a bandpass signal already particularly since the sinc function satisfies the Nyquist zero ISI criterion and would be a natural pulse shape filter! This would also change our discrete time domain signal to be analog. The problem with this is that the frequency samples are complex and will introduce delays in the time domain. This is because a phase shift in the frequency domain is equivalent to a delay in the time domain. The periodically spaced frequency samples are most likely complex and contain a non zero angle. Some OFDM systems propose that the signal (C)/(D) should be real [8]. How does one generate real outputs from an IFFT? Well, it is a property of the DFT known as the conjugate symmetry. That is the IDFT of D[n] is real if D[n] = D∗ [N − n] for the sequence length N . Anyhow, this does not really suit our purpose since we can send complex signal over the I and Q channels. This will be discussed when we come to
31
upconverting. The signal (D) is now passed through to the GII (Gaurd Interval Insertion) also commonly known as the Cyclic Prefix Insertion. The implications of this are important and is discussed in detail in Section 3.5. May papers refer to [8] as the inventors of this method but their paper just seems to merely state the use of it. Anyway, an OFDM symbol at (E) now has 80 samples. This is because the original symbol has 64 samples and we add the 16 cyclic extended samples to give 80. Many OFDM systems window the signal (E). We do not do this because we have not incorporated a cyclic postfix and thus we would have attenuated some subcarriers near the Nyquist and DC frequency The OFDM cyclic prefix is discussed in detail in section 3.5. Cyclic postfixes are discussed in [5] and in other sources because of the effects of the OFDM window operation. The cylic postfix just acts as a gaurd against the roll-off effects of windowing without a perfect LPF. Paper [9] and in the text [5, p.65] windowing of the OFDM is discussed in detail. The reason for windowing arises from the fact that an OFDM (D) is made from a series of IFFTs that are concatenated to each other. Therefore, at each symbol boundary, there will be a signal discontinuity between the end of one symbol and the start of the next. This can cause high frequency spectral noise which should be avoided. So that is why a window function with some type of smooth roll-off whould be applied. Some proposed OFDM systems use window sizes which zero cross at the FFT Nyquist frequency[17, p.109]. This leads to distortion in the subcarriers near the Nyquist frequency due to attenuation by the filter roll-offs. The DC carriers may also be distorted and is commonly not used for data transmissions. Figure 4.3 shows the signal at (E). This signal may seem somewhat erratic but it does have some underlying structure to it because it is basically the output of the FFT which is a sampled version of the sum weighted harmonics. Now, signal (E) is passed to the transmit filter where we pulse shape it using the raised cosine pulse. This is because this particular pulse shape satisfies the Nyquist criteria for zero ISI as discussed in Section 2.5. It also converts our digital signal into a somewhat analog form and also LPF our spectrum. You may think that passing a signal through a LPF will remove information from the signal. Well, it is true that the signal is attenuated, but the important thing in pulse shaping is that the sampling points actually remain the same! This is the Nyquist zero ISI theorem once again. We should note that before we pulse shape filter the signal, we need to interpolate the signal so that there would be enough samples for upconverting to the carrier frequency. We in fact need more samples than that determined by the carrier frequency. To make all this clearer, the receiver needs to
32
CHAPTER 4. OFDM SIMULATION MODEL
Cycl. Ext. Signal (Time) 1
Amplitude
0.8 0.6 0.4 0.2 0
0
0.5
1
1.5
2
2.5
3
3.5
4
Time (s) x 10−6 Specturm of Cycl. Ext. Signal (Freq) 8
Amplitude
6
4
2
0 −1
−0.8
−0.6
−0.4
−0.2
0
0.2
0.4
Frequncy (Hz)
0.6
0.8
1 7
x 10
Figure 4.3: Signal at (E).
sample the transmitted bandpass signal at twice the highest frequency, which is indeed the carrier frequency. The simulation model samples at five times the carrier frequency. In order to do this, we need all those extra samples and that’s why we need to interpolate. The interpolation factor is determined from Ts = 4e-6; % Symbol period is 4e-6 seconds. fc = 2.4e9; % Carrier freq. Rfs = 5*fc; % Simulation frequency. RT = 1/Rfs; % The real-time sampling period rt = RT:RT:Ts; % The time samples in real-time bandpass and the interpolation factor itself is given by over=size(rt)/80-1=599 which can be seen in the code accordingly. Figure 4.4 shows the pulse shaping in action. We can see how the raised cosine does not introduce ISI by attenuating the amplitude at the other sample times. The spectrum of the signal shows the bandwidth of the OFDM symbol.
33
Signal after pulse shaping. 0.7
Amplitude
0.6 0.5 0.4 0.3 0.2 0.1 0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5 −7
Time (s)
x 10
Spectrum of OFDM Symbol 4000
Amplitude
3000
2000
1000
0 −5
−4
−3
−2
−1
0
1
Frequncy (Hz)
2
3
4
5 11
x 10
Figure 4.4: Signal at (F).
Interesting things happens when this signal is upconverted to the carrier frequency. We cannot transmit imaginary symbols, it has no meaning, so the signal G) is made real by taking the real components of the multiplication with a complex carrier. For a complex symbol a + jb, on multiplication with a complex carrier jfc t e and taking the real components gives real[(a + jb)ejfc t ] = real [(a + jb)(cos(fc t) + jsin(fc t))] = real [acos(fc t) + ajsin(fc t) + bjcos(fc t) − bsin(fc t)] = acos(fc t) − bsin(fc t) (4.1) This is our bandpass signal at G) which is real. We actually need to scale this by a factor of two, the reason for this will be made clear when we come to downconverting the signal. So how can we split it back into its real and imaginary parts for demodulation? This is the operation of the downconverter, to bring the signal back into baseband. This was done using an LPF
34
CHAPTER 4. OFDM SIMULATION MODEL
and a Hilbert filter. We will discuss this later. Now, we will have a look at what our bandpass signal looks like. Figure 4.5 shows the envelope structure of the time domain signal. The solid looking component is actually a carrier sinusoid at the frequency of 2.4 GHz as indicated by the corresponding spectrum graph. The time domain graph does not span an entire OFDM for graphing purposes, otherwise we would not see it properly.
Bandpass signal (time) 1.5
Amplitude
1 0.5 0 −0.5 −1 −1.5
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Time (s) x 10−7 Spectrum of Bandpass Signal (Freq) 4000
Amplitude
3000
2000
1000
0 −6
−4
−2
0
2
Frequncy (Hz)
4
6 9
x 10
Figure 4.5: Signal at (G).
Block diagrams usually show the process of downconverting to be just that of a multiplication with a complex carrier e−jfc t . This is somewhat misleading because when we are dealing with I and Q channels multiplying e−jfc t by the signal (G) in Equation (4.1) does not recover the original complex baseband signal a + jb. Something more needs to be done and that’s where the LPF and the Hilbert transform comes in. Let’s just multiply our signal (G) with the complex sinusoid and see what we get
35
(G)e−jfc t = (acos(fc t) − bsin(fc t))(cos(fc t) − jsin(fc t)) = acos2 (fc t) − ajcos(fc t)sin(fc t) − bcos(fc t)sin(fc t) + bjsin( fc t) a aj b bj = (cos(2fc t) + 1) − sin(2fc t) − sin(fc t) + (1 − cos(2fc t)) 2 2 2 2 (now applying LPF to filter out the double angles above) a bj = + (4.2) 2 2 So amazingly, we have recovered our complex baseband signal. In the frequency domain however, the use of the LPF is much more intuitive. On modulation with a carrier, we of course result in the duplication of the baseband signal spectrum at the carrier frequency. This is because the dual of multiplication is convolution in the frequency domain. After shifting this spectrum back down on multiplication with e−jfc t , we must remove the other duplicate and thus the need for the LPF. We should also note here that the recovered signal power has descreased by half the signal amplitude. For this reason, we introduce the gain of 2 in the transmitter as previously mentioned. Let’s have a look at an LPF implementation of this in our simulation. The LPF is designed by the Parks-McClellan optimal equiripple FIR filter design. It is optimal in the sense with which it best approximates the desired frequency response for a given filter order. Figure 4.6 shows the LPF in red as it filters the relevant part of our signal. Note that in a noiseless channel, the signal (G) ≡ (H). Downconversion can also be done with the Hilbert transformer. This basically splits the signal with respect to phase on reception. Thus, all we need to do is downconvert on multiplying by e−jfc t with no need for a LPF. Figure 4.7 shows the Hilbert filter in action on the signal (G/(H)). Just a small note, the time domain signal in Figure 4.7 may look different in this graph, it is because the Hilbert filter is in another file and the inputs are randomly generated. The code for our OFDM system using a Hilbert transform on reception can be found in Appendix C. After we perform either the LPF or use the Hilbert transform and downconversion, we get the signal (J). Under noiseless conditions it is the same as the pulse shaped signal found in Figure 4.4. This recovered signal is displayed in Figure 4.8. What we now do is sample it periodically corresponding to the discrete signals in Figure 4.4. This is where OFDM synchronisation becomes such an important and sensitive issue. But once sampled, we have already recovered our baseband symbols! This is the signal at (K). All we do now is just do
36
CHAPTER 4. OFDM SIMULATION MODEL
Received Baseband Signal (time) 1.4
Amplitude
1.2 1 0.8 0.6 0.4 0.2 0
0
0.5
1
1.5
2
2.5
3
3.5
4
Time (s)
4.5 −7
x 10
Spectrum of Baseband Signal (Freq) 1.4
Amplitude
1.2 1 0.8 0.6 0.4 0.2 0 −6
−4
−2
0
2
Frequncy (Hz)
4
6 9
x 10
Figure 4.6: Signal at (G)/(H).
the inverse of that in the transmitter and we get our QAM symbols back at the receiver, that is signal (N). Figure ?? shows the recovered signal at (N) without the use constellation detection. Figure ?? is a scatter diagram showing no noise. This is because the channel was noiseless for the purposes of demonstrating the OFDM transmission and reception technique.
4.0.3
Summary
We have taken an OFDM symbol from baseband to bandpass and back again. This model has provided us with realizations of the signals at each stage of OFDM syntheses. We have been able to analyse the signals both in time and frequency to see the implications of the parameters we have used. We hope that future thesis students who research this area may gain considerable insight from our model and be able to take it further.
37
Received Baseband Signal (time) 2
Amplitude
1.5
1
0.5
0
0
0.5
1
1.5
2
2.5
3
3.5
4
Time (s)
4.5 −7
x 10
Spectrum of Baseband Signal (Freq) 1.4
Amplitude
1.2 1 0.8 0.6 0.4 0.2 0 −6
−4
−2
0
2
Frequncy (Hz)
Figure 4.7: Signal at (G)/(H).
4
6 9
x 10
38
CHAPTER 4. OFDM SIMULATION MODEL
Received Baseband LPF Signal (time) 0.7
Amplitude
0.6 0.5 0.4 0.3 0.2 0.1 0
0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Time (s) x 10−7 Spectrum of Baseband LPF Signal (Freq) 4000
Amplitude
3000
2000
1000
0 −6
−4
−2
0
2
Frequncy (Hz)
Figure 4.8: Signal at (J).
4
6 9
x 10
39
Received Symbols
2.5 2 1.5
Imaginary
1 0.5 0 −0.5 −1 −1.5 −2 −2.5
−3
−2
−1
0
1
Real
Figure 4.9: Signal at (N).
2
3
40
CHAPTER 4. OFDM SIMULATION MODEL
Chapter 5 Channel Estimation 5.1
Introduction
In a wireless environment, the channel is much more unpredictable than a wire channel because of a combination of factors such as multi-path, frequency offset, timing offset, and noise. This results in random distortions in amplitude and phase of the received signal as it passes through the channel. These distortions change with time since the wireless channel response is time varying. Channel estimation attempts to track the channel response by periodically sending known pilot symbols, which enables it to characterise the channel at that time. This pilot information is used as a reference for channel estimation. The channel estimate can then be used by an equalizer to correct the received constellation data so that they can be correctly demodulated to binary data. Modulation can be classified as differential or coherent. For differential, information is encoded in the difference between two consecutive symbols so no channel estimate is required. However, this limits the number of bits per symbol and results in a 3-dB loss in SNR [?]. Coherent modulation allows the use of arbitrary signaling constellations, allowing for a much higher bit rate than differential modulation and better efficiency. This chapter will give a description of our system environment, the channel model and present several channel estimation techniques that are required for the case of coherent modulation.
41
42
CHAPTER 5. CHANNEL ESTIMATION
5.2 5.2.1
System Environment Wireless
The system environment we will be considering in this thesis will be wireless indoor and urban areas, where the path between transmitter and receiver is blocked by various objects and obstacles. For example, an indoor environment has walls and furniture, while the outdoor environment contains buildings and trees. This can be characterized by the impulse response in a wireless environment.
5.2.2
Multipath Fading
Most indoor and urban areas do not have direct line of sight propagation between the transmitter and receiver. Multi-path occurs as a result of reflections and diffractions by objects of the transmitted signal in a wireless environment. These objects can be such things as buildings and trees. The reflected signals arrive with random phase offsets as each reflection follows a different path to the receiver. The signal power of the waves also decreases as the distance increases. The result is random signal fading as these reflections destructively and constructively superimpose on each other. The degree of fading will depend on the delay spread (or phase offset) and their relative signal power.
5.2.3
Fading Effects due to Multi-path Fading
Time dispersion due to multi-path leads to either flat fading or frequency selective fading: • Flat fading occurs when the delay is less than the symbol period and affects all frequencies equally. This type of fading changes the gain of the signal but not the spectrum. This is known as amplitude varying channels or narrowband channels, since the bandwidth of the applied signal is narrow compared to the channel bandwidth. • Frequency selective fading occurs when the delay is larger than the symbol period. In the frequency domain, certain frequencies will have greater gain than others frequencies.
5.3. CHANNEL MODEL
5.2.4
43
White noise
In wireless environments, random changes in the physical environment resulting in thermal noise and unwanted interference from many other sources can cause the signal to be corrupted. Since it is not possible to take into account all of these sources, we assume that they produce a single random signal with uniform distributions across all frequencies. This is known as white noise.
5.3
Channel Model
This section will show how the channel will become diagonalised from a cyclic convolution due to the insertion of the Cyclic Prefix. If the Cyclic Prefix is longer than the impulse response of the channel, we can show that the OFDM channel can be viewed as a set of parallel Gaussian channel (a complex gain followed by Additive White Gaussian noise) that is free of ISI and ICI. h0
n0
x0
y0 .. .
xN −1
hN −1
nN −1.. . yN −1
Figure 5.1: Parallel Gaussian channels. First, let our QAM signalling symbols be expressed as x0 x1 x = .. . xN −1 After we apply the IFFT to s, our OFDM symbol becomes X0 X1 H x = F x = .. . XN −1
(5.1)
(5.2)
44
CHAPTER 5. CHANNEL ESTIMATION
where the matrix F is the DFT matrix. For the channel impulse response h0 h1 h = .. (5.3) . hm−1 where m is less than the length of the cyclic prefix. To simplify our derivation, we will choose N = 4 sub-carriers and m = 2 tap impulse response, but this proof will generally apply as long as m satisfies the above condition. So after passing through the multi-path channel, the received OFDM symbol can be expressed as a convolution, h ? x. In matrix form, this becomes Y0 h0 0 0 0 X0 Y1 h1 h0 0 0 X1 y= (5.4) Y2 = 0 h1 h0 0 X2 Y3 0 0 h1 h0 X3 If we insert the cyclic prefix before sending across the channel, this convolution becomes YCP h0 0 0 0 0 X3 Y0 h1 h0 0 0 0 X0 = 0 h1 h0 0 0 X1 Y y= (5.5) 1 Y2 0 0 h1 h0 0 X2 Y3 0 0 0 h1 h0 X3 And after removing the cyclic h0 0 0 Y0 Y1 h1 h0 0 y= Y2 = 0 h1 h0 Y3 0 0 h1
prefix at the receiver, we can express this as h1 X0 0 X1 ⇐⇒ Y = HX’ = Hc X (5.6) 0 X2 X3 h0
This is equivalent to a circular convolution. The channel matrix Hc is now a circulant matrix and X’ is the cyclically extended symbol. We can now use the property of circular convolution on finite length sequences, y = h ⊗ x ⇐⇒ Y[k] = H[k]X[k],
k = (0, ..., N − 1)
(5.7)
5.3. CHANNEL MODEL
45
This property means every circulant matrix Hc is diagonalised by the DFT matrix F.
x = F Y = F Hc X = FHc F H x = Λx,
H[0] · · · 0 .. ... Λ = ... (5.8) . 0 · · · H[N − 1]
So our multi-path fading channel can be written as: y = Hc x + n
(5.9)
where y is the received vector of signalling points, x is the transmitted signalling points, Hc is the diagonalised channel attenuation vector, and n is a vector of complex, zero mean, Gaussian noise with variance σn2 . The attenuation on each tone is given by µ ¶ k H[k] = G , k = 0, ..., N − 1 N Ts
(5.10)
where G(.) is the frequency response of the channel during the current OFDM symbol and Ts is the sampling period of the system. The impulse response of the channel can be expressed as g(τ ) =
M −1 X
αk δ(τ − τk Ts )
(5.11)
k=0
where αk are independent zero mean, complex Gaussian random variables, and τk is the delay of the kth impulse. The next few sections will talk about our considerations regarding some issues on the wireless channel and the justifications for our channel model.
5.3.1
Rayleigh Distribution
The Rayleigh distribution is a statistical distribution that is used to model amplitude variations of the impulse response in a wireless multi-path channel. A Rayleigh distribution assumes: • There is no direct line of sight (LOS) component in the received signal. • There are many indirect components from reflected and scattered signals, each taking different paths to the receiver.
46
CHAPTER 5. CHANNEL ESTIMATION
Because these assumptions are valid for the wireless environment described above, we will use a Rayleigh distributed model for our channel response. It can be shown amplitude of two quadrature Gaussian noise sources follows a Rayleigh distribution. If we let s(t) be the signal transmitted through a Rayleigh channel, then r(t) can be expressed as [?]: r(t) = x(t)cos(2πfc t) − y(t)sin(2πfc t)
(5.12)
where x(t) and y(t) are normalised random processes, with zero mean and and variance σ. Then the combination probability density function is µ 2 ¶ 1 x + y2 p(x, y) = exp (5.13) 2πσ 2 2σ 2 We can express r(t) in polar form in terms of amplitude and phase of the received signal r(t) = R(t)cos(2πfc t + θ(t)) (5.14) where R(t) and θ(t) are given by
p
x2 + y 2 ³y´ θ(t) = θ = tan−1 (5.15) x By using the polar transformation, the probability density function now becomes: µ ¶ −R2 R exp p(R, θ) = (5.16) 2πσ 2 2σ 2 Integrating p(R, θ) over θ from 0 to 2π, we obtain the probability density function p(R): µ ¶ −R2 R p(R) = 2 exp (5.17) σ 2σ 2 which follows a Rayleigh distribution. R(T ) = R =
5.3.2
Power Delay Profile
The Power Delay Profile (PDP) describes the envelope of the impulse response as a function of the delay. The PDP of an urban and indoor environment is generally described by an exponential, since each delayed impulse usually has less power than the previous ones. Thus, our PDP is described by the following equation ¶ µ −τ (5.18) φ(τ ) ∼ exp τrms
5.3. CHANNEL MODEL
5.3.3
47
AWGN
When the signal passes through the channel, it is corrupted by white noise. This is modelled by the addition of white Gaussian noise (AWGN). AWGN is a random process with power spectral density as follows: 1 φ(f ) = N0 [W/Hz] 2
(5.19)
where N0 is a constant and often called the noise power density.
5.3.4
Channel Synchronisation
There are two types of channel synchronisation models - Sample spaced and Non sample spaced synchronisation.[1] • Sample spaced synchronisation assumes all delayed impulses of its channel impulse response are at integer multiples of the sampling period T. • In non sample spaced channels, the delayed impulses are not at periods of the sampling period T, thus the most of the impulse power is spread locally among the closest sampling intervals at the receiver, and leads to a larger impulse response at the receiver as shown in figure 5.2. P
P Non sample spaced channel
Sample spaced channel
t Channel length
t Channel length
Figure 5.2: Resampling a non-sample-spaced channel extends the channel length. For simplicity, we will only consider synchronised sample spaced channels for channel estimation in this thesis.
48
CHAPTER 5. CHANNEL ESTIMATION
5.3.5
Assumptions on channel
To simplify our simulated channel, the following are assumed to hold: • The impulse response is shorter than the Cyclic Prefix. Therefore, there is no ISI and ICI and the channel is therefore diagonal. • The channel is a synchronised, sample spaced channel. • Channel noise is additive, white and complex Gaussian. • The fading on the channel is slow enough to be considered constant during one OFDM frame.
5.4
Pilot Based Channel Estimation
The following estimators use on pilot data that is known to both transmitter and receiver as a reference in order to track the fading channel. The estimators use block based pilot symbols, meaning that pilot symbols are sent across all sub-carriers periodically during channel estimation. This estimate is then valid for one OFDM frame before a new channel estimate will be required. Since the channel is assumed to be slow fading, our system will assume a frame format, transmitting one channel estimation pilot symbol, followed by five data symbols, as indicated in the time frequency lattice shown in figure 5.3. Thus each channel estimate will be used for the following five data symbols.
5.5
Least Squares Estimator
The simplest channel estimator is to divide the received signal by the input signals, which should be known pilot symbols. This is known as the Least Squares (LS) Estimator and can simply be expressed as: HLS =
y x
(5.20)
This is the most naive channel estimator as it works best when no noise is present in the channel. When there is no noise the channel can be estimated perfectly. This estimator is equivalent to a zero-forcing estimator.
5.6. LINEAR MINIMUM MEAN SQUARE ERROR ESTIMATOR
49
Frequency ···
(subcarriers)
Time (OFDM symbols) Figure 5.3: An example of block based pilot information.
The main advantage is its simplicity and low complexity. It only requires a single division per sub-carrier. The main disadvantage is that it has high mean-square error. This is due to its use of an oversimplified channel and does not make use of the frequency and time correlation of the slow fading channel. An improvement to the LS estimator would involve making use of the channel statistics. We could modify the LS estimator by tracking the average of the most recently estimated channel vectors.
5.6
Linear Minimum Mean Square Error Estimator
The Linear Minimum Mean Squares Error (LMMSE) Estimator minimises the mean square error (MSE) between the actual and estimated channel by using the frequency correlation of the slow fading channel. This is achieved through a optimizing linear transformation applied to the LS estimator described in the previous section. From adaptive filter theory, the optimum
50
CHAPTER 5. CHANNEL ESTIMATION
solution in terms of the MSE is given by the Wiener-Hopf equation[5]: h = Rhhls Rh−1 h ls hls ls
(5.21)
where X is a matrix conatining the transmitted signalling points on its diagonal, σn2 is the additive noise variance. The matrix Rhhls is the cross correlation between channel attenuation vector h and the LS estimate hls and Rhls hls is the auto correlation matrix of the LS estimate hls , given by Rhhls = E{hhH ls } Rhls hls = E{hls hH ls }
(5.22)
Since white noise is uncorrelated with the channel attenuation, the cross correlation between the channel h and noisy channel hls is the same as the autocorrelation of the channel h. Thus we can replace Rhhls with Rhh . Also the autocorrelation of Rhls hls is equavalent to Rhh plus the noise power σ 2 and signal power. So the estimator can be expressed as: ¡ ¢−1 hls hlmmse = Rhh Rhh + σn2 (XXH )−1
(5.23)
The above equation seems to pose a contradiction since we need the autocorrelation of our desired channel vector in order to estimate an optimum channel vector. But we do not know what our desired channel vector since we do not know the channel. To overcome this problem, we replace the autocorrelation with its expected value. This can be done in two ways: • By theoretically calculating the expected value based on assumed or known channel statistics. This simplifies the complexity as the inverse only needs to be calculated once, which will be explained further on. The values will need to be recalculated each time the statistics of the channel changes. • Through realization, the autocorrelation matrix can be averaged each time channel estimation occurs. This approach will converge slower than the above method since the expected value is calculated adaptively but is more flexible since it does not assume any fixed channel statistics. For our OFDM channel estimation, we will use the first approach because of its lower complexity and easier implementation. The main disadvantage of this estimator is that it has a very high complexity. The evaluation of inverse R and XXH involves the inversion of a
5.7. OPTIMAL RANK REDUCTION USING SINGULAR VALUE DECOMPOSITIONS
51
matrix of dimension N x N which makes this estimator computationally complex. By using statistics that we know about the additive noise and the transmitted data, we can simplify the estimator. Since the binary data is completely random, we can assume equal probability on all constellation points, and we can replace XXH by its expected value E{XXH } = E|
1 2 |I xk
(5.24)
Thus our simplified estimator can be expressed as[?]: µ hlmmse = Rhh
β Rhh + I SN R
¶−1 hls
(5.25)
where I is the Identity matrix, SNR is the average signal-to-noise ratio is defined as E|xk |2 /σn2 . β is a signal constellation dependent constant. For the case of 16-QAM β = E|xk |2 E|1/xk |2 = 17/9 (5.26) Thus the inverse need only be calculated once every time channel estimation occurs, or just once if set to theoretical values.
5.7
Optimal Rank Reduction using Singular Value Decompositions
The complexity of the LMMSE estimator can be further reduced using a singular value decomposition on the autocorrelation matrix Rhh , which is nearly rank deficient due to its frequency correlation. Hence we can apply a rank reduction and use only the most significant parts of Rhh . This simplification will come at the expense of a small reduction in performance. This approach to reduce the computational complexity is based on using transforms that concentrate the channel power to a few transform coefficients, allowing efficient channel estimation to be performed with little effort in the transform domain. The idea is that by excluding the transform coefficients with the least amount of channel power, an accurate approximation of the high complexity filter can be obtained. This is illustrated in figure 5.4. The optimal rank reduction of the LMMSE estimator, using singular value
52
CHAPTER 5. CHANNEL ESTIMATION
δ0
x−1 0 y0
ˆ0 h δp−1
.. . .. .
.. .
UH
U
.. .
0
x−1 N −1
.. .
.. .
yN −1
ˆ N −1 h
0 Figure 5.4: Block diagram of the rank-p channel estimator.
decomposition, is obtained by excluding the base vectors corresponding to the smallest singular values. The channel autocorrelation Rhh can be decomposed as: Rhh = U ΛU H (5.27) where U is a matrix with orthonormal columns and Λ is a diagonal matrix containing the singular values λ0 ≥ λ1 ≥ ... ≥ λN −1 ≥ 0 on its diagonal. By applying the Singular Value Decomposition as follows [?]: −1/2
Rhhls Rhls hls = Q1 DQH 2
(5.28)
where Q is a matrix with orthonormal columns and D is a diagonal matrix containing the singular values d0 ≥ d1 ≥ ... ≥ dN −1 ≥ 0 on its diagonal. Since Rhhls = Rhh and Rhls hls = Rhh + SNβ R I, they all share the same singular values as Rh h, so we can simplify the expression as −1/2
Rhhls Rhls hls = U ΛU H (U (Λ + = U Λ(Λ +
β I)U H )−1/2 SN R
β I)−1/2 U H SN R
= Q1 DQH 2 =⇒ Q1 = Q2 = U and D = Λ(Λ +
β I)−1/2 SN R
(5.29)
5.8. SIMULATION RESULTS AND COMPARISONS
53
By taking including only the first p singular values corresponding to the upper left corner of the diagonal matrix D, the best rank p approximation of the estimator is then −1/2
−1/2
hp = Rhhls Rhls hls Rhls hls hls · ¸ Dp 0 H −1/2 Q R = Q1 h 0 0 2 hls hls ls · ¸ β Dp 0 H =U U (U (Λ + I)U H )−1/2 hls 0 0 SN R · ¸ β Dp 0 =U (Λ + I)−1/2 U H hls 0 0 SN R · ¸ ∆p 0 H =U U hls 0 0
where ∆p is the upper left corner of the matrix ∆. ! Ã ¶−1 µ λN −1 λ0 β , ..., I = diag ∆=Λ Λ+ SN R λ0 + SNβ R λN −1 + SNβ R
5.8
(5.30)
(5.31)
Simulation Results and Comparisons
The channel estimation simulation is based on the basic OFDM model in the Appendices. The simulation is normally run independently from the equalization simulation. It includes a basic equalizer for performance measurement purposes. The channel estimator performance will be tested by varying the average Signal to Noise Ratio and plotted against a performance measure. This is achieved by varying the variance of the additive noise and then running channel estimation for a fixed amount of OFDM frames. The performance result is recorded in vectors for comparison and graphing purposes. The performance of the channel will be measured in terms of the Mean square error (MSE), Symbol error rate (SER) and Bit error rate (BER) to obtain three performance measures.
54
CHAPTER 5. CHANNEL ESTIMATION
Estimator MSE Comparison 20 MSE LS MSE LMMSE MSE SVD
Mean Square Error
15
10
5
0
5
10
15
20
25 SNR (dB)
30
35
40
45
50
Figure 5.5: Average Mean Squared Error for the channel estimators.
Since the LMMSE estimator is based on the MSE, it is important we compare its performance with other estimators under this measure. The MSE is calculated according to: M SE = E|h − hest |2
(5.32)
where hest is the estimated channel attenuation and h is the true channel attenuation. The symbol error rate will be calculated for data symbols only according to: SER =
T otal error symbols T otal data symbols sent
Similarly the bit error rate will be calculated as:
(5.33)
5.8. SIMULATION RESULTS AND COMPARISONS
55
Estimator SER Comparison
0
10
SER LS SER LMMSE SER SVD
−1
Symbol Error Rate
10
−2
10
−3
10
0
5
10
15
20
25 SNR (dB)
30
35
40
45
50
Figure 5.6: Average Symbol Error Rate for the channel estimators.
BER =
T otal error bits T otal data bits sent
(5.34)
After running the simulations, it is obvious that in terms of pure performance, the LMMSE estimator and its low rank approximation are the most appealing of the three estimators considered under the three performance measures. As expected, the LMMSE estimator is the best performer with reference to the MSE, especially at lower SNRs. With reference to the SER in figure ?? and BER in figure ??, the difference in performance between the LS and the other estimators is approximately 5dB for all error rates. Thus, the LS estimator can be a suitable choice for high SNR channels where complex estimators are not viable. But a good channel estimator design is based on achieving a balance between performance and complexity. In terms of complexity the LMMSE requires
56
CHAPTER 5. CHANNEL ESTIMATION
Estimator BER Comparison
0
10
BER LS BER LMMSE BER SVD −1
10
Bit Error Rate
−2
10
−3
10
−4
10
−5
10
0
5
10
15
20
25 SNR (dB)
30
35
40
45
50
Figure 5.7: Average Bit Error Rate for the channel estimators.
much more computation than the low rank and least squares estimator. The low rank estimator in this regard is the clearly better than LMMSE, as it achieves almost identical performance to the LMMSE, but has an advantage of a substantial reduction in the number of computations required. The LMMSE estimator is a 64 x 64 matrix while the rank 5 SVD approximation is only a 5 x 5 matrix. As seen in figure ?? and ??, the performance difference between the LMMSE and low rank estimator is virtually identical. Only under the MSE measure is the difference in performance between the two estimators evident. But under practical measures situations, these two have approximately the same performance under BER and SER measure. Thus, the negligible performance benefits of the LMMSE does not seem to justify its higher complexity. The low rank estimator seems the more feasible and practical option.
5.9. SUMMARY
5.9
57
Summary
In this thesis, we have provided a detailed explanation of the basic principles and analysis of three block based pilot estimators suitable for an OFDM system using coherent modulation. These estimators use pilot tones on all carriers to track the channel characteristics. Through analytical and practical simulations, the LMMSE estimator was found to perform better than the LS estimator, especially in low SNR environments, but only marginally better than its low rank approximation estimator. But its substantially higher complexity does not justify the minor performance gain. In this respect, the low rank estimator achieves a compromise between the two competing interests of high performance and low complexity. The LS estimator is often neglected due to its relatively poor performance, but for its low complexity, the LS estimator is adequate for channels with a high SNR. We need to remember though that the LMMSE and its low rank approximation are based on noise and channel statistics. If the channel statistics are incorrect or change later on, then mismatch will occur and performance will be sub standard.
58
CHAPTER 5. CHANNEL ESTIMATION
Chapter 6 Equalization Equalizers. They are found in amplifiers, in car stereo systems and in your computer’s music players. These are basically all subband gain controllers. They split your signal into separate frequency bands allowing the user to change the gains in each spectrum. So does this have anything in OFDM? Well, an equalizer’s aim in a communications receiver is to basically put the transmitted signal back together. We will explore different types of equalizers, their advantages, disadvantages and further challenges.
6.1
Introduction to Equalization
There are several methods of equalization commonly used. These are • Maximum Likelihood (ML) sequence detection - Optimal in the sense of error probability. • Linear Equalization - filters with adjustable coefficients. • Decision Feedback Equaization (DFE) - uses previously detected symbols to suppress ISI in the symbol presently being detected. It is clear that equalization in OFDM can be very simple. This is one of the major advantages of using OFDM over single carrier systems. Channel equalization in OFDM actually can be done by just a simple division in the frequency domain. This is because the channel as a filter is convolved with the input signal in the time domain on transmission. This operation is equivalent to multiplication in the frequency domain and thus undoing the effects of the channel is just a division. This optimization follows the Zero-Forcing criteria (ZF) which will be discussed in the following section. 59
60
CHAPTER 6. EQUALIZATION
Now, Equalizers like the zero-forcing and MMSE require channel estimation, refer Sections 6.3 and 6.4. This can introduce additional errors in equalization. To test if we can combat this, I have implemented adaptive complex RLS (Recursive Least Squares) and LMS (Least Mean Squares) equalizers. These algorithms can use the statistical averages of correlated signals to derive a representation of the channel and undo its effects accordingly. The following sections contain somewhat long derivations of the LMS and RLS algorithms. To see what each step does (not just briefing over them) has taken considerable time. I thought it was only befitting to include these since so much time was spent in reading these and again in revision for the report. I believe I have been able to explain them again in simpler terms. So let’s get into it and see a this of the work have been doing.
6.2
Linear Equalization
The linear filter for equalization is most usually the transversal filter shown in Figure 6.1. unequalized input
z −1
w0
w1
z −1
z −1
w2
w3
P
Tap gain adjustment algorithm
equalized outnput
Figure 6.1: Linear transversal filter.
For an input sequence v[n] and the output as an estimation of y[n], the estimate of the nth symbol for a 2N + 1 tap filter is y¯[n] =
N X i=−N
wi vn−i
(6.1)
6.3. ZERO-FORCING EQUALIZER
61
Here, wi are the complex equalizer tap weights selected based on some optimization criterion. We will continue to denote wi as the equalizer coefficients. This is because they are done so in the M atlab code. There are two basic criterion of optimization for which the following equalizers are made. • Peak Distortion Criterion - for which the Zero-Forcing Equalizer is derived. • Mean-Square-Error (MSE) Criterion - for which the LMMSE equalizer is derived
6.3
Zero-Forcing Equalizer
In OFDM, as long as the cyclic prefix remains long enough to maintain the orthogonality of the subcarriers, then equalization can be achieve simply by the zero-forcing equalizer. It is the designated method of channel equalization in OFDM in the Sari-Karam-Jeanclaude paper[10]. It is discussed in paper [22]
6.3.1
Introduction
The zero-forcing equalizer minimizes the peak distortion which is simply defined as the worst case symbol interference at the equalizer output. It is important to mention that our equalizer takes place in the frequency domain. The transversal filters mentioned above and in [3] take place in the time domain. The derivation below of the zero-forcing filter coefficients are derived in [3]. I will attempt to explain it more simply because the author likes to word things in a difficult way. His solution results from a z transform which can be easily changed to a frequency perspective on the substitution of z = ejw . The linear channel filter with coefficients {hn } and the equalizer with coefficients {wn } can be expressed as a single filter simply by the convolution of the two ∞ X qn = wj hn−j (6.2) j=−∞
We are assuming that the equalizer has infinite taps and then look at the situation where it is finite. The output at the kth sampling can be expressed as ∞ X X yˆk = q0 yk + yn qk−n + wj ηk−j (6.3) n6=k
j=−∞
62
CHAPTER 6. EQUALIZATION
where {yk } is the transmitted information sequence and ηk−j is a noise term. This can be seen more clearly by reference to equation 2.18. And as established before the second term is the ISI term. Now, the peak value of this interference is called the peak distortion. Reference [3] uses the notation D(w) =
∞ X
|qn |
n=−∞,n6=0
=
∞ X
(6.4)
¯ ¯ ∞ ¯ ¯X ¯ ¯ wj ηk−j ¯ ¯ ¯ ¯
(6.5)
n=−∞,n6=0 j=−∞
Now what we do is select a finite number of taps to force D(w) to zero, that is D(w) = 0 and qn = 0 for all n except n = 0. That’s why it’s called zero f orcing as we are completely eliminating the inter-symbol interference. The condition for this is ( ∞ X 1 n=0 qn = wj hn−j = (6.6) 0 n = 6 0 j=−∞ Finally, if we take the z transform of this, we get Q(z) = W (z)H(z) = 1
(6.7)
in other words
1 (6.8) H(z) So, what this means is that the filter which satisfies the zero forcing criterion has the set of coefficients W (z) which is just the inverse of of the channel coefficients H(z). This what is called a zero f orcing equalizer. A traditional zero forcing filter operation in shown in Figure 6.2. W (z) =
{yk }
Channel H(z)
Equalizer 1 W (z) = F )z)
{ˆ yk }
AWGN {ηk }
Figure 6.2: Zero-forcing equalizer block diagram. It is important to note that this equalizer does not eliminate ISI as long as the filter is of finite length. The remaining ISI can be reduced by increasing the filter length which will increase filter complexity.
6.3. ZERO-FORCING EQUALIZER
63
However, this may all seem somewhat irrelevant to a system that uses a cyclic prefix. A cyclic extension which is longer than the channel impulse response can cancel out ISI and ICI, refer to Section 3.5. In OFDM where the zero forcing equalizer takes place in the frequency domain, the ICI is forced to zero for which is already zero. Thus, the role of the equalizer becomes just a gain operation and phase adjustment in each sub-carrier. The main disadvantage of such a method is that when the H(w) is close to zero, the reciprocal filter W (w) will be very large in which will dramatically amplify noise or numerical round-off errors.
6.3.2
Implementation and Results
Let us now focus on the M atlab design of an OFDM equalizer. The basic OFDM model can be found in M atlab code in Appendix D. On top of this is built the zero forcing equalizer. Well it may seem quite simple to design such an equalizer, we just need to find the inverse filter. But, the trick here is to implement it in the frequency domain. This is simple because an OFDM system, we begin and end in the frequency domain. Instead of finding an inverse filter in the time domain, we just dot divide each of the values in received signal spectrum by that of the coefficients of channel spectrum. As mentioned before, this can be seen as a deconvolution of the the channel impulse response. The question is now, how can we obtain the frequency response of the channel? We will use the Least Squares (LS) estimate mentioned in Section [?]. It is actually equivalent the zero-forcing equalizer in the way it estimates the channel. This will allow perfect recovery in noiseless situations, though impractical we will demonstrate its recovery in a training period with 100 dB SNR. The problem with the zero forcing equalizer is that it relies on an estimate of the channel is is liable to change in time. This problem is the same for all equalizers. The only time in which the equalizer can estimate the channel spectrum is during the training or pilot symbol transmissions. These signals which are sent are previously known to the receiver. This allows the receiver to statistically compare the sequences and find the channel characteristics. In the zero forcing equalizer, the coefficients cannot be adjusted until the next bath of pilot symbols arrive though is not the case for adaptive equalizers. Figure 6.3 is a simple diagram to represent the zero-forcing equalizer in OFDM. Theoretically, perfect reconstruction of the signals in the training period can be achieved. In practice this is not the case. The channel effects
64
CHAPTER 6. EQUALIZATION
Baseband modulation
input
OFDM transmitter uknown channel ˆ h(w)
Constellation detector
output
Baseband demodulation
OFDM receiver and equalizer
Figure 6.3: OFDM Zero-forcing equalizer block diagram.
are not perfectly cancelled out but is very low, can be considered to be zero. This is due the small errors in the estimate of the channel spectrum. The simulation model is a little different to that in Figure 6.3. The used for the purposes of simulating it equalizer’s effectiveness is shown in Figure 6.4. This model estimates the channel spectrum from the first incoming input
Baseband modulation
OFDM transmitter uknown channel ˆ h(w)
output
Constellation detector
Baseband demodulation
OFDM receiver and equalizer
z −1 Channel estimate
Figure 6.4: OFDM Zero-forcing equalizer block diagram for simulation. symbol and then uses it to equalize the next signal. This shows how the equalizer would work with regular pilot symbols. Figure 6.5 and Figure 6.6 shows the symbol recovery ability of the zero forcing during training. This was done on an OFDM model using 4 bit QAM, 64 point FFT and 16 symbol cyclic extension. The channel is modeled by a 3 tap filter with an exponential PDP. The channel also contains AWGN at an SNR of 100 dB for the purposes of clearer reconstruction. Constellation detection is achieved by simple mapping to the closest constellation symbol distance wise.
6.3. ZERO-FORCING EQUALIZER
65
Transmitted Symbols vs Equalized Symbols vs Unequalized Symbols 7 Tansmitted Symbols Equalized Symbols Unequalized Symbols 6
Amplitude
5
4
3
2
1
0
0
10
20
30
40
50
60
70
Symbol
Figure 6.5: Diagram of 3 types of symbol sequences.
We can see in Figure 6.5 that the equalized symbols are closely matched to the transmitted symbols in comparison the the unequalized symbols. The shape of the unequalized symbols are due to that of the filter. An almost erratic plot is shown in Figure 6.6. However, the error is somewhat correlated to the channel spectrum. The first thing we notice is the large error at the beginning. This is because the first received symbols is not equalized but used in channel estimation for equalization of the next symbol. We can also see that the error jumps up in the middle of each symbol across the last nine symbols. This is because the channel coefficients are closer to zero at this point and thus noise is amplified. This noise is that of the channel estimate and the additive AWGN. Let’s now increase SNR and see what happens. In Figure 6.7 we can see a somewhat exponential decay in BER as we increase the SNR. This can be due to the constellation detection algorithm. As symbols get closer to the actual constellation symbols, the mapping is attributed the sphere packing in
66
CHAPTER 6. EQUALIZATION
Zero Force Equalizer Error Over 10 Symbols
1
10
0
10
−1
Error Squared
10
−2
10
−3
10
−4
10
−5
10
−6
10
0
100
200
300 400 OFDM Symbol
500
600
700
Figure 6.6: Error of Zero-forcing equalizer over 10 OFDM symbols.
vector quantization. That is the symbols which are mapped are in a certain radius from the constellation point. This area around the constellation point is resembles a circle.
6.4
LMMSE
The zero-forcing equalizer does not account for additive noise in its optimization. Here we will base our equalizer on the Mean-Square-Error (MSE) Criterion. This type of equalizer can be called the Linear Mean Squared Error Equalizer (LMMSE). Anyhow, we have seen the MSE criterion before during Linear prediction and Winer filtering. It is the well known second order equation which upon application of orthogonality or partial differentiation arrives at the normal equations, refer Sections 2.7 and 2.8. The LMMSE equalizer for OFDM is mention by Sari in [10].
6.4. LMMSE
67
−3
BER vs SNR
x 10
8
7
BER
6
5
4
3
2
0
2
4
6
8
10 SNR (dB)
12
14
16
18
20
Figure 6.7: OFDM Zero-forcing equalizer BER vs SNR (dB).
6.4.1
Introduction
The LMMSE solution makes a tradeoff between residual ISI and noise enhancement. This provides a far better solution for channels with spectral nulls. There are many derivation for the equalizer coefficients with which satisfy the MMSE criterion. Some are more insightful than others but they all begin with minimizing the expected error squared. For the purposes of our simulation, the proof by intuition from the Wiener solution in [6] is much clearer than than in [3]. I will present it in my own words to make clear some of my own insights into these equations. Let us start with the basic system X[n] = (hs ? Y )[n] + V [n]
(6.9)
where X[n] is the received signal random process, Y [n] the input and V [n] the additive noise. The cross-correlation sequence is defined as
68
CHAPTER 6. EQUALIZATION
"
Ã
RY X [m] = E Y [n] V [n − m] + = RY V +
X
X
!# hs [k]Y [n − m − k]
k
hs [k]RY Y [m + k]
³k ´ ˜ s [k] ? RY Y [m] + h
= RY V
(6.10)
˜ s is the time reversal of hs . The auto-correlation sequence is where h "Ã RY X [m] = E = RV V [m] +
V [n] + X k
X
!Ã hs [k]Y [n − k]
V [n − m] +
k
hs [k]
X j
hs [j]RY Y [m + k − j] + X
X
X
!# hs [k]Y [n − m − k]
k
hs [k]RY V [m − k]+
k
hs [j]RV Y [m + k]
j
³ ´ ˜ s ? RY Y [m] + (hs ? RY V )[m] + (hs ? RY V )[−m] = RV V [m] + hs ? h Now we can actually simply these quite a bit by assuming that the noise sequence is uncorrelated with the signal Y [n], so RY V = 0 for all m, RV V [m] = σV2 δ[m] and RY Y [m] = σY2 δ[m]. So the above can be rewritten as ³ ´ ˜ s ? RY Y [m] RY X [m] = h ³ ´ 2 2 ˜ RXX [m] = σV δ[m] + hs ? hs ? σY δ [m]
(6.11) (6.12)
taking the Fourier transform of these gives ˆ ∗ (w)SY Y (w) SY X [m] = h s ¯2 ¯ ¯ 2 ¯ˆ (w) SXX [m] = σV2 + ¯h ¯ σY s
(6.13) (6.14)
which gives the unconstrained Wiener filter given by ˆ ∗ (w) h ˆ ∞ (w) = SY X (w) = ¯ h ¯2s ¯ ¯ˆ SXX (w) ¯hs (w)¯ + σV2 /σY2
(6.15)
6.4. LMMSE
69
Note that the MMSE solution reduces to the zero-forcing solution for σ 2 = ˆ s (w) is close to zero, 0. An intuitive way to see this work is that when h we concentrate on filtering out the noise rather than trying to recover the attenuated signal. ˆ ∞ (w) = SY X (w) in equation (6.15). You may also be wondering how h SXX (w) Well, it can be derived directly from the definitions of the auto and cross correlation sequences. This is an interesting property which I found valuable to understand. So here it is and we will begin by talking about PSDs. We can estimate the spectrum of the channel using estimations called the Power Spectral Denisties (PSD). Denoted by SXX (w) for the random process X[n], it is the Fourier transform of the autocorrelation sequence RXX [m]. That is Z π 1 RXX [m] = SXX (w)ejwm dw (6.16) 2π −π This is a more robust method of obtaining the channel spectrum than performing the FFT over the impulse response. This is because the impulse is not an ideal signal to transmit through a channel. Other methods of channel estimation was explored in Chapter 5. A rough guide to the channel estimation used can be found in[6]. It arises from the Unconstrained Wiener solution and even more simply from the cross-correlation definition. The cross-correlation sequence, RY X [m], is defined at the convolution of the autocorrelation sequence RXX [m] and the impulse response, h[m]. That is X h[k]RXX [m − k] (6.17) RY X [m] = k
Since convolution is equivalent to multiplication in the Fourier domain, the Fourier transform of the equation above becomes simply
which gives
6.4.2
ˆ SY X (w) = SXX (w)h(w)
(6.18)
SY X (w) ˆ h(w) = SXX (w)
(6.19)
Implementation and Results
The M atlab code for this equalizer can be found in Appendix E. This was done on the same base OFDM model as with the zero forcing equalizer, using 4 bit QAM, 64 point FFT and 16 symbol cyclic extension. The channel is modeled by a 3 tap filter with an exponential PDP. The channel also contains AWGN at an SNR of 100 dB for the purposes of clearer reconstruction.
70
CHAPTER 6. EQUALIZATION
Constellation detection is achieved by simple mapping to the closest constellation symbol distance wise. The LMMSE equalizer implementation was not particularly successful. The code can be found in Appendix E but the results will not be documented.
6.5
Adaptive Equalization
What adaptive equalizers do is basically update its coefficients with each incoming symbol. Simply, what the an adaptive filter does is it finds a set of coefficients with with on filtering an incoming sequence will result in a desired sequence. Traditional literature on OFDM never really mentioned use of such equalizers mainly because it does not really exploit the advantages of OFDM. The two adaptive equalizers I have looked into operate in the time domain on baseband symbols. Most OFDM literature use Decision Feedback Equalizers (DFE) which consist of a forward and backwards transversal filter. DFEs for OFDM are discussed in [2, p.103], [11] and [5, p.50] but I will not go into DFEs. I decided I would look into two well known adaptive algorithms and find what advantages they have to offer and the disadvantages they pose. The first algorithms is based on a method of steepest descent. Here is where we shall begin.
6.6
Method of Steepest Descent
The method of steepest descent is a gradient-based adaptation technique which is recursive in the sense that its feedback system proceeds iteratively over with incoming samples. This method is described in detail in [3, p.663] and [4, p.203]. This proof is a little hairy and I will attempt to explain it clearly. To understand the basic idea, we define a cost function J which is usually associated with the mean-square error J = E[e[n]e∗ [n]] = E[|e[n]|2 ]
(6.20)
where e(n) is an error sequence. Usually J is a function of the equalizer coefficients w, ie J(w). We can express the kth complex coefficient as wk = ak + jbk ,
k = 0, 1, 2, ...
(6.21)
This will allow us to to define the all important gradient operator as ∇k =
∂ ∂ +j , ∂ak ∂bk
k = 0, 1, 2, ...
(6.22)
6.7. LMS
71
Now if we apply the ∇ operator to the cost function J, we obtain the gradient vector ∇J for which the kth element is ∇k J =
∂J ∂J +j , ∂ak ∂bk
k = 0, 1, 2, ...
(6.23)
We will see later, the implications of descent in two dimensions ak and bk for the complex LMS algorithm. Now, in the method of steepest descent, the adjustments to w are in the direction of steepest descent which is opposite to the gradient vector of the cost function J(w). For which we can now describe the steepest-descent algorithm as 1 w(n + 1) = w(n) − µ∇J(w) 2
(6.24)
where µ is a step-size parameter, w(n) is the vector of equalizer coefficients at time n and the factor of 1/2 is for numerical convenience which we will soon see why. Equation (6.24) shows the recursive procedure for the equalizer coefficient updates. The question now is how do we find ∇J(w) and what does µ do? I think it is best if we now jump to the gradient vector as a function of the cross-correlation vector p, refer Equation (6.27), and the correlation matrix R, refer Equation (6.26), as shown in [4, p.206] ∇J(w) = −2p + 2Rw(n)
(6.25)
R = E[x(n)xH (n)]
(6.26)
where where x(n) is the vector of filter inputs at time n. We can see that R is the M -by-M correlation matrix for x(n) with length M . And p = E[x(n)d∗ (n)]
(6.27)
which is the m-by-1 cross-correlation vector between the the filter inputs and the desired response d(n). We are now in a situation to start looking into the LMS algorithm and implementation.
6.7
LMS
We have seen that in the case of Wiener filters, we depend on the knowledge of the cross and auto-correlation function RY X [m] and RXX [m]. But in many
72
CHAPTER 6. EQUALIZATION
cases, we cannot estimate these ahead of time to fix the Wiener coefficients. More commonly, the statistics vary slowly in time from which we can make crude approximations and fix the coefficients gradually. The Least-M eanSquare algorithm does not require us to keep track of past outcomes to estimate statistics but one of the disadvantages as we will see is the somewhat slow adaptation to change.
6.7.1
Adaptation Algorithm
The LMS algorithm we are dealing with needs to be complex since our frequency downconverted symbols are complex. The complex form of the LMS originally proposed by Widrow-McCool-Ball 1975 [23], the exact measurements of the gradient vector ∇J(w) at time n would require the prior knowledge of the correlation matrix R and the cross-correlation vector p. So according to [4, p.235], what we do in the LMS algorithm is to use instantaneous estimates of R and p defined by ˆ = x(n)xH (n) R
(6.28)
ˆ = x(n)d∗ (n) p
(6.29)
and and substitute them into into Equation (6.25) giving ˆ ∇J(w) = −2x(n)d∗ (n) + 2x(n)xH (n)w(n) Now on substitution back into Equation (6.24), we get £ ¤ ˆ + 1) = w(n) ˆ ˆ w(n − µx(n) d∗ (n) − xH (n)w(n)
(6.30)
(6.31)
From which results in the following three relations with which defines the LM S algorithm! ˆ H (n)x(n) 1. Compute filter output y(n) = w 2. Compute error e(n) = d(n) − y(n) ˆ + 1) = w(n) ˆ 3. Update coefficients w(n + µˆ x(n)e∗ (n)
(6.32) (6.33) (6.34)
Here, y(n) is the output of the equalizer filter and e(n) is the error sequence which is the difference between the desired signal and the filtered signal. ˆ (n), Since we are taking the instantaneous products between e∗ (n) and x instead of the statistical expectation, our approximation will most likely to be inaccurate. But if we make small adjustments to the filter coefficients at each
6.7. LMS
73
time step, determined by µ, then the instantaneous approximation errors can be averaged out and we move slowly towards the optimal coefficients. There are entire papers written on the selection of µ but in general, a large value will increase the rate of convergence but will tend to oscillate around the optimal coefficient values. It is common to use a large value of µ to begin with and then take on a smaller value as the algorithm converges. The parameter µ according to [4, p.238] can be set to 0<µ<
2 M Smax
(6.35)
where Smax is the maximum value of the power spectral density of the filter inputs x(n) and M is the filter length.
6.7.2
Implementation and Results
An adaptive LMS equalizer is usually implemented according to to the simplified Figure 6.8. input
Baseband modulation
OFDM transmitter uknown channel ˆ h(w)
output
Constellation detector
Baseband demodulation
OFDM receiver and equalizer d0 (n)
Resynthesis
Figure 6.8: LMS equalizer block diagram. For the equalizer which is not in training, Figure 6.8 shows a system that adapts its coefficients using the resynthesised symbols as the desired sequence. This of course introduces errors which may accumulate with each iteration. To overcome this, we need to periodically send training symbols to correct the filter coefficients. The simulation model for our LMS equalizer on OFDM can be found in Appendix F. The following simulation models that in the training period, so there is no resynthesis block. The equalizer takes in a noisy sequence, a training sequence known as pilot tones (which are known in advance by the
74
CHAPTER 6. EQUALIZATION
receiver) and outputs a filtered signal based on the adapted coefficients. The equalizer is built on top of the basic OFDM baseband model used in the previous equalizer simulations of Sections 6.3 and 6.4. The OFDM model uses 4 bit QAM, 64 point FFT and 16 symbol cyclic extension. The channel is modeled by a 3 tap filter with an exponential PDP. The channel also contains AWGN at variable SNR. Constellation detection is achieved by simple mapping to the closest constellation symbol with respect to distance. Figure LMS tracking over first OFDM symbol
0
Absolute Amplitude
10
−1
10
Desired Sequence Equalized Sequence
−2
10
0
10
20
30
40
50
60
70
80
QAM symbol in OFDM symbol
Figure 6.9: LMS equalizer tracking over first symbol. 6.9 shows the LMS equalizer adapting its coefficients to mimic the desired signal. The two input signals, desired and noisy, must me correlated for the coefficients to make any real sense. We can see that the equalizer output has a delay of 3 samples shown by the beginning of red line. This is because the LMS equalizer is defaulted to 3 coefficients. The three samples are used to equalize the 4th samples and so on, so the first three samples cannot be equalized unless we decrease the filter order. This simulation was performed in presence of no noise. This is done to demonstrate its ability
6.7. LMS
75
to equalize channel attenuation. Performance of course degrades when noise is introduced and the SNR is lowered. This will be discussed in this section later on. Figure 6.10 shows the LMS convergence property over one OFDM Error Sequence e(n)=d(n)−y(n)
0
10
−2
10
Mean Squared Error
−4
10
−6
10
−8
10
−10
10
−12
10
0
10
20
30
40
50
60
70
80
QAM symbol in OFDM symbol
Figure 6.10: Error sequence over the first OFDM symbol. symbol. We can see that the LMS algorithm does allow considerable convergence over one symbol. We further speed up the convergence by changing the step-size associated with µ in the LMS algorithm. For the first half of the input sequence we set µ = 0.4 and then µ = 0.15 for the remaining half. This is so the LMS tracking does not bounce around near convergence. The error sequence here starts at the 10th symbol, the reason for this is the same for that in Figure 6.9. Looking at the convergence rate of LMS is not too clear over just one symbol so let us take a look at it working over ten OFDM symbols. It may also be useful to remind the reader that an OFDM symbol consists of 80 samples. Derived from Hyperlan/2 standards, we use a 64 point FFT and 16 samples Cyclic Prefix which adds to 80 samples for which a whole symbol spans 4µ seconds. Figure 6.11 shows the LMS con-
76
CHAPTER 6. EQUALIZATION
LMS Tracking Over 10 OFDM Symbols
0
10
−5
Mean Squared Error
10
−10
10
−15
10
−20
10
−25
10
0
100
200
300
400
500
600
700
800
QAM symbol
Figure 6.11: Error sequence of LMS tracking over 10 OFDM symbols.
vergence property over 10 OFDM symbol, that is over 800 samples within 40µ seconds. This simulation was achieved by keeping the coefficient weights from symbol to another so that with each new symbol, we did not have to start the algorithm training from scratch. This used a channel with additive noise with an SNR 100dB. Even though this noise level is quite low, we can achieve a BER of zero with an SNR of 7 dB. The only variables to initialize ˆ in the LMS algorithm is the filter coefficients w(n). If prior knowledge of the signals are available, then these can be set to their statistics. In our case, ˆ ˆ we initialize w(0) = 0. Of course prior estimations and assignment of w(n) would lead to faster convergence times. We can see that final convergence takes place around the 450th sample mark. That is almost the 5th OFDM symbol. The slow convergence of the LMS algorithm is indeed one of its disadvatanges which we will try to overcome with the RLS algorthm in Section 6.8.
6.8. RLS
6.8
77
RLS
The advantage in the LMS steepest-descent algorithm lies in its computational simplicity but the price paid is slow convergence. Now, to design an algorithm with a faster convergence we need to trade it off for a more complex algorithm involving additional parameters. The Kalman filter provides the basic framework from which all RecursiveLeast-Squares filters are derived. The family of RLS filters consist of • The standard RLS filters • Square-root RLS filters • Order-recursive RLS filters We will deal with the standard RLS filter in its complex form. Information concerning the other filter categories can be found in [4]. Complex adpative filters are aslo covered in [22]. In Kalman’s 1960 paper [24], describes a recursive solution to the discretedata linear filtering problem. The recursive relation can be found in Theorem 3 of [24]. It is an extensive paper and now with advances in digital signal computations, the Kalman filter has been the subject of extensive research and applications.
6.8.1
Least Squares
In deriving an algorithm with faster convergence, we adopt the Least-Squares approach. This allows us to directly minimize the quadratic performance index in terms of a time average rather than a statistical average. The following derivation is taken from [3, p.683]. We will use his notation in the following where he likes to use I(n) as the information carrying desired sequence, YN (n) as the noisy input to the filter of length N . From now on, will drop the subscript N (as we have previously done) because everything is basically of length N anyway. However, we will denote filter taps with W(n) because this is the notation used in my M atlab code and is also standard in [4]. Weighting factors will be denoted by λ. So let us now begin with our last equalization algorithm! The RLS is formulated to minimize the time-average weighted square error t X LS λt−n |e(n, t)|2 (6.36) ²N = n=0
78
CHAPTER 6. EQUALIZATION
where the error is defined as e(n, t) = I(n) − W(t)Y(n)
(6.37)
It maybe confusing to have the n and t indices. What this means is that each coefficient vector W(t) is calculated from the vectors Y(n), n = 0, 1, ..., t.
6.8.2
Adaptation Algorithm
The formulation of the RLS time update equations are actually not that complex though formulating it yourself might be. Let us continue from the equations 6.36 and 6.37 already established. The weighting factor 0 < λ < 1 introduces an exponential weighting on past data appropriate to our channel PDP. The minimization of ²LS N with respect to W(t) yields the set of linear equations R(t)W(t) = D(t) (6.38) where R(t) is the signal correlation matrix R(t) =
t X
λt−n Y∗ (n)Y0 (n)
(6.39)
n=0
and D(t) is the cross-correlation vector D(t) =
t X
λt−n I(n)Y0 (n)
(6.40)
n=0
For which the form should look familiar now. On solving for the filter coefficients W(t) = R−1 (t)D(t) (6.41) On which we should mention that R(t) is not a Toeplitz matrix for which was the case in Equation (2.32). Also important to the purposes of our implementation, R(t) may be ill conditioned for small values of t and so the add the matrix δI to R(t), where δ is a small positive constant and I is the N -by-N identity matrix. Now according to Equation (refe:wupdate1) if we had access to W(t − 1) to compute W(t), we will need to solve N linear equations for each new symbol arriving. To avoid this inefficiency we compute R(t) recursively with R(t) = λR(t − 1) + Y∗ (t)Y0 (t)
(6.42)
6.8. RLS
79
As we need the to find the inverse correlation matrix of Equation (6.41) we define the following recursion accordingly · ¸ 1 R−1 (t − 1)Y∗ (t)Y0 (t)R−1 (t − 1) −1 −1 R (t) = (6.43) R (t − 1) − λ λ + Y0 (t)R−1 (t − 1)Y∗ (t) And since this is such a mess, let’s just define P(t) = R−1 (t). We will now define what is commonly known as the Kalman gain vector to be 1 K(t) = P(t − 1)Y∗ (t) (6.44) λ + µ(t) with µ(t) conveniently defined as follows to simplify the inverse correlation matrix. µ(t) = Y0 (t)R−1 (t − 1)Y∗ (t) (6.45) so that the inverse correlation matrix in Equation (6.43) becomes P(t) =
1 [P(t − 1) − K(t)Y0 (t − 1)P(t)] λ
(6.46)
Now if we just postmulitply both side by Y∗ (t) 1 [P(t − 1)Y∗ (t) − K(t)Y0 (t − 1)P(t)Y∗ (t)] λ 1 = ([λ + µ(t)]K(t) − K(t)µ(t)) on subs (6.45) and (6.44) λ = K(t) (6.47)
P(t)Y∗ (t) =
Which gives us a much simpler expression for the Kalman gain expression. Now since by the definition of P(t), W(t) = P(t)D(t) and D(t) = λD(t − 1) + I(t)Y∗ (t)
(6.48)
for the same reasoning as in Equation 6.42. Then we have 1 [P(t − 1) − K(t)Y0 (t − 1)P(t)] [λD(t − 1) + I(t)Y∗ (t)] λ 1 = P(t − 1)D(t − 1) + I(t)P(t − 1)Y∗ (t) λ 0 − K(t)Y (t − 1)P(t − 1)D(t − 1) 1 − I(t)K(t)Y0 (t − 1)P(t)Y∗ (t) λ = W(t − 1) + K(t) [I(t) − Y0 (t)W(t − 1)] (6.49)
W(t) =
80
CHAPTER 6. EQUALIZATION
This messy expression can be simplified just by noting that YH (t)W(t − 1) is the equalizer output at time t. So noting
and
ˆI(t) = Y0 (t)W(t − 1)
(6.50)
ˆ e(t) = I(t) − I(t)
(6.51)
then the recursive update equation for W(t) is as follows ˆ W(t) = W(t − 1) + K(t)e(t)
(6.52)
and that’s it! We can summarize our RLS update equations into five steps 1. Compute filter output 2. Compute the error
ˆI(t) = Y0 (t)W(t − 1) e(t) = I(t) − ˆI(t)
3. Compute Kalman gain vector K(t) =
P(t − 1)Y0 (t) λ + Y0 (t)P(t − 1)Y∗ (t)
(6.53)
4. Update inverse correlation matrix 1 P(t) = [P(t − 1) − K(t)Y0 (t − 1)P(t)] λ ˆ 5. Update coefficients W(t) = W(t − 1) + K(t)e(t) This algorithm is called the RLS direct form which in [3] is said to be the Kalman algorithm. It is important at this time to note that the equalizer coefficients change by the amount K(t)e(t). Since K(t) is N -dimensional, each coefficient is controlled by an element of K(t). Thus we have a faster convergence algorithm compared to that of the LMS where the only variable parameter is the step-size.
6.8.3
Implementation and Results
Now that we are familiar with the algorithm, let’s take a deep breath and look at the simulation model. Our RLS equalizer on OFDM looks just like that of the LMS as shown in Figure 6.12 The RLS equalizer is built on top of the same basic OFDM model used in the previous equalizer simulations of Sections 6.3, 6.4 and 6.7. Just as a reminder, the OFDM model uses 4 bit QAM, 64 point FFT and 16 symbol cyclic extension. The channel is modeled by a 3 tap filter with an exponential PDP. The channel also contains AWGN with variable SNR. The baseband symbol detection is achieved by simple mapping to the closest constellation symbol with respect to distance. PLease refer to Appendix G for the code.
6.9. COMPARISON
81
input
Baseband modulation
OFDM transmitter uknown channel ˆ h(w)
output
Constellation detector
Baseband demodulation
OFDM receiver and equalizer d0 (n)
Resynthesis
Figure 6.12: RMS equalizer block diagram.
Figure (6.13) shows how well the RLS equalizer can track the desired signal. The most important feature of the following graphs are the rate of convergence compared to those of the LMS in Figure (6.9) and (6.10). Similarly, these graphs show a delay of 3 samples in the error sequence and the equalized signal. This is because we are using an order 3 filter. This simulation performed under zero noise and a 3 tap channel to give zero BER which is what was expected. We will inject some noise into the channel with specific SNR later on. Figure (6.14) shows evidently the much faster convergence of the RLS algorithm in comparison to that of the LMS. Both Figures were performed under a weighting factor λ = 0.99. This is an exponential weighting of the past data, that is it determines how quickly the filter “forgets” past samples. Setting λ = 1 implies infinite memory.
6.9
Comparison
The code used for the comparisons can be found in Appendix H. We have actually already considerably discussed the case of the convergence properties of the two algorithms. This is due to the criteria each is optimized for and basically because the LMS only converges in two dimensions for a complex weighting function where as in RLS, each element in the Kalman vector affect the coefficients giving greater flexibility. Figure (6.15) just overlaps the tracking sequence of both algorithms for the purposes of comparison. The RLS algorithm is not considerably much more complex than the LMS algorithm though there are many papers which look into reducing the complexity of the RLS like that in [26]. It all depends on the application, to find a suitable equalizer for the system specifics.
82
CHAPTER 6. EQUALIZATION
RLS Tracking Over OFDM Symbol
0
Mean Squared Error
10
−1
10
Desired Signal Equalized Signal
−2
10
0
10
20
30
40
50
60
70
80
Baseband Symbol Number
Figure 6.13: RLS tracking over first OFDM symbol.
6.10
Summary
The analysis of the four type of equalizers bring me to the conclusion that the complexities involved in the adaptive filters analysed to do not merit a much better system than that of the instantaneous equalizers in the zero forcing and LMMSE solutions. In the training period, all the equalizers can perform rather optimally and after that, all endure noise effects which are carried through. In the adaptive filters, noise effects from having incorrect “desired signals” will accumulate inaccuracies in the equalizer coefficients until the next pilot symbols arrive. Such is the case for the zero forcing and LMMSE algorithms which use the same coefficients until the next pilot signal are received, but the simplicity of these equalizers cannot be over looked. Particularly when they are performed in the frequency domain utilizing the role of the DFT in the OFDM system. Further research needs to be done to come to a fairer conclusion. Looking into Decision Feedback Equalizers which use zero forcing and LMMSE is necessary. There are also other adaptive schemes for zero forcing and LMMSE which I would encourage future students to look into. I hope I have covered ground in explaining fundamen-
6.10. SUMMARY
83
RLS Error Over OFDM Symbol
−1
10
−2
10
−3
Mean Squared Error
10
−4
10
−5
10
−6
10
−7
10
−8
10
0
10
20
30
40
50
60
70
80
Baseband Symbol Number
Figure 6.14: Error sequence of RLS tracking over first OFDM symbol.
tals clearly enough so that future thesis students who may read this do not have to re-invent the wheel and spend too much time on the basics in order to move on. One area which I planned to look into but didn’t get to was finding TEQ (Time domain Equalizers) to shorten the effective channel impulse response. This is useful in the case where carrier orthogonality is compromised when the channel impulse response grows larger than the length of the cyclic prefix. Relevant papers on these include [18], [19], [20] and [21]. In wireless time variant channels, the impulse response can change be it slowly with laptops which people use on a table. Well, that’s all on Equalization from me. I found it somewhat a bad tradition in signal processing circles to use language hard to understand and equations that look like a mess. Hopefully I have presented material, although already no new, but in a clearer way.
84
CHAPTER 6. EQUALIZATION
LMS vs RLS Receivers
0
10
RLS algorithm LMS algorithm −5
Mean Squared Erorr
10
−10
10
−15
10
−20
10
−25
10
0
50
100
150
200
250
300
350
Number of Iteration
Figure 6.15: LMS vs RLS in tracking 5 OFMD symbols.
400
Chapter 7 Further Research As you may have noticed, we have already talked about further research as we have progressed in this thesis. A well know challenge in OFDM systems is that of synchronization in time, to find which instance to sample and to find where the cyclic prefix starts synchronization in frequency, the frequency offset must be very small. For Equalization, one area which would be interesting to look into is finding TEQ (Time domain Equalizers) to shorten the effective channel impulse response. This is useful in the case where carrier orthogonality is compromised when the channel impulse response grows larger than the length of the cyclic prefix. It is most common for OFDM equalizers to to used in a DFE (Decision Feedback Equalization) structure. I would encourage future students to look into this and why this is such a popular technique and the intricacies behind it. There is also work to be done on what some people call pre-equalization. These are recovery techniques done at the transmitter using some kind of feedback link. Optimizations in adaptive loading has also been mentioned as a tool for engineers to use in OFDM systems. The channel estimators considered in this thesis have all been block based channel estimators. In order to obtain better spectral efficiency, we can investigate the performance of channel estimation based on pilot patterns where pilot symbols occur only on some sub carriers. This would free the sub carriers to carry data. This can then be compared to the performance of block based estimators. 85
86
CHAPTER 7. FURTHER RESEARCH
The LMMSE and low rank approximate estimators in this thesis only considers the frequency correlation of the signal. In order to maximize the performance, we should consider both time and frequency correlation in the channel estimator. The problem with this is that it is very high complexity due to two correlation. One possible solution to this is to use a seperable filter to consider each correlation separately from the other, which will result in a small performance degradation, but substantial reduction in complexity. Other possible areas for future study include the study of channel estimation under fast fading environments, where the channel changes faster than the symbol, or estimation under non-sample spaced channels.
Chapter 8 Conclusion From the 1960s to today, we can see that OFDM is another tool for which the engineer can use to overcome channel effects in a wireless environment. The are many advantages in OFDM, but there are still many complex problems to solve. We hope this thesis has provided a basic simulation tool for future students to use as a starting point in their theses. It is our motivation that by using the parameters of a working system, a much clearer and insightful exaplanation of the fundementals of OFDM have been presented. Channel Estimation is an important part of an OFDM receiver, especially in wireless environments where the channel is unpredictable and changing continuously. A good channel estimation will allow the equalizer to correct the fading effects of the channel. Of the three channel estimators studied in this thesis, the low rank approximate estimator seems to be the most practical in terms of good performance and low complexity. The LS does not perform well in low SNR environments while the LMMSE estimator complexity seems to high for a small performance improvement. In OFDM equalization, it seems that the adaptive algorithms used in the OFDM did not add many special benefits. It’s adaptive capability allowed the equalizer coefficients to change with time but it is done on the basis on resythesised symbols for which noise and rounding errors may accumulate. These algorithm did not exploit OFDM characteristics which the zero forcing and LMMSE did. It may be wise to incorporate LMMSE design into a DFE. Because the zero forcing and LMMSE equalizers exploit the OFDM design by equalizing in the frequency domain, it is very simple, epsecially compared the the complexities of the adaptive algorithms. 87
88
CHAPTER 8. CONCLUSION
The conclusion of the matter is, the journey that is thesis has taught as much. It has enabled us to learn for ourselves and digest textbooks which would have boggled our eyes and minds before. As our supervisor, Dr. Choi, said, I think we have stronger stomachs for doing it all on our own from scratch. Enjoy your thesis! For further information, please visit our thesis website at: http://www.geocities.com/ofdm99 for a comprehensive list of references and internet resources on OFDM.
Bibliography [1] M. Engels, “Wireless OFDM Systems How to make them work?”, Kluwer Academic Publishers, Massachusets, USA, 2002. [2] A.R.S. Bahai, B.R. Saltzberg, “Multi-Carrier Digital Communications Theory and Applications of OFDM”, Kluwer Academic/Plenum Publishers, New York, USA ,1999. [3] J.G. Proakis, “Digital Communications 4th Edition”, McGraw-Hill Higher Education, New York, USA, 2001. [4] S. Haykin, “Adaptive Filter Theory 4th Edition”, Prentice Hall, New Jersey , USA, 2002. [5] R. van Nee, R. Prasad, “OFDM for Wireless Multimedia Communications” , Artech House, 2000 [6] J. Terry, J. Heiskala, “OFDM Wireless LANs: A Theoretical and Practical Guide” , Sams Publishing, 2002 [7] H. Harada, R. Prasad, “Simulation and software radio for mobile communications” , Artech House Publishers [8] D.S. Taubman, “Elec4042: Signal Processing 2 Complete Set of Written Materials Session 1, 2003”, 2003. [9] R.W. Chang. “Synthesis of bandlimited orthogonal signals for multichannel data transmission.”, Bell System Tech. Journal, 45 pp. 1775–1796, Dec. 1966. [10] A. Peled and A. Ruiz. “Frequency domain data transmission using reduced computational complexity algorithms.”, In proc. IEEE Conf. Acoust., Signal Processing, pp. 964–967, Denver, CO, 1980. 89
90
BIBLIOGRAPHY
[11] S. B. Weinstein and P.M. Ebert. “Data transmission by frequencydivison multiplexing using the discrete Fourier transform.”, IEEE Trans. Commun., COM- 19, No.5. pp. 628–634, Oct 1971 [12] H. Sari, G. Karam, and I. Jeanclaude, “Transmission techniques for digital terrestrial TV broadcasting,”, IEEE Commun. Mag., vol. 33, pp. 100–109, Feb. 1995. [13] Bingham, J.A.C., “Multicarrier modulation for data transmission: An idea whose time has come”, IEEE Communications Magazine, vol. 28, no. 5, pp. 5-14, May 1990. [14] J. A. C. Bingham, ADSL, VDSL, and Multicarrier Modulation, WileyInterscience, 2000. [15] J. S. Chow, J. C. Tu, and J. M. Cioffi, “A discrete multitone transceiver system for HDSL applications,” IEEE Journal on Selected Areas in Communications, vol. 9, no. 6, pp. 895-908, Aug. 1991. [16] P. S. Chow, J. M. Cioffi, and J. A. C. Bingham, “A practical discrete multitone transceiver loading algorithm for data transmission over spectrally shaped channels,” IEEE Transactions on Communications, vol. 73, no. 2, pp. 773-775, Feb./Mar./Apr. 1995. [17] P. S. Chow, J. C. Tu, and J. M. Cioffi, “Performance evaluation of a mutlichannel transceiver system for ADSL and VHDSL services,” IEEE Journal on Selected Areas in Communications, vol. SAC-9, no. 6, pp. 909-919, Aug. 1991. [18] Broadband Radio Access Networks; Hiperlan Type 2; Physical (PHY) Layer, ETSI Standard TS 101 475, ETSI, February 2001. [19] K. Witrisal, 11 OFDM Air-Interface Design for Multimedia Communications”, Ch.4 Ph.D. Thesis, Delft University of Technology, The Netherlands, April 2002. [20] Henkel, W., Kessler, Th., “Maximizing the Channel Capacity of Multicarrier Transmission by Suitable Adaptation of the Time-Domain Equalizer”, IEEE Transactions on Communications, Vol. 48, No. 12, pp. 2000– 2004, Dec. 2000. [21] Peter J.W. Melsa, Richard C.Younce, and Charles E. Rohrs. “Impulse Response Shortening for Discrete Multitone Transceivers.”, IEEE Transactions on Communications, 44(12):1662-1672, December 1996.
BIBLIOGRAPHY
91
[22] Kok-Wui Cheong and John M. Cioffi. Precoder for DMT with Insufficient Cyclic Prefix. In Proc. of the IEEE International Conference on Communications, ICC, Atlanta, USA, June 1998. [23] N. Al-Dhahir and J. M. Cioffi, “Optimum Finite-length equalization for multicarrier transceivers,” IEEE Trans. Commun., vol. 44, no. 1, 1996, pp. 56–64. [24] Ove Edfors, Magnus Sandell, Jan-Jaap van de Beek, Daniel Landstrom and Frank Sjoberg, “An introduction to orthogonal frequency-division multiplexing” September 1996. [25] Jan-Jaap van de Beek, Ove Edfors, Magnus Sandell, Sarah Kate Wilson and Per Ola Borjesson, “On Channel Estimation in OFDM Systems,” in Proc. IEEE Vehicular Technology Conf.,vol. 2,Chicago, IL, July 1995, pp. 815–819. [26] Ove Edfors, Magnus Sandell, Jan-Jaap van de Beek, Sarah Kate Wilson and Per Ola Borjesson, “OFDM Channel Estimation by Singular Value Decomposition,” IEEE Trans. Comms., July 1998, 46(7) pp. 931–939 [27] S. U. H. Qureshi, “Adaptive Equalization,” Proc. IEEE, vol. 73, no. 9, pp. 1349–1387, Sept. 1985. [28] B. Widrow, J. McCool, and M. Ball, “Complex LMS Algorithm.”, IEEE Proceedings, vol. 63, p:719–720, 1975. [29] R.E. Kalman. “A new approach to linear filtering and prediction problems.”, Transactions of the ASME, Journal of Basic Engineering, 82, p:35–45, 1960. [30] J. S. Chow, J. M. Cioffi and J. Bingham, “Equalizer training algorithms for multicarrier modulation systems,” in Int. Conf. Commun., 1993, pp. 761–765. [31] G. Iliev and N. Kasabov. “Channel equalization using adaptive filtering with averaging”, 5th Joint Conference on Information Sciences (JCIS 2000), Atlantic City, USA, 27 Feb - 3 March
92
BIBLIOGRAPHY
Appendix A Basic OFDM model %+----------------------------------------------------------------+ %| | %| Name: ofdm.m | %| Author: Mathew Liu, James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| This is meant to provide a skeleton for further | %| implmentations. Channel estimates, Equalizers and bandpass | %| models will be built on top of this. | %| Requirements: closest.m, qammod.m, qamdemod.m | %| | %+----------------------------------------------------------------+ % We assume that with are using 64 length FFT with 64 subcarriers % all carrying data. So there are no carriers specifically assigned % to pilot. clear all; close all; %============= Some standard Hyperlan Params ====================== %--- These params are not used in this particular model-----------T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples delta_f = 0.3125e6; % Frequency spacing %============== Our params based on Hyperlan/2 ==================== FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix 93
94
M = 4;
CHAPTER 8. APPENDIX A
% Bits encoded in a QAM symbol.
%+----------------------------------------------------------------+ %| OFDM TRANSMITTER | %+----------------------------------------------------------------+ %======== Data Generation ========================================= input = rand(1,FFTLen*M) > 0.5; % Binary data generation %======== Serial To Block (FFTLen, M) ============================= input_para = reshape(input,FFTLen,M); %======== Baseband Modulation ===================================== input_symbols = qammod(input_para,FFTLen, M); %================= IFFT =========================================== input_time_para = ifft(input_symbols); %================ Parallel to Serial ============================== input_time_serial = reshape(input_time_para,1,FFTLen); % Time domain signal %============= Gaurd Interval Removal (GII) ====================== input_ext = [input_time_serial((FFTLen-CPLen+1):FFTLen), ... input_time_serial]; %+----------------------------------------------------------------+ %| CHANNEL MODEL | %+----------------------------------------------------------------+ %=============== Pass Through Rayleigh Channel ========== output_ext = filter(1, 1, input_ext); % Does nothing at the moment. %+----------------------------------------------------------------+ %| OFDM RECEVIER | %+----------------------------------------------------------------+ %============== Gaurd Interval Removal (GIR) ====================== output_time_serial = output_ext((CPLen+1):FFTLen+CPLen); %======== Serial To Parallel ====================================== output_time_para = reshape(output_time_serial,FFTLen,1); %================= FFT ============================================
95
output_symbols = fft(output_time_para); %================= Baseband Demodulation ========================== output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ============================== output = reshape(output_para,1,FFTLen*M); % Time domain signal %================ Error Calculation =============================== % Error is ZERO, so it works. error1= input - output; figure(1); semilogy(abs(error1)); %====================== End File ================================== %+----------------------------------------------------------------+ %| | %| Name: qammod.m | %| Author: Mathew Liu, James Shen | %| Description: takes in a binary stream "in_binary" and maps | %| them to a constellation defined by QAM symbols. The number | %| of QAM symbols on this constellation is determined by M^2. | %| | %+----------------------------------------------------------------+ function[symbols] = qammod(in_binary, carrier_count, M) % M^2 = number of points on constellation. % in_binary(64,M) 64 derived from IFFT size % in_binary is made from the S/P %=================== Generate QAM Alphabet ========================= temp_M = -(M-1):2:(M-1); for i=1:M for k = 1:M QAM(i,k) = temp_M(i) + j*temp_M(k); end end QAM = QAM(:).’; %================= Binary to Decimal and assign Symbol ============== symbols = zeros(carrier_count, 1);
96
CHAPTER 8. APPENDIX A
index = 1; for row=1:carrier_count index = 1; for bit_position=1:M index = index + ((2^(bit_position-1))*in_binary(row,bit_position)); % index is a number from 1-16 end symbols(row) = QAM(index); end %====================== End File ==================================== %+----------------------------------------------------------------+ %| | %| Name: qamdemod.m | %| Author: Mathew Liu, James Shen | %| Description: Takes in ’in_symbol’ which can be noisy, ie | %| it does not lie on the original constellation. We map it to | %| the closest symbol in the constellation, find it’s index in | %| the QAM alphabet array and turn it back into a binary. | %| | %+----------------------------------------------------------------+ function[out_binary] = qamdemod(in_symbols, carrier_count, M) %================ Generate QAM alphabet again ================= temp_M = -(M-1):2:(M-1); % Generate QAM Alphabet for i=1:M for k = 1:M QAM(i,k) = temp_M(i) + j*temp_M(k); end end QAM_alpha = QAM(:).’; %========= Map Symbol to Constellation and Dec2Bin ============ for row=1:carrier_count [out_symbol, index] = closest(QAM_alpha, in_symbols(row)); index = index - 1;
97
% The index is always 1 more than the binary number since the % index needs to start with one, where as the binary data can be 0. % Decimal to Binary conversion for bit_position = M:-1:1 if (index >= 2^(bit_position-1)) out_binary(row,bit_position) = 1; index = index - 2^(bit_position-1); else out_binary(row,bit_position) = 0; end end end %====================== End File ================================= %+----------------------------------------------------------------+ %| | %| Name: closest.m | %| Author: Mathew Liu, James Shen | %| Description: Takes in a QAM alphabet and a noisy_symbol and | %| finds the closest match on the constellation. It also returns | %| the index of it inside the QAM alphabet array. | %| | %+----------------------------------------------------------------+ function[out_symbol, index] = closest(QAM_alpha, noise_symbol) for i=1:length(QAM_alpha) dist(i) = abs(QAM_alpha(i) - noise_symbol); end [val,index] = min(dist); out_symbol = QAM_alpha(index); %====================== End File =================================
98
CHAPTER 8. APPENDIX A
Appendix B Passband Simulation OFDM model using LPF %+----------------------------------------------------------------+ %| | %| Name: ofdm_LPF.m %| Author: Mathew Liu, James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| Using rcosine as transmit filter. Works using LPF at the | %| receiver. | %| | %+----------------------------------------------------------------+
|
% We assume that with are using 64 length FFT with 64 subcarriers % all carrying data. So there are no carriers specifically assigned % to pilot. clear all; close all; %=============== Some standard Hyperlan Params ==================== T = 50e-9; % System baseband sampling period. fs = 1/T; % System baseband sampling freq = 20MHz . Tcp = 16*T;% CP period. Tu = 64*T; % Useful symbol period. Ts = Tu+Tcp; % OFDM Symbol period 80 samples. delta_f = 0.3125e6; % Frequency spacing. time_scale = T:T:Ts; % Time samples in baseband signals. N = length(time_scale); % NUmber of time samples in baseband. f1 = 1/Ts:1/Ts:N/(2*Ts); % Freqs in the 1st half of Nyquist circle. f2 = -N/(2*Ts):1/Ts:-1/Ts; % Freqs in the 2nd half of Nyquist circle. freq_scale = [f1 f2]; % Baseband frequency scale. fc = 2.4e9; % Carrier freq. 99
100
CHAPTER 8. APPENDIX B
% If Rfs=2*fc then, % If fc=5.2, over=size(rt)/80 - 1=519; % If fc=2.4, over=239 % If Rfs=5*fc then, % If fc=5.2, over=size(rt)/80 - 1=1299; % If fc=2.4, over=599 Rfs = 5*fc; % Simulation frequency. % Mimics real time behaviour for bandpass signal. % Sampling at Nyquist rate of twice the highest freq. RT = 1/Rfs; % The real-time sampling period rt = RT:RT:Ts; % The time samples in real-time bandpass RN = length(rt); % Number of samples in real-time bandpass f3 = 1/Ts:1/Ts:RN/(2*Ts); f4 = -RN/(2*Ts):1/Ts:-1/Ts; rf_scale = [f3 f4]; % Bandpass freq scale. %============== Our params based on Hyperlan/2 ==================== FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. %+----------------------------------------------------------------+ %| OFDM TRANSMITTER | %+----------------------------------------------------------------+ %==================== Data Generation ============================= input = rand(1,FFTLen*M) > 0.5; % transmits one symbol %================ Serial To Block (FFTLen, M) ===================== input_para = reshape(input,FFTLen,M); %================== Baseband Modulation =========================== input_symbols = qammod(input_para,FFTLen, M); figure(1); plot(input_symbols,’ob’);grid;axis square;axis equal, ... title(’4 bit QAM constellation’), ylabel(’Imaginary’), xlabel(’Real’); %====================== IFFT ======================================= input_time_para = ifft(input_symbols); %================ Parallel to Serial =============================== input_time_serial = reshape(input_time_para,1,FFTLen); % Time domain signal
101
%============= Gaurd Interval Insertion (GII) ===================== input_ext = [input_time_serial((FFTLen-CPLen+1):FFTLen),input_time_serial]; figure(2); subplot(2,1,1); stem(time_scale, abs(input_ext)), title(’Cycl. Ext. Signal (Time)’), ... ylabel(’Amplitude’), xlabel(’Time (s)’); subplot(2,1,2); stem(freq_scale, abs(fft(input_ext))), ... title(’Specturm of Cycl. Ext. Signal (Freq)’), ... ylabel(’Amplitude’), xlabel(’Frequncy (Hz)’); %=================== Pulse shaping Tansmit Filter ==================== over = 599; % Oversampling factor according to Simulation frequency. input_over = kron(input_ext, [1, zeros(1,over)]); Nover = length(input_over); pulse_shape = rcosine(1,(over+1),’normal’,0.35); % raised-cosine pulse-shape [trash,pos] = max(pulse_shape); % raised cosine filter delay ’pos’ input_shaped_temp = conv(pulse_shape, input_over); input_shaped = input_shaped_temp(pos:(pos+Nover-1));% Get rid of transient %-----------------Over sampling scales-------------------------------overt = Ts/Nover:Ts/Nover:Ts; f5 = 1/T:1/T:Nover/(2*T); f6 = -Nover/(2*T):1/T:-1/T; overf_scale = [f5 f6]; %=================== Graphing Section ================================ figure(3); subplot(2,1,1); stem(overt(1:5000), abs(input_over(1:5000)), ’b’), ... title(’Signal after over sampling’), ... ylabel(’Amplitude’), xlabel(’Time (s)’); hold on; plot(overt(1:5000), abs(input_shaped(1:5000)), ’r’), ... title(’Signal after pulse shaping.’); hold off; subplot(2,1,2); plot(overf_scale, abs(fft(input_shaped))), ... ylabel(’Amplitude’), xlabel(’Frequncy (Hz)’); %================== Upconverter to Carrier Freq ======================= input_bandpass = 2*real(input_shaped.*exp(j*2*pi*fc*rt)); % Bandpass signal figure(4);
102
CHAPTER 8. APPENDIX B
subplot(2,1,1); plot(rt(1:5000), input_bandpass(1:5000)), title(’Bandpass signal (time)’), ... ylabel(’Amplitude’), xlabel(’Time (s)’); subplot(2,1,2); stem(rf_scale, abs(fft(input_bandpass))), ... title(’Spectrum of Bandpass Signal (Freq)’), ... ylabel(’Amplitude’), xlabel(’Frequncy (Hz)’); %+----------------------------------------------------------------+ %| CHANNEL MODEL | %+----------------------------------------------------------------+ %=============== Pass Through Rayleigh Channel ==================== output_ext = filter(1, 1, input_bandpass); % Does nothing at the moment. %+----------------------------------------------------------------+ %| OFDM RECEVIER | %+----------------------------------------------------------------+ %================ Downconvert ==================================== rec_over_bad = output_ext.*exp(-j*2*pi*fc*rt); % I/Q downconversion figure(5); subplot(2,1,1); plot(rt(1:5000), abs(rec_over_bad(1:5000))), ... title(’Received Baseband Signal (time)’), ... ylabel(’Amplitude’), xlabel(’Time (s)’); subplot(2,1,2); rec_over_temp = abs(fft(rec_over_bad)); rec_over_temp = rec_over_temp./max(abs(rec_over_temp)); % Normalize spectrum for plotting. stem(rf_scale, rec_over_temp), ... title(’Spectrum of Baseband Signal (Freq)’), ... ylabel(’Amplitude’), xlabel(’Frequncy (Hz)’); hold on; f = remez(50,[0 0.1 0.2 1],[1 1 0 0]); % Design of the receiver lowpass filter, order 50 LPF = freqz(f,1,-pi:2*pi/RN:pi-2*pi/RN); % Frequency response of the filter plot([f4, f3], abs(LPF),’r’); hold off; rec_over_temp = conv(f, rec_over_bad); % Signal is filtered rec_over = rec_over_temp(26:(26+Nover-1)); % Discard transient %(delay is here 26, linear phase FIR of order 50)
103
figure(6); subplot(2,1,1); plot(rt(1:5000), abs(rec_over(1:5000))), ... title(’Received Baseband LPF Signal (time)’), ... ylabel(’Amplitude’), xlabel(’Time (s)’); subplot(2,1,2); stem(rf_scale, abs(fft(rec_over))), ... title(’Spectrum of Baseband LPF Signal (Freq)’), ... ylabel(’Amplitude’), xlabel(’Frequncy (Hz)’); hold on; rec_baseband = rec_over(1:over+1:Nover); output_ext = rec_baseband; %============== Gaurd Interval Removal (GIR) ========================= output_time_serial = output_ext((CPLen+1):FFTLen+CPLen); %======== Serial To Parallel ========================================= output_time_para = reshape(output_time_serial,FFTLen,1); %================= FFT =============================================== output_symbols = fft(output_time_para); %================= Baseband Demodulation ============================= figure(7); plot(output_symbols,’ob’);grid;axis square;axis equal, ... title(’Received Symbols’), ylabel(’Imaginary’), xlabel(’Real’);; output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ================================= output = reshape(output_para,1,FFTLen*M); % Time domain signal %==================== BER Calculation ================================ errors = abs(input - output); num_errors = sum(sum(errors)); BER = num_errors/(FFTLen*M)
104
CHAPTER 8. APPENDIX B
Appendix C Passband Simulation OFDM model using Hilbert %+----------------------------------------------------------------+ %| | %| Name: ofdm_Hilbert.m | %| Author: Mathew Liu, James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| Using rcosine as transmit filter. Hilbert transform at | %| recevier. | %| | %+----------------------------------------------------------------+ % We assume that with are using 64 length FFT with 64 subcarriers all % carrying data. So there are no carriers specifically assigned to pilot. clear all; close all; %=============== Some standard Hyperlan Params ================== T = 50e-9; % System baseband sampling period. fs = 1/T; % System baseband sampling freq = 20MHz . Tcp = 16*T; % CP period. Tu = 64*T; % Useful symbol period. Ts = Tu+Tcp; % OFDM Symbol period 80 samples. delta_f = 0.3125e6; % Frequency spacing. time_scale = T:T:Ts; % Time samples in baseband signals. N = length(time_scale); % NUmber of time samples in baseband. f1 = 1/Ts:1/Ts:N/(2*Ts); % Freqs in the 1st half of Nyquist circle. f2 = -N/(2*Ts):1/Ts:-1/Ts; % Freqs in the 2nd half of Nyquist circle. freq_scale = [f1 f2]; % Baseband frequency scale. fc = 2.4e9; % Carrier frequency % If Rfs=2*fc then, 105
106
CHAPTER 8. APPENDIX C
% If fc=5.2, over=size(rt)/80 - 1=519; % If fc=2.4, over=239 % If Rfs=5*fc then, % If fc=5.2, over=size(rt)/80 - 1=1299; % If fc=2.4, over=599 Rfs = 5*fc; % Simulation frequency. % Sampling at Nyquist rate of twice the highest freq. RT = 1/Rfs; % The real-time sampling period rt = RT:RT:Ts; % The time samples in real-time bandpass RN = length(rt); % Number of samples in real-time bandpass f3 = 1/Ts:1/Ts:RN/(2*Ts); f4 = -RN/(2*Ts):1/Ts:-1/Ts; rf_scale = [f3 f4]; % Bandpass freq scale. %============== Our params based on Hyperlan/2 ================= FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. %+----------------------------------------------------------------+ %| OFDM TRANSMITTER | %+----------------------------------------------------------------+ %======== Data Generation =============================== input = rand(1,FFTLen*M) > 0.5; % transmits one symbol %======== Serial To Block (FFTLen, M) ============================ input_para = reshape(input,FFTLen,M); %======== Baseband Modulation =========================== input_symbols = qammod(input_para,FFTLen, M); figure(1); plot(input_symbols,’ob’);grid;axis square;axis equal; %================= IFFT ================================= input_time_para = ifft(input_symbols); %================ Parallel to Serial ==================== input_time_serial = reshape(input_time_para,1,FFTLen); % Time domain signal %============= Gaurd Interval Insertion (GII) ================= input_ext = [input_time_serial((FFTLen-CPLen+1):FFTLen),input_time_serial]; figure(2);
107
subplot(2,1,1); stem(time_scale, abs(input_ext)), title(’Cycl. Ext. Signal (Time)’); subplot(2,1,2); stem(freq_scale, abs(fft(input_ext))), ... title(’Specturm of Cycl. Ext. Signal (Freq)’); %=================== Pulse shaping Tansmit Filter =============================== %input_shaped = input_ext.*hamming(FFTLen+CPLen).’; over = 599; % Oversampling factor according to Simulation frequency. input_over = kron(input_ext, [1, zeros(1,over)]); Nover = length(input_over); %pulse_shape = ones(1, over+1); pulse_shape = rcosine(1,(over+1),’normal’,0.35); % basic raised-cosine pulse-shape [trash,pos] = max(pulse_shape); % raised cosine filter delay ’pos’ input_shaped_temp = conv(pulse_shape, input_over); input_shaped = input_shaped_temp(pos:(pos+Nover-1));% Get rid of transient %-----------------Over sampling scales--------------overt = Ts/Nover:Ts/Nover:Ts; f5 = 1/T:1/T:Nover/(2*T); f6 = -Nover/(2*T):1/T:-1/T; overf_scale = [f5 f6]; %================= Graphing Section ================================ figure(3); subplot(2,1,1); stem(overt(1:5000), abs(input_over(1:5000)), ’b’), ... title(’Signal after over sampling’); hold on; plot(overt(1:5000), abs(input_shaped(1:5000)), ’r’), ... title(’Signal after pulse shaping.’); hold off; subplot(2,1,2); stem(overf_scale, abs(fft(input_shaped))), ... title(’Spectrum of signal after pulse shaping’); %================== Upconverter to Carrier Freq ========================== input_bandpass = 2*real(input_shaped.*exp(j*2*pi*fc*rt)); % Bandpass signal figure(4); subplot(2,1,1); plot(rt(1:5000), input_bandpass(1:5000)), title(’Bandpass signal (time)’);
108
CHAPTER 8. APPENDIX C
subplot(2,1,2); stem(rf_scale, abs(fft(input_bandpass))), ... title(’Spectrum of Bandpass Signal (Freq)’); %+----------------------------------------------------------------+ %| CHANNEL MODEL | %+----------------------------------------------------------------+ %=============== Pass Through Rayleigh Channel ========== output_ext = filter(1, 1, input_bandpass); % Does nothing at the moment. %+----------------------------------------------------------------+ %| OFDM RECEVIER | %+----------------------------------------------------------------+ %================ Downconvert ================================== rec_over_bad = output_ext; figure(5); subplot(2,1,1); plot(rt(1:5000), abs(rec_over_bad(1:5000))), ... title(’Received Baseband Signal (time)’), ... ylabel(’Amplitude’), xlabel(’Time (s)’); subplot(2,1,2); rec_over_temp = abs(fft(rec_over_bad)); rec_over_temp = rec_over_temp./max(abs(rec_over_temp)); % Normalize spectrum for plotting. stem(rf_scale, rec_over_temp), ... title(’Spectrum of Baseband Signal (Freq)’), ... ylabel(’Amplitude’), xlabel(’Frequncy (Hz)’); hold on; h = remez(200,[0.02 0.98],[1 1],’Hilbert’); % Design of a % Hilbert filter of order 200 f2 = 0.5*([zeros(1,100) 1 zeros(1,100)]+ j*h); % Complex Phase %splitter filter whose real part is a delay and pos = 101; % imaginary part is a Hilbert transformer F2 = freqz(f2,1,-pi:2*pi/RN:pi-2*pi/RN); % Frequency response % of the complex filter plot([f4, f3],abs(F2),’r’); hold off; rec_over_temp = conv(f2,rec_over_bad); % Signal is filtered rec_over = rec_over_temp(pos:(pos+Nover-1)); % Get rid of transient part.
109
rec_baseband = rec_over.*exp(-j*2*pi*fc*rt); % I/Q downconversion figure(6); subplot(2,1,1); plot(rt(1:5000), abs(rec_baseband(1:5000))), ... title(’Received Baseband Downconverted Signal (time)’); subplot(2,1,2); stem(rf_scale, abs(fft(rec_baseband))), ... title(’Spectrum of Baseband Downconverted Signal (Freq)’); hold on; output_ext = rec_baseband(1:over+1:Nover); %============== Gaurd Interval Removal (GIR) ================== output_time_serial = output_ext((CPLen+1):FFTLen+CPLen); %======== Serial To Parallel ================================= output_time_para = reshape(output_time_serial,FFTLen,1); %================= FFT ================================= output_symbols = fft(output_time_para); %================= Baseband Demodulation =========================== figure(7); plot(output_symbols,’ob’);grid;axis square;axis equal; output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ==================== output = reshape(output_para,1,FFTLen*M); % Time domain signal %==================== BER Calculation ========================= errors = abs(input - output); num_errors = sum(sum(errors)); BER = num_errors/(FFTLen*M)
110
CHAPTER 8. APPENDIX C
Appendix D Channel Estimation %+-----------------------------------------------------------------+ %| | %| Name: ofdm_CE.m | %| Author: Mathew Liu | %| Description: Test File for Channel Estimation | %| This file can be run to produce the graphs | %| | %+----------------------------------------------------------------+ %-------------------------------------------------------------------------% System parameters clear all; para = 64; gilen = 16; fftlen = 64; fftlen2 = fftlen + gilen; ml = 4; rayleigh_var = 0.5; noiseVar = 0.001; frame_count = 300; symbol_count = 5; %-------------------------------------------------------------------------% Initialise Error Vectors SER = zeros(1,11); BER = zeros(1,11); MSE = zeros(1,11);
111
112
CHAPTER 8. APPENDIX D
SER_LS = zeros(1,11); BER_LS = zeros(1,11); MSE_LS = zeros(1,11); SER_LMMSE = zeros(1,11); BER_LMMSE = zeros(1,11); MSE_LMMSE = zeros(1,11); SER_SVD5 = zeros(1,11); BER_SVD5 = zeros(1,11); MSE_SVD5 = zeros(1,11); %SER_SVD10 = zeros(1,11); %BER_SVD10 = zeros(1,11);
for i = 1:11 % Set Channel noise variable SNRdB = (i-1) * 5; % SNRdB = 0 - 40dB SNR = 10^(SNRdB/10); noiseVar = 1 / SNR; % % % %
Simulating 1000 OFDM Frames Each frame has 6 OFDM symbols The first symbol is for Channel Estimation, and the others for data The channel is assumed to be constant for one frame (6 symbols)
for frames = 1:frame_count impulse_response = [rayleigh(rayleigh_var,gilen) zeros(1,para-gilen)]’; channel_attn = fft(impulse_response); % Generate random binary data (pilot tones) Tx_sel_data = binary_data(1, para*ml); % Serial -> Parallel conversion Tx_para_data = reshape(Tx_sel_data,para,ml); % 16-QAM modulation
113
Tx_QAM_data = qammod(Tx_para_data, para, ml); % OFDM Transmitter Tx_data = ofdm_transmit(Tx_QAM_data, para, gilen); % Normalise signal power Tx_data = (1 / sqrt(power_calc(Tx_data))) * Tx_data; % Pass through noisy multipath channel Rx_data = channel(Tx_data, impulse_response, noiseVar); % OFDM Receiver Rx_QAM_data = ofdm_receive(Rx_data, para, gilen); % Channel Estimation h_LS = LS_estimate(Rx_QAM_data, Tx_QAM_data); h_LMMSE = LMMSE_estimate(Rx_QAM_data, Tx_QAM_data, h_LS, ... rayleigh_var, noiseVar, para, gilen, channel_attn); h_SVD5 = SVD5_estimate(Rx_QAM_data, Tx_QAM_data, h_LS, ... rayleigh_var, noiseVar, para, gilen, channel_attn); % Update the MSE MSE(i) MSE_LS(i) MSE_LMMSE(i) MSE_SVD5(i)
vector = MSE(i) + mean((abs(channel_attn - channel_attn)).^2); = MSE_LS(i) + mean((abs(channel_attn - h_LS)).^2); = MSE_LMMSE(i) + mean((abs(channel_attn - h_LMMSE)).^2); = MSE_SVD5(i) + mean((abs(channel_attn - h_SVD5)).^2);
for symbols = 1:symbol_count % Generate random binary data (pilot tones) Tx_sel_data = binary_data(1, para*ml); % Serial -> Parallel conversion Tx_para_data = reshape(Tx_sel_data,para,ml); % 16-QAM modulation Tx_QAM_data = qammod(Tx_para_data, para, ml); % OFDM Transmitter Tx_data = ofdm_transmit(Tx_QAM_data, para, gilen);
114
CHAPTER 8. APPENDIX D
% Normalise signal power Tx_data = (1 / sqrt(power_calc(Tx_data))) * Tx_data; % Pass through multipath channel Rx_data = channel(Tx_data, impulse_response, noiseVar); % OFDM Receiver Rx_QAM_data = ofdm_receive(Rx_data, para, gilen); % Equalise data Rx_QAM_data_LS Rx_QAM_data_LMMSE Rx_QAM_data_SVD5
a = = =
simple equaliser (division in freq domain) Rx_QAM_data ./ h_LS; Rx_QAM_data ./ h_LMMSE; Rx_QAM_data ./ h_SVD5;
% 16-QAM demodulation Rx_para_data = qamdemod(Rx_QAM_data, para, ml); Rx_para_data_LS = qamdemod(Rx_QAM_data_LS, para, ml); Rx_para_data_LMMSE = qamdemod(Rx_QAM_data_LMMSE, para, ml); Rx_para_data_SVD5 = qamdemod(Rx_QAM_data_SVD5, para, ml);
% Parallel -> Serial conversion Rx_sel_data = reshape(Rx_para_data, 1, para*ml); Rx_sel_data_LS = reshape(Rx_para_data_LS, 1, para*ml); Rx_sel_data_LMMSE = reshape(Rx_para_data_LMMSE, 1, para*ml); Rx_sel_data_SVD5 = reshape(Rx_para_data_SVD5, 1, para*ml); % Calculate error bit_errors = sum(xor(Tx_sel_data, Rx_sel_data)); if (bit_errors ~= 0) BER(i) = BER(i) + bit_errors; SER(i) = SER(i) + 1; end % Calculate LS error bit_errors_LS = sum(xor(Tx_sel_data, Rx_sel_data_LS)); if (bit_errors_LS ~= 0) BER_LS(i) = BER_LS(i) + bit_errors_LS; SER_LS(i) = (SER_LS(i) + 1); end
115
% Calculate LMMSE error bit_errors_LMMSE = sum(xor(Tx_sel_data, Rx_sel_data_LMMSE)); if (bit_errors_LMMSE ~= 0) BER_LMMSE(i) = BER_LMMSE(i) + bit_errors_LMMSE; SER_LMMSE(i) = (SER_LMMSE(i) + 1); end % Calculate SVD Rank 5 error bit_errors_SVD5 = sum(xor(Tx_sel_data, Rx_sel_data_SVD5)); if (bit_errors_SVD5 ~= 0) BER_SVD5(i) = BER_SVD5(i) + bit_errors_SVD5; SER_SVD5(i) = (SER_SVD5(i) + 1); end end end end %-------------------------------------------------------------------------% Average the Errors to find the error rate BER BER_LS BER_LMMSE BER_SVD5
= = = =
BER ./ (symbol_count * frame_count * para * ml); BER_LS ./ (symbol_count * frame_count * para * ml); BER_LMMSE ./ (symbol_count * frame_count * para * ml); BER_SVD5 ./ (symbol_count * frame_count * para * ml);
SER SER_LS SER_LMMSE SER_SVD5
= = = =
SER ./ (symbol_count * frame_count) SER_LS ./ (symbol_count * frame_count) SER_LMMSE ./ (symbol_count * frame_count) SER_SVD5 ./ (symbol_count * frame_count)
MSE MSE_LS MSE_LMMSE MSE_SVD5
= = = =
MSE ./ frame_count; MSE_LS ./ frame_count; MSE_LMMSE ./ frame_count; MSE_SVD5 ./ frame_count;
% Plot graphs figure(1); plot([0:5:50], MSE_LS, ’ro:’), title(’Estimator MSE Comparison’), ... ylabel(’Mean Square Error’), xlabel(’SNR (dB)’); hold on;
116
CHAPTER 8. APPENDIX D
plot([0:5:50], MSE_LMMSE, ’bx:’), legend(’MSE LS’,’MSE LMMSE’,’MSE SVD’); plot([0:5:50], MSE_SVD5, ’c^:’); hold off; figure(2); semilogy([0:5:50], BER_LS, ’ro:’), title(’Estimator BER Comparison’), ... ylabel(’Bit Error Rate’), xlabel(’SNR (dB)’); hold on; semilogy([0:5:50], BER_LMMSE, ’bx:’), legend(’BER LS’,’BER LMMSE’,’BER SVD’); semilogy([0:5:50], BER_SVD5, ’c^:’); hold off; figure(3); semilogy([0:5:50], SER_LS, ’ro:’), title(’Estimator SER Comparison’), ... ylabel(’Symbol Error Rate’), xlabel(’SNR (dB)’); hold on; semilogy([0:5:50], SER_LMMSE, ’bx:’), legend(’SER LS’,’SER LMMSE’,’SER SVD’); semilogy([0:5:50], SER_SVD5, ’c^:’); hold off; %+----------------------------------------------------------------+ %| | %| Name: binary_data.m | %| Author: Mathew Liu | %| Description: Random Binary Data Generator | %| | %| | %+----------------------------------------------------------------+ function [bin_data] = binary_data(rows, cols) bin_data = rand(rows,cols) > 0.5; %+----------------------------------------------------------------+ %| | %| Name: qammod.m | %| Author: James Shen, Mathew Liu | %| Description: QAM16 modulator | %| | %| | %+----------------------------------------------------------------+ function[symbols] = qammod(in_binary, carrier_count, M) % M^2 = number of points on constellation. % in_binary(64,M) 64 derived from IFFT size
117
% in_binary is made from the S/P % Generate QAM Alphabet temp_M = -(M-1):2:(M-1); for i=1:M for k = 1:M QAM(i,k) = temp_M(i) + j*temp_M(k); end end QAM = QAM(:).’; % Find the index corresponding to signal point symbols = zeros(carrier_count, 1); index = 1; for row=1:carrier_count for bit_position=1:M index = index + ((2^(bit_position-1)) * in_binary(row,bit_position)); % sum should be a number from 1-16 end symbols(row) = QAM(index); index = 1; end %+----------------------------------------------------------------+ %| | %| Name: closest.m | %| Author: James Shen, Mathew Liu | %| Description: function to return the closest QAM16 signal point| %| This function is used by qamdemod and is part of the basic | %| model. | %+----------------------------------------------------------------+ function[out_symbol] = closest(QAM_alpha, noise_symbol) for i=1:length(QAM_alpha) dist(i) = abs(QAM_alpha(i) - noise_symbol); end [val,index] = min(dist); out_symbol = QAM_alpha(index);
118
CHAPTER 8. APPENDIX D
%+----------------------------------------------------------------+ %| | %| Name: giins.m | %| Author: Mathew Liu | %| Description: Cyclic Prefix / Guard Interval Insertion | %| | %| | %+----------------------------------------------------------------+
function [outdata]= giins(data,fftlen,gilen); outdata = [data(fftlen-gilen+1:fftlen,:); data];
%+----------------------------------------------------------------+ %| | %| Name: ofdm_transmit.m | %| Author: Mathew Liu | %| Description: Basic OFDM transmitter | %| | %| | %+----------------------------------------------------------------+ function [Tx_data] = ofdm_trasmit(Tx_QAM_data, para, gilen) % Parameter Derivation Initialisation fftlen = para; fftlen2 = fftlen + gilen; % Convert to Time Domain Signal Tx_IFFT_data = ifft(Tx_QAM_data); % Cyclic Prefix Insertion Tx_data = giins(Tx_IFFT_data,fftlen,gilen); %+----------------------------------------------------------------+ %| | %| Name: channel.m | %| Author: Mathew Liu | %| Description: Represents the noisy multipath channel |
119
%| This is based on the model decribed under channel estimation | %| | %+----------------------------------------------------------------+ function [Rx_data] = channel(Tx_data, impulse_response, noiseVar) fftlen2 = length(Tx_data); % Channel Distortion Rx_faded_data = filter(impulse_response,1,Tx_data); % Add Noise white_noise = AWGN_noise(noiseVar,fftlen2)’; Rx_data = Rx_faded_data + white_noise; %+----------------------------------------------------------------+ %| | %| Name: rayleigh.m | %| Author: Mathew Liu | %| Description: Rayleigh Distributed Multi path Fading Channel | %| Channel is based on exponential PDP as described under CE | %| | %+----------------------------------------------------------------+ function [impulse_response] = rayleigh(var,gilen) % Parameter Initialisation impulse_response = zeros(1,gilen); sigma=sqrt(var); %The standard deviation rms_delay = floor(gilen / 4); for i=1:gilen % Two gaussian distribution x=sigma * randn(1); y=sigma * randn(1); % Amplitude is a Rayleigh distribution amp = sqrt (x^2 + y^2);
120
CHAPTER 8. APPENDIX D
% Scale according to exponential PDP impulse_response(i) = amp * exp(-(i-1)/rms_delay); end %+----------------------------------------------------------------+ %| | %| Name: AWGN_noise.m | %| Author: Mathew Liu | %| Description: Additive White Gaussian Noise Generator | %| Generates Complex Noise with variance noiseVar | %| | %+----------------------------------------------------------------+ function noise = AWGN_noise(noiseVar,noiseLength) sigma=1/sqrt(2)*sqrt(noiseVar); noise=randn(1,noiseLength)*sigma ... + i*randn(1,noiseLength)*sigma; %+----------------------------------------------------------------+ %| | %| Name: LS_estimate.m | %| Author: Mathew Liu | %| Description: Function to return the LS channel estimation | %| | %| | %+----------------------------------------------------------------+ function [h_LS] = LS_estimate(Rx_QAM_data, Tx_QAM_data) h_LS = Rx_QAM_data ./ Tx_QAM_data; %+----------------------------------------------------------------+ %| | %| Name: LMMSE_estimate.m | %| Author: Mathew Liu | %| Description: Function to calculate LMMSE channel estimate | %| | %| | %+----------------------------------------------------------------+
121
function [h_LMMSE] = LMMSE_estimate(Rx_QAM_data, Tx_QAM_data, h_LS, ... rayleigh_var, noiseVar, para, gilen, channel_attn) % Parameter initialisation SNR = 10 / noiseVar; beta = 17 / 9; % Calculate frequency correlation matrix R_hh = channel_attn * channel_attn’; R_hy = R_hh + (beta/SNR * eye(para)); % Calculate LMMSE estimate h_LMMSE = R_hh * inv(R_hy) * h_LS; g_LMMSE = ifft(h_LMMSE); %+----------------------------------------------------------------+ %| | %| Name: SVD5_estimate.m | %| Author: Mathew Liu | %| Description: Function to calculate Rank 5 Approximation | %| | %| | %+----------------------------------------------------------------+ function [h_SVD] = SVD5_estimate(Rx_QAM_data, Tx_QAM_data, h_LS, ... rayleigh_var, noiseVar, para, gilen, channel_attn) % Derive parameters SNR = 10 / noiseVar; beta = 17 / 9; rms_delay = gilen / 4; % Optimal Low Rank LMMSE Estimator using SVD R_hh = channel_attn * h_LS’; [U,S,V] = svd(R_hh); delta = diag(S) ./ (diag(S) + (beta/SNR)); h_SVD = U * diag(delta)*P * V’ * h_LS; %+----------------------------------------------------------------+ %| |
122
CHAPTER 8. APPENDIX D
%| Name: ofdm_receive.m | %| Author: Mathew Liu | %| Description: Basic OFDM model receiver | %| | %| | %+----------------------------------------------------------------+ function [Rx_QAM_data] = ofdm_receive(Rx_data, para, gilen) % Parameter Derivation initialisation fftlen = para; fftlen2 = fftlen + gilen; % Cyclic Prefix Removal Rx_FFT_data = girem(Rx_data,fftlen2,gilen); % Convert to Frequency Domain Signal Rx_QAM_data = fft(Rx_FFT_data); %+----------------------------------------------------------------+ %| | %| Name: girem.m | %| Author: Mathew Liu | %| Description: Cyclic Prefix / Guard Interval Deletion | %| | %| | %+----------------------------------------------------------------+ function [out]= girem(data,fftlen2,gilen); out=data(gilen+1:fftlen2,:); %+----------------------------------------------------------------+ %| | %| Name: qamdemod.m | %| Author: James Shen, Mathew Liu | %| Description: QAM16 demodulator | %| This file calls the closest function to map noisy signalling | %| points. | %+----------------------------------------------------------------+
123
function[out_binary] = qamdemod(in_symbols, carrier_count, M) % Generate QAM Alphabet temp_M = -(M-1):2:(M-1); for i=1:M for k = 1:M QAM(i,k) = temp_M(i) + j*temp_M(k); end end QAM_alpha = QAM(:).’; % Find the index corresponding to signal point for row=1:carrier_count out_symbol = closest(QAM_alpha, in_symbols(row)); index=0; for i=1:length(QAM_alpha) if(out_symbol == QAM_alpha(i)) index = i; end end index = index-1; % Calculate the binary value from decimal index for bit_position = M:-1:1 if (index >= 2^(bit_position-1)) out_binary(row,bit_position) = 1; index = index - 2^(bit_position-1); else out_binary(row,bit_position) = 0; end end end %----------------------------------END------------------------------------------
124
CHAPTER 8. APPENDIX D
Appendix E Zero Forcing Equalizer %+----------------------------------------------------------------+ %| | %| Name: ofdm_mutlisymbol_ZF.m | %| Author: James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| This model can transmit a specified number of symbols . | %| | %+----------------------------------------------------------------+ clear all; close all; %=============== Some standard Hyperlan Params ================== T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples delta_f = 0.3125e6; % Frequency spacing FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. Ns = 10; % Number of Symbols/Carrier w = ones(FFTLen, 1); % Filter coeff, initial to zero order 10 by default. SNRdB = 100; % SNR of AWGN in channel in dB store_input = zeros(Ns, FFTLen*M); % Used to calculate BER at the end. store_output = zeros(Ns, FFTLen*M); store_error = zeros(Ns, FFTLen); %=================== Simulation =============================== 125
126
CHAPTER 8. APPENDIX E
for sym=1:Ns %----------- Data genration -----------------input = rand(1,FFTLen*M) > 0.5; %transmits one symbol store_input(sym,:) = input; %----------- Transmit Data ------------------[signal_tx, input_symbols] = transmitter(input, FFTLen, CPLen, M); %----------- Channel the data ---------------signal_rx = channel(signal_tx, SNRdB); %-------------- Receiver --------------------[signal_recovered, w, error_sym] = ... receiver_zf(signal_tx, signal_rx, ... input_symbols, FFTLen, CPLen, M, w); store_output(sym,:) = signal_recovered; store_error(sym,:) = error_sym.’; end %=============== Simulation End ============================ %==================== BER Calculation ========================= errors_ext = abs(store_input - store_output); errors = errors_ext(FFTLen+1:length(errors_ext)); num_errors = sum(sum(errors)); BER = num_errors/(FFTLen*M*(Ns-1)) %=================== Plot Equlaizer Convergence ================== figure(10); error_samples = reshape(store_error.’,1,(FFTLen)*Ns); semilogy(abs(error_samples.^2)), ... title(’Zero Force Equalizer Error Over 10 Symbols’) ... ,ylabel(’Error Squared’), xlabel(’OFDM Symbol’); %=====================
END FILE ===================================
%+----------------------------------------------------------------+ %| | %| Name: receiver_zf.m | %| Author: James Shen | %| Description: Takes ina signal and tries to demodulate it. | %| We assume that we are receiving pilot signals so that the | %| desired signal is know already. What happens in a real | %| implementation is that the equalizer coefficients derived | %| will continue to be used with data and the desired signal |
127
%| will then be the decovered signal. This will accumulate | %| errors in the coefficients until the next batch of | %| pilot symbols arrive. Receives one OFDM. | %| | %+----------------------------------------------------------------+ function[recovered_signal,w, error1] = ... receiver_zf(desired_signal, noisy_signal, ... input_symbols, FFTLen, CPLen, M, w); %============== Gaurd Interval Removal (GIR) ================== % Remove cyclic extension from desired signal. desired_time_serial = desired_signal((CPLen+1):FFTLen+CPLen); % Remove cyclic extension from noisy signal. noisy_time_serial = noisy_signal((CPLen+1):FFTLen+CPLen);
%================= Serial To Parallel ================================= output_time_para = reshape(noisy_time_serial,FFTLen,1); %================= FFT ================================= output_noisy_symbols = fft(output_time_para); %============== Zero Forcing Equalizer ======================== % LS channel estimator in frequency domain h_est = output_noisy_symbols ./ input_symbols; % Zf equalizer output_symbols = output_noisy_symbols ./ w; %================= Baseband Demodulation =========================== output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ==================== output = reshape(output_para,1,FFTLen*M); % Time domain signal %================ Returning output =============================== recovered_signal = output; w = h_est; %e = - _time_serial; % The code below should be commented out when
128
CHAPTER 8. APPENDIX E
% running for more than one iteration as it just % shows graphs for one symbol %================ Error Calculation =========================== %figure(1); %plot(abs(input_symbols), ’bx’); hold on; %plot(abs(output_symbols), ’ro’), ... % title(’ ’); %plot(abs(output_noisy_symbols), ’gd’), ... % legend(’ ’) ... % ,ylabel(’Amplitude’), xlabel(’Symbol’); hold off; error1= input_symbols - output_symbols; %================ Graphs =========================== %figure(2); %semilogy(abs(desired_signal), ’b’); hold on; %semilogy(abs(output_ext), ’r’); hold off; %figure(3); %semilogy(abs(e)); %=====================
END FILE ===================================
%+----------------------------------------------------------------+ %| | %| Name: transmitter.m | %| Author: Mathew Liu, James Shen | %| Description: Takes in a bit stream and makes it into an OFDM | %| signal ready to transmit. Only does it for one symbol. | %| Transmits based on the FFT. | %| | %+----------------------------------------------------------------+ function[trans_signal, input_symbols] = transmitter(input, FFTLen, CPLen, M); % We assume that with are using 64 length FFT with 64 subcarriers all carrying % data. So there are no carriers specifically assigned to pilot. %=============== Some standard Hyperlan Params ================== T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples
129
delta_f = 0.3125e6; % Frequency spacing %============== Our params based on Hyperlan/2 ================= %+----------------------------------------------------------------+ %| OFDM TRANSMITTER | %+----------------------------------------------------------------+ %======== Serial To Block (FFTLen, M) ============================ input_para = reshape(input,FFTLen,M); %======== Baseband Modulation =========================== input_symbols = qammod(input_para,FFTLen, M); %================= IFFT ================================= %input_time_para = FFTLen*ifft(input_symbols); input_time_para = ifft(input_symbols); % Need to multiply by FFTLen since the IFFT scales it by (1/N) %================ Parallel to Serial ========================== input_time_serial = reshape(input_time_para,1,FFTLen); % Time domain signal %============= Gaurd Interval Insertion (GII) =================== input_ext = [input_time_serial((FFTLen-CPLen+1):FFTLen),input_time_serial]; %==================== Return output ========================== trans_signal = input_ext; input_symbols = input_symbols; %=====================
END FILE ===================================
%+----------------------------------------------------------------+ %| | %| Name: channel.m | %| Author: Mathew Liu, James Shen | %| Description: Filters an input signal based on channel | %| characteristics. | %| | %+----------------------------------------------------------------+ function[output] = channel(input, SNRdB);
130
CHAPTER 8. APPENDIX E
%+----------------------------------------------------------------+ %| CHANNEL MODEL | %+----------------------------------------------------------------+ %=============== Pass Through Rayleigh Channel ==================== h = [1 0.5 0.1 0.001]; output = filter(h, 1, input) + AWGN_noise(input, SNRdB); %=====================
END FILE ===================================
%+----------------------------------------------------------------+ %| | %| Name: AWGN_noise.m | %| Author: James Shen | %| Description: Takes a signal and a SNR to output a noise | %| sequence as a row vector. | %| | %+----------------------------------------------------------------+ function[noise] = AWGN_noise(input, SNR); % SNR = 10*log10(var(input)/var(noise)) noise = crand(1, length(input))*( var(input)/(10^(SNR/10)) ); %=====================
END FILE ===================================
Appendix F LMMSE Equalizer %+----------------------------------------------------------------+ %| | %| Name: ofdm_multisymbol_LMMSE.m | %| Author: James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| This model can transmit a specified number of symbols . | %| | %+----------------------------------------------------------------+ clear all; close all; %=============== Some standard Hyperlan Params ================== T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples delta_f = 0.3125e6; % Frequency spacing FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. Ns = 10; % Number of Symbols/Carrier %F = 3; % Order of the filter w = ones(FFTLen, 1); % Filter coeff, initial to zero order 10 by default. SNRdB = 0; % SNR of AWGN in channel in dB store_input = zeros(Ns, FFTLen*M); % Used to calculate BER at the end. store_output = zeros(Ns, FFTLen*M); 131
132
CHAPTER 8. APPENDIX F
store_error = zeros(Ns, FFTLen); %=================== Simulation =============================== for sym=1:Ns %----------- Data genration -----------------input = rand(1,FFTLen*M) > 0.5; %transmits one symbol store_input(sym,:) = input; %----------- Transmit Data ------------------[signal_tx, input_symbols] = transmitter(input, FFTLen, CPLen, M); %----------- Channel the data ---------------signal_rx = channel(signal_tx, SNRdB); %-------------- Receiver --------------------[signal_recovered, w, error_sym] = ... receiver_lmmse(signal_tx, signal_rx, ... input_symbols, FFTLen, CPLen, M, w, SNRdB); store_output(sym,:) = signal_recovered; store_error(sym,:) = error_sym.’; end %=============== Simulation End ============================ %==================== BER Calculation ========================= errors = abs(store_input - store_output); num_errors = sum(sum(errors)); BER = num_errors/(FFTLen*M*Ns) %=================== Plot Equlaizer Convergence ================== figure(10); error_samples = reshape(store_error.’,1,(FFTLen)*Ns); semilogy(abs(error_samples.^2)), ... title(’Zero Force Equalizer Error Over 10 Symbols’) ... ,ylabel(’Error Squared’), xlabel(’OFDM Symbol’); %==================== END FILE =================================== %+----------------------------------------------------------------+ %| | %| Name: receiver_lmmse.m | %| Author: James Shen | %| Description: Takes ina signal and tries to demodulate it. | %| We assume that we are receiving pilot signals so that the | %| desired signal is know already. What happens in a real | %| implementation is that the equalizer coefficients derived |
133
%| will continue to be used with data and the desired signal | %| will then be the decovered signal. This will accumulate | %| errors in the coefficients until the next batch of | %| pilot symbols arrive. Receives one OFDM. | %| | %+----------------------------------------------------------------+ function[recovered_signal,w, error1] = ... receiver_lmmse(desired_signal, noisy_signal, ... input_symbols, FFTLen, CPLen, M, w, SNRdB); %============== Gaurd Interval Removal (GIR) ================== % Remove cyclic extension from desired signal. desired_time_serial = desired_signal((CPLen+1):FFTLen+CPLen); % Remove cyclic extension from noisy signal. noisy_time_serial = noisy_signal((CPLen+1):FFTLen+CPLen);
%================= Serial To Parallel ================================= output_time_para = reshape(noisy_time_serial,FFTLen,1); %================= FFT ================================= output_noisy_symbols = fft(output_time_para); %============== Zero Forcing Equalizer ======================== % LS channel estimator in frequency domain h_est = output_noisy_symbols ./ input_symbols; % LMMSE equalizer SNR = 10^(SNRdB/10); new_w = conj(h_est) ./ ( abs(h_est).^2 + 1/SNR); output_symbols = output_noisy_symbols .* w; %================= Baseband Demodulation =========================== output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ==================== output = reshape(output_para,1,FFTLen*M); % Time domain signal %================ Returning output =============================== recovered_signal = output; w = new_w;
134
CHAPTER 8. APPENDIX F
% The code below should be commented out when % running for more than one iteration as it just % shows graphs for one symbol %================ Error Calculation =========================== %figure(1); %plot(abs(input_symbols), ’bx’); hold on; %plot(abs(output_symbols), ’ro’), ... % title(’’); %plot(abs(output_noisy_symbols), ’gd’), ... % legend(’’) ... % ,ylabel(’Amplitude’), xlabel(’Symbol’); hold off; error1= input_symbols - output_symbols; %================ Graphs =========================== %figure(2); %semilogy(abs(desired_signal), ’b’); hold on; %semilogy(abs(output_ext), ’r’); hold off; %figure(3); %semilogy(abs(e)); %=============== END FILE ================================
Appendix G LMS Equalizer %+----------------------------------------------------------------+ %| | %| Name: ofdm_multisymbol.m | %| Author: James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| This model can transmit a specified number of symbols . | %| | %+----------------------------------------------------------------+ clear all; close all; %=============== Some standard Hyperlan Params ================== T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples delta_f = 0.3125e6; % Frequency spacing FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. Ns = 10; % Number of Symbols/Carrier F = 3; % Order of the filter w = zeros(F,1); % Filter coeff, initial to zero order 10 by default. store_input = zeros(Ns, FFTLen*M); % Used to calculate BER at the end. store_output = zeros(Ns, FFTLen*M); store_error = zeros(Ns, FFTLen+CPLen); 135
136
CHAPTER 8. APPENDIX G
%=================== Simulation =============================== for sym=1:Ns %----------- Data genration -----------------input = rand(1,FFTLen*M) > 0.5; %transmits one symbol store_input(sym,:) = input; %----------- Transmit Data ------------------signal_tx = transmitter(input, FFTLen, CPLen, M); %----------- Channel the data ---------------signal_rx = channel(signal_tx); %-------------- Receiver --------------------%[signal_recovered, w, error_sym] = ... % receiver_rls(signal_tx, signal_rx, FFTLen, CPLen, M, w, F); [signal_recovered, w, error_sym] = ... receiver_lms(signal_tx, signal_rx, FFTLen, CPLen, M, w, F); store_output(sym,:) = signal_recovered; store_error(sym,:) = error_sym; end %=============== Simulation End ============================ %==================== BER Calculation ========================= errors = abs(store_input - store_output); num_errors = sum(sum(errors)); BER = num_errors/(FFTLen*M*Ns) %=================== Plot Equlaizer Convergence ================== figure(10); error_samples = reshape(store_error.’,1,(FFTLen+CPLen)*Ns); semilogy(abs(error_samples).^2), ... title(’LMS Tracking Over 10 OFDM Symbols’), ... ylabel(’Mean Squared Error’), xlabel(’QAM symbol’); %======================= END FILE ================================ %+----------------------------------------------------------------+ %| | %| Name: receiver_lms.m | %| Author: James Shen | %| Description: Takes ina signal and tries to demodulate it. | %| We assume that we are receiving pilot signals so that the | %| desired signal is know already. What happens in a real | %| implementation is that the weiner coefficients derived will |
137
%| continue to be used with data and the desired signal will | %| then be the decovered signal. This will accumulate errors in | %| the coefficients until the next batch of pilot symbols | %| arrive. Receives one OFDM. | %| | %+----------------------------------------------------------------+ function[recovered_signal,w,e] = ... receiver_lms(desired_signal, noisy_signal, FFTLen, CPLen, M, w, F); % desired_signal The signal you want to obtain after filtering. % noisy_signal This signal is somehow correlated to the desired_signal. % FFTLen This is the size of the FFT to be used. Should be a power of % 2. Hyoerlan works to 64 points. % M Bits per symbol used in baseband mod and demod. % w The filter coefficients % F Samples taken for correlation and that of the Kalman filter. % e Error (desired_signal - noisy_signal) % recovered _signal = the signal that is finally output. %+----------------------------------------------------------------+ %| OFDM RECEVIER | %+----------------------------------------------------------------+ %======================= RLS Equalizer ================================ %======================= Initializations ================================ N = length(desired_signal); F = 3; % Filter order. udata = noisy_signal; % Noisy signal yet correlated to desired. d = desired_signal; % Desired signal. %mu = 0.25; % Typically 0
138
CHAPTER 8. APPENDIX G
end output_ext = y; % ext means still with cyclic prefix extension. %============== Gaurd Interval Removal (GIR) ================== output_time_serial = output_ext((CPLen+1):FFTLen+CPLen); %======== Serial To Parallel ================================= output_time_para = reshape(output_time_serial,FFTLen,1); %================= FFT ================================= output_symbols = fft(output_time_para); %================= Baseband Demodulation =========================== output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ==================== output = reshape(output_para,1,FFTLen*M); % Time domain signal %================ Returning output =============================== recovered_signal = output; w = w; e = e; % The code below should be commented out when % running for more than one iteration as it just % shows graphs for one symbol %================ Error Calculation =========================== % Error is ZERO, so it works! error1= desired_signal - output_ext; figure(1); semilogy(abs(error1)); %================ Graphs =========================== %figure(2); %semilogy(abs(desired_signal), ’b’); hold on; %semilogy(abs(noisy_signal), ’g’); %semilogy(abs(output_ext), ’r’); hold off; %figure(3); %semilogy(abs(e)); %======================= END FILE ================================
Appendix H RLS Equalizer %+----------------------------------------------------------------+ %| | %| Name: ofdm_multisymbol.m | %| Author: James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| This model can transmit a specified number of symbols . | %| | %+----------------------------------------------------------------+ clear all; close all; %=============== Some standard Hyperlan Params ================== T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples delta_f = 0.3125e6; % Frequency spacing FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. Ns = 10; % Number of Symbols/Carrier F = 3; % Order of the filter w = zeros(F,1); % Filter coeff, initial to zero order 10 by default. store_input = zeros(Ns, FFTLen*M); % Used to calculate BER at the end. store_output = zeros(Ns, FFTLen*M); store_error = zeros(Ns, FFTLen+CPLen); %=================== Simulation =============================== 139
140
CHAPTER 8. APPENDIX H
for sym=1:Ns %----------- Data genration -----------------input = rand(1,FFTLen*M) > 0.5; %transmits one symbol store_input(sym,:) = input; %----------- Transmit Data ------------------signal_tx = transmitter(input, FFTLen, CPLen, M); %----------- Channel the data ---------------signal_rx = channel(signal_tx); %-------------- Receiver --------------------[signal_recovered, w, error_sym] = ... receiver_rls(signal_tx, signal_rx, FFTLen, CPLen, M, w, F); % [signal_recovered, w, error_sym] = ... % receiver_lms(signal_tx, signal_rx, FFTLen, CPLen, M, w, F); store_output(sym,:) = signal_recovered; store_error(sym,:) = error_sym; end %=============== Simulation End ============================ %==================== BER Calculation ========================= errors = abs(store_input - store_output); num_errors = sum(sum(errors)); BER = num_errors/(FFTLen*M*Ns) %=================== Plot Equlaizer Convergence ================== figure(10); error_samples = reshape(store_error.’,1,(FFTLen+CPLen)*Ns); semilogy(abs(error_samples).^2), ... title(’LMS Tracking Over 10 OFDM Symbols’), ... ylabel(’Mean Squared Error’), xlabel(’QAM symbol’); %======================= END FILE ================================
%+----------------------------------------------------------------+ %| | %| Name: receiver_rls.m | %| Author: James Shen | %| Description: Takes ina signal and tries to demodulate it. | %| We assume that we are receiving pilot signals so that the | %| desired signal is know already. What happens in a real | %| implementation is that the weiner coefficients derived will |
141
%| continue to be used with data and the desired signal will | %| then be the decovered signal. This will accumulate errors in | %| the coefficients until the next batch of pilot symbols | %| arrive. Receives one OFDM. | %| | %+----------------------------------------------------------------+ function[recovered_signal,w,e] = ... receiver_rls(desired_signal, noisy_signal, FFTLen, CPLen, M, w, F); % desired_signal The signal you want to obtain after filtering. % noisy_signal This signal is somehow correlated to the desired_signal. % FFTLen This is the size of the FFT to be used. Should be a power of % 2. Hyoerlan works to 64 points. % M Bits per symbol used in baseband mod and demod. % w The filter coefficients % F Samples taken for correlation and that of the Kalman filter. % e Error (desired_signal - noisy_signal) % recovered _signal = the signal that is finally output. %+----------------------------------------------------------------+ %| OFDM RECEVIER | %+----------------------------------------------------------------+ %======================= RLS Equalizer ================================ %======================= Initializations ================================ N = length(desired_signal); P = zeros(F,1); % Inverse correlation matrix. P = eye(F)*100; udata = noisy_signal; % Noisy signal yet correlated to desired. d = desired_signal; % Desired signal. lambda = 0.9; % Weighting factor 0.95<=w<=1 %====================== Filter Iterations ============================== for n=F:N u = flipud(udata(n:-1:(n-F+1)).’); %col vector now K = P*u ./ ((1-lambda) + u.’*P*u); y(n) = w.’*u; e(n) = d(n) - y(n); w = w + K*e(n); P = (1/(1-lambda))*(eye(F) - K*u.’)*P; end output_ext = y; % ext means still with cyclic prefix extension.
142
CHAPTER 8. APPENDIX H
%============== Gaurd Interval Removal (GIR) ================== output_time_serial = output_ext((CPLen+1):FFTLen+CPLen); %======== Serial To Parallel ================================= output_time_para = reshape(output_time_serial,FFTLen,1); %================= FFT ================================= output_symbols = fft(output_time_para); %================= Baseband Demodulation =========================== output_para = qamdemod(output_symbols,FFTLen, M); %================ Parallel to Serial ==================== output = reshape(output_para,1,FFTLen*M); % Time domain signal %================ Returning output =============================== recovered_signal = output; w = w; e = e; % The code below should be commented out when % running for more than one iteration as it just % shows graphs for one symbol %================ Error Calculation =========================== error1= desired_signal - output_ext; figure(1); semilogy(abs(error1)); %================ Graphs =========================== figure(2); semilogy(abs(desired_signal), ’b’); hold on; semilogy(abs(noisy_signal), ’g’); semilogy(abs(output_ext), ’r’); hold off; figure(3); semilogy(abs(e)); %======================= END FILE ================================
Appendix I RLS vs LMS %+----------------------------------------------------------------+ %| | %| Name: ofdm_rlsvslms.m | %| Author: James Shen | %| Description: Basic OFDM model used for simulation purposes. | %| Compares LMS to RLS equalizer. | %| | %+----------------------------------------------------------------+ clear all; close all; %=============== Some standard Hyperlan Params ================== T = 50e-9; % System sampling period fs = 1/T; % System sampling freq = 20MHz Tcp = 16*T; % CP period Tu = 64*T; % Useful symbol period Ts = Tu+Tcp; % OFDM Symbol period 80 samples delta_f = 0.3125e6; % Frequency spacing FFTLen = 64; % Length of FFT. CPLen = 16; % Length of Cyclic Prefix M = 4; % Bits encoded in a QAM symbol. Ns = 5; % Number of Symbols/Carrier F = 3; % Order of the filter R = zeros(F,1); % Filter coeff, initial to zero order 10 by default. L = zeros(F,1); % Filter coeff, initial to zero order 10 by default. store_input = zeros(Ns, FFTLen*M); % Used to calculate BER at the end. store_output_rls = zeros(Ns, FFTLen*M); store_output_lms = zeros(Ns, FFTLen*M); 143
144
CHAPTER 8. APPENDIX I
store_error_rls = zeros(Ns, FFTLen+CPLen); store_error_lms = zeros(Ns, FFTLen+CPLen); %=================== Simulation =============================== for sym=1:Ns %----------- Data genration -----------------input = rand(1,FFTLen*M) > 0.5; %transmits one symbol store_input(sym,:) = input; %----------- Transmit Data ------------------signal_tx = transmitter(input, FFTLen, CPLen, M); %----------- Channel the data ---------------signal_rx = channel(signal_tx); %-------------- Receiver --------------------[signal_recovered, R, error_sym] = ... receiver_rls(signal_tx, signal_rx, FFTLen, CPLen, M, R, F); store_output_rls(sym,:) = signal_recovered; store_error_rls(sym,:) = error_sym; [signal_recovered, L, error_sym] = ... receiver_lms(signal_tx, signal_rx, FFTLen, CPLen, M, L, F); store_output_lms(sym,:) = signal_recovered; store_error_lms(sym,:) = error_sym; end %=============== Simulation End ============================ %==================== BER Calculation ========================= error_rls = abs(store_input - store_output_rls); error_lms = abs(store_input - store_output_lms); num_error_rls = sum(sum(error_rls)); num_error_lms = sum(sum(error_lms)); BER_rls = num_error_rls/(FFTLen*M*Ns) BER_lms = num_error_lms/(FFTLen*M*Ns) %=================== Plot Equlaizer Convergence ================== figure(10); error_samples_rls = reshape(store_error_rls.’,1,(FFTLen+CPLen)*Ns); error_samples_lms = reshape(store_error_lms.’,1,(FFTLen+CPLen)*Ns); semilogy(abs(error_samples_rls).^2,’r’), ... title(’LMS vs RLS Receivers’); hold on; semilogy(abs(error_samples_lms).^2,’b’), ... title(’LMS vs RLS Receivers’) ... ,legend(’RLS algorithm’,’LMS algorithm’) ... ,ylabel(’Mean Squared Erorr’), xlabel(’Number of Iteration’); ...
145
hold off; %======================= END FILE ================================