PERFORMANCE ANALYSIS OF SPACE-TIME TRELLIS CODES
by
Nicky Yuen
B.A.Sc, The University of British Columbia, 2000
A REPORT SUBMITTED IN PARTIAL FULFILLMENT OF THE
REQUIREMENTS FOR THE DEGREE OF
MASTER OF ENGINEERING
in
THE FACULTY OF GRADUATE STUDIES
Department of Electrical and Computer Engineering
We accept this report as conforming to the required standard:
_______________________________________
_______________________________________
_______________________________________
THE UNIVERSITY OF BRITISH COLUMBIA Vancouver, British Columbia, Canada
April 2003
© Nicky Yuen, 2003
ii
Table of Contents
List of Tables .................................................................................................................. iv
List of Figures .................................................................................................................v
Acknowledgements......................................................................................................vi
Chapter 1.0 Introduction .........................................................................................7
1.1 Diversity .........................................................................................................8
1.2 Temporal Diversity .......................................................................................9
1.2 Frequency Diversity .....................................................................................9
1.3 Antenna Diversity .........................................................................................9
Chapter 2.0 Space-Time Trellis Coding ............................................................11
2.1 Performance Criteria..................................................................................11
2.2 Code Construction .....................................................................................14
2.3 Trellis Codes ...............................................................................................20
Chapter 3.0 Simulation System Model ..............................................................23
3.1 Channel Estimation....................................................................................24
3.2 Generator Matrix to Trellis Converter......................................................25
3.3 STTC Encoder ............................................................................................25
3.4 STTC Decoder ............................................................................................26
3.5 Simulation Results .....................................................................................27
Chapter 4.0 Conclusion and Future Considerations.....................................31
List of Abbreviations...................................................................................................32
List of References ........................................................................................................33
iii
Appendix A. Generator Matrix to Trellis Converter ...........................................34
Appendix B. Space-Time Encoder Source Code................................................36
Appendix C. Space-Time Decoder Source Code For 4PSK, 4-State Case ..39
iv
List of Tables
Table 1. Coefficient Pairs for 4PSK, 4-, 8-, and 16-State, STTCM Codes ..........21
Table 2. Coefficient Pairs for 8PSK, 8-State, STTCM Code..................................21
v
List of Figures
Figure 1. Space-Time Trellis Code System Model ..................................................11
Figure 2. 4PSK Signal Constellation..........................................................................14
Figure 3. 4-State, 4PSK Trellis Diagram ...................................................................15
Figure 4. 4-State, 4PSK Encoder Structure ..............................................................16
Figure 5. 8-State, 4PSK Trellis Diagram ...................................................................17
Figure 6. 16-State, 4PSK Trellis Diagram.................................................................18
Figure 7. 8PSK Signal Constellation..........................................................................18
Figure 8. 8-State, 8PSK Trellis Diagram ...................................................................19
Figure 9. 8-State, 8PSK Encoder Structure ..............................................................20
Figure 10. Performance Of 4PSK Codes With Two Transmit And One Receive
Antenna....................................................................................................................28
Figure 11. Performance Of 8PSK Code With Two Transmit And One Receive
Antenna....................................................................................................................29
vi
Acknowledgements
I would like to express my deepest gratitude and appreciation to my mom
and dad, Connie and Yau-Lin, and to my brothers, Kevin, Alex, and Kenny, who
have constantly been an encouragement to me, wanting me to always challenge
myself, and never letting me let go.
To my brothers and sisters in Christ and especially the Newbern
Trailblazers, all of whom have been an implicit component to the completion of
this degree, I am most grateful for you and for the times we shared in prayer.
To my very dear friends, Mel and Jill Hoskyn, thank you for supporting,
praying for, and encouraging me throughout the difficulties. You have shown me
how to persevere and smile at the same time.
To my Lord, Jesus Christ, you have always been there for me, never
letting me do things independent of you, and I thank you.
Last but absolutely not least, if it were not for Dr. Cyril Leung and his
constant supervision, guidance, and help, this report would have been so much
more difficult to write.
7
Chapter 1.0 Introduction
Receive diversity is one method for reducing the destructive and
corrupting effects of fading due to multipaths or interference from other users, but
incorporating this type of diversity in mobile handsets is undesirable due to the
possible increase in power consumption, size, and cost. Therefore, in cellular
systems, diversity has been implemented mostly at base stations (BSs), rather
than at the mobile stations (MSs).
Space-Time Trellis Codes (STTCs) were introduced in 1998 [1] as a high-
data rate, bandwidth and power-efficient method of communication over wireless
Rayleigh and Rician fading channels. STTCs can achieve a diversity advantage
by placing the diversity burden on the BS, and hence leaving the MS to maintain
its mobility and practicality [2].
STTCs are based on well defined trellis structures and hence can be
decoded using soft-decision decoding techniques at the receiver, such as Viterbi
decoding. STTC modulation proposed a joint design of coding, modulation, and
transmit diversity for flat Rayleigh fading channels.
In this report, an encoder and Viterbi decoder are implemented to simulate
the performance of STTCs in a second order diversity (two transmit and one
receive antennas), Rayleigh fading environment. The specific cases of 4-, 8-,
and 16-State 4PSK codes, and the 8-State 8PSK codes are studied.
8
1.1 Diversity
The wireless channel suffers from attenuation due to destructive
multipaths in the propagation media [1]. These forms of attenuation result in the
inefficient and unreliable transmission of data over many radio channels. Some
possible, but non-pragmatic, solutions to combat this degradation are to increase
transmission power, antenna size, or antenna height. A practical alternative to
these solutions would be to transmit some less-attenuated replica of the signal to
the receiver thereby increasing the probability that the receiver will receive a less
corrupted signal. This scheme of transmission and reception is called diversity
and is one of the most important techniques used to mitigate the effects of fading
in wireless communications.
It is assumed that fading in all diversity branches are independent (or at
least highly uncorrelated). This feature is important in diversity techniques, since
it would not help the receiver to have additional copies of the signal if the copies
are all equally poor [3].
Several techniques of achieving diversity are available and include:
temporal diversity, frequency diversity, and spatial (antenna) diversity.
9
1.2 Temporal Diversity
In temporal (or time) diversity, replicas of the information signal are
transmitted in different time slots so that multiple, uncorrelated repetitions of the
signal will be received [4]. The separation between successive time slots should
exceed the coherence time of the channel [5].
1.2 Frequency Diversity
In frequency diversity, the information signal is transmitted on more than
one carrier frequency. If the frequency separations among carriers are larger
than the coherence bandwidth of the channel, then fading variations at the
different signal carrier frequencies will be largely uncorrelated.
1.3 Antenna Diversity
Antenna diversity is one of the most popular forms of diversity used in
wireless communications systems, where multiple, spatially separated antennas
are used to receive uncorrelated signals. Conventional cellular radio systems
consist of an elevated BS antenna and a mobile antenna close to the ground.
The existence of a direct path between the transmitter and the receiver is not
guaranteed and the possibility of a number of scatterers in the vicinity of the
mobile suggests a Rayleigh fading signal [4].
10
At the MS, an antenna separation of 2
λ or more would be sufficient for
uncorrelated envelopes at the receiver. Diversity reception at the cell site can be
achieved by using multiple receive antennas (call receive diversity); however,
since the important scatterers are generally close to the ground in the vicinity of
the mobile, the BS antennas must be spaced considerably farther apart to
achieve decorrelation [4], typically on the order of several tens of wavelengths.
11
Chapter 2.0 Space-Time Trellis Coding
In [1], Tarokh et al. derived the design criteria for STTCs over slow
frequency non-selective fading channels. The design criteria were shown to be
determined by the distance matrices constructed from pairs of distinct
codewords. The minimum rank of the distance matrices was used to determine
the diversity gain, and the minimum distance of the distance matrices was used
to determine the coding gain [6]. The system model for STTC modulation is
shown in Figure 1.
InformationSource
Space-TimeTrellis Encoder
ChannelEstimator
ChannelEstimator
Space-TimeTrellis Decoder
InformationSink
Figure 1. Space-Time Trellis Code System Model
2.1 Performance Criteria
Consider the STTC codeword
nLLL
nn cccccccccc LLLL 212
22
121
31
21
11=c
that is transmitted in a frame of length L from the n transmit antennas, and the
erroneous codeword
nLLL
nn eeeeeeeeee LLLL 212
22
121
31
21
11=e .
12
In order to achieve the maximum diversity order nm ⋅ (m receive antennas, n
transmit antennas), the (n x L) difference matrix
B(c,e) =
nL
nL
nnnn
LL
LL
cecece
cecece
cecece
−−−
−−−−−−
L
MOMM
L
L
2211
2222
22
21
21
1112
12
11
11
has to be full rank for the codewords c and e. If B(c,e) has minimum rank r over
the set of pairs of distinct codewords, then a diversity of mr ⋅ is achieved [7].
Let A(c,e) = B(c,e) B*(c,e) be the distance matrix, where B*(c,e) is the
Hermitian of B(c,e). The rank of A is r, the kernel of A has a minimum dimension
n-r, and exactly n-r eigenvalues of A are zero. The non-zero eigenvalues of A
can be denoted by 1λ , 2λ , 3λ , … rλ .
Assuming perfect channel state information (CSI), the probability of
transmitting c and deciding in favour of e at the decoder is given by [1] [6]
)4
),(exp(),...2,1;,...,2,1,|( 2
o
sij N
EecdmjnihecP −≤==→
where 2
0Nis the noise variance per dimension and
∑∑ ∑= = =
−=m
j
l
t
n
i
it
itij echecd
1 1
2
1
2 )(),(
is the Euclidean distance.
It follows from [1] that the pair-wise error bound is given by
13
∏=
−−≤→r
i
rm
o
smi N
EecP
1
)4
()()( λ .
To achieve the best performance for a given system, we should satisfy the
following rank and determinant criteria [6]:
Rank Criterion
Maximize the diversity gain given by mr ⋅ , or maximize over all possible
codeword pairs c and e the minimum rank of matrix A(c,e). The minimum
rank of matrix A taken over all codeword pairs is also called the rank of the
code.
To illustrate this criterion, consider a 4-PSK system where the transmitted
codeword is c = 220313, and a possible erroneous codeword, that the
receiver may decide in favour of, is e = 330122. In this example, n = 2
and L = 3. The 2 x 3 difference matrix is
121
101
)(1)()1(
111)1(),(
−−−−−
=−−−−−−−−
−−−−−−=
jjj
jj
jjjj
jjB ec .
The rank of B(c,e) is 2, and that of A(c,e), and hence the rank of this
codeword, is also 2. For a diversity system of n = 2 transmit antennas and
m = 1 receive antenna, the diversity gain is then 2.
Determinant Criterion:
Maximize the coding gain specified by ( rλλλλλ ...4321 )1/r, where
rλλλλλ ...4321 is the absolute value of the sum of determinants of all the
14
principal (r x r) cofactors of A. If full rank r = n is achievable, it is
equivalent to maximizing the determinant of A(c,e) taken over all possible
codeword pairs c and e [6]. Using the same data from the rank criterion
example, the eigenvalues of matrix A are
1λ = -2.2679 - 3j,
2λ = -5.7321 - 3j.
With r = 2, the coding gain for this particular codeword is then 4.9327.
2.2 Code Construction
STTCs can be represented and analyzed in their trellis form or by their
generator matrix, G. For example, consider the 4PSK signal constellation shown
in Figure 1, where the signal points are labeled as 0, 1, 2, and 3.
3
2
1
0
Figure 2. 4PSK Signal Constellation
The 4-State trellis structure is shown in Figure 2 for a rate of 2 b/s/Hz.
15
1
0
2
3
0
23
100,01,02,03
10,11,12,13
30,31,32,33
20,21,22,23
Figure 3. 4-State, 4PSK Trellis Diagram
The input signal can take on any value from the signal constellation (in this case
0, 1, 2, or 3); they are shown on the trellis diagram on the transition branches. In
general, for each state, the first transition branch to state 0 results from input 0,
the second transition branch to state 1 results from input 1, and so on. The
output depends on the input and on the current state. The states are labeled on
the right. The labels on the left of the trellis represent the possible outputs from
that state. The leftmost output is assumed to be the output for the first trellis
branch for that particular state, and the second leftmost label is assumed to be
the output for the second trellis branch for the same state, and so on. These
assumptions were verified to be correct and can be manually traced through the
encoder structure.
It was proved in [1] that the above code provides a diversity gain of 2
(assuming one receive antenna), and has a minimum determinant of 2 [7].
16
The encoder structure for the 4PSK scheme with two transmit antennas
and one receive antenna is shown in Figure 3.
∑),( 21
tt xx
),( 20
10 aa
),( 21
11 aa
),( 21
11 bb
),( 20
10 bb
1tI
2tI
Figure 4. 4-State, 4PSK Encoder Structure
At time t, two binary inputs 1tI and 2
tI are fed into the branches of the
encoder with 1tI being the MSB. The memory order of the upper and lower
branches are v1 and v2, respectively, where v = v1 + v2, and hence the number of
states is 2v. vi is calculated as
2,1,2
1 =
−+= i
ivv i
where x denotes the largest integer smaller than or equal to x. For each
branch, the output is the sum of the current input scaled by a coefficient and the
previous input scaled by another coefficient. Each of the different coefficients in
the coefficient pairs, ),( 21pp aa and ),( 21
qq bb , applied to 1tI and 2
tI , respectively,
17
where 12 ,...,1,0;,...,1,0;2,1};3,2,1,0{, vpvqiba iq
ip ===∈ , are for each of the two
different transmit antennas. The final output of the encoder is then calculated as
2,1,4mod1 2
0 0
21 =
⋅+⋅= ∑ ∑
= =−− kbIaIx k
q
v
p
v
qqt
kppt
kt .
1tx and 2
tx are transmitted simultaneously on the first and second antenna,
respectively.
The corresponding trellis diagrams for the 8-State and 16-State 4PSK
codes are shown in Figures 4 and 5, for a rate of 2 b/s/Hz.
00,01,02,03
10,11,12,13
20,21,22,23
30,31,32,33
22,23,20,21
02,03,00,01
12,13,10,11
32,33,30,31
0
6
5
4
3
2
1
7
Figure 5. 8-State, 4PSK Trellis Diagram
18
20,21,22,23
12,13,10,11
00,01,02,03
10,11,12,13
02,03,00,01
30,31,32,33
22,23,20,21
30,31,32,33
22,23,20,21
10,11,12,13
02,03,00,01
12,13,10,11
00,01,02,03
32,33,30,31
20,21,22,23
32,33,30,31
0
15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
Figure 6. 16-State, 4PSK Trellis Diagram
The 8PSK, 8-State signal constellation and trellis diagram are shown in
Figures 6 and 7, for a rate of 3 b/s/Hz.
6
32
1
0
5 7
4
Figure 7. 8PSK Signal Constellation
19
00,01,02,03,04,05,06,07
40,41,42,43,44,45,46,47
10,11,12,13,14,15,16,17
60,61,62,63,64,65,66,67
30,31,32,33,34,35,36,37
70,71,72,73,74,75,76,77
20,21,22,23,24,25,26,27
50,51,52,53,54,55,56,57
0
7
6
5
4
3
2
1
Figure 8. 8-State, 8PSK Trellis Diagram
The 8-State, 8PSK encoder shown in Figure 8 is easily derived from the
encoder of Figure 3 by adding another pair of branches for a third input bit, 3tI .
20
∑),( 21
tt xx
),( 20
10 aa
),( 21
11 aa
),( 21
11 bb
),( 20
10 bb
1tI
2tI
),( 21
11 cc
),( 20
10 cc
3tI
Figure 9. 8-State, 8PSK Encoder Structure
This additional input stream, 3tI , is introduced with a branch of memory order v3.
The total memory order is v = v1 + v2 + v3, where
3,2,1,3
1 =
−+= i
ivv i .
The coefficient pairs are ),,(),,( 2121qqpp bbaa and ),( 21
ss cc for each input It,
respectively. The encoder output is
2,1,4mod1 2 3
0 0
321 =
⋅+⋅+⋅= ∑ ∑ ∑
= = =−−− kcIbIaIx
v
p
v
oq
v
s
ksst
kqqt
kppt
kt .
2.3 Trellis Codes
The trellis codes used in the simulations are shown in Table 1 and Table
2. The details of these codes can be found in [1], [6], and [8].
21
v ),( 20
10 aa ),( 2
111 aa ),( 2
212 aa ),( 2
010 bb ),( 2
111 bb ),( 2
212 bb
2 (0,2) (2,0) - (0,1) (1,0) -
3 (0,2) (2,0) - (0,1) (1,0) (2,2)
4 (0,2) (2,0) (0,2) (0,1) (1,2) (2,0)
Table 1. Coefficient Pairs for 4PSK, 4-, 8-, and 16-State, STTCM Codes
v ),( 20
10 aa ),( 2
111 aa ),( 2
010 bb ),( 2
111 bb ),( 2
010 cc ),( 2
111 cc
3 (0,4) (4,0) (0,2) (2,0) (0,1) (5,0)
Table 2. Coefficient Pairs for 8PSK, 8-State, STTCM Code
The generator matrix, for example, for the 4PSK case is
01
02
10
20
=G
where the elements are taken from the MPSK constellation. Each G matrix has
the dimensions of (i+s) x n, where i = log2M represents the number of information
bits transmitted, s represents the number of shift registers in the encoder, and n
represents the number of transmit antennas. The elements of this matrix define
the coefficient pairs described earlier in the encoder structure. The matrix for any
number of states (4, 8, 16, 32), for a two-transmit antenna space-time code is
22
21
21
22
12
22
12
21
11
21
11
20
10
20
10
22
11
vv
vv
bb
aa
bb
aa
bb
aa
bb
aa
G
MM
=
The codes presented here provide the best tradeoff between data rate,
diversity advantage, and trellis complexity [1].
23
Chapter 3.0 Simulation System Model
Consider a mobile communications system that implements antenna
diversity both at the BS and at the MS. The BS is equipped with n antennas and
the MS is equipped with m antennas. Data is encoded by the channel encoder.
The encoded data then goes through a serial-to-parallel converter and is divided
in n streams of data which are input into a pulse shaper. Modulation is then
applied to the output of the pulse shaper. At each time slot, t, the modulated
output, i, is a signal itc that is transmitted by transmit antenna i for 1≤ i ≤ n.
Each of the n signals has a transmission period of T, and is transmitted
simultaneously from a transmit antenna. Through the air medium, the
transmitted signals undergo Rayleigh fading. The signal at each of the m receive
antennas is a noisy superposition of the n transmitted signals, each of which has
undergone fading.
At the receiver, the demodulator computes a decision statistic based on
the received signals arriving at each antenna 1≤ j ≤ m. The signal received by
antenna j at time t is given by
jt
n
is
itij
tj Echr η+⋅⋅= ∑
=1
where the noise jtη at time t is modeled as independent samples of a zero-mean,
complex Gaussian random variable with variance 2
0N per dimension [1]. ijh is
the channel coefficient from transmit antenna i to receive antenna j, and is used
24
to characterize the random phase shift and gain of the channel. The channel
coefficients are modeled as samples of independent, complex Gaussian random
variables with variance 0.5 per dimension. The wireless channel is assumed to
be quasi-static (i.e. constant over a long period of time, and then changing in an
independent manner) so that the path gains are constant over a frame of length
L, which consists of 130 symbols each, and vary from one frame to another [9].
3.1 Channel Estimation
The parameters which constitute Rayleigh fading are characterized by the
hij coefficient. In these simulations, it is assumed that the decoder is aware of
this CSI and has perfect knowledge of it. In practice, this is rarely the case, as it
is difficult for the receiver to have foreknowledge of this parameter or to perfectly
estimate it.
An analysis with channel estimation errors was carried out in [2]. The
analysis shows that space-time coding remains effective even in the presence of
channel estimation errors, though as the number of transmit antennas increases,
the sensitivity of the system to channel estimation errors increases. However,
this is not a major problem if the number of transmit antennas is small, and this is
usually the case [2]. In addition, the diversity order is preserved when imperfect
estimates for the CSI are available to the receiver.
25
3.2 Generator Matrix to Trellis Converter
For these simulations a Matlab script written by Yibin Liang, adopted from
[10], was used to convert the generator matrix G into their trellis representations.
This script can be found in Appendix A. The descriptions for the generator matrix
and trellis, as described in sections 2.2 and 2.3 respectively, are different from
those for convolutional codes, and hence the method in which the generator
matrix is mapped into the trellis description is unlike the mapping for
convolutional codes.
3.3 STTC Encoder
The space-time encoder maps the raw information bits into space-time
symbols based on the trellis diagram, as described in section 2.2. The encoder
takes L = 130 symbols (one frame) from the MPSK signal constellation and
encodes them into an (L x n) matrix of complex symbols where n is the number
of transmit antennas. This mapping procedure is accomplished through the
encoder structure described in section 2.2.
At the beginning and end of each frame, the encoder is required to be in
state 0. The encoding algorithm then loops through each pair of input symbols
and determines the output for each antenna based on those current inputs and
the current state. Then the next state is determined based on the current input.
Details of the encoder source code can be found in Appendix B.
26
3.4 STTC Decoder
The decoding procedure is based on the well-known Viterbi algorithm.
However, for space-time codes the Viterbi decoder is modified from the
conventional convolutional decoder so that the branch metric is computed from
the complex inputs and the CSI. The Viterbi decoder is then used to calculate
the path through the trellis diagram with the lowest accumulated metric.
Assuming that jtr is the received signal at receiver antenna j at time t, the
branch metric is determined by
∑ ∑= =
⋅−=m
j
n
i
itij
jt xhrMetricBranch
1
2
1
where itx is the transmitted signal as shown in Figures 3 and 8.
In these simulations, at every time unit of the trellis, a survivor is
determined for each state from the minimum partial metric. The state from which
the minimum partial metric originated is saved into a state predecessor (or state
history) table. Once the end of the trellis is reached, the decoder can begin to
determine the sequence of bits that were input into the space-time encoder.
First, beginning at the end of the trellis, select the state with the smallest total
metric and save that state into a state sequence table (if we assume that the
trellis begins and ends in state 0, then this initial chosen state would be state 0).
The decoder iteratively performs the following traceback procedure until the
beginning of the trellis is reached: using the state predecessor table, for the
27
selected state, determine a new state which is the predecessor to that state.
Save the state number of that selected state onto the state sequence table.
Once the trellis is exhausted, the completed state sequence table will show the
state transitions taken by the final survivor. The decoder can now work forward
through the state sequence table to determine what input bits led to the transition
from one state to the next.
Details of the decoder source code can be found in Appendix C. More
references to the Viterbi algorithm can be found in [4] and [11].
3.5 Simulation Results
The performance of Tarokh’s 4PSK, 4-, 8-, and 16-State codes, for a
transmission rate of 2 bits/s/Hz, and the 8PSK, 8-State code, for a transmission
rate of 3 bits/s/Hz, over a flat Rayleigh fading channel using two transmit and one
receive antenna is shown in Figures 9 and 10, respectively.
In the simulations, each frame consists of 130 symbols transmitted out of
each transmit antenna. The curves are plotted against the signal to noise ratio
(SNR), the symbol energy to noise ratio per receive antenna, which in these
simulations is SNR = 2Es/N0.
28
Figure 10. Performance Of 4PSK Codes With Two Transmit And One Receive Antenna
It can be seen that as the number of states increases, the performance
improves. In general, the coding advantage of the above codes can be improved
by constructing encoders with more states [1]. The 8PSK, 8-State code appears
to have poorer performance than the 4PSK, 4-State code but this is because the
former has a slightly improved bandwidth efficiency of 3 bits/s/Hz. All of the
codes have full rank by the design rules and achieve the maximum possible
diversity gain. However, the coding gain can be improved [1] [8]. This is not
surprising as the determinant criterion is only approximate.
29
Figure 11. Performance Of 8PSK Code With Two Transmit And One Receive Antenna
The results of these simulations are identical with those produced by
Tarokh and found in [1].
These simulations were executed with a maximum of 1000 frame errors
for each of the ten trials, with a total of 10000 frames per trial. Departmental Sun
workstations were used to carry out the simulations. The duration of the
simulations depended on the size of the signal constellation and the number of
states of the encoder. As an example, for 4PSK modulation with a 4-state
encoder, the simulation run time was approximately 10 hours. In contrast, with a
16-state encoder, the simulation run time was approximately 55.5 hours. For
31
Chapter 4.0 Conclusion and Future Considerations
Diversity methods are aimed at improving most operating aspects of
wireless communications, including cost, power, and size. Space-Time trellis
codes are able to achieve significant improvement by combining coding,
modulation, spatial, and temporal diversity techniques.
This report studies a method for implementing an encoder and a decoder
for Space-Time Trellis Codes derived by Tarokh et al. The performance curves
were derived for 4PSK, 4-, 8-, and 16-State codes, and for the 8PSK, 8-State
code. The signal was assumed to undergo flat Rayleigh fading through a quasi-
static wireless channel, with perfect channel state information available at the
receiver. The results show that for 4PSK modulation, there is improvement as
the number of states increases. Only a limited analysis of the results could be
performed as there was an insufficient number of test cases due to the length of
time required to write a script for each test case, and the time required to debug
it.
Possible future work and research can be carried out for the cases of
multiple receive antennas, higher order modulation, different types of fading, and
imperfect channel estimation. The Matlab script that was used for Viterbi
decoding could be optimized so that simulation times could be significantly
reduced.
32
List of Abbreviations
BS ...................................................................................................................Base Station
CSI............................................................................................Channel State Information
FER.........................................................................................................Frame Error Rate
MPSK........................................................................................M-ary Phase Shift Keying
MS.................................................................................................................Mobile Station
MSB.....................................................................................................Most Significant Bit
SNR ..................................................................................................Signal to Noise Ratio
STTC ......................................................................................Space-Time Trellis Coding
STTCM................................................................Space-Time Trellis Coded Modulation
33
List of References [1] V. Tarokh, N. Seshadri, and A.R. Calderbank, “Space-Time Codes for High Data
Rate Wireless Communications: Performance Criterion and Code Construction”, IEEE Transactions on Information Theory, vol. 44, no. 2, pp. 744-765, March 1998.
[2] V. Tarokh, A. Naguib, N. Seshadri, and A. R. Calderbank, “Space-Time Codes for
High Data Rate Wireless Communication: Performance Criteria in the Presence of Channel Estimation Errors, Mobility, and Multiple Paths”, IEEE Transactions on Communications, vol. 47, no. 2, pp. 199-207, February 1999.
[3] B. Sklar, “Rayleigh fading channels in mobile digital communication systemrs. ii.
Mitigation”, IEEE Communications Magazine, 35(7):, pp. 102-109, September 1997.
[4] T.S. Rappaport, Wireless Communications: Principles and Practices, Upper
Saddle River, N.J.: Prentice Hall PTR, 1996. [5] J.G. Proakis, Digital Communications, 2nd edition, New York: McGraw-Hill, 1989. [6] Z. Chen, J. Yuan, and B. Vucetic, “An Improved Space-Time Trellis Coded
Modulation Scheme on Slow Rayleigh Fading Channels”, IEEE International Conference on Communications, 2001. ICC 2001. Vol. 4, pp. 1110-1116, Helsinki, Finland, 11-14 June 2001.
[7] V. Tarokh, N. Seshadri, and A. R. Calderbank, “Space-Time Codes for Wireless
Communication: Code Construction”, IEEE 47th Vehicular Technology Conference, vol. 2, pp. 637-641, Phoenix, Arizona, 4-7 May 1997.
[8] S. Bäro, G. Bauch, and A. Hansmann, “Improved Codes for Space-Time Trellis-
Coded Modulation”, IEEE Communications Letters, vol. 4, no. 1, pp. 20-22, January 2000.
[9] V. Tarokh, H. Jafarkhani, and A.R. Calderbank, “Space-Time Block Codes from
Orthogonal Designs”, IEEE Transactions on Information Theory, vol. 45, no. 5, pp. 1456-1467, July 1999.
[10] Y. Liang, Simulation of Space-Time Trellis Codes, technical report. Department of
Electrical and Computer Engineering, Virginia Tech, April 2002. [11] S. Haykin, Communications Systems, 3rd edition, New York: John Wiley & Sons,
1994.
34
Appendix A. Generator Matrix to Trellis Converter function [trellis] = gm2trellis(GM, M) % GM2TRELLIS Convert generator matrix to trellis description % for encoding and decoding space-time trellis codes % % The GM format: % e.g. GM = transpose[a0 b0 c0 a1 b1 c1 c2; a0' b0' c0' a1' b1' c1' c2'] % a0 is the most significant bit (MSB) % Reference: % Z. Chen, J. Yuan, etc. "An improved space-time trellis coded modulation % scheme on slow rayleigh fading channels" % % Input paraeters: % GM - generator matrix % M - M-PSK constellation % % Return: % trellis - trellis description of the space-time trellis codes % % (C) Yibin Liang <[email protected]> Last updated: July 18, 2002 % check inputs and get parameters k = log2(M); % input/output bits per symbol if (nargin ~= 2) error('Usage: [trellis] = GM2TRELLIS(GM, M)'); end if (ndims(GM) ~= 2) error('Input generator matrix must be 2D matrix'); end if (M <= 1 | k >= size(GM, 1) ) error('Invalid M value'); end if (k <= 0 | M < max(GM) ) error('Invalid M value'); end % number of states, equal to number of rows in GM minus number of input bits s = size(GM, 1) - k; num_states = 2^s; % number of outputs (transmit antennas), equal to number of columns in GM Nt = size(GM, 2); % outputs and nextState outputs = zeros(num_states, 2^k); nextStates = zeros(num_states, 2^k); % generate outputs and nextState matrix for i=(0:num_states-1) %state_bits = fliplr(getbits(i, s)); state_bits = (getbits(i, s)); for j=(0:2^k-1) % compute output %input_bits = fliplr(getbits(j, k)); input_bits = (getbits(j, k)); bits = [input_bits, state_bits]; for t=(0:Nt-1) outputs(i+1, j+2^k*t+1) = mod(bits*GM(:,t+1),M); end % get next state next_state_bits = rightshift(state_bits, k); rem=mod(s,k); nshift = k-rem; if (rem~=0) for idx=(0:rem-1) next_state_bits(s-idx) = state_bits(s-idx-nshift); end end
35
next_state_bits(1:k) = input_bits; % save next state %next_state = bit2num(fliplr(next_state_bits)); next_state = bit2num((next_state_bits)); nextStates(i+1, j+1) = next_state; end end % the trellis structure trellis.numInputSymbols = 2^k; trellis.numOutputSymbols = 2^k; trellis.numStates = num_states; trellis.numOutputs = Nt; trellis.outputs = outputs; trellis.nextStates = nextStates; % display results %if (nargout ~= 1) if(0) display(outputs) display(nextStates) end %end % ------------------------ % helper functions % ------------------------ function [bits] = getbits(x, n) % get the binary bits for decimal integer inputs % e.g. (12) => [1,1,0,0] bits = zeros(1, n); ind = 1; while (x~=0) bits(ind) = mod(x,2); x = floor(x/2); ind = ind + 1; end bits = fliplr(bits); function [y] = bit2num(x) % convert bit streams to interger % e.g. [1 1 0 0] => (12) y = 0; mul = 1; for i=(length(x):-1:1) y = y + mul*x(i); mul = mul*2; end function [y] = rightshift(x, k) % shift bit streams right k times (arithmatic shift) y = zeros(size(x)); for i=(1:length(x)-k) y(i+k) = x(i); end
36
Appendix B. Space-Time Encoder Source Code /*---------------------------------------------------------------------------- Space-Time Trellis Codes (STTC) Encoder MATLAB C-Mex Function Calling format: [code, finalState] = stcenc( in, // input message symbols (column vector) k, // trellis: number of input bits n, // trellis: number of output bits numOutputs, // trellis: number of outputs numStates, // trellis: number of states outputs, // trellis: outputs (numStates by 2^k*numOutputs) nextStates, // trellis: next states (numStates by 2^k) initState) // trellis: initial state by Yibin Liang <[email protected]>, Last updated: July 18, 2002 ----------------------------------------------------------------------------*/ #include "mex.h" #include "math.h" #define PI 3.14159265358979 static const char MEM_ALLOCATION_ERROR[] = "Memory allocation error."; enum {IN_ARGC = 0, /* input message symbols */ TRELLIS_K_ARGC, /* number of input bits */ TRELLIS_N_ARGC, /* number of output bits */ TRELLIS_NUM_OUTPUTS_ARGC, /* number of outputs */ TRELLIS_NUM_STATES_ARGC, /* number of states */ TRELLIS_OUTPUT_ARGC, /* output matrix (decimal) */ TRELLIS_NEXT_STATE_ARGC, /* next state matrix */ INITSTATE_ARGC, /* initial state */ NUM_ARGS}; #define IN_ARG (prhs[IN_ARGC]) #define TRELLIS_K_ARG (prhs[TRELLIS_K_ARGC]) #define TRELLIS_N_ARG (prhs[TRELLIS_N_ARGC]) #define TRELLIS_NUM_OUTPUTS_ARG (prhs[TRELLIS_NUM_OUTPUTS_ARGC]) #define TRELLIS_NUM_STATES_ARG (prhs[TRELLIS_NUM_STATES_ARGC]) #define TRELLIS_OUTPUT_ARG (prhs[TRELLIS_OUTPUT_ARGC]) #define TRELLIS_NEXT_STATE_ARG (prhs[TRELLIS_NEXT_STATE_ARGC]) #define INITSTATE_ARG (prhs[INITSTATE_ARGC]) #define CODE_ARG (plhs[0]) #define STATE_ARG (plhs[1]) static void SttcEncode(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { /* Get input & outputs */ int_T blockSize = (int_T)mxGetM(IN_ARG); int_T k = (int_T)mxGetScalar(TRELLIS_K_ARG); int_T n = (int_T)mxGetScalar(TRELLIS_N_ARG); int_T numOutputs = (int_T)mxGetScalar(TRELLIS_NUM_OUTPUTS_ARG); int_T numStates = (int_T)mxGetScalar(TRELLIS_NUM_STATES_ARG); real_T *outputs = mxGetPr(TRELLIS_OUTPUT_ARG); real_T *nextState = mxGetPr(TRELLIS_NEXT_STATE_ARG); real_T initState = (real_T)mxGetScalar(INITSTATE_ARG); real_T *in = mxGetPr(IN_ARG); real_T *rout = mxGetPr(CODE_ARG = mxCreateDoubleMatrix(blockSize, numOutputs, mxCOMPLEX)); real_T *iout = mxGetPi(CODE_ARG); real_T *currState = mxGetPr(STATE_ARG = mxCreateDoubleMatrix(1,1,mxREAL)); int_T M = 1<<n; int_T indx1;
37
const char *msg = NULL; /* Verify memory allocation */ if(rout == NULL){ msg = MEM_ALLOCATION_ERROR; goto EXIT_POINT; } if(iout == NULL){ msg = MEM_ALLOCATION_ERROR; goto EXIT_POINT; } if(currState == NULL){ msg = MEM_ALLOCATION_ERROR; goto EXIT_POINT; } /* setup initial state */ currState[0] = initState; /* Loop through all input symbols */ for(indx1 = 0; indx1 < blockSize; indx1++){ int_T indx2; /* Loop through all outputs */ for(indx2 = 0; indx2 < numOutputs; indx2++){ /* Calculate offsets */ int_T bOffset = blockSize * indx2; int_T cOffset = numStates * ( (int_T)in[indx1] + indx2*(1<<k) ); /* Get output */ real_T code = outputs[((int_T)currState[0])+cOffset]; /* Map to inphase and quadrature components using M-ary PSK constellation*/ /* the average energy for the constellations points is sqrt(Es) = 1 */ rout[indx1+bOffset] = cos(2.0*PI*code/M); iout[indx1+bOffset] = sin(2.0*PI*code/M); } /* Get next state */ currState[0] = nextState[(int_T)currState[0]+(((int_T)in[indx1])*numStates)]; } EXIT_POINT: if(msg != NULL){ mexErrMsgTxt(msg); } } static void CheckParameters(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { int_T k = (int_T)mxGetScalar(TRELLIS_K_ARG); int_T n = (int_T)mxGetScalar(TRELLIS_N_ARG); int_T numOutputs = (int_T)mxGetScalar(TRELLIS_NUM_OUTPUTS_ARG); int_T numStates = (int_T)mxGetScalar(TRELLIS_NUM_STATES_ARG); int_T nrow, ncol; const char *msg = NULL; /* Check number of parameters */ if(nrhs != 8){ msg = "Invalid number of input arguments."; goto EXIT_POINT; } if(nlhs > 2){ msg = "Invalid number of output arguments."; goto EXIT_POINT; } /* Check input demension */ nrow = (int_T) mxGetN(IN_ARG);
38
if(nrow != 1){ msg = "Input message must be a column vector."; goto EXIT_POINT; } /* Check trellis outputs */ ncol = (int_T) mxGetM(TRELLIS_OUTPUT_ARG); nrow = (int_T) mxGetN(TRELLIS_OUTPUT_ARG); if( ncol != numStates || nrow != numOutputs*(1<<k) ){ msg = "Incorrect size of trellis outputs table."; goto EXIT_POINT; } /* Check trellis nextStates */ ncol = (int_T) mxGetM(TRELLIS_NEXT_STATE_ARG); nrow = (int_T) mxGetN(TRELLIS_NEXT_STATE_ARG); if(ncol != numStates || nrow != 1<<k ){ msg = "Incorrect size of trellis nextStates table."; goto EXIT_POINT; } EXIT_POINT: if(msg != NULL){ mexErrMsgTxt(msg); } }/* CheckParameters */ void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { CheckParameters(nlhs, plhs, nrhs, prhs); SttcEncode (nlhs, plhs, nrhs, prhs); }
39
Appendix C. Space-Time Decoder Source Code For 4PSK, 4-State Case function [fer, ser] = qpsk4state21(Nt, Nr, trellis, maxFrameErr) % 2Tx 1Rx diversity scheme without channel estimation errors, 4PSK, 4state % Filename: qpsk4state21.m % Last edited: December 27, 2002 % By Nicky Yuen . . . % MLSE Decoding with the Viterbi algorithm % Initialize the partial metric for each state to 0. for (j=1:numStates) partMet(j) = 0; end %State (predecessor) history table. The entries for each array is a state (ie. 0 to M-1). stateHist = zeros(numStates,size(msg,1)); %stateHist(A,i)=B reads "The state at time i is A, and it comes from state B". %State sequence table stateSeq = ones(1,size(msg,1)+1); %1x(frameLength+1) %stateSeq(frameLength+1) = 0; % Loop through each input symbol and determine the survivor for each state for (i=1:size(msg,1)) if (i==1) %at the beginning for (state=1:numStates) surv(state,2*i-1)=0; surv(state,2*i)=state; tmp_surv(state,2*i-1)=0; tmp_surv(state,2*i)=state; %calculate branch metrics brMet(i,state) = (abs(chanOut(i) - h(1)*in(i) - h(2)*in(state))).^2; %update partial metrics partMet(state) = brMet(i,state); %update state history table stateHist(state,i) = 1; end elseif (i==frameLength) %at the end %calculate branch metrics for (state=1:numStates) brMet(state,1) = (abs(chanOut(i) - h(1)*in(state) - h(2)*in(1))).^2; %update the partial metrics partMet(1,state) = partMet(state) + brMet(state,1); %update survivors partMetArray(state) = [partMet(1,state)]; end [minVal, minIndex] = min(partMetArray); if (minIndex == 1) %00 branch is survivor surv(1) = [tmp_surv(1)]; surv(1,2*i-1)=0; surv(1,2*i)=0; stateHist(1,i) = 1; elseif (minIndex == 2) %10 branch is survivor surv(1) = [tmp_surv(2)]; surv(1,2*i-1)=1; surv(1,2*i)=0; stateHist(1,i) = 2; elseif (minIndex == 3) %20 branch is survivor surv(1) = [tmp_surv(3)]; surv(1,2*i-1)=2; surv(1,2*i)=0; stateHist(1,i) = 3; else %30 branch is survivor
40
surv(1) = [tmp_surv(4)]; surv(1,2*i-1)=3; surv(1,2*i)=0; stateHist(1,i) = 4; end else %i = [2:frameLength-1] %% STATE 0 %% %Calculate branch metrics going into state 0 for (state=1:numStates) brMet(state,1) = (abs(chanOut(i) - h(1)*in(state) - h(2)*in(1))).^2; %Calculate partial metrics going into state 0 tmpPartMet(1,state) = partMet(state) + brMet(state,1); end %update survivors [minVal(1), minIndex(1)] = min([tmpPartMet(1,1) tmpPartMet(1,2) tmpPartMet(1,3) tmpPartMet(1,4)]); if (minIndex(1) == 1) %00 branch is survivor surv(1) = [tmp_surv(1)]; surv(1,2*i-1)=0; surv(1,2*i)=0; elseif (minIndex(1) == 2) %10 branch is survivor surv(1) = [tmp_surv(2)]; surv(1,2*i-1)=1; surv(1,2*i)=0; elseif (minIndex(1) == 3) %20 branch is survivor surv(1) = [tmp_surv(3)]; surv(1,2*i-1)=2; surv(1,2*i)=0; else %30 branch is survivor surv(1) = [tmp_surv(4)]; surv(1,2*i-1)=3; surv(1,2*i)=0; end %update state history table for state 0 stateHist(1,i) = minIndex(1); %% STATE 1 %% %Calculate branch metrics going into state 1 for (state=1:numStates) brMet(state,2) = (abs(chanOut(i) - h(1)*in(state) - h(2)*in(2))).^2; %calculate partial metrics going into state 1 tmpPartMet(2,state) = partMet(state) + brMet(state,2); end %update survivors [minVal(2), minIndex(2)] = min([tmpPartMet(2,1) tmpPartMet(2,2) tmpPartMet(2,3) tmpPartMet(2,4)]); if (minIndex(2) == 1) %01 branch is survivor surv(2) = [tmp_surv(1)]; surv(2,2*i-1)=0; surv(2,2*i)=1; elseif (minIndex(2) == 2) %11 branch is survivor surv(2) = [tmp_surv(2)]; surv(2,2*i-1)=1; surv(2,2*i)=1; elseif (minIndex(2) == 3) %21 branch is survivor surv(2) = [tmp_surv(3)]; surv(2,2*i-1)=2; surv(2,2*i)=1; else %31 branch is survivor surv(2) = [tmp_surv(4)]; surv(2,2*i-1)=3; surv(2,2*i)=1; end %update state history table for state 1 stateHist(2,i) = minIndex(2); %% STATE 2 %% %Calculate branch metrics going into state 2 for (state=1:numStates) brMet(state,3) = (abs(chanOut(i) - h(1)*in(state) - h(2)*in(3))).^2; %Calculate partial metrics going into state 2 tmpPartMet(3,state) = partMet(state) + brMet(state,3); end %update survivors [minVal(3), minIndex(3)] = min([tmpPartMet(3,1) tmpPartMet(3,2) tmpPartMet(3,3) tmpPartMet(3,4)]); if (minIndex(3) == 1) %02 branch is survivor surv(3) = [tmp_surv(1)]; surv(3,2*i-1)=0; surv(3,2*i)=2;
41
elseif (minIndex(3) == 2) %12 branch is survivor surv(3) = [tmp_surv(2)]; surv(3,2*i-1)=1; surv(3,2*i)=2; elseif (minIndex(3) == 3) %22 branch is survivor surv(3) = [tmp_surv(3)]; surv(3,2*i-1)=2; surv(3,2*i)=2; else %32 branch is survivor surv(4) = [tmp_surv(4)]; surv(3,2*i-1)=3; surv(3,2*i)=2; end %update state history table for state 3 stateHist(3,i) = minIndex(3); %% STATE 3 %% %Calculate branch metrics going into state 3 for (state=1:numStates) brMet(state,4) = (abs(chanOut(i) - h(1)*in(state) - h(2)*in(4))).^2; %Calculate partial metrics going into state 3 tmpPartMet(4,state) = partMet(state) + brMet(state,4); end %update survivors [minVal(4), minIndex(4)] = min([tmpPartMet(4,1) tmpPartMet(4,2) tmpPartMet(4,3) tmpPartMet(4,4)]); if (minIndex(4) == 1) %03 branch is survivor surv(4) = [tmp_surv(1)]; surv(4,2*i-1)=0; surv(4,2*i)=3; elseif (minIndex(4) == 2) %13 branch is survivor surv(4) = [tmp_surv(2)]; surv(4,2*i-1)=1; surv(4,2*i)=3; elseif (minIndex(4) == 3) %23 branch is survivor surv(4) = [tmp_surv(3)]; surv(4,2*i-1)=2; surv(4,2*i)=3; else %33 branch is survivor surv(4) = [tmp_surv(4)]; surv(4,2*i-1)=3; surv(4,2*i)=3; end %update state history table for state 3 stateHist(4,i) = minIndex(4); for (state=1:numStates) %update the temporary survivors tmp_surv(state) = surv(state); %update the partial metrics partMet(state) = minVal(state); end end %end for % Starting from the end of the trellis, work backwards to determine the state transition % sequence for (i=size(msg,1):-1:2) stateSeq(i-1) = stateHist(stateSeq(i),i-1); end % States are from 0 to 3, not 1 to 4. stateSeq = stateSeq-1; % Traceback decoding. For each state, determine the input that led to that state based % on the current state and the previous state. for (i=1:frameLength) switch (stateSeq(i)) case 0 switch (stateSeq(i+1)) case 0 decoded(i)=0; case 1 decoded(i)=1; case 2 decoded(i)=2; otherwise decoded(i)=3;
42
end case 1 switch (stateSeq(i+1)) case 0 decoded(i)=0; case 1 decoded(i)=1; case 2 decoded(i)=2; otherwise decoded(i)=3; end case 2 switch (stateSeq(i+1)) case 0 decoded(i)=0; case 1 decoded(i)=1; case 2 decoded(i)=2; otherwise decoded(i)=3; end otherwise switch (stateSeq(i+1)) case 0 decoded(i)=0; case 1 decoded(i)=1; case 2 decoded(i)=2; otherwise decoded(i)=3; end end end end %end if(0/1) . . .