SpaceTimeCoding Report.
Abstract
Contemporarycommunications are based on characteristics and properties ofelectromagnetic waves. The use of wireless communication system isgaining more and more credibility and therefore, a lot of researchwork is being done to improve already existing activities in wirelesscommunications. In this report, we shall look at some work pioneeredby A. Alamouti in 1998 which is gaining significance in wirelesscommunication systems.
Transmissionof electromagnetic waves in wireless communication depends oncreation and use of codes. Such codes are time based and aretransmitted through given channels and in a given space of time. Spacetime codes are commonly used and have to be transmitted fromone or more transmit antennas to one or more receive antennas. Thecodes can be transmitted directly or as blocks which can be presentedand expressed in matrix form. Such a transmission matrix must beorthogonal.
Thecodes are formed from sequences designed by the use of bits. The bitsequence so transmitted can give errors in the path or at thereceiving end. The errors will certainly alter the bitsequence inthe data resulting in distorted or incorrect information at thereceiving end. It is necessary to look into such errors and otherfactors that may interfere with wireless communications such as noiseand other distortions.
Anoverview of such code transmission can be propagated through computersimulations that lead to graphical presentations using programs suchas mat lab. Encoding, transmitting and decoding theseelectromagnetic waves are inevitable. In this report, we look atsome code models and consider some errors and noise involved intransmission of the waves in wireless communications.
Inthe spacetime codes Wikipedia, the wiki expresses Spacetime codingas a method employed to improve the reliability of data transmissionsthrough a wireless communications system [ CITATION Spa14 l 1033 ]. The transmissions are emitted from one or a multiple number oftransmit antennas, and also target one or a multiple number ofreceiver antennas. It indicates that STC’s relies on transmitting multiple, redundantcopies of a stream of data in the hope that at least some of them maysurvive the physical path between transmission and reception in agood enough state to allow reliable decoding.
Thecodes can be categorized into two groups:

Space time trellis codes (STTC’s)

Space time block codes (STBC’s).
Otherapproaches that have been used to develop coding structures includespace time turbo coding and layered architectures.
Spacetime block codes are used in wireless communications to transmit amultiplicity of data copies across a number of antennas and toexploit the various received versions of the data to improvereliability of the data transfer[ CITATION Wik14 l 1033 ]. The fact that transmit signals must traverse a potentiallydifficult environment with scattering , reflection, defraction,refraction, absorbency and the like, may be further corrupted bythermal noise in the receiver. This results in some of the receiveddata copiesbeing better than others, and other aspects of challenge like fading.Branks in his document, concurs with information from the Wikipediastated above and mentions other challenges in wireless communicationsinclude:

A need for high data rates

Quality of service

Mobility

Portability

Connectivity in wireless networks

Interference from other users

Privacy and security. [ CITATION Bra14 l 1033 ]
Therefore,space time coding is an effective transmit diversity techniquedeveloped to combat fading and other challenges in the wirelesscommunication systems [ CITATION Bra14 l 1033 ].The exploitation of multipath effects will result in achievement ofhigh spectral efficiencies.
Inthis report, we shall look at some work pioneered by Alamouti inspace time block codes, and two other models using BPSK in mat lab.
Methodsand materials
Spectralefficiencies of traditional wireless systems range between 15bps/sec/Hz, but using space time techniques, spectral efficiencies of2040 bps/sec/Hz have been possible. Hence, space time coding willenable an increase in capacity by an order of magnitude [ CITATION Bra14 l 1033 ]. Itis also essential in implementation of 3G.
Oneof the distinguishing characteristics of wireless channels is thefact that there are many different paths between the transmitter andthe receiver as shown in the figure 1 below.
Figure1. Channels of transmission of electromagnetic waves
Reflection
LineOf Sight (LOS)
Receiver
Transmitter
Defraction/Refraction
Theexistence of various paths results in receiving different versions oftransmitted signals at the receivers is inevitable. These differentversions experience different path loss and phases. At the receiver,all received signals are accumulated together creating a nonAdditiveWhite Gaussian Noise (AWGN) model for the wireless channels. Adirect path between the transmitter and receiver is called the lineof sight (LOS). A line of sight does not exist when objects obstructthe line between the transmitter and the receiver. If the LOSexists, the corresponding signal received through the LOS is usuallythe strongest and the dominant signal. The LOS is a function ofdistance and not other factors. Other than the line of sight,electromagnetic waves can follow other paths from the transmitter tothe receiver [ CITATION Jaf05 l 1033 ].
Anelectromagnetic wave may reflect when it hits an object which islarger than its wavelength diffract when it hits a surface withirregularities in shape scatter in the case where the path has alarge number of objects smaller than the wavelength between thetransmitter and the receiver. The scattering results in many copiesof the wavelength being propagated in different directions beabsorbed or refracted.
Simulationsare done in Mat lab to provide the necessary data for modulations. The Alamouti data modulator is used to modulations for encoding. Adecoder is then used to transfer the required information to areceiver antenna. Modulations are done through the process of binaryphase shift keying which is the simplest form of phase shift keying. A Demodulator is used in decoding the bit sequences received from thetransmitter antennas. In the BPSK wiki [ CITATION Wik141 l 1033 ],the following formulae were extracted that are used in modulations:
BPSKformula is
S_{n}(t)= √ [2E_{b}/T_{b}]x cos(2πf_{c}t+ π(1n)), n=0,1
Formulafor BER which also gives the bit error probability is given as:
P_{b}= Q √ [2E_{b}/N_{o}]
OrP_{b}=½ erfc (√ [E_{b}/N_{o}]) [ CITATION Wik141 l 1033 ]
Asindicated in the Wikipedia for BER, the formula is derived from thefollowing:
x_{1}(t)= A + w(t) for a bit of “1” and x_{o}(t)= A + w(t) for a bit of “0”. Each of x_{1}(t)and x_{o}(t)has a period of T.
Noisehas a bilateral spectral density of N_{o}/2,therefore, x_{1}(t)= N(A,N_{o}/2T)and x_{o}(t)= N(A, N_{o}/2T).
BERas a likelihood of bit misinterpretation is = p_{e}= p(0/1)p_{1}+ p(1/0)p_{o.}
P(1/0)= 0.5 erfc [(A+λ)/(√N_{o}/T)and P(0/1) = 0.5 erfc [(Aλ)/(√N_{o}/T)where λ is the threshold of decision, set to 0 when p_{1}=p_{o}=0.5.
Usingthe average energy of the signal E=A^{2}T,the final expression for BER is
P_{b}=½ erfc (√ [E_{b}/N_{o}])[ CITATION Wik141 l 1033 ].
Derivationand calculations were performed in mat lab which was also used inperforming the necessary simulations [ CITATION Kha11 l 1033 ]. Channel model was worked out and modulated using BPSK 16QAM withgrey mapping constellation. The transmitted wave form gets corruptedby noise ή typically referred to as additive white Gaussian noise(AWGN). It is additive in the sense that the noise factor gets addedand not multiplied. White refers to the spectrum of the noise ifflat for all frequencies. Gaussian refers to the value of the noisethat follows Gaussian probability distribution function. Thisinformation is given by blogs from the DS site [ CITATION DS14 l 1033 ]. Mat lab simulations are used to compute Bit error rates or Bit errorratio (BER) and BPSK modulations. In this process, random BPSKmodule symbols are generated and then passed on to the AWGNdemonstration of the received symbols in the constellation is donethe number of errors is cut down the process is then repeated formultiple E_{b}/N_{o}values.
Modelingspace time block codes (STBC) using Alamouti code
AlamoutiSTBC uses both spatial and temporal diversity of multiple copies ofdata. This helps to compensate for the channel problems such asthermal noise and fading. The data is encoded in blocks prior totransmission. These data blocks are then distributed among multipleantennas spaced apart and data also spaced across time.
STBCis usually represented by a matrix. Each row represents a time slotand each column represents one antenna transmission over time [ CITATION Ass14 l 1033 ].
Transmitantenna
Timeslots s_{12} S_{11}
S_{21} s_{22}
Thedesign of the STBC’s is based on diversity criterion as expressedin the BPSK Wikipedia and designed by Tarokh et al in their paper onspacetime trellis codes. Orthogonal STBC’s can be shown toachieve the maximum diversity allowed by the criterion.
Encoding
Alamoutiinvented the simplest of all STBC’s designed for a two transmitantenna with the following coding matrix:
C_{1} c_{2}
c_{2}* c1*
Itis readily apparent that this rate is a rate1 code. It takes twotime slots to transmit two symbols.
Decoding
TheWikipedia gives the decoding method as follows:
Ata time t, r = ∑ αs + n where α is the path gain and n is theAWGN.
Theprocess followed by signals to the transmitters can be givendiagrammatically as shown below.
S_{1}S_{2}
….101101 …..S_{1}S_{2}
(source:Wikipedia) S_{1}S_{2}
MIMOAlamouti coding.
Thescheme for MultipleIn MultipleOut (MIMO) was developed by Alamouti. The associated codes are MIMO Alamouti’s codes or just Alamouticodes. The MIMO Alamouti’s scheme is an ingenious transmitdiversity scheme for two transmit antennas that do not requiretransmit knowledge developed in 1998. The output only depends on thecurrent input bits but not current and previous bits[ CITATION Ass14 l 1033 ]. Thisscheme also results in reduction in processing power to decode.
Thebinary bits enter a modulator and are converted to symbols. A symbolfrom modulator is represented by a complex number. This symbol canbe transmitted directly in a single antenna as in a single inputsingle output (SISO) system. In MIMO system, the complex symbols arefed into the alamouti’s encoder. The alamouti’s encoder maps thesymbols into the transmitter by using the matrix given below:
Y= x_{1} x*_{2} *is a complex conjugate
x_{2} x_{1} x_{1},x_{2}are input symbols
Inthis matrix, rows represent the transmit antennas and the columnsrepresent time. The element of the matrix represents what symbol isto be transmitted from a particular antenna. The Alamouti codesworks with pairs of symbols at a time. It takes two time periods totransmit the two symbols.
Modelingof a system using two Transmit Antennas and one Receive Antenna (2×1)using BPSK in Matlab.
Thesimplest STBC is the Alamouti STBC 2×1
figure2:Alamouti’s 2×1 STBC
Transmitter1 h_{1} Receiver
h_{2}
Transmitter2 Channels
h_{1}and h_{2}are impulse responses of the two channels whose envelopes followRayleigh distribution [ CITATION Spa141 l 1033 ]
Transmitter 1 
Transmitter 2 

Time t 
X_{1} 
X_{2} 
Time t+T 
X_{2}^{*} 
X^{*}_{1} 
Wherex_{1},x_{2}are modulated symbols.
Thesimulation codes below are extracted from channels models in mat lab[ CITATION Mat14 l 1033 ]
tau= [0 0.4 0.9]*1e6 % Path delays, in seconds
pdb= [0 15 20] % Average path gains, in dB
fd = 0.5% Maximum Doppler shift for all paths(identical)
ds = doppler.rounded% Doppler spectrum, with default parameters
Nt = 2 % Number of transmit antennas
Nr = 1 % Number of receive antennas
Rt = toeplitz([1 0.7]) % Transmit correlation matrix with correlationcoefficient 0.7
kf = 4 % Rician Kfactor on the first path
h= comm.MIMOChannel( …
`SampleRate`,Rs, …
`PathDelays`,tau, …
`AveragePathGains`,pdb, …
`MaximumDopplerShift`,fd, …
`DopplerSpectrum`, ds, …
`TransmitCorrelationMatrix`,Rt, …
`ReceiveCorrelationMatrix`, 1, …
`FadingDistribution`, `Rician`, …
`KFactor`,kf, …
`RandomStream`, `mt19937ar with seed`, …
`Seed`,912, …
`PathGainsOutputPort`,true)
Fora 1×1 system, Nt =1 and Nr = 1
Fora 2×2 system, Nt = 2 and Nr = 2.
Modelingof a system two transmit antenna and two receive antennas (2×2) usingBPSK in mat lab.
Thedata stream is encoded in a block represented by a 2×2 matrix priorto transmission. It uses the input bits and not the previous bits. The binary bits enter a data modulator under binary phase shiftkeying to give the Alamouti code for a two transmit antenna and tworeceive antenna system (2×2). Decoding is done byZero forcing (ZF)technique. The modulation used is 16 QAM. The best code for thissystem model is the golden code. Golden code is a code for twotransmit antennas and two receiver antennas (2×2), which achievesfull diversity and full rate and that is a rate equals to one asstated in the Wikipedia for space time codes [ CITATION Spa14 l 1033 ]. Sphere decoding is done using the decoder and this implies thatdecoding algorithms are used in the process. The diagram belowrepresents what Alamouti designed for a two receive antenna STBC.
Figure3: Alamouti’s STBC with two receive antennas
Transmitantenna 1 h_{11 }Receiveantenna 1
h_{21}
Transmitantenna 2 h_{12 }Receiveantenna 2
h_{22}
h_{12}is the channel from the 1^{st} receive antenna to the 2^{nd} transmit antenna. The binary digits are +√E_{b}and √E_{b}respectively. Simulations are done in mat lab using BPSK 16 QAM andas Khan describes it, a positive gradient on the BER curve gives adiversity gain and a negative gradient on the curve gives a codinggain [ CITATION Kha11 l 1033 ].
TheBER is given by P_{b}=½ erfc (√ [E_{b}/N_{o}])where E_{b}is the energy per bit and N_{o}is the noise power spectral density. P_{b}istherefore the probability of the bit error in the transmission whichis equivalent to the BER.
Thecode rate in this case is given by r = k/T where T are the time slotsand k are the number of symbols encoded in the block.
Hence,r = 2/2 = 1. Full diversity is achieved in this case. The BPSKmodulation is given by /M(1 1)/ + 1.
Sincethe codes are transmitted in blocks, the block error rate will beapproximately P_{b}N.
TheWikipedia also gives explanations that in a noisy channel, the BER isoften expressed as a function of the normalized carrier to noisemeasure. The BER curve is usually plotted to describe thefunctionality of a digital system of communication. In opticalcommunication, BER is plotted against Received Power but in wirelesscommunications, the BER is normally plotted against the signal noiserate (SNR). The curve below (figure 4) depicts this relation asplotted by Khan [ CITATION Kha11 l 1033 ].
Figure4: BER vs SNR performance curves.
Witha 2X2 MIMO transmission over frequency selective Rayleigh fadingchannel, the resulting matrix is given as:
Y_{1}(t, l) = h_{11}(t, l)h_{12}(t, l) s_{1}(t, l) + w_{1}(t, l)
Y_{2}(t,l) h_{21}(t, l)h_{22}(t, l) s_{2}(t, l) w_{2}(t, l)
Wherec(t, l) is the independent zero mean complex Gaussian processrepresenting the frequency selective Rayleigh coefficient, h_{ij}(t, l) is the channel response for each of the 2x 2 channel matrix, s_{n}(t, l) is the delayed signal and w_{n}(t, l) is the additive Gaussian noise [ CITATION Abo06 l 1033 ]. The received vectors are:
Y_{1}(t, l) = h_{11}(t, l) s_{1}(t, l) + h_{12}(t, l) s_{2}(t, l) + w_{1}(t, l)
Y_{2}(t,l) = h_{21}(t, l) s_{1}(t, l) + h_{22}(t, l) s_{2}(t, l) + w_{2}(t, l)
Measuringthe bit error ratio helps us to choose the appropriate forward errorcorrection codes. It is also important to note that the BER is thelikelihood of a bit being misinterpreted due to electrical noise. This likelihood is expressed in the probability formula given earlieron for BER. The BER curve below by Sankar is a typical example ofthe relationships explained above [ CITATION San09 l 1033 ].
Figure5: BER plot for 2 transmit 2 receive Alamouti’s STBC (source:DSPLOG)
TheSignal noise ratio is plotted against the signal output in normalcases and this give the curve shown below as extracted from thewikipedia.
Figure6. SNR curve
Beloware a sample codes that were used by Sankar [ CITATION San09 l 1033 ].
Script_BER_alamouti_STBC_code_BPSK_Rayleigh_channel.m 
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % All rights reserved by Krishna Pillai, http://www.dsplog.com % The file may not be redistributed without explicit authorization % from Krishna Pillai. % Checked for proper operation with Octave Version 3.0.0 % Author : Krishna Pillai % Email: [email protected] % Version : 1.0 % Date : 16th October 2008 % %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Script for computing the BER for BPSK modulation in a % Rayleigh fading channel with Alamouti Space Time Block Coding % Two transmit antenna, 1 Receive antenna clear N = 10^6 % number of bits or symbols Eb_N0_dB = [0:25] % multiple Eb/N0 values for ii = 1:length(Eb_N0_dB) % Transmitter ip = rand(1,N)>0.5 % generating 0,1 with equal probability s = 2*ip1 % BPSK modulation 0 > 1 1 > 0 % Alamouti STBC sCode = zeros(2,N) sCode(:,1:2:end) = (1/sqrt(2))*reshape(s,2,N/2) % [x1 x2 …] sCode(:,2:2:end) = (1/sqrt(2))*(kron(ones(1,N/2),[11]).*flipud(reshape(conj(s),2,N/2))) % [x2* x1* ….] h = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)] % Rayleigh channel hMod = kron(reshape(h,2,N/2),ones(1,2)) % repeating the same channel for two symbols n = 1/sqrt(2)*[randn(1,N) + j*randn(1,N)] % white gaussian noise, 0dB variance % Channel and noise Noise addition y = sum(hMod.*sCode,1) + 10^(Eb_N0_dB(ii)/20)*n % Receiver yMod = kron(reshape(y,2,N/2),ones(1,2)) % [y1 y1 … y2 y2 …] yMod(2,:) = conj(yMod(2,:)) % [y1 y1 … y2* y2*…] % forming the equalization matrix hEq = zeros(2,N) hEq(:,[1:2:end]) = reshape(h,2,N/2) % [h1 0 … h2 0…] hEq(:,[2:2:end]) = kron(ones(1,N/2),[11]).*flipud(reshape(h,2,N/2)) % [h1 h2 … h2 h1 …] hEq(1,:) = conj(hEq(1,:)) % [h1* h2* … h2 h1 …. ] hEqPower = sum(hEq.*conj(hEq),1) yHat = sum(hEq.*yMod,1)./hEqPower % [h1*y1 + h2y2*, h2*y1 h1y2*, … ] yHat(2:2:end) = conj(yHat(2:2:end)) % receiver – hard decision decoding ipHat = real(yHat)>0 % counting the errors nErr(ii) = size(find([ip ipHat]),2) end simBer = nErr/N % simulated ber EbN0Lin = 10.^(Eb_N0_dB/10) theoryBer_nRx1 = 0.5.*(11*(1+1./EbN0Lin).^(0.5)) p = 1/2 – 1/2*(1+1./EbN0Lin).^(1/2) theoryBerMRC_nRx2 = p.^2.*(1+2*(1p)) pAlamouti = 1/2 – 1/2*(1+2./EbN0Lin).^(1/2) theoryBerAlamouti_nTx2_nRx1 = pAlamouti.^2.*(1+2*(1pAlamouti)) close all figure semilogy(Eb_N0_dB,theoryBer_nRx1,`bp`,`LineWidth`,2) hold on semilogy(Eb_N0_dB,theoryBerMRC_nRx2,`kd`,`LineWidth`,2) semilogy(Eb_N0_dB,theoryBerAlamouti_nTx2_nRx1,`c+`,`LineWidth`,2) semilogy(Eb_N0_dB,simBer,`mo`,`LineWidth`,2) axis([0 25 10^5 0.5]) grid on legend(`theory (nTx=1,nRx=1)`, `theory (nTx=1,nRx=2, MRC)`, `theory (nTx=2, nRx=1, Alamouti)`, `sim (nTx=2, nRx=1, Alamouti)`) xlabel(`Eb/No, dB`) ylabel(`Bit Error Rate`) title(`BER for BPSK modulation with Alamouti STBC (Rayleigh channel)`) 
Results
InAlamouti STBC with 2 transmit antennas and 1 receive antenna, theperformance is around 3db poorer than in the two transmit antennasand one receive antenna. The SNR is approximately 24db and in thesimulation SNR decreases to approximately 11db. This can also beseen in the BER plot nT_{x}=1, nR_{x}= 2. Maximal ratio combining the Alamouti STBC was around 5db betterperformance as observed by khan [ CITATION Kha11 l 1033 ].
Discussionand conclusion
BERperformance is much better in the one transmit antenna and tworeceive (1×2). The effects of the channel path from two receiveantennas over symbols results in a diversity order of 4. In general,with m receive antennas, the diversity order is 2m transmit antennain Alamouti STBC [ CITATION Ass14 l 1033 ].
Onlyone standard STBC can achieve full rate thus a rate = 1 and this isthe Alamouti’s code as concluded in the Wikipedia for Alamouti’scodes [ CITATION Wik14 l 1033 ]. Further research on the Alamouti’s STBC’s would certainly helpin standardizing transmissions of electromagnetic waves in wirelesscommunications. The development of this work cannot be overstated.
References
Assignment point. (n.d.). Retrieved May 11, 2014, from Assignment point web site: http://www.assignmentpoint.com/science/computer/alamouti…..html
Branks, V., & Etal. (n.d.). Space time coding. Retrieved May 12, 2014, from Wiley: eu.wiley.com/wileyCDA/wileytitle/productCD0470847573html.
DS. (n.d.). Retrieved May 12, 2014, from dsplog.com: http://www.dsplog.com/2007/08/05….modulationDL
Jafarkhami, H. (2005). Space time coding: theory and practice. Cambridge University Press.
Khan, S. G. (2011). Matlab Central. Retrieved May 12, 2014, from Mathworks website: http:..www.mathworks.com/matlabcentral/fileexchange/screenshot/4936/original.jpg
Matworks. (n.d.). Retrieved May 21, 2014, from IEEE 802 Channel models: http://www.mathworks.com/help/comm/examples/ieee80216models/html
Sankar, K. (2009, March 15). Alamouti STBC with 2 recieve antenna. Retrieved May 21, 2014, from DSPLOG website: http://www.dsplog.com/2009/03/15/alamoutistbc2receiveantenna/
Space time codes. (n.d.). Retrieved May 12, 2014, from Space time codes blog spot: http://www.spacetimecodes.blogspot.com
Space time codes. (n.d.). Retrieved May 12, 2014, from blog spot web site: http:www.spacetimecodes.blogspot.com/p/alamouticodehtml
Wikipedia. (n.d.). Retrieved May 5, 2014, from Space time block code: http://en.wikipedia.org/wiki/spacetimeblockcode
Wikipedia. (n.d.). Retrieved May 13, 2014, from BPSK: en.wikipedia.org/wiki/BPSK/…../28BPSK.29