Chapter 6

MIMO

So far we have studied the modulation, scrambling, coding, channel modeling, and multicarrier transmission schemes used in the LTE (Long Term Evolution) standard. In this chapter we focus on its multi-antenna characteristics. The LTE and LTE-Advanced standards achieve high maximum data rates mainly as the result of incorporating many multi-antenna or MIMO (Multiple Input Multiple Output) techniques. LTE can be regarded as a MIMO–OFDM (Orthogonal Frequency Division Multiplexing) system, with MIMO multi-antenna configurations being combined with the OFDM multicarrier transmission scheme.

In general, multi-antenna transmission schemes map modulated data symbols to multiple antennas ports. In the OFDM transmission scheme, each antenna constructs the resource grid, generates the OFDM symbols, and transmits the signal. In a MIMO–OFDM system, the process of resource-grid mapping and OFDM modulation is repeated over multiple transmit antennas. Depending on the MIMO mode used, this multi-antenna extension may result in a boost in data rates or an improvement in the link quality.

In this chapter, we will first review MIMO algorithms of the first four transmission modes of the LTE standard. These transmission modes exploit two main MIMO techniques: (i) transmit diversity (techniques such as Space–Frequency Block Coding, SFBC) and (ii) spatial multiplexing with or without delay-diversity coding. As noted earlier, transmit diversity techniques improve the link quality and reliability but not the data rate or spectral efficiency of a system. On the other hand, spatial multiplexing can bring about in a substantial boost in data rates.

6.1 Definition of MIMO

“MIMO antenna processing” is often used as a general term to refer to all techniques employing multiple transmit and receive antennas. The LTE standard is based on a combination of MIMO multi-antenna techniques and OFDM multicarrier techniques. Essentially, in LTE relationships between multiple transmit and receive antennas are best explained at each individual subcarrier rather than across the entire bandwidth. Figure 6.1 illustrates transmit and receive antenna relationships, together with the channel gains linking each antenna pair.

Figure 6.1 Block diagram of a MIMO transmitter, receiver, and channel

c06f001

At each subcarrier, the relationship between the received and transmitted resource elements on different antennas is expressed by a system of linear equations. In this system, the vector of received resource elements on receive antennas results from the multiplication of the MIMO channel matrix by the vector of transmitted resource elements on transmit antennas. As indicated by the MIMO system of equations, in order to recover the best estimate of the transmitted resource element at a given subcarrier, we need not only the vector of received resource elements but also the channel response (or the CSI, Channel State information) connecting each pair of transmit and receive antennas.

6.2 Motivation for MIMO

Theoretically, the best way to increase data rates over a communications link is to increase the overall received signal power for a given transmit power 1. An effective way of increasing the received power is to use additional antennas at the transmitter and/or the receiver. This represents a class known as multi-antenna or MIMO techniques. Impressive improvements in capacity and Bit Error Rates (BERs) brought about by the use of MIMO techniques have spurred a lot of interest in multi-antenna radio systems. Along with the gains, however, comes added computational complexity. The complexity of a MIMO technique is usually in proportion to the number of antennas used.

Among various MIMO techniques, spatial multiplexing introduces a multi-antenna methodology that achieves a linear capacity growth with the number of antennas 1. Given that typical methods of increasing capacity such as increasing power only lead to a logarithmic improvement, the promise of substantial capacity gains from the use of MIMO techniques represents a historical step forward in wireless communications.

6.3 Types of MIMO

LTE takes extensive advantage of MIMO techniques, for example by introducing many forms of multi-antenna technique in each of its nine downlink transmission modes. LTE-Advanced provides multiple transmit-antenna configurations of up to eight antennas at a time.

Let us examine the mathematical foundation of MIMO systems. A successful implementation of a MIMO system hinges on solving systems of linear equations at the receiver in order to correctly recover the transmitted data. In the presence of channel degradations, the full spectrum exhibits a frequency-selective response. At each sub-band, however, the channel response is flatter and may be approximated by a scalar gain value. In a MIMO system, at each subcarrier the relationship between any pair of transmitted and received symbols can be expressed with a single gain value. This means that the relationship between multiple transmitters and receivers can be expressed with a MIMO system of linear equations, which are solved at the receiver for each and every subcarrier of the full spectrum in order to recover the transmitted signal.

The MIMO algorithms used in the LTE standard can be subdivided into four broad categories: receiver-combining, transmit-diversity, beamforming, and spatial-multiplexing. We will provide a short discussion of three of these techniques in this section.

6.3.1 Receiver-Combining Methods

Receiver-combining methods combine multiple versions of the transmitted signal at the receiver to improve performance. They have been used in 3G mobile standards and WiFi and WiMAX systems. Two types of combining method can be used at the receiver: Maximum Ratio Combining (MRC) and Selection Combining (SC) 2. In MRC, we combine the multiple received signals (usually by averaging them) to find the most likely estimate of the transmitted signal. In SC, we forego the extensive complexity of MRC and use only the received signal with the highest SNR (Signal-to-Noise Ratio) to estimate the transmitted signal.

6.3.2 Transmit Diversity

In transmit diversity, redundant information is transmitted on different antennas at each subcarrier. In this mode, LTE does not increase the data rate but only makes the communications link more robust. Transmit diversity belongs to a class of multi-antenna techniques known as space–time coding. Space–time codes are capable of delivering a diversity order equal to the product of the number of receive and transmit antennas. SFBC, a technique closely related to Space–Time Block Coding (STBC), is the transmit-diversity technique used in the LTE standard.

6.3.3 Spatial Multiplexing

In spatial multiplexing, the system transmits independent (nonredundant) information on different antennas. This mode of MIMO can substantially boost the data rate of a given communications link as the data rate can increase linearly in proportion to the number of transmit antennas. The ability to transmit independent data streams in spatial multiplexing comes with a cost, however. Spatial multiplexing is susceptible to deficiencies in rank of the matrix representing the MIMO equation. Multiple techniques are introduced in LTE spatial multiplexing in order to minimize the probability of these rank deficiencies occurring and to harness its benefits.

6.4 Scope of MIMO Coverage

In this book we focus on signal processing related to the first four modes of MIMO transmission. Beamforming, used in mode 6, relates to multicast and is important for coordinated multipoint. Multi-user MIMO (MU-MIMO), used in modes 5 and 7–9, can be best understood as an extension of the single-user cases of modes 3 and 4. A detailed discussion of beamforming methods and MU-MIMO in both downlink and uplink deserves further study in a different volume.

6.5 MIMO Channels

MIMO channels specify the relationships between signals transmitted over multiple transmit antennas and signals received at multiple receive antennas. The number of connection links is equal to the product of the number of transmit antennas (numTx) and the number of receive antennas (numRx).

In a flat-fading scenario, the relationship between any given pair of transmit and receive antennas at any point in time is given by a scalar gain value known as the channel path gain. The collection of these path gains specifies the channel matrix H. The dimension of the channel matrix is equal to (numTx, numRx). A system of linear equations characterizes the relationship between the received signal at each receive antenna, the transmitted signal at each transmit antenna, and the channel matrix. Figure 6.2 illustrates this relationship between X(n) (the transmitted vector at sample time n), Y(n) (the received vector at sample time n), and H(n) (the channel matrix at sample time n) in a 2 × 2 MIMO channel characterized by a flat-fading response.

Figure 6.2 A 2 × 2 MIMO channel with a flat-fading response

c06f002

The range for the time index n is equal to n = 1, … , nSamp, where nSamp is the number of transmitted symbols in each subframe per antenna. As a result, over a full subframe the transmitted signal has a dimension of (nSamp, numTx), the received signal has a dimension of (nSamp, numRx), and the channel matrix is a 3D matrix with dimensions of (nSamp, numTx, numRx).

In a multipath fading scenario, the relationship between any given transmit and receive antenna at any point in time is characterized by the channel-path gain vector. So each received signal at any point in time depends on the present and past values of transmitted signals. This necessitates the introduction of one more parameter: the number of path delays L. To compute the received signals in a multipath case, the MIMO operations mentioned in the flat-fading scenario must be repeated for each value of the path-delay vector.

As a result, over a full subframe the transmitted signal has a dimension of (nSamp, numTx), the received signal has a dimension of (nSamp, numRx), but the channel matrix is a 4D matrix with dimensions of (nSamp, L, numTx, numRx). Figure 6.3 illustrates this relationship between the transmitted signal X(n), the received signal Y(n), and the channel matrix H(n,k) in a 2 × 2 MIMO channel characterized by a multipath fading response. Here the range for the time index n is equal to n = 1, … , nSamp, where nSamp is defined as before and the range for the path-delay index k is equal to k = 1, … , L, where L is the number of path delays.

Figure 6.3 A 2 × 2 MIMO channel with a multipath fading response

c06f003

6.5.1 MATLAB® Implementation

We can use the comm.MIMOChannel System object to study the effects of multiple antennas and multiple propagation paths and to implement a MIMO channel model. The comm.MIMOChannel System object uses such parameters as number of transmit and receive antennas, delay profile, and Doppler shift to model the dynamics of a flat- or frequency-selective-fading MIMO channel.

The following MATLAB function shows a MIMO fading channel model that can handle frequency-flat- or selective-fading characteristics. This function takes as input a variable (x) that is organized as a 2D matrix. The first dimension of the matrix (nSamp) is the number of samples processed by each transmit antenna in a subframe. The second dimension is the number of transmit antennas (numTx). The function has two output variables. The first (y) is the filtered version of the input variable (x), processed by the fading channel. The first dimension of the first output signal is the same as the first dimension of the input signal (nSamp). The second dimension is equal to the number of receive antennas (numRx). The second output of the function is a multidimensional matrix (H) representing the channel matrix (otherwise known as path gains). The path gains operate on the input variable (x) to generate the output faded signal (y).


Algorithm
MATLAB function
function [y, yPg] = MIMOFadingChan(in, prmLTE, prmMdl)
% MIMOFadingChan
%#codegen
% Get simulation params
numTx          = prmLTE.numTx;
numRx          = prmLTE.numRx;
chanSRate    = prmLTE.chanSRate;
chanMdl       = prmMdl.chanMdl;
corrLvl           = prmMdl.corrLevel;
PathDelays   = prmMdl.PathDelays ;
PathGains     = prmMdl.PathGains ;
Doppler         = prmMdl.Doppler;
ChannelType = prmMdl.ChannelType ;
AntConfig      = prmMdl.AntConfig;
% Initialize objects
persistent chanObj;
if isempty(chanObj)
    if ChannelType ==1
        chanObj = comm.MIMOChannel('SampleRate', chanSRate, 
            'MaximumDopplerShift', Doppler, 
            'PathDelays', PathDelays,
            'AveragePathGains', PathGains,
            'RandomStream', 'mt19937ar with seed',
            'Seed', 100,
            'NumTransmitAntennas', numTx,
            'TransmitCorrelationMatrix', eye(numTx),
            'NumReceiveAntennas', numRx,
            'ReceiveCorrelationMatrix', eye(numRx),
            'PathGainsOutputPort', true,
            'NormalizePathGains', false,
            'NormalizeChannelOutputs', true);
    else
        chanObj = comm.LTEMIMOChannel('SampleRate', chanSRate, 
            'Profile', chanMdl, 
            'AntennaConfiguration', AntConfig, 
            'CorrelationLevel', corrLvl,
            'RandomStream', 'mt19937ar with seed',
            'Seed', 100,
            'PathGainsOutputPort', true);
    end
end
[y, yPg] = step(chanObj, in);

In this function we use two different System objects to perform MIMO channel processing. The comm.MIMOChannel System object is a generic model for MIMO channels. It takes such parameters as path delay, path gains, and Doppler shift to specify the model.

The comm.LTEMIMOChannel System object is specific to LTE channel modeling and is fully described in the next section. It takes a different set of parameters, such as antenna configurations and the correlation level between transmit antennas, to compute all the necessary channel-modeling operations. This function implements the MIMO fading profiles prescribed in the LTE standard 3.

6.5.2 LTE-Specific Channel Models

The 3GPP (Third Generation Partnership Project) Technical Recommendation (TR) 36.104 3 specifies three different multipath fading channel models: the Extended Pedestrian A (EPA), Extended Vehicular A (EVA), and Extended Typical Urban (ETU). The channel-modeling functions used in this book explicitly take advantage of these models. We will not use the higher-mobility profiles as the closed-loop spatial-multiplexing mode is applicable to high-data-rate and low-mobility scenarios only. Together with the generic channel models described earlier, these models enable us to evaluate the performance of the transceiver in various reference channel conditions.

A multipath fading channel model is specified by the combination of delay profiles and a maximum Doppler frequency. The delay profiles of these channel models correspond to a low, medium, and high delay spread environment, respectively and a value of 5, 70, or 300 Hz will be used as the maximum Doppler shift. Table 6.1 illustrates the delay profile of each of the channel models expressed with excess tap delay values (in nanoseconds) and relative power (in decibels).

Table 6.1 LTE channel models (EPA, EVA, ETU): delay profiles

Channel model Excess tap delay (ns) Relative power (dB)
Extended Pedestrian A (EPA) [0 30 70 90 110 190 410] [0 −1 −2 −3 −8 −17.2 −20.8]
Extended Vehicular A (EVA) [0 30 150 310 370 710 1090 1730 2510] [0 −1.5 −1.4 −3.6 −0.6 −9.1 −7 −12 −16.9]
Extended Typical Urban (ETU) [0 50 120 200 230 500 1600 2300 5000] [−1 −1 −1 0 0 0 −3 −5 −7]

In a MIMO transmission scenario, the spatial correlations between the transmit antennas and the receiver antennas are important parameters that directly affect the overall performance. MIMO works best under maximum-scattering and multipath fading environments. Therefore, it is desirable to minimize the correlation between various antenna ports in the transmitter or the receiver side. This will minimize the chance of rank deficiency in the MIMO channel matrices and boost the performance.

For example, in a 2 × 2 MIMO antenna configuration, the transmitter-side (eNodeB, enhanced Node Base station) spatial correlation matrix (c06-math-0001) is expressed as a 2 × 2 matrix with diagonal elements equal to one and off-diagonal elements specified by a parameter (c06-math-0002) as c06-math-0003. Similarly, the receiver-side (UE, User Equipment) spatial correlation matrix (c06-math-0004) is expressed as a 2 × 2 matrix specified by another parameter (c06-math-0005) as c06-math-0006. Note that if both parameters c06-math-0007 and c06-math-0008 are real-valued we do not need to perform the conjugation.

In a 4 × 4 antenna configuration, the spatial-correlation matrices of the transmitter and the receiver side are specified in identical ways as a function of either parameter c06-math-0009 or parameter c06-math-0010. The transmitter-side (eNodeB) spatial correlation matrix (c06-math-0011) is expressed with a 4 × 4 matrix as

equation

Three different correlation levels are defined in the LTE specification: low (actually no correlation), medium, and high. These correlation levels are reflected in the values of the parameters (α and β) specifying the correlation matrices, as illustrated in Table 6.2.

Table 6.2 LTE channel models: correlation levels and coefficients of the spatial-correlation matrices

LTE MIMO channel α β
correlation levels
Low correlation 0 0
Medium correlation 0.3 0.9
High correlation 0.9 0.9

6.5.3 MATLAB Implementation

The System object comm.LTEMIMOChannel is specific to LTE channel modeling and implements the three types of channel model (EPA, EVA, and ETU) discussed in the previous section. It takes different sets of parameters, such as antenna configurations and the correlation level between transmit antennas, to compute all the necessary channel-modeling operations. The System object implements the MIMO fading profiles prescribed in LTE Recommendation 36.104 3.

Since this System object is implemented as a MATLAB-authored object, we can use the command edit comm.LTEMIMOChannel to examine the MATLAB code implementing its various functionalities. For example, the delay profiles of various LTE channel models are implemented with a few lines of MATLAB code in the setDelayDopplerProfiles function of the System object:


Algorithm
MATLAB code segment
function setDelayDopplerProfiles(obj)
    EPAPathDelays = [0 30 70 90 110 190 410]*1e-9;
    EPAPathGains  = [0 -1 -2 -3 -8 -17.2 -20.8];
    EVAPathDelays = [0 30 150 310 370 710 1090 1730 2510]*1e-9;
    EVAPathGains  = [0 -1.5 -1.4 -3.6 -0.6 -9.1 -7 -12 -16.9];
    ETUPathDelays = [0 50 120 200 230 500 1600 2300 5000]*1e-9;
    ETUPathGains  = [-1 -1 -1 0 0 0 -3 -5 -7];
    switch obj.Profile
    case 'EPA 5Hz'
        obj.PathDelays          = EPAPathDelays;
        obj.AveragePathGains    = EPAPathGains;
        obj.MaximumDopplerShift = 5;
    case 'EVA 5Hz'
        obj.PathDelays          = EVAPathDelays;
        obj.AveragePathGains    = EVAPathGains;
        obj.MaximumDopplerShift = 5;
    case 'EVA 70Hz'
        obj.PathDelays          = EVAPathDelays;
        obj.AveragePathGains    = EVAPathGains;
        obj.MaximumDopplerShift = 70;
    case 'ETU 70Hz'
        obj.PathDelays          = ETUPathDelays;
        obj.AveragePathGains    = ETUPathGains;
        obj.MaximumDopplerShift = 70;
    case 'ETU 300Hz'
        obj.PathDelays          = ETUPathDelays;
        obj.AveragePathGains    = ETUPathGains;
        obj.MaximumDopplerShift = 300;
    end

6.5.4 Initializing MIMO Channels

As we initialize the simulation, many properties that are either constant or reused in multiple functions are stored in various simulating parameter structures. In Chapter 4, we introduced a parameter structure called prmLTEDLSCH, which contains the properties needed to perform turbo coding and payload generation. In Chapter 5, we introduced a parameter structure called prmLTEPDSCH, which contains the properties needed to perform downlink shared-channel operations, including resource-grid mapping, OFDM signal generation, and MIMO operations. In this chapter, we introduce a parameter structure called prmMdl, which contains multiple properties related to specification of the MIMO fading channel and the criteria needed to stop the simulation.

The following MATLAB function initializes the prmMdl parameter structure. Depending on the values of nine parameters specified at the beginning of the simulation, the function sets a number of the structure's fields. For example, depending on the string specified as the chanMdl input argument, different values are set for the path delays, path gains, Doppler shift, and channel type. This determines whether a flat or frequency-selective fading is implemented and how the amount of mobility reflected by the Doppler-shift parameter affects the fading operations.


Algorithm
MATLAB function
function prmMdl = prmsMdl(chanSRate,  chanMdl, numTx, numRx, 
    corrLvl, chEstOn, snrdB, maxNumErrs, maxNumBits)
prmMdl.chanMdl = chanMdl;
prmMdl.AntConfig=char([48+numTx,'x',48+numRx]);
switch chanMdl
    case 'flat-low-mobility',
        prmMdl.PathDelays = 0*(1/chanSRate);
        prmMdl.PathGains  = 0;
        prmMdl.Doppler=0;
        prmMdl.ChannelType =1;
    case 'flat-high-mobility',
        prmMdl.PathDelays = 0*(1/chanSRate);
        prmMdl.PathGains  = 0;
        prmMdl.Doppler=70;
        prmMdl.ChannelType =1;
    case 'frequency-selective-low-mobility',
        prmMdl.PathDelays = [0 10 20 30 100]*(1/chanSRate);
        prmMdl.PathGains  = [0 -3 -6 -8 -17.2];
        prmMdl.Doppler=0;
        prmMdl.ChannelType =1;
    case 'frequency-selective-high-mobility',
        prmMdl.PathDelays = [0 10 20 30 100]*(1/chanSRate);
        prmMdl.PathGains  = [0 -3 -6 -8 -17.2];
        prmMdl.Doppler=70;
        prmMdl.ChannelType =1;
    case 'EPA 0Hz'
        prmMdl.PathDelays = [0 30 70 90 110 190 410]*1e-9;
        prmMdl.PathGains  = [0 -1 -2 -3 -8 -17.2 -20.8];
        prmMdl.Doppler=0;
        prmMdl.ChannelType =1;
    otherwise
        prmMdl.PathDelays = 0*(1/chanSRate);
        prmMdl.PathGains  = 0;
        prmMdl.Doppler=0;
        prmMdl.ChannelType =2;
end
prmMdl.corrLevel = corrLvl;
prmMdl.chEstOn = chEstOn;
prmMdl.snrdB=snrdB;
prmMdl.maxNumBits=maxNumBits;
prmMdl.maxNumErrs=maxNumErrs;

6.5.5 Adding AWGN

In Chapter 8, we introduced the AWGNChannel function, which adds white Gaussian noise to the signal. The following MATLAB code segment shows how channel modeling is performed by combining a fading channel with an AWGN (Additive White Gaussian Noise) channel. First, by calling the MIMOFadingChan function, we generate the faded version of the transmitted signal (rxFade) and the corresponding channel matrix (chPathG). Note that in the MIMOFadingChan function we specified path gains as being normalized. Despite this specification, since the MIMO fading channel computes the faded signal as a linear combination of multiple transmit antennas the output signal (rxFade) may not have a unity variance. To compute the noise variance needed to execute the AWGNChannel function, we must first compute the signal variance (sigPow) and derive the noise variance as the difference between the signal power and the SNR value in decibels.


Algorithm
MATLAB code segment
%% Channel
% MIMO Fading channel
[rxFade, chPathG] = MIMOFadingChan(txSig, prmLTEPDSCH, prmMdl);
% Add AWG noise
sigPow = 10*log10(var(rxFade));
nVar = 10.^(0.1.*(sigPow-snrdB));
rxSig =  AWGNChannel(rxFade, nVar);

Finally, through a decibel-to-linear transformation we compute the noise variance (nVar) as a vector of linear values. Since the second dimension of the faded output signal (rxFade) is equal to the number of receive antennas (numRx), the noise variance vector will have a dimension equal to the number of receive antennas. As we will see shortly, these noise-variance estimates are important parameters in equalization and demodulation procedures.

6.6 Common MIMO Features

Some of the functionalities introduced in the previous chapter for multicarrier transmission are common between it and the current chapter and need to be modified to accommodate multiple antennas. These functional components include resource-element mapping and demapping, channel-estimation methods, channel-response extraction, and equalization. On the other hand, some of the functionalities are unique to the MIMO implementation, including precoding, layer mapping, and the MIMO receiver. In this section we detail the modifications required for common functionalities and introduce the original MIMO operations.

6.6.1 MIMO Resource Grid Structure

The Cell-Specific Reference (CSR) signals play a critical role in both frequency-domain equalization (see Chapter 5) and MIMO receiver operations (to be described shortly). There is a fundamental difference, however, in the MIMO case, resulting from the multi-antenna requirements. When a CSR signal is transmitted on any antenna at any given subcarrier, all other antennas must transmit nothing (a zero-valued signal) at the same subcarrier. This requirement introduces a new set of components to be included within the resource grid, called spectral nulls.

Figure 6.4 shows the locations of CSR and spectral nulls within a typical resource block in cases where one, two, or four transmit antennas are used. The single-antenna case is illustrated at the top, showing that CSR signals are available in four OFDM symbols per subframe and that in every symbol there are two CSR samples available within each resource block. In this case there is no need for a spectral null, since only one antenna transmits any information. This configuration, for resource-element mapping and demapping, was implemented in the last chapter by the functions REmapper_1Tx.m and REdemapper_1Tx.m, respectively.

Figure 6.4 Cell-Specific Reference (CSR) signals and spectral nulls for one, two, and four antennas

c06f004

In the 2 × 2 MIMO configuration shown in the middle of Figure 6.4, we can see the addition of spectral nulls (zero-valued resource elements, marked by the letter x) in both antennas. Note also that the location of the spectral nulls in the resource block of one transmit antenna coincides exactly with the location of a CSR signal in the same resource block of the other one. In this 2 × 2 MIMO case, the density of the CSR signals is the same across multiple antennas. This means that in both antennas there are four OFDM symbols containing CSR signals and in each symbol there are two CSR signals per resource block.

In the 4 × 4 configuration, illustrated at the bottom of the figure, we can see two differences:

1. The CSR density in the first and second transmit antennas is different to that in the third and fourth.
2. The spectral nulls across all four transmit antennas have a higher overall density than in the two-antenna case.

The first and second transmit antennas have the same CSR signal density as found in the 2 × 2 MIMO configuration. This means there are four OFDM symbols containing CSR signals and that in each symbol and there are two CSR signals per resource block. In the third and fourth transmit antennas, there are only two OFDM symbols containing CSR signals, located on the first and eighth symbols, and there are two CSR signals per resource block. The location of the spectral nulls in any one transmit antenna coincides exactly with the location of all CSR signals in the other transmit antennas. As a consequence, the sum of CSR signals and spectral nulls is constant across different transmit antennas.

Details regarding the locations of CSR signals and spectral nulls form the basis for specifying resource-element mapping and demapping in the multi-antenna case. Next we will discuss the functions that implement this functionality: REmapper_mTx.m and REdemapper_mTx.m.

6.6.2 Resource-Element Mapping

In this section we detail the resource-element mapping for the MIMO transmission modes. As in single-antenna transmission, resource-element mapping is performed essentially by creating indices to the resource grid matrix and placing various information types within the grid. The types of signal that form the LTE downlink resource grid include the user data (PDSCH, Physical Downlink Shared Channel), CSR signals, Primary Synchronization Signal and Secondary Synchronization Signal (PSS, SSS), Physical Broadcast Channel (PBCH), and Physical Downlink Control Channel (PDCCH). The composition of the resource grid in the MIMO case is very similar to that for a single antenna, except that we need to include two more features. First, we must introduce the spectral nulls needed to mitigate interference among CSR signals during spectral estimation. Second, we must implement the special case of CSR placement in the 4 × 4 configuration, where the number of CSR symbols varies across multiple antennas.

The following MATLAB function shows the resource-element mapping. This function implements the mapping for the SISO (Single Input Single Output), SIMO (Single Input Multiple Output), and MIMO cases, using one, two, and four transmit antennas, respectively. The function takes as input the user data (in), CSR signal (csr), subframe index (nS), and PDSCH parameters, captured in a structure called prmLTEPDSCH. Depending on the availability of BCH (Broadcast Channel), SSS, PSS, and DCI (Downlink Control Information), the function may take on additional inputs. The output variable (y) is the resource grid matrix. The resource grid is a 3D matrix whose first dimension is the number of subcarriers, second dimension is equal to the number of OFDM symbols per subframe, and third dimension is the number of transmit antennas. The function is composed of three sections. In the first, depending on the number of transmit antennas (numTx), we initialize the indices for the user data (idx_data), the CSR signals (idx_csr), and the DCI (idx_ pdcch). To compute indices for the user data we use the function ExpungeFrom.m to exclude the locations of all CSR indices. This way we exclude both the CSR and nulls in each transmit antenna. In the second section, we exclude from the user data and DCI indices the locations of the PSS, SSS, and PBCH, according to the value of the subframe index (nS). Finally, in the third section, we initialize the output buffer. By initializing the entire resource grid to zero we essentially place spectral nulls within it at locations where no other information is written. For each transmit antenna we fill up the resource grid using the indices generated in the first two sections.


Algorithm
MATLAB function
function y = REmapper_mTx(in, csr, nS, prmLTE, varargin)
%#codegen
switch nargin
    case 4, pdcch=[];pss=[];sss=[];bch=[];
    case 5, pdcch=varargin{1};pss=[];sss=[];bch=[];
    case 6, pdcch=varargin{1};pss=varargin{2};sss=[];bch=[];
    case 7, pdcch=varargin{1};pss=varargin{2};sss=varargin{3};bch=[];
    case 8, pdcch=varargin{1};pss=varargin{2};sss=varargin{3};bch=varargin{4};
    otherwise
        error('REMapper has 4 to 8 arguments!');
end
% NcellID = 0;                                               % One of possible 504 values
% Get input params
numTx                   = prmLTE.numTx;              % Number of transmit antennas
Nrb                         = prmLTE.Nrb;
Nrb_sc                   = prmLTE.Nrb_sc;              % 12 for normal mode
Ndl_symb             = prmLTE.Ndl_symb;         % 7    for normal mode
numContSymb    = prmLTE.contReg;            % either {1, 2, 3}
%% Specify resource grid location indices for CSR, PDCCH, PDSCH, PBCH, PSS, SSS
coder.varsize('idx_data');
lenOFDM = Nrb*Nrb_sc;
ContREs=numContSymb*lenOFDM;
idx_dci=1:ContREs;
lenGrid= lenOFDM * Ndl_symb*2;
idx_data  = ContREs+1:lenGrid;
%% 1st: Indices for CSR pilot symbols
idx_csr0   = 1:6:lenOFDM;              % More general starting point = 1+mod(NcellID, 6);
idx_csr4   = 4:6:lenOFDM;              % More general starting point = 1+mod(3+NcellID, 6);
% Depends on number of transmit antennas
switch numTx
    case 1
        idx_csr      = [idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM
+idx_csr4];
        idx_data   = ExpungeFrom(idx_data,idx_csr);
        idx_ pdcch = ExpungeFrom(idx_dci,idx_csr0);
        idx_ex       = 7.5* lenOFDM - 36 + (1:6:72);
        a=numel(idx_csr); IDX=[1, a];
    case 2
        idx_csr1     = [idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM
+idx_csr4];
        idx_csr2     = [idx_csr4, 4*lenOFDM+idx_csr0, 7*lenOFDM+idx_csr4, 11*lenOFDM
+idx_csr0];
        idx_csr       = [idx_csr1, idx_csr2];
        % Exclude pilots and NULLs
        idx_data    = ExpungeFrom(idx_data,idx_csr1);
        idx_data    = ExpungeFrom(idx_data,idx_csr2);
        idx_ pdcch  = ExpungeFrom(idx_dci,idx_csr0);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,idx_csr4);
        idx_ex        = 7.5* lenOFDM - 36 + (1:3:72);
        % Point to pilots only
        a=numel(idx_csr1); IDX=[1, a; a+1, 2*a];
    case 4
        idx_csr1     = [idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM
+idx_csr4];
        idx_csr2     = [idx_csr4, 4*lenOFDM+idx_csr0, 7*lenOFDM+idx_csr4, 11*lenOFDM
+idx_csr0];
        idx_csr33   = [lenOFDM+idx_csr0, 8*lenOFDM+idx_csr4];
        idx_csr44   = [lenOFDM+idx_csr4, 8*lenOFDM+idx_csr0];
        idx_csr       = [idx_csr1, idx_csr2, idx_csr33, idx_csr44];
        % Exclude pilots and NULLs
        idx_data    = ExpungeFrom(idx_data,idx_csr1);
        idx_data    = ExpungeFrom(idx_data,idx_csr2);
        idx_data    = ExpungeFrom(idx_data,idx_csr33);
        idx_data    = ExpungeFrom(idx_data,idx_csr44);
        % From pdcch
        idx_ pdcch  = ExpungeFrom(idx_dci,idx_csr0);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,idx_csr4);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,lenOFDM+idx_csr0);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,lenOFDM+idx_csr4);
        idx_ex        = [7.5* lenOFDM - 36 + (1:3:72), 8.5* lenOFDM - 36 + (1:3:72)];
        % Point to pilots only
        a=numel(idx_csr1); b=numel(idx_csr33);
        IDX =[1, a; a+1, 2*a; 2*a+1, 2*a+b; 2*a+b+1, 2*a+2*b];
    otherwise
        error('Number of transmit antennas must be {1, 2, or 4}');
end
%% 3rd: Indices for PDSCH and PDSCH data in OFDM symbols where pilots are present
%% Handle 3 types of subframes differently
switch nS
    %% 4th: Indices for BCH, PSS, SSS are only found in specific subframes 0 and 5
    % These symbols share the same 6 center sub-carrier locations (idx_ctr)
    % and differ in OFDM symbol number.
    case 0    % Subframe 0
        % PBCH, PSS, SSS are available + CSR, PDCCH, PDSCH
        idx_ctr = 0.5* lenOFDM - 36 + (1:72) ;
        idx_SSS  = 5* lenOFDM + idx_ctr;
        idx_PSS  = 6* lenOFDM + idx_ctr;
        idx_bch0=[7*lenOFDM + idx_ctr, 8*lenOFDM + idx_ctr, 9*lenOFDM + idx_ctr, 10*lenOFDM + idx_ctr];
        idx_bch = ExpungeFrom(idx_bch0,idx_ex);
        idx_data   =  ExpungeFrom(idx_data,[idx_SSS, idx_PSS, idx_bch]);
    case 10  % Subframe 5
        % PSS, SSS are available + CSR, PDCCH, PDSCH
        % Primary and Secondary synchronization signals in OFDM symbols 5 and 6
        idx_ctr = 0.5* lenOFDM - 36 + (1:72) ;
        idx_SSS  = 5* lenOFDM + idx_ctr;
        idx_PSS  = 6* lenOFDM + idx_ctr;
        idx_data   =  ExpungeFrom(idx_data,[idx_SSS, idx_PSS]);
    otherwise % other subframes
        % Nothing to do
end
% Initialize output buffer
y = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2, numTx));
for m=1:numTx
    grid = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2));
    grid(idx_data.')=in(:,m);                                              % Insert user data
    Range=idx_csr(IDX(m,1):IDX(m,2)).';                          % How many pilots in this antenna
    csr_ flat=packCsr(csr, m, numTx);                              % Pack correct number of CSR values
    grid(Range)=  csr_ flat(:);                                             % Insert CSR pilot symbols
    if ˜isempty(pdcch), grid(idx_ pdcch)=pdcch(:,m);end
% Insert Physical Downlink Control Channel (PDCCH)
    if ˜isempty(pss),     grid(idx_PSS)=pss(:,m);end
% Insert Primary Synchronization Signal (PSS)
    if ˜isempty(sss),     grid(idx_SSS)=sss(:,m);end
% Insert Secondary Synchronization Signal (SSS)
    if ˜isempty(bch),     grid(idx_bch)=bch(:,m);end % Insert Broadcast Channel data (BCH)
    y(:,:,m)=grid;
end
end
%% Helper function
function  csr_ flat=packCsr(csr,  m, numTx)
    if ((numTx==4)&&(m>2))                                              % Handle special case of 4Tx
       csr_ flat=csr(:,[1,3],m);                                               % Extract pilots in this antenna
    else
        csr_ flat=csr(:,:,m);
    end
end

6.6.3 Resource-Element Demapping

Resource-element demapping inverts the operations of resource-grid mapping. The following MATLAB function illustrates how the reference signal and data are extracted from the recovered resource grid at the receiver. The function has three input arguments: the received resource grid (in), the index of the subframe (nS), and the PDSCH parameter set. The function outputs extracted user data (data), the indices to the user data (idx_data), the CSR signals (csr), and optionally the DCI (pdcch), primary and secondary synchronization signals (pss, sss), and BCH signal (bch). As different subframes contain different content, the second input subframe index parameter (nS) enables the function to separate the correct data. The same algorithm used in the resource-mapping function is used here to generate indices in the demapping function. In the multi-antenna case, the resource-grid input is a 3D matrix. The first two dimensions specify the size of the resource grid for each receive antenna and the third dimension is the number of receive antennas. Like the resource-mapping function, resource demapping is performed in three sections. In the first two, we compute the indices localizing various components of the resource grid. These include indices for the user data (idx_data), the CSR signals (idx_csr), the DCI (idx_ pdcch), primary and secondary synchronization signals (idx_PSS, idx_SSS), and the BCH signal (idx_bch). In the third section, we extract these data components from the resource grid for each receive antenna using the indices we generated in the first two sections.


Algorithm
MATLAB function
function [data, csr, idx_data, pdcch, pss, sss, bch] = REdemapper_mTx(in, nS, prmLTE)
%#codegen
% NcellID = 0;                                     % One of possible 504 values
% Get input params
numTx                 = prmLTE.numTx;              % number of receive antennas
numRx                 = prmLTE.numRx;              % number of receive antennas
Nrb                      = prmLTE.Nrb;                    % either of {6,…,100 }
Nrb_sc                 = prmLTE.Nrb_sc;              % 12 for normal mode
Ndl_symb            = prmLTE.Ndl_symb;         % 7    for normal mode
numContSymb     = prmLTE.contReg;            % either {1, 2, 3}
Npss                    = prmLTE.numPSSRE;
Nsss                    = prmLTE.numSSSRE;
Nbch                   = prmLTE.numBCHRE;
%% Specify resource grid location indices for CSR, PDCCH, PDSCH, PBCH, PSS, SSS
coder.varsize('idx_data');
coder.varsize('idx_dataC');
lenOFDM = Nrb*Nrb_sc;
ContREs=numContSymb*lenOFDM;
idx_dci=1:ContREs;
lenGrid= lenOFDM * Ndl_symb*2;
idx_data  = ContREs+1:lenGrid;
%% 1st: Indices for CSR pilot symbols
idx_csr0   = 1:6:lenOFDM;              % More general starting point = 1+mod(NcellID, 6);
idx_csr4   = 4:6:lenOFDM;              % More general starting point = 1+mod(3+NcellID, 6);
% Depends on number of transmit antennas
switch numTx
    case 1
        idx_csr      = [idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM
+idx_csr4];
        idx_data   = ExpungeFrom(idx_data,idx_csr);
        idx_ pdcch = ExpungeFrom(idx_dci,idx_csr0);
        idx_ex       = 7.5* lenOFDM - 36 + (1:6:72);
    case 2
        idx_csr1     = [idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM
+idx_csr4];
        idx_csr2     = [idx_csr4, 4*lenOFDM+idx_csr0, 7*lenOFDM+idx_csr4, 11*lenOFDM
+idx_csr0];
        idx_csr       = [idx_csr1, idx_csr2];
        % Exclude pilots and NULLs
        idx_data    = ExpungeFrom(idx_data,idx_csr1);
        idx_data    = ExpungeFrom(idx_data,idx_csr2);
        idx_ pdcch  = ExpungeFrom(idx_dci,idx_csr0);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,idx_csr4);
        idx_ex        = 7.5* lenOFDM - 36 + (1:3:72);
    case 4
        idx_csr1     = [idx_csr0, 4*lenOFDM+idx_csr4, 7*lenOFDM+idx_csr0, 11*lenOFDM
+idx_csr4];
        idx_csr2     = [idx_csr4, 4*lenOFDM+idx_csr0, 7*lenOFDM+idx_csr4, 11*lenOFDM
+idx_csr0];
        idx_csr33   = [lenOFDM+idx_csr0, 8*lenOFDM+idx_csr4];
        idx_csr44   = [lenOFDM+idx_csr4, 8*lenOFDM+idx_csr0];
        idx_csr       = [idx_csr1, idx_csr2, idx_csr33, idx_csr44];
        % Exclude pilots and NULLs
        idx_data    = ExpungeFrom(idx_data,idx_csr1);
        idx_data    = ExpungeFrom(idx_data,idx_csr2);
        idx_data    = ExpungeFrom(idx_data,idx_csr33);
        idx_data    = ExpungeFrom(idx_data,idx_csr44);
        % From pdcch
        idx_ pdcch  = ExpungeFrom(idx_dci,idx_csr0);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,idx_csr4);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,lenOFDM+idx_csr0);
        idx_ pdcch  = ExpungeFrom(idx_ pdcch,lenOFDM+idx_csr4);
        idx_ex        = [7.5* lenOFDM - 36 + (1:3:72), 8.5* lenOFDM - 36 + (1:3:72)];
    otherwise
        error('Number of transmit antennas must be {1, 2, or 4}');
end
%% 3rd: Indices for PDSCH and PDSCH data in OFDM symbols where pilots are present
%% Handle 3 types of subframes differently
switch nS
    %% 4th: Indices for BCH, PSS, SSS are only found in specific subframes 0 and 5
    % These symbols share the same 6 center sub-carrier locations (idx_ctr)
    % and differ in OFDM symbol number.
    case 0    % Subframe 0
        % PBCH, PSS, SSS are available + CSR, PDCCH, PDSCH
        idx_ctr = 0.5* lenOFDM - 36 + (1:72) ;
        idx_SSS  = 5* lenOFDM + idx_ctr;
        idx_PSS  = 6* lenOFDM + idx_ctr;
        idx_bch0=[7*lenOFDM + idx_ctr, 8*lenOFDM + idx_ctr, 9*lenOFDM + idx_ctr, 10*lenOFDM + idx_ctr];
        idx_bch = ExpungeFrom(idx_bch0,idx_ex);
        idx_data   =  ExpungeFrom(idx_data,[idx_SSS, idx_PSS, idx_bch]);
    case 10  % Subframe 5
        % PSS, SSS are available + CSR, PDCCH, PDSCH
        % Primary and Secondary synchronization signals in OFDM symbols 5 and 6
        idx_ctr = 0.5* lenOFDM - 36 + (1:72) ;
        idx_SSS  = 5* lenOFDM + idx_ctr;
        idx_PSS  = 6* lenOFDM + idx_ctr;
        idx_data   =  ExpungeFrom(idx_data,[idx_SSS, idx_PSS]);
    otherwise % other subframes
        % Nothing to do
end
%% Write user data PDCCH, PBCH, PSS, SSS, CSR
pss=complex(zeros(Npss,numRx));
sss=complex(zeros(Nsss,numRx));
bch=complex(zeros(Nbch,numRx));
pdcch = complex(zeros(numel(idx_ pdcch),numRx));
data=complex(zeros(numel(idx_data),numRx));
idx_dataC=idx_data.';
for n=1:numRx
    grid=in(:,:,n);
    data(:,n)=grid(idx_dataC);                               % Physical Downlink Shared Channel (PDSCH) = user data
    pdcch(:,n) = grid(idx_ pdcch.');                       % Physical Downlink Control Channel (PDCCH)
    if nS==0
        pss(:,n)=grid(idx_PSS.');                             % Primary Synchronization Signal (PSS)
        sss(:,n)=grid(idx_SSS.');                             % Secondary Synchronization Signal (SSS)
        bch(:,n)=grid(idx_bch.');                            % Broadcast Channel data (BCH)
    elseif nS==10
        pss(:,n)=grid(idx_PSS.');                             % Primary Synchronization Signal (PSS)
        sss(:,n)=grid(idx_SSS.');                              % Secondary Synchronization Signal (SSS)
    end
end
%% Cell-specific Reference Signal (CSR) = pilots
switch numTx
    case 1                                                            % Case of 1 Tx
        csr=complex(zeros(2*Nrb,4,numRx));        % 4 symbols have CSR  per Subframe
        for n=1:numRx
            grid=in(:,:,n);
            csr(:,:,n)=reshape(grid(idx_csr'), 2*Nrb,4) ;
        end
    case 2                                                            % Case of 2 Tx
        idx_0=(1:3:lenOFDM);                             % Total number of Nulls + CSR are constant
        idx_all=[idx_0,  4*lenOFDM+idx_0, 7*lenOFDM+idx_0,  11*lenOFDM+idx_0]';
        csr=complex(zeros(4*Nrb,4,numRx));       % 4 symbols have CSR+NULLs  per Subframe
        for n=1:numRx
            grid=in(:,:,n);
            csr(:, :,n)=reshape(grid(idx_all), 4*Nrb,4) ;
        end
    case 4
        idx_0=(1:3:lenOFDM);                             % Total number of Nulls + CSR are constant
        idx_all=[idx_0,                       lenOFDM+idx_0,      4*lenOFDM+idx_0, 
            7*lenOFDM+idx_0,  8*lenOFDM+idx_0,  11*lenOFDM+idx_0]';
        csr=complex(zeros(4*Nrb,6,numRx));       % 4 symbols have CSR+NULLs  per Subframe
        for n=1:numRx
            grid=in(:,:,n);
            csr(:, :,n)=reshape(grid(idx_all), 4*Nrb,6) ;
        end
end
end

6.6.4 CSR-Based Channel Estimation

The system of linear equations characterizing a MIMO channel can be expressed as follows:

6.1 c06-math-0013

where at time index n and at any given subcarrier, c06-math-0014 is the received signal, c06-math-0015 is the transmitted signal, c06-math-0016 is the channel matrix, and c06-math-0017 represents the AWGN vector. When the receiver has obtained the received signal c06-math-0018, we must compute an estimate for the channel matrix c06-math-0019 and the noise c06-math-0020 in order to properly estimate the transmitted signal c06-math-0021. Assuming that an estimate of the channel AWGN is available, we focus in this section on ways of estimating the channel matrix.

Let us denote the number of transmit antennas by numTx and the number of receive antennas by numRx. The channel matrix has a dimension of (numRx, numTx). For each subcarrier and for each OFDM symbol, numRx × numTx values must be estimated for the channel matrix. As discussed in the last chapter, we use the CSR (pilot) signals for channel-matrix estimation. Let us see how multi-antenna transmission affects the channel estimation process. Considering, for example, a 2 × 2 configuration for the MIMO channel, the MIMO system of equation at a given time index can be expressed as:

6.2 c06-math-0022

Focusing on a single receive antenna, for example c06-math-0023, the value of the received signal is a linear combination of values in two transmit antennas scaled by two channel gains:

6.3 c06-math-0024

Since multicarrier transmission allows us to perform channel estimation in the frequency domain, by taking a discrete Fourier transform of this expression we can express the relationship between the channel gains and received and transmitted signals as follows:

6.4 c06-math-0025

where c06-math-0026, for example, is the Fourier transform of the corresponding time-domain signal c06-math-0027 and nVar is the noise variance of the AWGN channel at a given subcarrier. Note that variables c06-math-0028, c06-math-0029, and c06-math-0030 are received and transmitted values at a given subcarrier and a given OFDM symbol in a transmitted and received resource grid, respectively.

If we choose known pilot (CSR) signals for variables c06-math-0031 and c06-math-0032, then by knowing the received variable c06-math-0033 and ignoring the noise variance we can easily estimate channel-matrix variables c06-math-0034 and c06-math-0035. This is where the need for spectral nulls becomes apparent. At a given subcarrier and with a given OFDM symbol, when the value of c06-math-0036 is equal to a reference signal at the same subcarrier the value of c06-math-0037 is equal to zero, because this variable represents a spectral null. As a result, the previous equation can be modified to derive an expression for the channel matrix:

6.5 c06-math-0038

This discussion shows that by exploiting the CSR signals and spectral nulls embedded within the resource grid, we can estimate the channel-matrix path gain value c06-math-0039 as:

6.6 c06-math-0040

where m is the index of the transmit antenna, with a range equal to m = 1, … , numTx and n is the index of the receive antenna, with a range equal to m = 1, … , numRx. In the next section we see how in MATLAB we can use the transmitted and received CSR signals to implement this equation and estimate the channel matrix. Then, by expanding the channel matrix across the resource grid through interpolation, we arrive at an estimate of the channel-frequency response over the entire grid.

6.6.5 Channel-Estimation Function

The following MATLAB function illustrates how channel estimation is performed using the transmitted and received reference symbols, also referred to as pilots, at regular intervals within the OFDM time–frequency grid. The function has four input arguments: the parameters of the PDSCH captured in a structure (prmLTE), the received CSR signal (Rx), the transmitted reference CSR signal (Ref), and a parameter representing the channel-estimation mode (Mode). As its output, the function computes the channel-frequency response over the entire grid (hD).


Algorithm
MATLAB function
function hD = ChanEstimate_mTx(prmLTE, Rx, Ref, Mode)
%#codegen
Nrb           = prmLTE.Nrb;     % Number of resource blocks
Nrb_sc      = prmLTE.Nrb_sc;                 % 12 for normal mode
Ndl_symb = prmLTE.Ndl_symb;        % 7    for normal mode
numTx      = prmLTE.numTx;
numRx      = prmLTE.numRx;
% Initialize output buffer
switch numTx
    case 1                                                                                       % Case of 1 Tx
        hD = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2,numRx));   % Initialize Output
        % size(Rx) = [2*Nrb,  4,numRx]  size(Ref) = [2*Nrb, 4] 
        Edges=[0,3,0,3];
        for n=1:numRx                                                                     
            Rec=Rx(:,:,n);
            hp= Rec./Ref;
            hD(:,:,n)=gridResponse(hp, Nrb, Nrb_sc, Ndl_symb, Edges,Mode);
        end
    case 2                                                           % Case of 2 Tx
        hD = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2,numTx, numRx));
        % size(Rx) = [4*Nrb,  4,numRx]  size(Ref) = [2*Nrb, 4, numTx] 
        for n=1:numRx
            Rec=Rx(:,:,n);
            for m=1:numTx
                [R,Edges]=getBoundaries2(m, Rec);
                T=Ref(:,:,m);
                hp= R./T;
                hD(:,:,m,n)=gridResponse(hp, Nrb, Nrb_sc, Ndl_symb, Edges,Mode);
            end
        end
    case 4
        hD = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2,numTx, numRx));
        % size(Rx) = [4*Nrb,  4,numRx]  size(Ref) = [2*Nrb, 4, numTx] 
        for n=1:numRx
            Rec=Rx(:,:,n);
            for m=1:numTx
                [R,idx3, Edges]=getBoundaries4(m, Rec);
                T=Ref(:,idx3,m);
                hp= R./T;
                hD(:,:,m,n)=gridResponse(hp, Nrb, Nrb_sc, Ndl_symb, Edges,Mode);
            end
        end
end
end
%% Helper function
function [R,idx3, Edges]=getBoundaries4(m,  Rec)
coder.varsize('Edges');coder.varsize('idx3');
numPN=size(Rec,1);
idx_0=(1:2:numPN);
idx_1=(2:2:numPN);
Edges=[0,3,0,3];
idx3=1:4;
switch m
    case 1
        index=[idx_0,  2*numPN+idx_1, 3*numPN+idx_0,  5*numPN+idx_1]';
        Edges=[0,3,0,3];   idx3=1:4;
    case 2
        index=[idx_1,  2*numPN+idx_0, 3*numPN+idx_1,  5*numPN+idx_0]';
        Edges=[3,0,3,0];    idx3=1:4;
    case 3
        index=[numPN+idx_0,  4*numPN+idx_1]';
        Edges=[0,3];           idx3=[1 3];
    case 4
        index=[numPN+idx_1,  4*numPN+idx_0]';
        Edges=[3,0];          idx3=[1 3];
end
R=reshape(Rec(index),numPN/2,numel(Edges));
end
%% Helper function
function [R, Edges]=getBoundaries2(m, Rec)
numPN=size(Rec,1);
idx_0=(1:2:numPN);
idx_1=(2:2:numPN);
Edges=[0,3,0,3];
switch m
    case 1
        index=[idx_0,  numPN+idx_1, 2*numPN+idx_0, 3*numPN+idx_1]';
        Edges=[0,3,0,3];
    case 2
        index=[idx_1,  numPN+idx_0, 2*numPN+idx_1,  3*numPN+idx_0]';
        Edges=[3,0,3,0];
end
R=reshape(Rec(index),numPN/2,4);
end

The function performs channel estimation in two steps. First, it computes the channel matrix over elements of the resource grid aligned with the reference signal. This is accomplished by accessing all combinations of the transmitted reference signal (T) and received reference signal (R) and using the elementwise division operator in MATLAB to compute the channel-matrix elements. In the second step, we call the gridResponse function to expand the channel-matrix estimates over the entire grid from those computed based only on CSR values. The type of interpolation or averaging of values that makes expansion possible is specified by the input argument (Mode).Next we will look at various channel-expansion operations.

6.6.6 Channel-Estimate Expansion

The following MATLAB function shows three algorithms that can expand the channel matrices computed only over CSR signals to generate the function output (y), channel-frequency responses over the entire resource grid. The function takes as input the following arguments: a limited set of channel responses computed over pilots (hp) and parameters related to the dimensions of the resource grid, including the number of resource blocks (Nrb), number of subcarriers in each resource block (Nrb_sc), and number of OFDM symbols per slot (Ndl_symb), as well as two others: a vector that specifies the location of the CSR signal relative to the edge of the resource block (Edges) and the algorithm chosen to expand the response to the entire grid (Mode).


Algorithm
MATLAB function
function y=gridResponse(hp, Nrb, Nrb_sc, Ndl_symb, Edges,Mode)
%#codegen
switch Mode
    case 1
        y=gridResponse_interpolate(hp, Nrb, Nrb_sc, Ndl_symb, Edges);
    case 2
        y=gridResponse_averageSlot(hp, Nrb, Nrb_sc, Ndl_symb, Edges);
    case 3
        y=gridResponse_averageSubframe(hp,  Ndl_symb, Edges);
    otherwise
        error('Choose the right Mode in function ChanEstimate.');
end
end

The following MATLAB function (gridResponse_interpolate.m) executes if the value chosen for the Mode argument in the gridResponse.m function is 1. It performs an expansion algorithm based on frequency-and-time-domain interpolation. This algorithm involves interpolation between subcarriers in the frequency domain in OFDM symbols that contain CSR signals. Having computed the channel response for all subcarriers on these symbols, the function then interpolates in time to find the channel response across the whole resource grid. The difference between this algorithm and the one used in the single-antenna case is the separate treatment of two-antenna and four-antenna cases. Note that the number of OFDM symbols containing CSR signals in the third and fourth antennas in the four-antenna case is only two. The interpolation between OFDM symbols must take this detail into account.


Algorithm
MATLAB function
function hD=gridResponse_interpolate(hp, Nrb, Nrb_sc, Ndl_symb, Edges)
% Average over the two same Freq subcarriers, and then interpolate between
% them - get all estimates and then repeat over all columns (symbols).
% The interpolation assmues NCellID = 0.
% Time average two pilots over the slots, then interpolate (F)
% between the 4 averaged values, repeat for all symbols in sframe
Separation=6;
hD = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2));
N=numel(Edges);
% Compute channel response over all resource elements of OFDM symbols
switch N
    case 2
        Symbols=[2, 9];
        % Interpolate between subcarriers
        for n=1:N
            E=Edges(n);Edge=[E, 5-E];
            y = InterpolateCsr(hp(:,n),  Separation, Edge);
            hD(:,Symbols(n))=y;
        end
        % Interpolate between OFDM symbols
        for m=[1,3:8,10:14]
            alpha=(1/7)*(m-2);
            beta=1-alpha;
            hD(:,m)    = beta*hD(:,2) + alpha*hD(:,  9);
        end
    case 4
        Symbols=[1, 5, 8, 12];
        % Interpolate between subcarriers
        for n=1:N
            E=Edges(n);Edge=[E, 5-E];
            y = InterpolateCsr(hp(:,n),  Separation, Edge);
            hD(:,Symbols(n))=y;
        end
        % Interpolate between OFDM symbols
        for m=[2, 3, 4, 6, 7]
            alpha=0.25*(m-1);
            beta=1-alpha;
            hD(:,m)    = beta*hD(:,1) + alpha*hD(:,  5);
            hD(:,m+7) =beta*hD(:,8) + alpha*hD(:,12);
        end
    otherwise
        error('Wrong Edges parameter for function gridResponse.');
end

The following MATLAB function (gridResponse_averageSlot.m) executes if the value of the Mode argument in the gridResponse.m function is set to 2. It performs an expansion algorithm based on frequency-domain interpolation and averaging in time among OFDM symbols in each slot. The operations of this algorithm depend on whether one or two OFDM symbols containing CSR signals are found in a given slot. If there are two OFDM symbols containing CSR signals, the algorithm combines the CSR signals from the first two OFDM symbols. In this case, instead of a separation of six subcarriers between CSR signals, we have a separation of three subcarriers. If there is only one OFDM symbol that contains CSR signals per slot (e.g., in a four-antenna case, in the third and fourth antennas), no CSR combination is performed and the separation between CSR values remains six subcarriers. As a next step, the function interpolates the values along the frequency axis based on the separation value determined previously. Finally, it applies the same channel response to all the OFDM symbols of a given slot and repeats the operations for the next slot in order to compute the channel response of the whole resource grid.


Algorithm
MATLAB function
function hD=gridResponse_averageSlot(hp, Nrb, Nrb_sc, Ndl_symb, Edges)
% Average over the two same Freq subcarriers, and then interpolate between
% them - get all estimates and then repeat over all columns (symbols).
% The interpolation assmues NCellID = 0.
% Time average two pilots over the slots, then interpolate (F)
% between the 4 averaged values, repeat for all symbols in sframe
Separation=3;
hD = complex(zeros(Nrb*Nrb_sc, Ndl_symb*2));
N=numel(Edges);
% Compute channel response over all resource elements of OFDM symbols
switch N
    case 2
        % Interpolate between subcarriers
        Index=1:Ndl_symb;
        for n=1:N 
        E=Edges(n);Edge=[E, 5-E];
        y = InterpolateCsr(hp(:,n),  2* Separation, Edge);
        % Repeat between OFDM symbols in each slot
        yR=y(:,ones(1,Ndl_symb));
        hD(:,Index)=yR;
        Index=Index+Ndl_symb;
        end
    case 4
        Edge=[0 2];
        h1_a_mat = [hp(:,1),hp(:,2)].';
        h1_a = h1_a_mat(:);
        h2_a_mat = [hp(:,3),hp(:,4)].';
        h2_a = h2_a_mat(:);
        hp_a=[h1_a,h2_a];
        Index=1:Ndl_symb;
        for n=1:size(hp_a,2) 
        y = InterpolateCsr(hp_a(:,n),  Separation, Edge);
        % Repeat between OFDM symbols in each slot
        yR=y(:,ones(1,Ndl_symb));
        hD(:,Index)=yR;
        Index=Index+Ndl_symb;
        end
    otherwise
        error('Wrong Edges parameter for function gridResponse.');
end

Finally, the following MATLAB function (gridResponse_averageSubframe.m) executes if the value of the Mode argument in the gridResponse.m function is set to 3. It performs an expansion algorithm based on frequency-domain interpolation and averaging in time among OFDM symbols in the entire subframe. The operations of this algorithm depend on whether or not there are two or four OFDM symbols containing CSR signals found in a given subframe. If there are four, the algorithm averages the values first in the first and third OFDM symbols and then in the second and fourth symbols, and then combines these average vectors. In this case, instead of a separation of six subcarriers between CSR signals we now have a separation of three subcarriers. If there is only one OFDM symbol per slot that contains CSR signals, the algorithm combines the two OFDM symbols, resulting in a separation of three subcarriers between combined CSR signals. As the next step, the function interpolates the values along the frequency axis based on a separation value of 3 in all cases. Finally, it applies the same channel response to all the OFDM symbols of the subframe as the channel response of the whole resource grid.


Algorithm
MATLAB function
function hD=gridResponse_averageSubframe(hp, Ndl_symb, Edges)
% Average over the two same Freq subcarriers, and then interpolate between
% them - get all estimates and then repeat over all columns (symbols).
% The interpolation assmues NCellID = 0.
% Time average two pilots over the slots, then interpolate (F)
% between the 4 averaged values, repeat for all symbols in sframe
Separation=3;
N=numel(Edges);
Edge=[0 2];
% Compute channel response over all resource elements of OFDM symbols
switch N
    case 2
        h1_a_mat = hp.';
        h1_a = h1_a_mat(:);
        % Interpolate between subcarriers
        y = InterpolateCsr(h1_a,  Separation, Edge);
        % Repeat between OFDM symbols
        hD=y(:,ones(1,Ndl_symb*2));
    case 4
        h1_a1 = mean([hp(:, 1), hp(:, 3)],2);
        h1_a2 = mean([hp(:, 2), hp(:, 4)],2);
        h1_a_mat = [h1_a1 h1_a2].';
        h1_a = h1_a_mat(:);
        % Interpolate between subcarriers
        y = InterpolateCsr(h1_a,  Separation, Edge);
        % Repeat between OFDM symbols
        hD=y(:,ones(1,Ndl_symb*2));
    otherwise
        error('Wrong Edges parameter for function gridResponse.');
end

The three algorithms mentioned here provide different dynamic behaviors within each subframe. Note that in OFDM transmission with a normal cyclic prefix, each slot contains seven OFDM symbols and each subframe contains fourteen. The first algorithm results in a channel estimate where the response within a subframe is dynamic and changes from one OFDM symbol to the next. The second algorithm results in a constant channel response for the first seven OFDM symbols (first slot) and in a different constant response for the next seven OFDM symbols (second slot). The third algorithm is the least dynamic implementation, with a single response applying to all OFDM symbols of a subframe.

6.6.7 Ideal Channel Estimation

So far we have discussed algorithms that rely on the pilots (CSR signals) to provide a channel-response estimate. These algorithms are realistic implementations and can be incorporated as part of a real system. In this section, we present what we call an “ideal channel estimator.” This type of ideal algorithm relies on exact knowledge of the channel matrix or the path gain values that the MIMO channel model provides. Since the second output of the MIMOFadingChan.m function is the multidimensional channel matrix representing the path gains, the ideal channel estimator can use these path gains to compute the best estimate of the channel-frequency response for the entire resource grid. Note that because of the way it is formulated, the ideal channel estimator cannot be implemented as part of a real system. It can only be used during simulation as a yardstick or as the best “upper-bound” solution to the problem of channel estimation.

The function IdChEst.m implements an ideal channel estimator. It takes as input the parameters of the PDSCH captured in a structure (prmLTEPDSCH), the channel model parameter structure (prmMdl), and the channel matrix (chPathG), which is the second output of the MIMOFadingChan.m function. As its output, the function computes the channel-frequency response over the entire grid (H).


Algorithm
MATLAB function
function H = IdChEst(prmLTEPDSCH, prmMdl, chPathG)
% Ideal channel estimation for LTE subframes
%
%   Given the system parameters and the MIMO channel path Gains, provide
%   the ideal channel estimates for the RE corresponding to the data.
%   Limitation - will work for path delays that are multiple of channel sample
%   time and largest pathDelay < size of FFT
%   Implementation based on FFT of channel impulse response
persistent hFFT;
if isempty(hFFT)
   hFFT = dsp.FFT;
end
% get parameters
numDataTones = prmLTEPDSCH.Nrb*12; % Nrb_sc = 12
N                        = prmLTEPDSCH.N;
cpLen0               = prmLTEPDSCH.cpLen0;
cpLenR               = prmLTEPDSCH.cpLenR;
Ndl_symb           = prmLTE.Ndl_symb;        % 7    for normal mode
slotLen               = (N*Ndl_symb + cpLen0 + cpLenR*6);
% Get path delays
pathDelays = prmMdl.PathDelays;
% Delays, in terms of number of channel samples, +1 for indexing
sampIdx = round(pathDelays/(1/prmLTEPDSCH.chanSRate)) + 1;
[˜, numPaths, numTx, numRx] = size(chPathG);
% Initialize output 
H = complex(zeros(numDataTones, 2*Ndl_symb, numTx, numRx));
for i= 1:numTx
    for j = 1:numRx
        link_PathG = chPathG(:, :, i, j);
        % Split this per OFDM symbol
        g = complex(zeros(2*Ndl_symb, numPaths));
        for n = 1:2 % over two slots
            % First OFDM symbol
            Index=(n-1)*slotLen + (1:(N+cpLen0));
            g((n-1)*Ndl_symb+1, :) = mean(link_PathG(Index, :), 1);
            % Next 6 OFDM symbols
            for k = 1:6
                Index=(n-1)*slotLen+cpLen0+k*N+(k-1)*cpLenR + (1:(N+cpLenR));
                g((n-1)*Ndl_symb+k+1, :) = mean(link_PathG(Index, :), 1);
            end
        end
        hImp = complex(zeros(2*Ndl_symb, N));
        % assign pathGains at impulse response sample locations
        hImp(:, sampIdx) = g;
        % FFT of impulse response
        h = step(hFFT, hImp.');
        % Reorder, remove DC, Unpack channel gains
        h = [h(N/2+1:N, :); h(1:N/2, :)];
        H(:, :, i, j) = [h(N/2-numDataTones/2+1:N/2, :); h(N/2+2:N/2+1+numDataTones/2, :)];
    end
end

This function essentially computes the channel frequency by applying a Fast Fourier Transform (FFT) to the channel impulse response. It is based on averaging over the entire subframe, so the same channel response is applied to all 14 OFDM symbols of a subframe. The operations of this function can be summarized as follows: (i) for any given transmit antenna and receive antenna, the channel path gains are extracted for all samples in time; (ii) the cyclic prefix samples are excluded; (iii) an average value is taken over the non-cyclic-prefix samples; (iv) a single impulse response vector (hImp) is initialized; (v) the non-zero samples of the impulse response are found by rounding the normalized path-delay values to the nearest integer; (vi) the impulse-response vector is updated by placing the average path gains in non-zero samples; (vii) an FFT is applied to the impulse response; (viii) the channel-response values are reordered and unpacked in oirder to compute the channel response over the entire resource grid.

6.6.8 Channel-Response Extraction

The received resource grid of each receive antenna contains multiple types of data, including user data, CSR and spectral-null signals, DCI, synchronization signals, and BCH signals. In order to focus on equalizing and recovering the user data, we must extract from the estimated channel response those elements that align with user data. The following MATLAB function (ExtChResponse.m) employs the PDSCH parameter structure (prmLTEPDSCH) and the user-data indices (idx_data) to extract from the full grid (chEst) the channel response values that align with the user data (hD). Note that when this function is called, the user-data indices (idx_data) have already been already computed as the third output of the resource-demapper function (REdemapper_mTx).


Algorithm
MATLAB function
function hD=ExtChResponse(chEst, idx_data, prmLTE)
%#codegen
numTx = prmLTE.numTx;
numRx = prmLTE.numRx;
if (numTx==1)
    hD=complex(zeros(numel(idx_data),numRx));
    for n=1:numRx
        tmp=chEst(:,:,n);
        hD(:,n)=tmp(idx_data);
    end
else
    hD=complex(zeros(numel(idx_data),numTx,numRx));
    for n=1:numRx
        for m=1:numTx
            tmp=chEst(:,:,m,n);
            hD(:,m,n)=tmp(idx_data);
        end
    end
end

6.7 Specific MIMO Features

In the following sections we will introduce functionalities that are unique to the MIMO implementation. These include precoding, layer mapping, and MIMO receiver. These operations will be markedly different depending on whether a transmit-diversity or a spatial-multiplexing technique is used. By adding these specific features to the common MIMO features – that is, resource grid computations, channel estimation, and OFDM specific features related to OFDM signal generation – we can completely specify the PDSCH operation. In this chapter we will feature PDSCH operations for modes 2, 3, and 4 of MIMO transmission in the LTE standard.

6.7.1 Transmit Diversity

Transmit diversity uses multiple antennas at the transmitter to exploit diversity gains and improve the link quality. There are two transmit-diversity schemes specified by LTE: one is a 2 × 2 SFBC technique and the other is a 4 × 4 technique. Both techniques feature full-rate codes and offer increased performance via their diversity as compared to single-antenna transmissions.

6.7.1.1 MIMO Operations in Transmit Diversity

The LTE standard specifies MIMO operations as a combination of layer mapping and precoding. In transmit-diversity mode, layer mapping and precoding are combined as a single encoding operation. The transmit-diversity encoder subdivides the modulated symbols into pairs and through diversity coding places transformed versions of modulated pairs on different transmit antennas. As the samples on each transmit antenna are derived from the original modulated stream, layer mapping is also implicit and precoding can be considered the result of various conjugations and negations. The number of layers is defined as the number of transmit antennas with independent and nonrelated data. Since samples on different antennas essentially reflect the same modulated data, the number of layers in transmit diversity is equal to one.

Two Antenna Ports

When using two transmit antennas, transmit diversity in LTE is based on SFBC. SFBC is closely related to the more familiar STBC. Transmit diversity using STBC has been deployed in various 3GPP and WiMAX standards. We will now provide a short overview of the STBC and SFBC techniques and show how SFBC can be derived from STBC through a simple transformation.

STBC can be regarded as a multi-antenna modulation and mapping technique that provides full diversity and results in simple encoders and decoders. One of the simplest forms of STBC is an Alamouti code defined for a two-antenna transmission. In STBC with Alamouti code, as illustrated in Figure 6.5, pairs of modulated symbols c06-math-0041 are mapped on the first and second antenna ports in the initial sample time. In the following sample time, the symbols are swapped and conjugated c06-math-0042 and mapped to the first and second antenna ports. Note that the two consecutive vectors in time are orthogonal.

Figure 6.5 Space–time block coding: Alamouti code

c06f005

In SFBC, as illustrated in Figure 6.6, pairs of consecutive modulated symbols c06-math-0043 map directly on to consecutive samples in time on the first antenna port. On the second port, the swapped and transformed symbols c06-math-0044 are mapped consecutively in time such that the consecutive vectors on different antennas are orthogonal.

Figure 6.6 Space–frequency block coding

c06f006

We can produce the SFBC output symbols through a simple transformation followed by STBC using the Alamouti code. As illustrated in Figure 6.7, we first transform every second modulated symbol such that it is both negated and conjugated and then apply STBC with an Alamouti code. The result is the SFBC output for the pair of modulated inputs. This approach leverages the availability of efficient implementations for STBC and the Alamouti code and is considered advantageous as an example of software reuse.

Figure 6.7 SFBC as a combination of a transformation and STBC

c06f007

Four Antenna Ports

When using four transmit antennas, LTE combines SFBC with a Frequency-Switched Transmit Diversity (FSTD) technique. In this case, we perform transmit-diversity encoding on four consecutive modulated symbols at a time. First we apply SFBC to the first pair of modulated symbols c06-math-0045 and place the results in first two samples in time and on the first and third transmit antennas. Then we apply SFBC on the third and fourth modulated symbols c06-math-0046 and place the results in the third and fourth samples in time and on the second and fourth transmit antennas. Figure 6.8 illustrates the four-antenna transmit-diversity operations.

Figure 6.8 SFBC combined with Frequency-Switched Transmit Diversity (FSTD)

c06f008

6.7.1.2 Transmit-Diversity Encoder Function

The following MATLAB function implements the transmit-diversity encoder for both two- and four-antenna configurations. The function takes as inputs the signal composed of modulated symbols (in) and the number of transmit antennas (numTx). The function output (out) is a 2D matrix. The first dimension is equal to the number of modulated symbols; that is, the size of the first input signal (in). The second dimension is equal to the number of transmit antennas (numTx). Operations performed for the two- and four-antenna cases include the following. First we transform the input signal by replacing every even-numbered element with its negative conjugate value. If we have two transmit antennas, we then perform STBC with Alamouti code. For the case of four transmit antennas, we perform the FSTD, which selects pairs of samples from the input, applies STBC with Alamouti code to both pairs, and places the results in the outputbuffer, as described in the last section. Finally, we scale the result to compute the output signal.


Algorithm
MATLAB function
function out = TDEncode(in, numTx)
%   Both SFBC and SFBC with FSTD
persistent hTDEnc;
if isempty(hTDEnc)
    % Use same object for either scheme
    hTDEnc = comm.OSTBCEncoder('NumTransmitAntennas', 2);
end
switch numTx
    case 1
        out=in;
    case 2 % SFBC
        in((2:2:end).') = -conj(in((2:2:end).'));
        % STBC Alamouti
        y= step(hTDEnc, in);
        % Scale
        out = y/sqrt(2);
    case 4
        inLen=size(in,1);
        y = complex(zeros(inLen, 4));
        in((2:2:end).') = -conj(in((2:2:end).'));
        idx12 = ([1:4:inLen; 2:4:inLen]); idx12 = idx12(:);
        idx34 = ([3:4:inLen; 4:4:inLen]); idx34 = idx34(:);
        y(idx12, [1 3]) = step(hTDEnc, in(idx12));
        y(idx34, [2 4]) = step(hTDEnc, in(idx34));
        out = y/sqrt(2);
end

Note that in order to perform STBC with the Alamouti code we take advantage of the comm.OSTBCEncoder System object from the Communications System Toolbox. As we will show in Chapter 9, using this System object results in a more efficient implementation of the STBC operation.

6.7.1.3 Transmit-Diversity Receiver Operations

To find the best estimates of the transmitted modulated symbols, we must perform transmit-diversity combining at the receiver. Transmit-diversity combining can be regarded as the inverse of transmit-diversity encoding.

Let us consider a 2 × 2 MIMO channel. A MIMO system of linear equations computes the received signals c06-math-0047 at two receive antennas in each time index (n) as a function of the transmitted signals c06-math-0048 and the MIMO channel matrix c06-math-0049 in the same time:

6.7 c06-math-0050

In the next time index (n + 1), the equation is expressed as:

6.8 c06-math-0051

In both cases of two and four antennas, transmit-diversity encoding operations process pairs of consecutive modulated symbols. Let us consider a pair of consecutive received samples at the first receive antenna c06-math-0052 and develop transmit-diversity equations with the assumption that STBC with Alamouti code has been used in the MIMO transmitter. The results can then be repeated for any pair of received signals at any receive-antenna port. The equation for the pair of consecutive received samples in the first receive antenna is expressed as:

6.9 c06-math-0053

Recall that the transmit-diversity encoder applies STBC with Alamouti code to pairs of modulated inputs symbols c06-math-0054 and maps them into a 2 × 2 transmitted signal as:

6.10 c06-math-0055

As a result, the equation for the pair of received signal in a 2 × 2 transmit-diversity case can be expressed as:

6.11 c06-math-0056

Now, if we assume that the channel gains in two consecutive samples in time are similar to each other (i.e., c06-math-0057 and c06-math-0058) and fix the value of time index n (i.e., c06-math-0059 and c06-math-0060), we can further simply the equations as:

6.12 c06-math-0061

Conjugating both sides of the second equation can lead to further simplification:

6.13 c06-math-0062

By essentially inverting the matrix c06-math-0063, we can solve for the best estimates of the modulated transmitted symbols c06-math-0064 as a function of received symbols c06-math-0065.

6.14 c06-math-0066

This equation expresses an estimate of the transmitted symbols c06-math-0067 at a given receiver antenna. To compute the best overall estimate of the transmitted symbols, a MRC algorithm is used. The MRC algorithm combines all the estimates computed at various receivers, as described next.

At each receiver (denoted by index n), let us call the estimate c06-math-0068, the channel matrix, c06-math-0069 the received symbols c06-math-0070 and the norm (the energy estimate) of the channel matrix c06-math-0071.

The Equation 6.14 can then be re-written as

6.15 c06-math-0072

The MCR algorithm computes the overall estimate c06-math-0073 as a weighted sum of the individual estimates c06-math-0074 across N receive antennas, where 1 < n < N. Each individual estimate, at receiver n, is weighted by a gain factor c06-math-0075, that is

6.16 c06-math-0076

The gain factor is defined as the ratio of a given channel matrix norm c06-math-0077 over the sum of all channel matrix norms, that is

6.17 c06-math-0078

By combining Equations 6.156.17 and simplifying the formulation, we arrive at the maximum-ratio combing expression for the best overall estimate of the transmitted symbols:

6.18 c06-math-0079

The following MATLAB function implements transmit-diversity combining for the 2 × 2 Alamouti code. The function has two inputs: (i) the received symbols (u), with dimensions of (LEN, 2), and (ii) the estimated channel matrix, with dimensions of (LEN, 2, 2). The function subdivides the received symbols in consecutive pairs in time and at each receive antenna performs an ML combining estimate as outlined in this section.


Algorithm
MATLAB function
function s = Alamouti_Combiner1(u,H)
%#codegen
% STBC_DEC STBC Combiner
%   Outputs the recovered symbol vector
LEN=size(u,1);
Nr=size(u,2);
BlkSize=2;
NoBlks=LEN/BlkSize;
% Initialize outputs
h=complex(zeros(1,2));
s=complex(zeros(LEN,1));
% Alamouti code for 2 Tx
indexU=(1:BlkSize);
for m=1:NoBlks
    t_hat=complex(zeros(BlkSize,1));
    h_norm=0.0;
    for n=1:Nr
        h(:)=H(2*m-1,:,n);
        h_norm=h_norm+real(h*h');
        r=u(indexU,n);
        r(2)=conj(r(2));
        shat=[conj(h(1)), h(2); conj(h(2)), -h(1)]*r;
        t_hat=t_hat+shat;
    end
    s(indexU)=t_hat/h_norm; % Maximum-likelihood combining
    indexU=indexU+BlkSize;
end
end

This function is an explicit and descriptive formulation of ML combining for the 2 × 2 Alamouti code. However, the runtime performance of this function is not optimal. As we will see in Chapter 9, a vectorized MATLAB function performs much better in runtime. As a result, we will use the comm.OSTBCCombiner System object of the Communications System Toolbox, which is optimized for performance. The following MATLAB function uses the comm.OSTBCCombiner System object to implement transmit-diversity combining. It requires just six lines of MATLAB code to achieve the same functionality as the previous function.


Algorithm
MATLAB function
function s = Alamouti_CombinerS(u,H)
%#codegen
% STBC_DEC STBC Combiner
persistent hTDDec
if isempty(hTDDec)
    hTDDec= comm.OSTBCCombiner(
        'NumTransmitAntennas',2,'NumReceiveAntennas',2);
end
s = step(hTDDec, u, H);

6.7.1.4 Transmit-Diversity Combiner Function

The following MATLAB function implements the transmit-diversity combiner for both two- and four-antenna configurations. The function takes as inputs: (i) the 2D received signal (in), (ii) the 3D channel-estimate signal (chEst), (iii) the number of transmit antennas (numTx), and (iv) the number of receive antennas (numRx). The function output (y) is an ML estimate of the transmitted modulated symbols. The number of samples in the output vector (y) is equal to the number of transmitted modulated symbols (inLen); that is, the first dimension of input signals (in and chEst). The second dimension of input signals (in and chEst) is equal to the number of transmit antennas (numTx). The third dimension of the channel-estimate signal (chEst) is the number of receive antennas (numRx).

The operations performed for the two- and four-antenna cases are the inverse of those in transmit-diversity encoding. We first scale the input signal. If we have two transmit antennas, we then perform STBC combining. In the case of four transmit antennas, we perform FSTD combining. First we rerrange the 3D channel-estimate matrix (chEst) to form a new matrix (H) with dimensions equal to (inLen, 2, 4). Then we perform STBC combining on matrix H; that is, we repeat Alamouti code combining for transmit antennas (1, 3) and (2, 4) separately. Finally we replace every even-numbered element of the combiner output with its negative and conjugate value to return to SFBC and compute the output signal.


Algorithm
MATLAB function
function y = TDCombine(in, chEst, numTx, numRx)
% LTE transmit diversity combining
%   SFBC and SFBC with FSTD.
inLen = size(in, 1);
Index=(2:2:inLen)';
switch numTx
    case 1
        y=in;
    case 2   % For 2TX - SFBC
        in = sqrt(2) * in; % Scale
        y = Alamouti_CombinerS(in,chEst);
        % ST to SF transformation.
        % Apply blockwise correction for 2nd symbol combining
        y(Index) = -conj(y(Index));
    case 4   % For 4Tx - SFBC with FSTD
        in = sqrt(2) * in; % Scale
        H = complex(zeros(inLen, 2, numRx));
        idx12 = ([1:4:inLen; 2:4:inLen]); idx12 = idx12(:);
        idx34 = ([3:4:inLen; 4:4:inLen]); idx34 = idx34(:);
        H(idx12, :, :) = chEst(idx12, [1 3], :);
        H(idx34, :, :) = chEst(idx34, [2 4], :);
        y = Alamouti_CombinerS(in, H);
        % ST to SF transformation.
        % Apply blockwise correction for 2nd symbol combining
        y(Index) = -conj(y(Index));
end

6.7.2 Transceiver Setup Functions

Before we look at models of the various MIMO transmission modes, we will present in this section the testbench, initialization, and visualization functions. These types of function are common among all simulations and help verify the performance of each transceiver model.

6.7.2.1 Initialization Functions

The following initialization function (commlteMIMO_initialize) sets simulation parameters. This function is used for all MIMO modes, including transmit diversity and spatial multiplexing. The first input argument (txMode) determines which MIMO mode is used: a value of 2 signals a transmit-diversity mode, a value of 3 an open-loop spatial-multiplexing mode, and a value of 4 a closed-loop spatial-multiplexing mode. In order to set prmLTEPDSCH, prmLTEDLSCH, and prmMdl parameter structures, this function calls three functions: prmsPDSCH, prmsDLSCH, and prmsMdl, respectively.


Algorithm
MATLAB function
function [prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, 
    chEstOn, snrdB, maxNumErrs, maxNumBits)
% Create the parameter structures
% PDSCH parameters
CheckAntennaConfig(numTx, numRx);
prmLTEPDSCH = prmsPDSCH(txMode, chanBW, contReg, modType,numTx, numRx);
prmLTEPDSCH.Eqmode=Eqmode;
prmLTEPDSCH.modType=modType;
[SymbolMap, Constellation]=ModulatorDetail(modType);
prmLTEPDSCH.SymbolMap=SymbolMap;
prmLTEPDSCH.Constellation=Constellation;
% DLSCH parameters
prmLTEDLSCH = prmsDLSCH(cRate,maxIter, fullDecode, prmLTEPDSCH);
% Channel parameters
chanSRate   = prmLTEPDSCH.chanSRate;
 prmMdl = prmsMdl(chanSRate,  chanMdl, numTx, numRx, 
    corrLvl, chEstOn, snrdB, maxNumErrs, maxNumBits);

The functions prmsDLSCH and prmsMdl are unchanged from those described in this and the previous chapter. The function prmLTEPDSCH is however modified to handle all MIMO cases. Depending on the transmission mode, number of antennas, channel bandwidth, and modulation mode used, this function sets all necessary parameters for many functions in PDSCH processing.


Algorithm
MATLAB function
function p  = prmsPDSCH(txMode, chanBW, contReg, modType, numTx, numRx, numCodeWords)
%% PDSCH parameters
switch chanBW
    case 1      % 1.4 MHz
        BW = 1.4e6; N = 128; cpLen0 = 10; cpLenR = 9;
        Nrb = 6; chanSRate = 1.92e6;
    case 2      % 3 MHz
        BW = 3e6; N = 256; cpLen0 = 20; cpLenR = 18;
        Nrb = 15; chanSRate = 3.84e6;
    case 3      % 5 MHz
        BW = 5e6; N = 512; cpLen0 = 40; cpLenR = 36;
        Nrb = 25; chanSRate = 7.68e6;
    case 4      % 10 MHz
        BW = 10e6; N = 1024; cpLen0 = 80; cpLenR = 72;
        Nrb = 50; chanSRate = 15.36e6;
    case 5      % 15 MHz
        BW = 15e6; N = 1536; cpLen0 = 120; cpLenR = 108;
        Nrb = 75; chanSRate = 23.04e6;
    case 6      % 20 MHz
        BW = 20e6; N = 2048; cpLen0 = 160; cpLenR = 144;
        Nrb = 100; chanSRate = 30.72e6;
end
p.BW = BW;                  % Channel bandwidth
p.N = N;                    % NFFT
p.cpLen0 = cpLen0;          % Cyclic prefix length for 1st symbol
p.cpLenR = cpLenR;          % Cyclic prefix length for remaining
p.Nrb = Nrb;                % Number of resource blocks
p.chanSRate = chanSRate;    % Channel sampling rate
p.contReg = contReg;
switch txMode
    case 1 % SISO transmission
        p.numTx = numTx;
        p.numRx = numRx;
        numCSRRE_RB = 2*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
        p.numLayers = 1;
        p.numCodeWords = 1;
    case 2 % Transmit diversity
        p.numTx = numTx;
        p.numRx = numRx;
        switch numTx
            case 1
                numCSRRE_RB = 2*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
            case 2    % 2xnumRx
                % RE - resource element, RB - resource block
                numCSRRE_RB = 4*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
            case 4      % 4xnumRx
                numCSRRE_RB = 4*3*2; % CSR, RE per OFDMsym/slot/subframe per RB
        end
        p.numLayers = 1;
        p.numCodeWords = 1; % for transmit diversity
    case 3 % CDD Spatial multiplexing
        p.numTx = numTx;
        p.numRx = numRx;
        switch numTx
            case 1
                numCSRRE_RB = 2*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
            case 2      % 2x2
                % RE - resource element, RB - resource block
                numCSRRE_RB = 4*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
            case 4      % 4x4
                numCSRRE_RB = 4*3*2; % CSR, RE per OFDMsym/slot/subframe per RB
        end
        p.numLayers = min([p.numTx, p.numRx]);
        p.numCodeWords = 1; % for spatial multiplexing
    case 4 % Spatial multiplexing
        p.numTx = numTx;
        p.numRx = numRx;
        switch numTx
            case 1
                numCSRRE_RB = 2*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
            case 2      % 2x2
                % RE - resource element, RB - resource block
                numCSRRE_RB = 4*2*2; % CSR, RE per OFDMsym/slot/subframe per RB
            case 4      % 4x4
                numCSRRE_RB = 4*3*2; % CSR, RE per OFDMsym/slot/subframe per RB
        end
        p.numLayers = min([p.numTx, p.numRx]);
        p.numCodeWords = numCodeWords; % for spatial multiplexing
end
% For Normal cyclic prefix, FDD mode
p.deltaF = 15e3;    % subcarrier spacing
p.Nrb_sc = 12;      % no. of subcarriers per resource block
p.Ndl_symb = 7;     % no. of OFDM symbols in a slot
%% Modeling a subframe worth of data (=> 2 slots)
numResources = (p.Nrb*p.Nrb_sc)*(p.Ndl_symb*2);
numCSRRE = numCSRRE_RB * p.Nrb;               % CSR, RE per OFDMsym/slot/subframe per RB
% Actual PDSCH bits calculation - accounting for PDCCH, PBCH, PSS, SSS
switch p.numTx
    % numRE in control region - minus the CSR
    case 1
        numContRE = (10 + 12*(p.contReg-1))*p.Nrb;
        numBCHRE = 60+72+72+72; % removing the CSR present in 1st symbol
    case 2
        numContRE = (8 + 12*(p.contReg-1))*p.Nrb;
        numBCHRE = 48+72+72+72; % removing the CSR present in 1st symbol
    case 4
        numContRE = (8 + (p.contReg>1)*(8+ 12*(p.contReg-2)))*Nrb;
        numBCHRE = 48+48+72+72; % removing the CSR present in 1,2 symbol
end
numSSSRE=72;
numPSSRE=72;
numDataRE=zeros(3,1);
% Account for BCH, PSS, SSS and PDCCH for subframe 0
numDataRE(1)=numResources-numCSRRE-numContRE-numSSSRE - numPSSRE-numBCHRE;
% Account for PSS, SSS and PDCCH for subframe 5
numDataRE(2)=numResources-numCSRRE-numContRE-numSSSRE - numPSSRE;
% Account for PDCCH only in all other subframes
numDataRE(3)=numResources-numCSRRE-numContRE;
% Maximum data resources - with no extra overheads (only CSR + data)
p.numResources=numResources;
p.numCSRResources =  numCSRRE;
p.numDataResources = p.numResources - p.numCSRResources;
p.numContRE = numContRE;
p.numBCHRE = numBCHRE;
p.numSSSRE=numSSSRE;
p.numPSSRE=numPSSRE;
p.numDataRE=numDataRE;
% Modulation types , bits per symbol, number of layers per codeword
Qm = 2 * modType;
p.Qm = Qm;
p.numLayPerCW = p.numLayers/p.numCodeWords;
% Maximum data bits - with no extra overheads (only CSR + data)
p.numDataBits = p.numDataResources*Qm*p.numLayPerCW;
numPDSCHBits =numDataRE*Qm*p.numLayPerCW;
p.numPDSCHBits = numPDSCHBits;
p.maxG = max(numPDSCHBits);

The CheckAntennaConfig function is called within commlteMIMO_initialize. It ensures that a valid antenna configuration is selected for simulation. In this book we limit our antenna configurations to four single-antenna cases (1 × 1, 1 × 2, 1 × 3, and 1 × 4), one two-antenna configuration (2 × 2), and one four-antenna configuration (4 × 4).


Algorithm
MATLAB function
function CheckAntennaConfig(numTx, numRx)
MyConfig=[numTx,numRx];
Allowed=[1,1;1,2;1,3;1,4;2,2;4,4];
tmp=MyConfig(ones(size(Allowed,1),1),:);
err=sum(abs(tmp-Allowed),2);
if isempty(find(˜err,1))
    Status=0;
else
    Status=1;
end
if ˜Status
    disp('Wrong antenna configuration! Allowable configurations are:');
    disp(Allowed);
    error('Please change number of Tx and/or Rx antennas!');
end

The ModulatorDetail function is also called within commlteMIMO_initialize. Depending on the modulation mode, the function provides the constellation and symbol mapping used in the visualization function and in one of the MIMO receiver functions, known as the Sphere Decoder (SD).


Algorithm
MATLAB function
function [SymMap, Constellation]=ModulatorDetail(Mode)
%% Initialization
persistent QPSK QAM16 QAM64
if isempty(QPSK)
    QPSK          = comm.PSKModulator(4, 'BitInput', true, …
        'PhaseOffset', pi/4, 'SymbolMapping', 'Custom', 
        'CustomSymbolMapping', [0 2 3 1]); 
    QAM16      = comm.RectangularQAMModulator(16, 'BitInput',true,…
        'NormalizationMethod','Average power',
        'SymbolMapping', 'Custom', 
        'CustomSymbolMapping', [11 10 14 15 9 8 12 13 1 0 4 5 3 2 6 7]);
    QAM64      = comm.RectangularQAMModulator(64, 'BitInput',true,…
        'NormalizationMethod','Average power',
        'SymbolMapping', 'Custom', 
        'CustomSymbolMapping', [47 46 42 43 59 58 62 63 45 44 40 41 …
        57 56 60 61 37 36 32 33 49 48 52 53 39 38 34 35 51 50 54 55 7 
        6 2 3 19 18 22 23 5 4 0 1 17 16 20 21 13 12 8 9 25 24 28 29 15 
        14 10 11 27 26 30 31]);
end
%% Processing
switch Mode
    case 1
        Constellation=constellation(QPSK);
        SymMap = QPSK.CustomSymbolMapping;
    case 2
        Constellation=constellation(QAM16);
        SymMap = QAM16.CustomSymbolMapping;
    case 3
        Constellation=constellation(QAM64);
        SymMap = QAM64.CustomSymbolMapping;
    otherwise
        error('Invalid Modulation Mode. Use {1,2, or 3}');
end

6.7.2.2 Visualization Functions

In this chapter we have updated the zVisualize function, which enables us to directly observe the effects of fading on transmitted symbols before and after MIMO receiver processing.


Algorithm
MATLAB function
function zVisualize(prmLTE, txSig, rxSig, yRec, dataRx, csr, nS)
% Constellation Scopes & Spectral Analyzers
zVisConstell(prmLTE, yRec, dataRx, nS);
zVisSpectrum(prmLTE, txSig, rxSig, yRec, csr, nS);

The function performs two tasks. First, it shows the constellation diagram of the user data at the receiver before and after equalization by calling the function zVisConstell, which shows constellation diagrams for data transmitted over multiple transmit antennas. Depending on the number of transmit antennas used, it creates and configures multiple Constellation Diagram System objects from the Communications System Toolbox.


Algorithm
MATLAB function
function zVisConstell(prmLTE, yRec, dataRx, nS)
% Constellation Scopes
switch prmLTE.numTx
    case 1
        zVisConstell_1(prmLTE, yRec, dataRx, nS);
    case 2
        zVisConstell_2(prmLTE, yRec, dataRx, nS);
    case 4
        zVisConstell_4(prmLTE, yRec, dataRx, nS);
end
end
%% Case of numTx =1
function zVisConstell_1(prmLTE, yRec, dataRx, nS)
persistent h1 h2
if isempty(h1)
    h1 = comm.ConstellationDiagram('SymbolsToDisplay',…
        prmLTE.numDataResources, 'ReferenceConstellation', prmLTE.
Constellation,…
        'YLimits', [-2 2], 'XLimits', [-2 2], 'Position', 
        figposition([5 60 20 25]), 'Name', 'Before Equalizer');
    h2 = comm.ConstellationDiagram('SymbolsToDisplay',…
        prmLTE.numDataResources, 'ReferenceConstellation', prmLTE.
Constellation,…
        'YLimits', [-2 2], 'XLimits', [-2 2], 'Position', 
        figposition([6 61 20 25]), 'Name', 'After Equalizer');
end
% Update Constellation Scope
if  (nS˜=0 && nS˜=10)
    step(h1, dataRx(:,1));
    step(h2, yRec(:,1));
end
end
%% Case of numTx =2
function zVisConstell_2(prmLTE, yRec, dataRx, nS)
persistent h11 h21 h12 h22
if isempty(h11)
    h11 = comm.ConstellationDiagram('SymbolsToDisplay',…
        prmLTE.numDataResources, 'ReferenceConstellation', prmLTE.Constellation,…
        'YLimits', [-2 2], 'XLimits', [-2 2], 'Position', 
        figposition([5 60 20 25]), 'Name', 'Before Equalizer');
    h21 = comm.ConstellationDiagram('SymbolsToDisplay',…
        prmLTE.numDataResources, 'ReferenceConstellation', prmLTE.Constellation,…
        'YLimits', [-2 2], 'XLimits', [-2 2], 'Position', 
        figposition([6 61 20 25]), 'Name', 'After Equalizer');
    h12 = clone(h11);
    h22 = clone(h21);
end
yRecM = sqrt(2) *TDEncode( yRec, 2);
% Update Constellation Scope
if  (nS˜=0 && nS˜=10)
    step(h11, dataRx(:,1));
    step(h21, yRecM(:,1));
    step(h12, dataRx(:,2));
    step(h22, yRecM(:,2));
end
end
%% Case of numTx =4
function zVisConstell_4(prmLTE, yRec, dataRx, nS)
persistent ha1 hb1 ha2 hb2 ha3 hb3 ha4 hb4
if isempty(ha1)
    ha1 = comm.ConstellationDiagram('SymbolsToDisplay',…
        prmLTE.numDataResources, 'ReferenceConstellation', prmLTE.Constellation,…
        'YLimits', [-2 2], 'XLimits', [-2 2], 'Position', 
        figposition([5 60 20 25]), 'Name', 'Before Equalizer');
    hb1 = comm.ConstellationDiagram('SymbolsToDisplay',…
        prmLTE.numDataResources, 'ReferenceConstellation', prmLTE.Constellation,…
        'YLimits', [-2 2], 'XLimits', [-2 2], 'Position', 
        figposition([6 61 20 25]), 'Name', 'After Equalizer');
    ha2 = clone(ha1);
    hb2 = clone(hb1);
    ha3 = clone(ha1);
    hb3 = clone(hb1);
    ha4 = clone(ha1);
    hb4 = clone(hb1);
end
yRecM = sqrt(2) *TDEncode( yRec, 4);
% Update Constellation Scope
if  (nS˜=0 && nS˜=10)
    step(ha1, dataRx(:,1));
    step(hb1, yRecM(:,1));
    step(ha2, dataRx(:,2));
    step(hb2, yRecM(:,2));
    step(ha3, dataRx(:,3));
    step(hb3, yRecM(:,3));
    step(ha4, dataRx(:,4));
    step(hb4, yRecM(:,4));
end
end

Second, the zVisualize function illustrates the spectra of the transmitted signal and of the received signal both before and after equalization, by calling the function zVisSpectrum, which shows the magnitude spectrum of data transmitted over multiple transmit antennas. Depending on the number of transmit antennas used, it creates and configures multiple Spectrum Analyzer System objects from the DSP System Toolbox.


Algorithm
MATLAB function
function zVisSpectrum(prmLTE, txSig, rxSig, yRec, csr, nS)
% Spectral Analyzers
switch prmLTE.numTx
    case 1
        zVisSpectrum_1(prmLTE, txSig, rxSig, yRec, csr, nS);
    case 2
        zVisSpectrum_2(prmLTE, txSig, rxSig, yRec, csr, nS);
    case 4
        zVisSpectrum_4(prmLTE, txSig, rxSig, yRec, csr, nS);
end
end
%% Case of numTx = 1
function zVisSpectrum_1(prmLTE, txSig, rxSig, yRec, csr, nS)
persistent hSpecAnalyzer
if isempty(hSpecAnalyzer)
    hSpecAnalyzer = dsp.SpectrumAnalyzer('SampleRate',  prmLTE.chanSRate, 
        'SpectrumType', 'Power density', 'PowerUnits', 'dBW', 
        'RBWSource', 'Property',   'RBW', 15000,
        'FrequencySpan', 'Span and center frequency',
        'Span',  prmLTE.BW, 'CenterFrequency', 0,
        'FFTLengthSource', 'Property',   'FFTLength',  prmLTE.N,
        'Title', 'Transmitted & Received Signal Spectrum', 'YLimits', [-110 -60],
        'YLabel', 'PSD');
end
alamoutiRx = TDEncode(yRec, prmLTE.numTx);
yRecGrid = REmapper_mTx(alamoutiRx, csr, nS, prmLTE);
yRecGridSig = lteOFDMTx(yRecGrid, prmLTE);
step(hSpecAnalyzer, 
    [SymbSpec(txSig(:,1), prmLTE), SymbSpec(rxSig(:,1), prmLTE),
SymbSpec(yRecGridSig(:,1), prmLTE)]);
end
%% Case of numTx = 2
function zVisSpectrum_2(prmLTE, txSig, rxSig, yRec, csr, nS)
persistent hSpec1 hSpec2
if isempty(hSpec1)
    hSpec1 = dsp.SpectrumAnalyzer('SampleRate',  prmLTE.chanSRate, 
        'SpectrumType', 'Power density', 'PowerUnits', 'dBW', 
        'RBWSource', 'Property',   'RBW', 15000,
        'FrequencySpan', 'Span and center frequency',
        'Span',  prmLTE.BW, 'CenterFrequency', 0,
        'FFTLengthSource', 'Property',   'FFTLength',  prmLTE.N,
        'Title', 'Transmitted & Received Signal Spectrum', 'YLimits', [-110 -60],
        'YLabel', 'PSD');
    hSpec2 = clone(hSpec1);
end
alamoutiRx = TDEncode(yRec, prmLTE.numTx);
yRecGrid = REmapper_mTx(alamoutiRx, csr, nS, prmLTE);
yRecGridSig = lteOFDMTx(yRecGrid, prmLTE);
step(hSpec1, 
    [SymbSpec(txSig(:,1), prmLTE), SymbSpec(rxSig(:,1), prmLTE),
SymbSpec(yRecGridSig(:,1), prmLTE)]);
step(hSpec2, 
    [SymbSpec(txSig(:,2), prmLTE), SymbSpec(rxSig(:,2), prmLTE),
SymbSpec(yRecGridSig(:,2), prmLTE)]);
end
%% Case of numTx = 4
function zVisSpectrum_4(prmLTE, txSig, rxSig, yRec, csr, nS)
persistent hSpec1 hSpec2 hSpec3 hSpec4
if isempty(hSpec1)
    hSpec1 = dsp.SpectrumAnalyzer('SampleRate',  prmLTE.chanSRate, 
        'SpectrumType', 'Power density', 'PowerUnits', 'dBW', 
        'RBWSource', 'Property',   'RBW', 15000,
        'FrequencySpan', 'Span and center frequency',
        'Span',  prmLTE.BW, 'CenterFrequency', 0,
        'FFTLengthSource', 'Property',   'FFTLength',  prmLTE.N,
        'Title', 'Transmitted & Received Signal Spectrum', 'YLimits', [-110 -60],
        'YLabel', 'PSD');
    hSpec2 = clone(hSpec1);
    hSpec3 = clone(hSpec1);
    hSpec4 = clone(hSpec1);
end
alamoutiRx = TDEncode(yRec, prmLTE.numTx);
yRecGrid = REmapper_mTx(alamoutiRx, csr, nS, prmLTE);
yRecGridSig = lteOFDMTx(yRecGrid, prmLTE);
step(hSpec1, 
    [SymbSpec(txSig(:,1), prmLTE), SymbSpec(rxSig(:,1), prmLTE),
SymbSpec(yRecGridSig(:,1), prmLTE)]);
step(hSpec2, 
    [SymbSpec(txSig(:,2), prmLTE), SymbSpec(rxSig(:,2), prmLTE),
SymbSpec(yRecGridSig(:,2), prmLTE)]);
step(hSpec3, 
    [SymbSpec(txSig(:,3), prmLTE), SymbSpec(rxSig(:,3), prmLTE),
SymbSpec(yRecGridSig(:,3), prmLTE)]);
step(hSpec4, 
    [SymbSpec(txSig(:,4), prmLTE), SymbSpec(rxSig(:,4), prmLTE),
SymbSpec(yRecGridSig(:,4), prmLTE)]);
end
%% Helper function
function y = SymbSpec(in, prmLTE)
N = prmLTE.N;
cpLenR = prmLTE.cpLen0;
y = complex(zeros(N+cpLenR, 1));
% Use the first Tx/Rx antenna of the input for the display
y(:,1) = in(end-(N+cpLenR)+1:end, 1);
end

6.7.3 Downlink Transmission Mode 2

The following MATLAB function shows a transceiver model for transmit diversity mode 2 of the LTE standard. It includes both the two- and the four-transmit-antenna configurations. In essence, both the 2 × 2 and the 4 × 4 schemes specified by LTE are full-rate codes and both offer increased performance benefits, due to their diversity when compared to single-antenna transmissions. The key components highlighted in this example include:

  • Generation of payload data for a single subframe (a transport block).
  • DLSCH processing: Transport-block CRC (Cyclic Redundancy Check) attachment, codeblock segmentation and CRC attachment, turbo coding based on a ⅓-rate code, rate matching, and codeblock concatenation to generate a codeword input to PDSCH.
  • PDSCH transmitter processing: Bit-level scrambling, data modulation, layer mapping, and precoding for two and four antennas with transmit diversity encoding, plus resource-element mapping and OFDM signal generation.
  • Channel modeling: A MIMO fading channel followed by an AWGN channel.
  • PDSCH receiver processing: An OFDM signal receiver generating the resource grid, resource element demapping to separate the CSR signal from the user data, channel estimation, SFBC-based combining using channel estimates and soft-decision demodulation and descrambling, and DLSCH decoding.

Algorithm
MATLAB function
function [dataIn, dataOut, modOut, rxSig, dataRx, yRec, csr_ref]
    = commlteMIMO_TD_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl)
%% TX
%  Generate payload
dataIn = genPayload(nS,  prmLTEDLSCH.TBLenVec);
% Transport block CRC generation
tbCrcOut1 =CRCgenerator(dataIn);
% Channel coding includes - CB segmentation, turbo coding, rate matching,
% bit selection, CB concatenation - per codeword
[data, Kplus1, C1] = lteTbChannelCoding(tbCrcOut1, nS, prmLTEDLSCH, prmLTEPDSCH);
%Scramble codeword
scramOut = lteScramble(data, nS, 0, prmLTEPDSCH.maxG);
% Modulate
modOut = Modulator(scramOut, prmLTEPDSCH.modType);
% TD with SFBC
numTx=prmLTEPDSCH.numTx;
alamouti = TDEncode(modOut(:,1),numTx);
% Generate Cell-Specific Reference (CSR) signals
csr = CSRgenerator(nS, numTx);
csr_ref=complex(zeros(2*prmLTEPDSCH.Nrb, 4, numTx));
for m=1:numTx
    csr_ pre=csr(1:2*prmLTEPDSCH.Nrb,:,:,m);
    csr_ref(:,:,m)=reshape(csr_ pre,2*prmLTEPDSCH.Nrb,4);
end
% Resource grid filling
txGrid = REmapper_mTx(alamouti, csr_ref, nS, prmLTEPDSCH);
% OFDM transmitter
txSig = OFDMTx(txGrid, prmLTEPDSCH);
%% Channel : MIMO Fading channel
[rxFade, chPathG] = MIMOFadingChan(txSig, prmLTEPDSCH, prmMdl);
% Add AWG noise
nVar = 10.^(0.1.*(-snrdB));
rxSig =  AWGNChannel(rxFade, nVar);
%% RX
% OFDM Rx
rxGrid = OFDMRx(rxSig, prmLTEPDSCH);
% updated for numLayers -> numTx
[dataRx, csrRx, idx_data] = REdemapper_mTx(rxGrid, nS, prmLTEPDSCH);
% MIMO channel estimation
if prmMdl.chEstOn
    chEst = ChanEstimate_mTx(prmLTEPDSCH, csrRx,  csr_ref, prmMdl.chEstOn);
    hD     = ExtChResponse(chEst, idx_data, prmLTEPDSCH);
else
    idealChEst = IdChEst(prmLTEPDSCH, prmMdl, chPathG);
    hD =  ExtChResponse(idealChEst, idx_data, prmLTEPDSCH);
end
% Frequency-domain equalizer
if (numTx==1)
    % Based on Maximum-Combining Ratio (MCR)
    yRec = Equalizer_simo(dataRx, hD, nVar, prmLTEPDSCH.Eqmode);
else
    % Based on Transmit Diversity  with SFBC combiner
    yRec = TDCombine(dataRx, hD, prmLTEPDSCH.numTx, prmLTEPDSCH.numRx);
end
% Demodulate
demodOut = DemodulatorSoft(yRec, prmLTEPDSCH.modType, nVar);
% Descramble received codeword
rxCW =  lteDescramble(demodOut, nS, 0, prmLTEPDSCH.maxG);
% Channel decoding includes - CB segmentation, turbo decoding, rate dematching
[decTbData1, ˜,˜] = lteTbChannelDecoding(nS, rxCW, Kplus1, C1,  prmLTEDLSCH, prmLTEPDSCH);
% Transport block CRC detection
[dataOut, ˜] = CRCdetector(decTbData1);
end

6.7.3.1 Structure of the Transceiver Model

The following MATLAB script is the testbench that calls the MIMO transceiver function commlteMIMO. First it calls the initialization function (commlteMIMO_initialize) to set all relevant parameter structures (prmLTEDLSCH, prmLTEPDSCH, prmMdl). Then it uses a while loop to perform subframe processing by calling the MIMO transceiver function commlteMIMO_TD_step. Finally, it computes the BER and calls the visualization function to illustrate the channel response and modulation constellation before and after equalization.


Algorithm
MATLAB function
% Script for MIMO LTE (mode 2)
%
% Single codeword transmission only,
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, chEstOn, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter fullDecode chanMdl corrLvl chEstOn snrdB maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 2: Multiple Tx & Rx antrennas with transmit diversity');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
hPBer = comm.ErrorRate;
snrdB=prmMdl.snrdB;
maxNumErrs=prmMdl.maxNumErrs;
maxNumBits=prmMdl.maxNumBits;
%% Simulation loop
nS = 0; % Slot number, one of [0:2:18]
Measures = zeros(3,1); %initialize BER output
while (( Measures(2)< maxNumErrs) && (Measures(3) < maxNumBits))
   [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr] = 
       commlteMIMO_TD_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl);
    % Calculate  bit errors
    Measures = step(hPBer, dataIn, dataOut);
     % Visualize constellations and spectrum
    if visualsOn, zVisualize( prmLTEPDSCH, txSig, rxSig, yRec, dataRx, csr, nS);end;
    % Update subframe number
    nS = nS + 2; if nS > 19, nS = mod(nS, 20); end;
end
disp(Measures);

6.7.3.2 Verifying Transceiver Performance

By executing the MATLAB script of the MIMO transceiver model (commlteMIMO), we can look at various signals to assess the performance of the system. The parameters used in simulation are summarized in the following MATLAB script (commlteMIMO_ params). This set of parameters specifies a transceiver model using the transmit-diversity MIMO mode, with the number of transmit and receive antennas equal to two, a channel bandwidth of 10 MHz (with 1 OFDM symbol per subframe carrying the DCI), a 16QAM (Quadrature Amplitude Modulation) modulation type (with ⅓-rate turbo coding with early termination enabled), the maximum number of iterations set to 6), and a frequency-selective MIMO channel with a Doppler shift of 70 Hz (estimating channel response based on the interpolation method and using a transmit-diversity combiner as a MIMO receiver). In this simulation, 10 million bits of user data are processed, the SNR of the AWGN channel is set to 16 dB, and the visualization function is turned on.


Algorithm
MATLAB function
% PDSCH
txMode         = 2;   % Transmission mode one of {1, 2, 4}
numTx          = 2;    % Number of transmit antennas
numRx          = 2;    % Number of receive antennas
chanBW       = 4;    % Index to chanel bandwidth used [1,....6]
contReg       = 1;    % No. of OFDM symbols dedictaed to control information [1,…,3]
modType      =  2;   % Modulation type [1, 2, 3] for ['QPSK,'16QAM','64QAM']
% DLSCH
cRate            = 1/3; % Rate matching target coding rate
maxIter         = 6;     % Maximum number of turbo decoding terations
fullDecode    = 0;    % Whether "full" or "early stopping" turbo decoding is performed
% Channel model
chanMdl        =  'frequency-selective-high-mobility';
corrLvl           = 'Medium';
% Simulation parameters
Eqmode        = 2;      % Type of equalizer used [1,2] for ['ZF', 'MMSE']
chEstOn        = 1;     % One of [0,1,2,3] for 'Ideal estimator','Interpolation',Slot average','Subframe average'
snrdB            = 16;   % Signal to Noise ratio
maxNumErrs = 5e5; % Maximum number of errors found before simulation stops
maxNumBits = 5e5;  % Maximum number of bits processed before simulation stops
visualsOn     = 1;      % Whether to visualize channel response and constellations

Figure 6.9 shows the constellation diagrams before (first row) and after (second row) equalization of user data obtained from each of the two receive antennas in a subframe. It shows that the equalizer can compensate for the effect of a fading channel to result in a constellation that more closely resembles that of the 16QAM modulator.

Figure 6.9 LTE model: MIMO transmit-diversity constellation diagram of user data before and after equalization

c06f009

Figure 6.10 illustrates the spectra of user data obtained from each of the two receive antennas in a subframe. It shows the transmitted signal and the received signal before and after equalization. The received signal before equalization (showing the effects of frequency-selective fading) is effectively equalized by the transmit diversity (showing a more frequency-flat nature), which closely resembles the transmitted signal spectrum.

Figure 6.10 LTE MIMO transmit-diversity model: spectra of the transmitted signal and of the received signal before and after equalization

c06f010

6.7.3.3 BER Measurements

In order to verify the BER performance of the transceiver, we create a testbench called commlteMIMO_test_timing_ber. This testbench first initializes the LTE system parameters and then iterates through a range of SNR values and calls the commlteMIMO_ fcn function in the loop in order to compute the corresponding BER values.


Algorithm
MATLAB script: commlteMIMO_test_timing_ber
% Script for MIMO LTE (mode 2)
%
% Single codeword transmission only,
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
maxNumErrs=5e7;
maxNumBits=5e7;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, chEstOn, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter fullDecode chanMdl corrLvl chEstOn snrdB maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 2: Multiple Tx & Rx antrennas with transmit diversity');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
%%
MaxIter=8;
snr_vector=getSnrVector(prmLTEPDSCH.modType, MaxIter);
ber_vector=zeros(size(snr_vector));
tic;
for n=1:MaxIter
    fprintf(1,'Iteration %2d out of %2d:  Processing %10d bits. SNR = %3d
', 
        n, MaxIter, prmMdl.maxNumBits, snr_vector(n));
    [ber, ˜] = commlteMIMO_ fcn(snr_vector(n), prmLTEPDSCH, prmLTEDLSCH, prmMdl);
    ber_vector(n)=ber;
end;
toc;
semilogy(snr_vector, ber_vector);
title('BER - commlteMIMO TD');xlabel('SNR (dB)');ylabel('ber');grid;

Figure 6.11 shows the BER of the transceiver as a function of the SNR after processing of 50 million bits of user data in each of the eight iterations.

Figure 6.11 BER results: LTE mode 2, transmit diversity, 2 × 2 MIMO channel

c06f011

6.7.4 Spatial Multiplexing

Spatial multiplexing is a multiple-antenna technique that allows MIMO wireless systems to obtain high spectral efficiencies by dividing the bit stream into multiple substreams. Because these substreams are independently modulated, spatial multiplexing can accommodate higher data rates than comparable space–time or space–frequency block codes. However, this absence of redundancy in the transmitted signal makes spatial multiplexing susceptible to deficiencies in the rank of the matrix characterizing the MIMO equation. Channel-estimation inaccuracies when computing the MIMO channel matrix can severely limit performance gains. As a result, the LTE standard introduces various mechanisms, including adaptive precoding and layer mapping based on rank estimation, to make the implementation more robust in the presence of various channel impairments.

In this section we will discuss details regarding the spatial-multiplexing approach to MIMO transmission in the LTE standard. These include the way in which it implements precoding and layer mapping, whcih eventually lead to generation of OFDM signals for simultaneous transmission over multiple antennas. Finally, by examining the receiver operations, including various MIMO equalization methodologies, we will study the performance of the system under various conditions.

6.7.4.1 Motivation for Precoding

The spectral-efficiency benefits associated with MIMO processing hinge on the availability of a rich scattering environment. A MIMO channel with a high degree of scattering enables independent multipath links to be made from each transmit antenna to each receive antenna. As a result, the matrix of channel gains connecting each pair of transmit and receive antennas pairs will have a full rank and the resulting MIMO equation will be solvable.

In a typical MIMO transmission, however, the assumption regarding a high level of scattering cannot be guaranteed. As a result, in order to design a practical system, steps must be taken to reduce the probability of channel matrices with reduced ranks occuring. Precoding is one of the most effective approaches taken by the LTE standard to combating the rank-deficiency problem. In this section we will elaborate on the nature of channel-matrix rank deficiencies, introduce a precoding formulation, provide a beamforming interpretation for precoding, and introduce different types of precoding used in the LTE standard. Then we will show the MATLAB functions that efficiently implement these operations.

6.7.4.2 Rank-Deficiency Problem

Spatial multiplexing solves the following system of linear equations, which expresses the received signal (Y) as a modified version of the transmitted signal (X) transformed linearly by the MIMO channel matrix (H) plus an added white noise (n):

6.19 c06-math-0080

For example, for a 4 × 4 MIMO configuration the received vector c06-math-0081 can be expressed as follows:

6.20 c06-math-0082

When the paths connecting transmit antennas to receive antennas become similar, multiple rows or columns of the channel matrix H can become linearly dependent; for example, in the following matrix the first two rows are identical.

6.21 c06-math-0083

In this scenario, the rank of the channel matrix (the number of linearly independent equations) is three, whereas the dimension of the matrix is four. This system of linear equations is singular and has no inverses. As a result, the MIMO system of equation represented by this type of linearly dependent matrix cannot be uniquely solved.

6.7.4.3 Formulation of Precoding

Precoding techniques have been developed to solve the problem of rank deficiency. The optimal precoder can be determined by exploiting the singular-value decomposition of the channel matrix. Singular-value decomposition expresses the channel matrix as:

6.22 c06-math-0084

where V is a square matrix whose size is equal to the rank of the channel matrix, D is a diagonal matrix with diagonal elements composed of singular values of the channel matrix, and U is a square matrix whose size is equal to the number of receiver antennas. As developed in References 4 and 5, one of the theoretically optimal precoders can be defined as a column-permuted version of matrix V. This precoder operates only on transmitter antennas with sufficient rank and guarantees that the resulting MIMO equation can be solved.

Such an optimal precoder cannot be practically implemented, since it requires complete knowledge of the channel matrix at the transmitter. As the channel matrix can only be estimated at the receiver, communicating this information to the transmitter would require an excessive amount of bandwidth. The LTE chooses a more practical approach, based on choosing among a finite set of predetermined precoding matrices. Through a process similar to vector quantization, we can choose the best precoder at both the transmitter and the receiver.

At the transmitter, precoding performs a matrix multiplication on modulated symbols after layer mapping. As a result, the MIMO equation with the precoder is expressed as:

6.23 c06-math-0085

where V is the precoding matrix. At the receiver, following the MIMO receiver operations, we apply the received signal with the inverse of the same precoding matrix V as used in the transmitter. LTE defines the precoding matrices as Hermitian matrices, which means that the precoder matrix is composed of a set of orthonormal vectors. This implies that the inverse of a precoder matrix is simply equal to its Hermitian transpose. It also results in efficient implementation of precoding, since transposing a matrix is much less computationally expensive than performing a matrix inversion.

6.7.4.4 Precoder-Matrix Codebooks

The finite sets of precoder matrices used in the LTE standard are known as the precoder codebook. Table 6.3 shows the precoder codebooks for two transmit antennas.

Table 6.3 Precoding matrices for two transmit antennas in LTE spatial multiplexing

Codebook index Number of layers
1 2
0 c06-math-0086 c06-math-0087
1 c06-math-0088 c06-math-0089
2 c06-math-0090 c06-math-0091
3 c06-math-0092

The precoding operation essentially spreads the input signal and reduces the probability of error by combating rank-deficiency problems. The efficacy of precoding in reducing the probability of rank deficiencies can be explained by interpreting the precoder matrix columns as beamforming vectors. In the case of single-layer transmission, for example, choosing each codebook index results in a multiplication of the transmitted signal X with different beamforming vectors. This multiplication is essentially a transformation that rotates the transmitted signal in various directions. Since precoder vectors are orthonormal, the direction of rotation results in phase differences of c06-math-0093. Large phase differences make it more likely that different streams will take different multipath trajectories before arriving at any receive antenna. This in turn reduces the possibility of channel matrices with linearly dependent rows or columns occurring and increases the chance of there being full-rank channel matrices.

The same interpretation applies to the two-antenna and four-antenna precoder matrices. For example, in the case of two transmit antennas, when we multiply the two modulated substreams by any of the precoder matrices, c06-math-0094 for example, each substream is steered like a beamformer by each of the precoder matrix column vectors. Since these vectors are orthonormal, they can represent rotation operations in different N-dimensional directions 6. When viewed as a beamformer, precoding enhances the chance of the transmitted streams following different multipaths, since it can force each substream to take different directions, as specified by the angle of rotation. This explains why spatial-multiplexing systems that use precoding have been shown to provide dramatic performance gains over unprecoded systems.

6.7.4.5 Types of Precoding

Precoding can be performed within an open- or a closed-loop MIMO processing context. Open-loop precoding is used in the third MIMO transmission mode and closed-loop precoding in the fourth. In open-loop precoding, the transmitter and receiver use a predefined set of precoding matrix indices and periodically rotate through them without any need for codebook index transmission. Precoding with closed-loop feedback prompts the receiver to choose the precoder matrix from a finite codebook and then to convey the selected matrix to the transmitter using a limited number of bits. Precoder-matrix codebook selection and closed-loop precoder-matrix feedback are discussed in Chapter 7.

6.7.5 MIMO Operations in Spatial Multiplexing

Among the nine modes of transmissions in the LTE standard, six are based on spatial multiplexing. In spatial multiplexing, layer mapping and precoding are distinct and explicit operations. As the samples on each transmit antenna are independent of each other, the original modulated stream will be mapped to various substreams to be transmitted on each transmit antenna. Since different samples are transmitted on different antennas, spatial multiplexing has the potential to boost data rates in proportion to the number of transmit antennas. The MIMO receiver operation is performed at the receiver to recover the best estimate of the modulated symbols from the received signal. The estimation processes featured in this book are based on the following three algorithms: Zero Forcing (ZF), Minimum Mean Square Error (MMSE), and Sphere Decoder (SD). Next, we will discuss in detail layer mapping, precoding, and MIMO receiver operations.

6.7.5.1 Layer Mapping

Layer mapping divides a single data stream into substreams destined for different antennas. The following MATLAB function shows how the modulated data stream from one or two codewords is mapped to layers (antenna ports) defined by the LTE standard. At this stage we assume a full rank transmission. As a result, the number of layers is equal to the number of transmit antennas. This function takes as input the modulated streams of the first (in1) and second (in2) codewords and the parameter structure of the PDSCH (prmLTEPDSCH). Depending on the number of codewords and the number of layers, the function reorganizes the input symbol stream to generate the output signal (out). The output signal is a 2D matrix whose second dimension is equal to the number of layers.


Algorithm
MATLAB function
function out = LayerMapper(in1, in2, prmLTEPDSCH)
% Layer mapper for spatial multiplexing.
%
%#codegen
% Assumes the incoming codewords are of the same length.
q = prmLTEPDSCH.numCodeWords;           % Number of codewords
v = prmLTEPDSCH.numLayers;              % Number of layers
inLen1 = size(in1, 1);
inLen2 = size(in2, 1);
switch q
    case 1  % Single codeword
        % for numLayers = 1,2,3,4
        out = reshape(in1, v, inLen1/v).';
    case 2  % Two codewords
        switch v
            case 2
                out = complex(zeros(inLen1, v));
                out(:,1) = in1;
                out(:,2) = in2;
            case 4
                out = complex(zeros(inLen1/2, v));
                out(:,1:2) = reshape(in1, 2, inLen1/2).';
                out(:,3:4) = reshape(in2, 2, inLen2/2).';
            case 6
                out = complex(zeros(inLen1/3, v));
                out(:,1:3) = reshape(in1, 3, inLen1/3).';
                out(:,4:6) = reshape(in2, 3, inLen2/3).';
            case 8
                out = complex(zeros(inLen1/4, v));
                out(:,1:4) = reshape(in1, 4, inLen1/4).';
                out(:,5:8) = reshape(in2, 4, inLen2/4).';
            otherwise
                assert(false, 'This mode is not implemented yet.');
        end
end

6.7.5.2 Precoding

Precoding performs linear transformations on the data of each substream to improve the overall receiver performance. The following MATLAB function shows how the multi-antenna data substreams that follow layer mapping are precoded prior to resource element mapping and generation of the resource grid. The function takes as input the modulated symbols organized in layers (in), the precoder matrix index (cbIdx), and the PDSCH parameter structure (prmLTEPDSCH). First we compute the orthonormal precoder matrix (Wn) by calling the SpatialMuxPrecoder function. Then we compute the precoded output (out) by multiplying the precoder matrix with vectors of input, selected by taking samples from all transmit antennas at a given sample time.


Algorithm
MATLAB function
function [out, Wn] = SpatialMuxPrecoder(in, prmLTEPDSCH, cbIdx)
% Precoder for PDSCH spatial multiplexing
%#codegen
% Assumes the incoming codewords are of the same length
v = prmLTEPDSCH.numLayers;              % Number of layers
numTx = prmLTEPDSCH.numTx;              % Number of Tx antennas
% Compute the precoding matrix 
Wn = PrecoderMatrix(cbIdx, numTx, v);
% Initialize the output
out = complex(zeros(size(in)));
inLen = size(in, 1);
% Apply the relevant precoding matrix to the symbol over all layers
for n = 1:inLen
    temp = Wn * (in(n, :).');
    out(n, :) = temp.';
end

The PrecoderMatrix function computes the precoder matrix (Wn) from the values stored in a codebook. The codebook values are defined in 7. The function takes as input the precoder index (cbIdx), the number of transmit antennas (numTx), and the number of layers (v). Regardless of whether an open- or a closed-loop precoding technique is used, at each subframe a common codebook index is selected at both the transmitter and the receiver. In this chapter, we choose a constant value of 1 as our codebook index. For a two-transmit-antenna configuration, valid values for the codebook index are from 0 to 3, and for a four-antenna configuration, from 0 to 15. Note that for a two-antenna transmission in which the number of layers is also two, only codebook indices of 1 and 2 are valid. Note also that for a four-antenna configuration, the precoder matrix is computed from 1 × 4 codebook vectors and a matrix operation that results in an orthonormal precoder matrix for any given index.


Algorithm
MATLAB function
function Wn = PrecoderMatrix(cbIdx, numTx, v)
% LTE Precoder for PDSCH spatial multiplexing.
%#codegen
%  v           = Number of layers
%  numTx  = Number of Tx antennas
switch numTx
    case 2
        Wn = complex(ones(numTx, v));
        switch v
            case 1
                a=(1/sqrt(2));
                codebook = [a,a; a,-a; a, 1j*a; a, -1j*a];
                Wn = codebook(cbIdx+1,:);
            case 2
                if cbIdx==1
                    Wn = (1/2)*[1 1; 1 -1];
                elseif cdIdx==2
                    Wn = (1/2)*[1 1; 1j -1j];
                else
                    error('Not used. Please try with a different index.');
                end
        end
    case 4
        un = complex(ones(numTx, 1));
        switch cbIdx
            case 0,   un = [1 -1 -1 -1].';
            case 1,   un = [1 -1j 1 1j].';
            case 2,   un = [1 1 -1 1].';
            case 3,   un = [1 1j 1 -1j].';
            case 4,   un = [1 (-1-1j)/sqrt(2) -1j (1-1j)/sqrt(2)].';
            case 5,   un = [1 (1-1j)/sqrt(2) 1j (-1-1j)/sqrt(2)].';
            case 6,   un = [1 (1+1j)/sqrt(2) -1j (-1+1j)/sqrt(2)].';
            case 7,   un = [1 (-1+1j)/sqrt(2) 1j (1+1j)/sqrt(2)].';
            case 8,   un = [1 -1 1 1].';
            case 9,   un = [1 -1j -1 -1j].';
            case 10, un = [1 1 1 -1].';
            case 11, un = [1 1j -1 1j].';
            case 12, un = [1 -1 -1 1].';
            case 13, un = [1 -1 1 -1].';
            case 14, un = [1 1 -1 -1].';
            case 15, un = [1 1 1 1].';
        end
        Wn = eye(4) - 2*(un*un')./(un'*un);
        switch cbIdx    % order columns, for numLayers=4 only
            case {2, 3, 14}
                Wn = Wn(:, [3 2 1 4]);
            case {6, 7, 10, 11, 13}
                Wn = Wn(:, [1 3 2 4]);
        end
        Wn = Wn./sqrt(v);
end

6.7.5.3 MIMO Receiver

The MIMO receiver inverts the combination of precoding and MIMO channel operations to recover the best estimate of the modulated symbols. As a result of the MIMO channel modeling, at each time index n the vector of received signals c06-math-0095 can be modeled as a linear combination of transmitted signals from transmit antennas c06-math-0096 scaled by the channel matrix c06-math-0097, with an added vector of white Gaussian noise c06-math-0098. In this book we will model the channel matrices only as 2 × 2 or 4 × 4 square matrices in order to simplify the discussion. The results can be easily generalized to non-square matrices where matrix inverse operations can be replaced by pseudo-inverse operations.

For example, for a 4 × 4 MIMO configuration, in any subframe and at any point in time, the received vector c06-math-0099 can be expressed as:

6.24 c06-math-0100

The objective of the MIMO receiver operation is to solve for best estimates of the modulated transmitted symbols c06-math-0101 as a function of received symbols c06-math-0102. Since the AWGN is a stochastic process, actual values of the noise vector c06-math-0103 are not exactly known. We can only estimate the noise variance in each receive antenna. As a result, the effect of the AWGN is already included in the received vector.

Defining the received signal as follows, c06-math-0104, we can rewrite Equation 6.24 as:

6.25 c06-math-0105

In this section we present the three most popular methods of MIMO equalizer design, which produce the best estimate of the modulated transmitted symbols c06-math-0106:

  • ZF equalizer: We apply the inverse of the channel matrix c06-math-0107 to both sides of the equation. As we will see shortly, ZF equalizers can augment the effect of uncorrelated noise on the equalization process, especially in a low-SNR transmission environment.
  • MMSE equalizer: We minimize the mean square error between the transmitted vector c06-math-0108 and its estimate c06-math-0109. This approach takes into account the effect of AWGN and offsets the inverse matrix with the noise variance. MMSE equalizers have been shown to outperform ZF equalizers in terms of reconstruction error.
  • SD equalizer: Our objective to find the Maximum-Likelihood solution for Equation 6.25. The SD algorithm needs to know the modulation scheme used on all of the transmit antennas. It combines MIMO equalization and soft-decision demodulation and maximizes the a posteriori probability measure to output the Log-Likelihood Ratios (LLRs) of the transmitted bits most likely to be involved in generating the received signal c06-math-0110 at each sample time.

The following function implements the MIMO receiver operation, taking as input the received signal (in), the channel matrix (chEst), the PDSCH parameter structure (prmLTE), the noise-variance vector (nVar), and the precoder matrix (Wn). Depending on the equalization mode specified (prmLTE.Eqmode), either of the functions implementing a ZF, MMSE, or SD receiver can be called to generate the output signal (y).

We will now discuss each of the equalizer methodologies. Each provides a unique way of inverting layer mapping, precoding, and MIMO channel operations. The ZF and MMSE techniques help arrive at an estimate of the transmitted modulated symbols. In the case of SD, the output is not actually an estimate of the modulated symbols but rather of the bits that if modulated would generate the symbols.


Algorithm
MATLAB function
function y = MIMOReceiver(in, chEst, prmLTE, nVar, Wn)
%#codegen
switch prmLTE.Eqmode
    case 1 % ZF receiver
        y = MIMOReceiver_ZF(in, chEst, Wn);
    case 2 % MMSE receiver
       y = MIMOReceiver_MMSE(in, chEst, nVar, Wn);
    case 3 % Sphere Decoder
        y = MIMOReceiver_SphereDecoder(in, chEst, prmLTE, nVar, Wn);
    otherwise
        error('Function MIMOReceiver: ZF, MMSE, Sphere decoder are only supported MIMO detectors');
end

ZF Receiver

The following MATLAB function shows a MIMO receiver that employs a ZF receiver to undo the effects of the MIMO channel and combat the interference from multi-antenna transmission. The function takes as input the received signal (in), the 2D channel matrix (chEst), and the precoder matrix used in this subframe (Wn). The function generates as its output (y) the estimated modulated symbols in this subframe based on the ZF equalization method. In a ZF approach, we simply invert the channel matrix and multiply the received signal by the inverse matrix. Since the vector of transmitted signals is also subject to precoding in the transmitter, in the MIMO receiver we need to multiply the equalized vector by the inverse of the precoder matrix.


Algorithm
MATLAB function
function y = MIMOReceiver_ZF(in, chEst, Wn)
%#codegen
% MIMO Receiver:
%   Based on received channel estimates, process the data elements
%   to equalize the MIMO channel. Uses the ZF detector.
% Get params
numData = size(in, 1);
y = complex(zeros(size(in)));
iWn = inv(Wn);
%% ZF receiver
for n = 1:numData
    h = squeeze(chEst(n, :, :)); % numTx x numRx
    h = h.';                     % numRx x numTx
    Q = inv(h);
    x = Q * in(n, :).';%#ok
    tmp = iWn * x; %#ok
    y(n, :) = tmp.';
end

MMSE Receiver

The objective of the MMSE equalizer is to minimize the power of the error signal c06-math-0111, defined as the difference between the equalized signal c06-math-0112 and the original transmitted modulated signal c06-math-0113. Let us define G as the optimum equalizer that transforms the received signal c06-math-0114 into the equalized signal. The error signal can then be expressed as:

6.26 c06-math-0115

Now, combining this expression with the definition of the received signal c06-math-0116 as the transformed version of the transmitted signal c06-math-0117 by the MIMO channel matrix H:

6.27 c06-math-0118

Assuming square matrices for both the channel matrix H and the equalizer matrix G, we obtain the following expression for the error signal:

6.28 c06-math-0119

Modeling this expression as a Wiener filtering problem that minimizes the expected value of the error signal, we find the MMSE optimal equalizer to be:

6.29 c06-math-0120

where c06-math-0121 represents the Hermitian of the channel matrix c06-math-0122, c06-math-0123 represents the channel noise variance, and c06-math-0124 represents the identity matrix of the same size as the number of transmit antennas.

The following MATLAB function shows a MIMO receiver based on an MMSE equalizer. The function takes as input the received signal (in), the 2D channel matrix (chEst), and the precoder matrix used in this subframe (Wn). The function generates as its output (y) the estimated modulated symbols in this subframe based on the MMSE equalization method. For each vector of received signal at sample time n, we compute the equalizer matrix (Q) based on the optimal MMSE equalizer formula and multiply the received vector by the equalizer matrix. To undo the precoding operation, we also need to multiply the equalized vector by the inverse of the precoder matrix.


Algorithm
MATLAB function
function y = MIMOReceiver_MMSE(in, chEst, nVar, Wn)
%#codegen
% MIMO Receiver:
%   Based on received channel estimates, process the data elements
%   to equalize the MIMO channel. Uses the MMSE detector.
% Get params
numLayers = size(Wn,1);
% noisFac = numLayers*diag(nVar);
noisFac = diag(nVar);
numData = size(in, 1);
y = complex(zeros(size(in)));
iWn = inv(Wn);
%% MMSE receiver
for n = 1:numData
    h = chEst(n, :, :);                         % numTx x numRx
    h = reshape(h(:), numLayers, numLayers).';  % numRx x numTx
    Q = (h'*h + noisFac)h';
    x = Q * in(n, :).';
    tmp = iWn * x;
    y(n, :) = tmp.';
end

SD Receiver

In SD, the objective is to find the ML solution for the MIMO equation. Given the MIMO channel modeling equation at a given time sample:

6.30 c06-math-0125

the SD finds the ML estimate for the transmitted modulated symbols c06-math-0126, such that:

6.31 c06-math-0127

where c06-math-0128 and c06-math-0129 is the complex-valued constellation from which the elements of c06-math-0130 are chosen. The SD algorithm makes use of knowledge concerning the modulation scheme and the actual constellation and symbol mapping used in the modulator. It combines MIMO equalization and soft-decision demodulation and maximizes the a posteriori probability measure to produce its output. The output of an SD is the LLRs of the transmitted bits most likely to be involved in generation of the received signal. The comm.SphereDecoder System object of the Communications System Toolbox implements an SD algorithm. The ML receiver used in the System object is implemented in a reduced-complexity form by means of a Soft Sphere Decoder (SSD).

The following MATLAB function shows a MIMO receiver implemented with an SD. The function takes as input the received signal (in), the 3D channel matrix (chEst), the PDSCH parameter structure (prmLTE), the noise variance vector (nVar), and the precoder matrix used in this subframe (Wn). It generates as its output (y) the estimated modulated symbols in this subframe based on the Sphere Decoder (SD) equalization method. First, we transform the channel matrices of each sample time by the inverse of the precoder matrix. Then , we use the comm.SphereDecoder System object to implement maximum-likelihood (ML) Sphere Decoding operation.


Algorithm
MATLAB function
function [y, bittable] = MIMOReceiver_SphereDecoder(in, chEst, prmLTE, nVar, Wn)
%#codegen
% MIMO Receiver:
%   Based on received channel estimates, process the data elements
%   to equalize the MIMO channel. Uses the Sphere detector.
% Soft-Sphere Decoder
symMap=prmLTE.SymbolMap;
numBits=prmLTE.Qm;
constell=prmLTE.Constellation;
bittable = de2bi(symMap, numBits, 'left-msb');
iWn=Wn.';
nVar1=(-1/mean(nVar));
persistent SphereDec
if isempty(SphereDec)
    % Soft-Sphere Decoder
    SphereDec = comm.SphereDecoder('Constellation', constell,
        'BitTable', bittable, 'DecisionType', 'Soft');
end
% SSD receiver
temp = complex(zeros(size(chEst)));
% Account for precoding
for n = 1:size(chEst,1)
    temp(n, :, :) = iWn * squeeze(chEst(n, :, :));
end
hD = temp;
y = nVar1 * step(SphereDec, in, hD);

6.7.6 Downlink Transmission Mode 4

In this section, we will focus on what is in my view one of the most innovative MIMO modes in the LTE standard, responsible for its highest data rates: mode 4. This mode employs spatial multiplexing with precoding and closed-loop channel feedback. In low-mobility scenarios, a closed-loop feedback of the channel quality can lead to performance improvements. We will actually perform the closed-loop feedback operations in the receiver in Chapter 7. In this chapter, we use a constant precoder matrix index as a stepping stone to implementation of the closed-loop adaptive precoding featured in the next chapter.

We will build two variants of this mode:

1. Single-codeword case: Only one codeword is generated at the DLSCH and processed by the PDSCH.
2. Two-codeword case: Two distinct codewords are generated at the DLSCH and multiplexed by the layer-mapping operation for precoding, resource-element mapping, and eventual OFDM transmission.

6.7.6.1 Single-Codeword Case

The following MATLAB function shows a transmitter, receiver, and channel model for the fourth mode of the LTE standard, featuring single-codeword spatial multiplexing. Using multiple antennas at both the transmitter and the receiver, we showcase both 2 × 2 and 4 × 4 MIMO antenna configurations. The key components highlighted in the example include the following:

  • Generation of payload data for a single subframe (a transport block)
  • DLSCH processing, as described earlier
  • PDSCH transmitter processing, including bit-level scrambling, data modulation, layer mapping, and precoding for two or four antennas, as well as precoding for spatial multiplexing, resource-element mapping, and OFDM signal generation
  • Channel modeling, including a MIMO fading channel followed by an AWGN channel
  • PDSCH receiver processing, including an OFDM signal receiver to generate the resource grid, resource-element demapping to separate the CSR signal from the user data, channel estimation, MIMO receiver and layer demapping, soft-decision demodulation, descrambling, and DLSCH decoding.

Algorithm
MATLAB script
function [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr_ref]
    = commlteMIMO_SM_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl)
%% TX
persistent hPBer1
if isempty(hPBer1), hPBer1=comm.ErrorRate; end;
%  Generate payload
dataIn = genPayload(nS,  prmLTEDLSCH.TBLenVec);
% Transport block CRC generation
tbCrcOut1 =CRCgenerator(dataIn);
% Channel coding includes - CB segmentation, turbo coding, rate matching,
% bit selection, CB concatenation - per codeword
[data, Kplus1, C1] = lteTbChannelCoding(tbCrcOut1, nS, prmLTEDLSCH, prmLTEPDSCH);
%Scramble codeword
scramOut = lteScramble(data, nS, 0, prmLTEPDSCH.maxG);
% Modulate
modOut = Modulator(scramOut, prmLTEPDSCH.modType);
% Map modulated symbols  to layers
numTx=prmLTEPDSCH.numTx;
LayerMapOut = LayerMapper(modOut, [], prmLTEPDSCH);
usedCbIdx = prmMdl.cbIdx;
% Precoding
[PrecodeOut, Wn] = lteSpatialMuxPrecoder(LayerMapOut, prmLTEPDSCH, usedCbIdx);
% Generate Cell-Specific Reference (CSR) signals
csr = CSRgenerator(nS, numTx);
csr_ref=complex(zeros(2*prmLTEPDSCH.Nrb, 4, numTx));
for m=1:numTx
    csr_ pre=csr(1:2*prmLTEPDSCH.Nrb,:,:,m);
    csr_ref(:,:,m)=reshape(csr_ pre,2*prmLTEPDSCH.Nrb,4);
end
% Resource grid filling
txGrid = REmapper_mTx(PrecodeOut, csr_ref, nS, prmLTEPDSCH);
% OFDM transmitter
txSig = OFDMTx(txGrid, prmLTEPDSCH);
%% Channel
% MIMO Fading channel
[rxFade, chPathG] = MIMOFadingChan(txSig, prmLTEPDSCH, prmMdl);
% Add AWG noise
sigPow = 10*log10(var(rxFade));
nVar = 10.^(0.1.*(sigPow-snrdB));
rxSig =  AWGNChannel(rxFade, nVar);
%% RX
% OFDM Rx
rxGrid = OFDMRx(rxSig, prmLTEPDSCH);
% updated for numLayers -> numTx
[dataRx, csrRx, idx_data] = REdemapper_mTx(rxGrid, nS, prmLTEPDSCH);
% MIMO channel estimation
if prmMdl.chEstOn
    chEst = ChanEstimate_mTx(prmLTEPDSCH, csrRx,  csr_ref, prmMdl.chEstOn);
    hD     = ExtChResponse(chEst, idx_data, prmLTEPDSCH);
else
    idealChEst = IdChEst(prmLTEPDSCH, prmMdl, chPathG);
    hD =  ExtChResponse(idealChEst, idx_data, prmLTEPDSCH);
end
% Frequency-domain equalizer
if (numTx==1)
    % Based on Maximum-Combining Ratio (MCR)
    yRec = Equalizer_simo(dataRx, hD, nVar, prmLTEPDSCH.Eqmode);
else
    % Based on Spatial Multiplexing
    yRec = MIMOReceiver(dataRx, hD, prmLTEPDSCH, nVar, Wn);
end
% Demap received codeword(s)
[cwOut, ˜] = LayerDemapper(yRec, prmLTEPDSCH);
if prmLTEPDSCH.Eqmode < 3
    % Demodulate
    demodOut = DemodulatorSoft(cwOut, prmLTEPDSCH.modType, mean(nVar));
else
    demodOut = cwOut;
end
    % Descramble received codeword
    rxCW =  lteDescramble(demodOut, nS, 0, prmLTEPDSCH.maxG);
% Channel decoding includes - CB segmentation, turbo decoding, rate dematching
[decTbData1, ˜,˜] = lteTbChannelDecoding(nS, rxCW, Kplus1, C1,  prmLTEDLSCH, prmLTEPDSCH);
% Transport block CRC detection
[dataOut, ˜] = CRCdetector(decTbData1);
end

Structure of the Transceiver Model

The following MATLAB script is the testbench that calls the MIMO transceiver function commlteMIMO. First it calls the initialization function (commlteMIMO_initialize) to set all relevant parameter structures (prmLTEDLSCH, prmLTEPDSCH, prmMdl). Then it uses a while loop to perform subframe processing by calling the MIMO transceiver function commlteMIMO_SM_step. Finally, it computes the BER and calls the visualization function to illustrate the channel response and modulation constellation before and after equalization.


Algorithm
MATLAB script
% Script for MIMO LTE (mode 4)
%
% Single codeword transmission
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, 
    chEstOn, numCodeWords, enPMIfback, cbIdx, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter fullDecode
chanMdl corrLvl chEstOn numCodeWords enPMIfback cbIdx snrdB maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 3: Multiple Tx & Rx antrennas with Spatial Multiplexing');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
hPBer = comm.ErrorRate;
snrdB=prmMdl.snrdB;
maxNumErrs=prmMdl.maxNumErrs;
maxNumBits=prmMdl.maxNumBits;
%% Simulation loop
tic;
nS = 0; % Slot number, one of [0:2:18]
Measures = zeros(3,1); %initialize BER output
while (( Measures(2)< maxNumErrs) && (Measures(3) < maxNumBits))
   [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr] = 
       commlteMIMO_SM_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl);
    % Calculate  bit errors
    Measures = step(hPBer, dataIn, dataOut);
     % Visualize constellations and spectrum
    if (visualsOn && prmLTEPDSCH.Eqmode˜=3)
        zVisualize( prmLTEPDSCH, txSig, rxSig, yRec, dataRx, csr, nS);
    end;
    % Update subframe number
    nS = nS + 2; if nS > 19, nS = mod(nS, 20); end;
end
disp(Measures);
toc;

Verifying Transceiver Performance

By executing the MATLAB script of the MIMO transceiver model (commlteMIMO) we can examine various signals to assess the performance of the system. The parameters used in simulation are summarized in the following MATLAB script (commlteMIMO_params). This parameter set copies the common MIMO parameters used in Section 6.7.1. The parameters that are different reflect the use of spatial multiplexing MIMO mode 4 with a single codeword, turning off of the precoder matrix feedback, and use of the MMSE equalizer for MIMO receiver processing. In this simulation, 1 million bits of user data are processed, the SNR of the AWGN channel is set to 16 dB, and the visualization function is turned on.


Algorithm
MATLAB script
% PDSCH
txMode             = 4;   % Transmission mode one of {1, 2, 4}
numTx              = 2;    % Number of transmit antennas
numRx              = 2;    % Number of receive antennas
chanBW            = 4;         % [1,2,3,4,5,6] maps to [1.4, 3, 5, 10, 15, 20]MHz
contReg            = 1;         % {1,2,3} for >=10MHz, {2,3,4} for <10Mhz
modType           = 2;         % [1,2,3] maps to ['QPSK','16QAM','64QAM']
% DLSCH
cRate                = 1/3; % Rate matching target coding rate
maxIter              = 6;     % Maximum number of turbo decoding terations
fullDecode         = 0;    % Whether "full" or "early stopping" turbo decoding is performed
% Channel model
chanMdl             =  'frequency-selective-high-mobility';
% one of {'flat-low-mobility', 'flat-high-mobility','frequency-selective-low-mobility',
% 'frequency-selective-high-mobility', 'EPA 0Hz', 'EPA 5Hz', 'EVA 5Hz', 'EVA 70Hz'}
corrLvl                 = 'Medium';
% Simulation parameters
Eqmode               = 2;      % Type of equalizer used [1,2,3] for ['ZF', 'MMSE','Sphere Decoder']
chEstOn              = 1;          % use channel estimation or ideal channel
snrdB                  = 16;    % Signal to Noise Ratio in dB
maxNumErrs       = 1e6; % Maximum number of errors found before simulation stops
maxNumBits       = 1e6;  % Maximum number of bits processed before simulation stops
visualsOn            = 1;      % Whether to visualize channel response and constellations
numCodeWords  = 1; % Number of codewords in PDSCH
enPMIfback         = 0;     % Enable/Disable Precoder Matrix Indicator (PMI) feedback
cbIdx                   = 1;      % Initialize PMI index

Figure 6.12 shows the constellation diagrams before (first row) and after (second row) equalization of user data obtained from each of the two receive antennas in a subframe. It shows that the equalizer can compensate for the effect of a fading channel to result in a constellation that more closely resembles that of the 16QAM modulator.

Figure 6.12 LTE model: MIMO spatial-multiplexing constellation diagram of user data before and after equalization

c06f012

Figure 6.13 illustrates the spectra of user data obtained from each of the two receive antennas in a subframe. It shows the transmitted signal and the received signal before and after equalization. The received signal before equalization (showing the effects of frequency-selective fading) is effectively equalized by the closed-loop spatial multiplexing (showing a more frequency-flat nature), which closely resembles the transmitted signal spectrum.

Figure 6.13 LTE MIMO spatial-multiplexing spectra of transmitted and of the received signal before and after equalization

c06f013

BER Measurements

In order to verify the BER performance of the transceiver, we create a testbench called commlteMIMO_test_timing_ber, which first initializes the LTE system parameters and then iterates through a range of SNR values and calls the commlteMIMO_fcn function in the loop in order to compute the corresponding BER values.


Algorithm
MATLAB script: commlteMIMO_test_timing_ber
% Script for MIMO LTE (mode 4)
%
% Single codeword transmission only
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
maxNumErrs=5e7;
maxNumBits=5e7;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, 
    chEstOn, numCodeWords, enPMIfback, cbIdx, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter fullDecode
chanMdl corrLvl chEstOn numCodeWords enPMIfback cbIdx snrdB maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 3: Multiple Tx & Rx antrennas with Spatial Multiplexing');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
%% Geerate code and setup parallelism
disp('Generating code for commlteMIMO_ fcn.m …');
arg1=coder.Constant(prmLTEPDSCH);
arg2=coder.Constant( prmLTEDLSCH);
arg3=coder.Constant(prmMdl);
codegen commlteMIMO_ fcn -args {16, arg1, arg2, arg3} -report
disp('Done.');
parallel_setup;
%%
MaxIter=8;
snr_vector=getSnrVector(prmLTEPDSCH.modType, MaxIter);
ber_vector=zeros(size(snr_vector));
maxNumBits=prmMdl.maxNumBits;
tic;
parfor n=1:MaxIter
    fprintf(1,'Iteration %2d out of %2d:  Processing %10d bits. SNR = %3d
', 
        n, MaxIter, maxNumBits, snr_vector(n));
    [ber, ˜] = commlteMIMO_ fcn_mex(snr_vector(n), prmLTEPDSCH, prmLTEDLSCH, prmMdl);
    ber_vector(n)=ber;
end;
toc;
semilogy(snr_vector, ber_vector);
title('BER - commlteMIMO SM');xlabel('SNR (dB)');ylabel('ber');grid;

Figure 6.14 shows the BER of the transceiver as a function of the SNR values after processing of 50 million bits of user data in each of eight iterations.

Figure 6.14 BER results: LTE mode 4 spatial-multiplexing single-codeword (2 × 2) MIMO channel

c06f014

6.7.6.2 Two-Codeword Case

The following MATLAB function shows a transmitter, receiver, and channel model for mode 4 of the LTE standard featuring two-codeword spatial multiplexing. The structure of the transceiver model is very similar to that in the single-codeword case, except that we create and process a pair of data bits and repeat operations such as CRC generation, DLSCH processing, scrambling, and modulation on data pairs. The layer-mapping operation transforms the data into layers, and from then until layer demapping everything is similar to the single-antenna case. After that, demodulation, descrambling, CRC detection, and transport-block-channel decoding (the inverse of DLSCH processing) also occur as pairs of operations.


Algorithm
MATLAB function
function [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr_ref]
    = commlteMIMO_SM2_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl)
%% TX
persistent hPBer1
if isempty(hPBer1), hPBer1=comm.ErrorRate; end;
%  Generate payload
dataIn1 = genPayload(nS,  prmLTEDLSCH.TBLenVec);
dataIn2 = genPayload(nS,  prmLTEDLSCH.TBLenVec);
dataIn=[dataIn1;dataIn2];
% Transport block CRC generation
tbCrcOut1 =CRCgenerator(dataIn1);
tbCrcOut2 =CRCgenerator(dataIn2);
% Channel coding includes - CB segmentation, turbo coding, rate matching,
% bit selection, CB concatenation - per codeword
[data1, Kplus1, C1] = lteTbChannelCoding(tbCrcOut1, nS, prmLTEDLSCH, prmLTEPDSCH);
[data2, Kplus2, C2] = lteTbChannelCoding(tbCrcOut2, nS, prmLTEDLSCH, prmLTEPDSCH);
%Scramble codeword
scramOut1 = lteScramble(data1, nS, 0, prmLTEPDSCH.maxG);
scramOut2 = lteScramble(data2, nS, 0, prmLTEPDSCH.maxG);
% Modulate
modOut1 = Modulator(scramOut1, prmLTEPDSCH.modType);
modOut2 = Modulator(scramOut2, prmLTEPDSCH.modType);
% Map modulated symbols  to layers
numTx=prmLTEPDSCH.numTx;
LayerMapOut = LayerMapper(modOut1, modOut2, prmLTEPDSCH);
usedCbIdx = prmMdl.cbIdx;
% Precoding
[PrecodeOut, Wn] = lteSpatialMuxPrecoder(LayerMapOut, prmLTEPDSCH, usedCbIdx);
% Generate Cell-Specific Reference (CSR) signals
csr = CSRgenerator(nS, numTx);
csr_ref=complex(zeros(2*prmLTEPDSCH.Nrb, 4, numTx));
for m=1:numTx
    csr_ pre=csr(1:2*prmLTEPDSCH.Nrb,:,:,m);
    csr_ref(:,:,m)=reshape(csr_ pre,2*prmLTEPDSCH.Nrb,4);
end
% Resource grid filling
txGrid = REmapper_mTx(PrecodeOut, csr_ref, nS, prmLTEPDSCH);
% OFDM transmitter
txSig = OFDMTx(txGrid, prmLTEPDSCH);
%% Channel
% MIMO Fading channel
[rxFade, chPathG] = MIMOFadingChan(txSig, prmLTEPDSCH, prmMdl);
% Add AWG noise
sigPow = 10*log10(var(rxFade));
nVar = 10.^(0.1.*(sigPow-snrdB));
rxSig =  AWGNChannel(rxFade, nVar);
%% RX
% OFDM Rx
rxGrid = OFDMRx(rxSig, prmLTEPDSCH);
% updated for numLayers -> numTx
[dataRx, csrRx, idx_data] = REdemapper_mTx(rxGrid, nS, prmLTEPDSCH);
% MIMO channel estimation
if prmMdl.chEstOn
    chEst = ChanEstimate_mTx(prmLTEPDSCH, csrRx,  csr_ref, prmMdl.chEstOn);
    hD     = ExtChResponse(chEst, idx_data, prmLTEPDSCH);
else
    idealChEst = IdChEst(prmLTEPDSCH, prmMdl, chPathG);
    hD =  ExtChResponse(idealChEst, idx_data, prmLTEPDSCH);
end
% Frequency-domain equalizer
if (numTx==1)
    % Based on Maximum-Combining Ratio (MCR)
    yRec = Equalizer_simo(dataRx, hD, nVar, prmLTEPDSCH.Eqmode);
else
    % Based on Spatial Multiplexing
    yRec = MIMOReceiver(dataRx, hD, prmLTEPDSCH, nVar, Wn);
end
% Demap received codeword(s)
[cwOut1, cwOut2] = LayerDemapper(yRec, prmLTEPDSCH);
if prmLTEPDSCH.Eqmode < 3
    % Demodulate
    demodOut1 = DemodulatorSoft(cwOut1, prmLTEPDSCH.modType, mean(nVar));
    demodOut2 = DemodulatorSoft(cwOut2, prmLTEPDSCH.modType, mean(nVar));
else
    demodOut1 = cwOut1;
    demodOut2 = cwOut2;
end
% Descramble received codeword
rxCW1 =  lteDescramble(demodOut1, nS, 0, prmLTEPDSCH.maxG);
rxCW2 =  lteDescramble(demodOut2, nS, 0, prmLTEPDSCH.maxG);
% Channel decoding includes - CB segmentation, turbo decoding, rate dematching
[decTbData1, ˜,˜] = lteTbChannelDecoding(nS, rxCW1, Kplus1, C1,  prmLTEDLSCH, prmLTEPDSCH);
[decTbData2, ˜,˜] = lteTbChannelDecoding(nS, rxCW2, Kplus2, C2,  prmLTEDLSCH, prmLTEPDSCH);
% Transport block CRC detection
[dataOut1, ˜] = CRCdetector(decTbData1);
[dataOut2, ˜] = CRCdetector(decTbData2);
dataOut=[dataOut1;dataOut2];
end

Structure of the Transceiver Model

The following MATLAB script is the testbench that calls the MIMO transceiver function commlteMIMO. First it calls the initialization function (commlteMIMO_initialize) to set all the relevant parameter structures (prmLTEDLSCH, prmLTEPDSCH, prmMdl). Then it uses a while loop to perform subframe processing by calling the MIMO transceiver function commlteMIMO_SM2_step. Finally, it computes the BER and calls the visualization function to illustrate the channel response and modulation constellation before and after equalization.


Algorithm
MATLAB script
% Script for MIMO LTE (mode 4)
%
% Two codeword transmission
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, 
    chEstOn, numCodeWords, enPMIfback, cbIdx, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter fullDecode
chanMdl corrLvl chEstOn numCodeWords enPMIfback cbIdx snrdB maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 3: Multiple Tx & Rx antrennas with Spatial Multiplexing');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
hPBer = comm.ErrorRate;
snrdB=prmMdl.snrdB;
maxNumErrs=prmMdl.maxNumErrs;
maxNumBits=prmMdl.maxNumBits;
%% Simulation loop
tic;
nS = 0; % Slot number, one of [0:2:18]
Measures = zeros(3,1); %initialize BER output
while (( Measures(2)< maxNumErrs) && (Measures(3) < maxNumBits))
   [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr] = 
       commlteMIMO_SM2_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl);
    % Calculate  bit errors
    Measures = step(hPBer, dataIn, dataOut);
     % Visualize constellations and spectrum
    if (visualsOn && prmLTEPDSCH.Eqmode˜=3)
        zVisualize( prmLTEPDSCH, txSig, rxSig, yRec, dataRx, csr, nS);
    end;
    % Update subframe number
    nS = nS + 2; if nS > 19, nS = mod(nS, 20); end;
end
disp(Measures);
toc;

Verifying Transceiver Performance

By executing the MATLAB script of the MIMO transceiver model (commlteMIMO) we can examine various signals in order to assess the performance of the system. The parameters used in simulation are summarized in the following MATLAB script (commlteMIMO_ params). This parameter set copies the common MIMO parameters used in Section 6.7.1. The parameters that are different reflect the use of spatial-multiplexing MIMO mode 4 with two codewords, turning off of the precoder matrix feedback, and the use of the MMSE equalizer for MIMO receiver processing. In this simulation, 1 million bits of user data are processed, the SNR of the AWGN channel is set to 16 dB, and the visualization function is turned on.


Algorithm
MATLAB script
% PDSCH
txMode             = 4;   % Transmission mode one of {1, 2, 4}
numTx              = 2;    % Number of transmit antennas
numRx              = 2;    % Number of receive antennas
chanBW            = 4;         % [1,2,3,4,5,6] maps to [1.4, 3, 5, 10, 15, 20]MHz
contReg            = 1;         % {1,2,3} for >=10MHz, {2,3,4} for <10Mhz
modType           = 2;         % [1,2,3] maps to ['QPSK','16QAM','64QAM']
% DLSCH
cRate                = 1/3; % Rate matching target coding rate
maxIter              = 6;     % Maximum number of turbo decoding terations
fullDecode         = 0;    % Whether "full" or "early stopping" turbo decoding is performed
% Channel model
chanMdl             =  'frequency-selective-high-mobility';
% one of {'flat-low-mobility', 'flat-high-mobility','frequency-selective-low-mobility',
% 'frequency-selective-high-mobility', 'EPA 0Hz', 'EPA 5Hz', 'EVA 5Hz', 'EVA 70Hz'}
corrLvl                 = 'Medium';
% Simulation parameters
Eqmode               = 2;      % Type of equalizer used [1,2,3] for ['ZF', 'MMSE','Sphere Decoder']
chEstOn              = 1;          % use channel estimation or ideal channel
snrdB                  = 16;    % Signal to Noise Ratio in dB
maxNumErrs       = 1e6; % Maximum number of errors found before simulation stops
maxNumBits       = 1e6;  % Maximum number of bits processed before simulation stops
visualsOn            = 1;      % Whether to visualize channel response and constellations
numCodeWords  = 2; % Number of codewords in PDSCH
enPMIfback         = 0;     % Enable/Disable Precoder Matrix Indicator (PMI) feedback
cbIdx                   = 1;      % Initialize PMI index

Figure 6.15 shows the constellation diagrams before (first row) and after (second row) equalization of the user data obtained from each of the two receive antennas in a given subframe. It shows that the equalizer can compensate for the effect of a fading channel to result in a constellation that more closely resembles that of the 16QAM modulator.

Figure 6.15 LTE model: MIMO spatial-multiplexing two-codeword constellation diagram before and after equalization

c06f015

Figure 6.16 illustrates the spectra of user data obtained from each of the two receive antennas in a subframe. It shows the transmitted signal and the received signal before and after equalization. The received signal before equalization is effectively equalized in the 2-codeword spatial multiplexing case which closely resembles the transmitted signal spectrum.

Figure 6.16 MIMO spatial-multiplexing two-codewords spectra of the transmited signal and of the received signal before and after equalization

c06f016

BER Measurements

In order to verify the BER performance of the transceiver, we create a testbench called commlteMIMO_test_timing_ber, which first initializes the LTE system parameters and then iterates through a range of SNR values and calls the commlteMIMO_ fcn function in the loop to compute the corresponding BER values. The results obtained are very similar to the single-codeword results illustrated in Figure 6.14.


Algorithm
MATLAB script: commlteMIMO_test_timing_ber
% Script for MIMO LTE (mode 4)
%
% Single codeword transmission only
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
maxNumErrs=5e7;
maxNumBits=5e7;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode, chanMdl, corrLvl, 
    chEstOn, numCodeWords, enPMIfback, cbIdx, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter fullDecode chanMdl corrLvl chEstOn numCodeWords enPMIfback cbIdx snrdB maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 3: Multiple Tx & Rx antrennas with Spatial Multiplexing');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
%% Geerate code and setup parallelism
disp('Generating code for commlteMIMO_ fcn.m …');
arg1=coder.Constant(prmLTEPDSCH);
arg2=coder.Constant( prmLTEDLSCH);
arg3=coder.Constant(prmMdl);
codegen commlteMIMO_ fcn -args {16, arg1, arg2, arg3} -report
disp('Done.');
parallel_setup;
%%
MaxIter=8;
snr_vector=getSnrVector(prmLTEPDSCH.modType, MaxIter);
ber_vector=zeros(size(snr_vector));
maxNumBits=prmMdl.maxNumBits;
tic;
parfor n=1:MaxIter
    fprintf(1,'Iteration %2d out of %2d:  Processing %10d bits. SNR = %3d
', 
        n, MaxIter, maxNumBits, snr_vector(n));
    [ber, ˜] = commlteMIMO_ fcn_mex(snr_vector(n), prmLTEPDSCH, prmLTEDLSCH, prmMdl);
    ber_vector(n)=ber;
end;
toc;
semilogy(snr_vector, ber_vector);
title('BER - commlteMIMO SM');xlabel('SNR (dB)');ylabel('ber');grid;

6.7.7 Open-Loop Spatial Multiplexing

The following MATLAB function shows the spatial-multiplexing-with-large-CDD (Cyclic Delay Diversity) algorithm that implements MIMO transmission mode 3 of the LTE standard. Open-loop precoding is designed for transmission in high-mobility scenarios and does not rely on Precoder Matrix Indicator (PMI) by the mobile terminal. When the mobile terminal moves rapidly, an open-loop approach works best, since the channel-state feedback from a previous subframe cannot accurately predict the channel quality in the current one. As a result, in open-loop spatial multiplexing no explicit information regarding the precoder matrix is transmitted from the base station to the mobile terminal. Instead, the precoder matrix is selected in a deterministic way that can be computed synchronously in both the transmitter and the receiver in every subframe.

6.7.7.1 Open-Loop Precoding

In open-loop precoding, the transmitter and receiver do not communicate the choice of codebook indices using a feedback loop. Instead, a predefined set of precoding matrix indices is used, whcih is periodically updated in the transmitter and the receiver and is synchronized with each transmitted sample.

The transmission rank for open-loop precoding can also vary, from a full rank down to a minimum of two layers. When rank estimation results in a single layer, we switch from spatial multiplexing to transmit diversity. For a mode 3 transmission, when the rank takes on a value of 1, SFBC is used for two antennas and combined SFBC/FSTD for four.

The PrecoderMatrix function computes the precoder matrix (W), the diagonal matrix (D), and the matrix of eigenvectors (U) for each sample of the input signal. The function takes as input the sample index (n) and the number of layers (v). The codebook values are defined in Reference 7.


Algorithm
MATLAB function
function [W, D, U] = PrecoderMatrix(n, v)
% LTE Precoder for PDSCH spatial multiplexing.
%#codegen
idx=mod(n-1,4);
switch v
    case 1
        W=complex(1,0);
        U=W;D=W;
    case 2
        W=[1 0; 0 1];
        U=(1/sqrt(2))*[1 1;1 exp(-1j*pi)];
        D=[1 0;0 exp(-1j*pi*idx)];
    case 4
        k=1+mod(floor(n/4),4);
        switch k
            case 1, un = [1 -1 -1 1].';
            case 2, un = [1 -1 1 -1].';
            case 3, un = [1 1 -1 -1].';
            case 4, un = [1 1 1 1].';
        end
        W = eye(4) - 2*(un*un')./(un'*un);
        switch k    % order columns
            case 3
                W = W(:, [3 2 1 4]);
            case 2
                W = W(:, [1 3 2 4]);
        end
        a=[0*(0:1:3);2*(0:1:3);4*(0:1:3);6*(0:1:3)];
        U=(1/2)*exp(-1j*pi*a/4);
        b=0:1:3;
        D=diag(exp(-1j*2*pi*idx*b/4));
end

The following MATLAB function shows the precoding operations used when open-loop spatial multiplexing is selected as the mode of transmission. The function takes as input the modulated symbols organized in layers (in), the precoder matrix index (cbIdx), and the PDSCH parameter structure (prmLTEPDSCH). The output (out) is computed in three steps: (i) in the processing loop for each sample of the input, the PrecoderMatrix function obtains the three output matrices (W, D, U); (ii) the matrices are multiplied to obtain the transformation matrix (T); (iii) finally, the input vector is precoded sample by sample by multiplying it with the transformation matrix.


Algorithm
MATLAB function
function out = SpatialMuxPrecoder(in, prmLTEPDSCH)
% Precoder for PDSCH spatial multiplexing
%#codegen
% Assumes the incoming codewords are of the same length
v = prmLTEPDSCH.numLayers;              % Number of layers
% Initialize the output
out = complex(zeros(size(in)));
inLen = size(in, 1);
% Apply the relevant precoding matrix to the symbol over all layers
for n = 1:inLen
    % Compute the precoding matrix
    [W, D, U] = PrecoderMatrix(n, v);
    T=W *D*U;
    temp = T* (in(n, :).');
    out(n, :) = temp.';
end

6.7.7.2 MIMO Receiver Operations

The MIMO receiver function in open-loop spatial multiplexing is analogous to those used in closed-loop spatial multiplexing. It takes as input the received signal (in), the channel matrix (chEst), the PDSCH parameter structure (prmLTE), and the noise-variance vector (nVar). Depending on the equalization mode specified (prmLTE.Eqmode), either of the functions implementing a ZF, MMSE, or SD receiver is then called to generate the output signal (y).


Algorithm
MATLAB function
function y = MIMOReceiver_OpenLoop(in, chEst, prmLTE, nVar)
%#codegen
v=prmLTE.numTx;
switch prmLTE.Eqmode
    case 1 % ZF receiver
        y = MIMOReceiver_ZF_OpenLoop(in, chEst, v);
    case 2 % MMSE receiver
       y = MIMOReceiver_MMSE_OpenLoop(in, chEst, nVar, v);
    case 3 % Sphere Decoder
        y = MIMOReceiver_SD_OpenLoop(in, chEst, prmLTE, nVar, v);
    otherwise
        error('Function MIMOReceiver: ZF, MMSE, Sphere decoder are only
supported MIMO detectors');
end

ZF Receiver

The following MATLAB function shows a MIMO receiver that employs a ZF receiver. The function takes as input the received signal (in), the 2D channel matrix (chEst), and the number of layers in this subframe (v). Based on the ZF equalization method, it generates as output (y) the estimated modulated symbols in this subframe.


Algorithm
MATLAB function
function y = MIMOReceiver_ZF_OpenLoop(in, chEst, v)
%#codegen
% MIMO Receiver:
%   Based on received channel estimates, process the data elements
%   to equalize the MIMO channel. Uses the ZF detector.
% Get params
numData = size(in, 1);
y = complex(zeros(size(in)));
%% ZF receiver
for n = 1:numData
    [W, D, U] = PrecoderMatrixOpenLoop(n, v);
    iWn = (W *D*U)';
    h = squeeze(chEst(n, :, :)); % numTx x numRx
    h = h.';                     % numRx x numTx
    x = h  (in(n, :).');
    tmp = iWn * x;
    y(n, :) = tmp.';
end

MMSE Receiver

The following MATLAB function shows a MIMO receiver that employs a MMSE receiver. The function input and output signatures are very similar to those for the ZF algorithm, but with an additional input parameter corresponding to the noise variance (nVar) of the current subframe.


Algorithm
MATLAB function
function y = MIMOReceiver_MMSE_OpenLoop(in, chEst, nVar, v)
%#codegen
% MIMO Receiver:
%   Based on received channel estimates, process the data elements
%   to equalize the MIMO channel. Uses the MMSE detector.
% noisFac = numLayers*diag(nVar);
noisFac = diag(nVar);
numData = size(in, 1);
y = complex(zeros(size(in)));
%% MMSE receiver
for n = 1:numData
    [W, D, U] = PrecoderMatrixOpenLoop(n, v);
    iWn = (W *D*U)';             % Orthonormal matrix
    h = chEst(n, :, :);               % numTx x numRx
    h = reshape(h(:), v, v).';    % numRx x numTx
    Q = (h'*h + noisFac)h';
    x = Q * in(n, :).';
    tmp = iWn * x;
    y(n, :) = tmp.';
end

SD Receiver

The following MATLAB function shows a MIMO receiver that employs an Sphere Decoder (SD) receiver. The function input and output signatures are identical to those presented in the MMSE case.


Algorithm
MATLAB function
function [y, bittable] = MIMOReceiver_SD_OpenLoop(in, chEst, prmLTE, nVar, v)
%#codegen
% MIMO Receiver:
%   Based on received channel estimates, process the data elements
%   to equalize the MIMO channel. Uses the Sphere detector.
% Soft-Sphere Decoder
symMap=prmLTE.SymbolMap;
numBits=prmLTE.Qm;
constell=prmLTE.Constellation;
bittable = de2bi(symMap, numBits, 'left-msb');
nVar1=(-1/mean(nVar));
persistent SphereDec
if isempty(SphereDec)
    % Soft-Sphere Decoder
    SphereDec = comm.SphereDecoder('Constellation', constell,
        'BitTable', bittable, 'DecisionType', 'Soft');
end
% SSD receiver
temp = complex(zeros(size(chEst)));
% Account for precoding
for n = 1:size(chEst,1)
    [W, D, U] =PrecoderMatrixOpenLoop(n, v);
    iWn = (W *D*U).';
    temp(n, :, :) =  iWn * squeeze(chEst(n, :, :)) ;
end
hD = temp;
y = nVar1 * step(SphereDec, in, hD);

6.7.8 Downlink Transmission Mode 3

The third downlink transmission mode uses open-loop spatial multiplexing and is intended for transmission in high-mobility scenarios. The following MATLAB function shows a transmitter, receiver, and channel model for this mode featuring single-codeword spatial multiplexing. Using multiple antennas at both the transmitter and the receiver, we showcase both 2 × 2 and 4 × 4 MIMO antenna configurations. The key components highlighted in the example include the following:

  • Generation of payload data for a single subframe (a transport block)
  • DLSCH processing, as described earlier
  • PDSCH transmitter processing, including bit-level scrambling, data modulation, layer mapping and precoding for two or four antennas, precoding for spatial multiplexing, resource-element mapping, and OFDM signal generation
  • Channel modeling, including a MIMO fading channel followed by an AWGN channel
  • PDSCH receiver processing, including an OFDM signal receiver to generate the resource grid, resource-element demapping to separate the CSR signal from the user data, channel estimation, MIMO receiver and layer demapping, soft-decision demodulation, descrambling, and DLSCH decoding.

Algorithm
MATLAB script
function [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr_ref]
    = commlteMIMO_SM_Mode3_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH, prmMdl)
%% TX
persistent hPBer1
if isempty(hPBer1), hPBer1=comm.ErrorRate; end;
%  Generate payload
dataIn = genPayload(nS,  prmLTEDLSCH.TBLenVec);
% Transport block CRC generation
tbCrcOut1 =CRCgenerator(dataIn);
% Channel coding includes - CB segmentation, turbo coding, rate matching,
% bit selection, CB concatenation - per codeword
[data, Kplus1, C1] = lteTbChannelCoding(tbCrcOut1, nS, prmLTEDLSCH, prmLTEPDSCH);
%Scramble codeword
scramOut = lteScramble(data, nS, 0, prmLTEPDSCH.maxG);
% Modulate
modOut = Modulator(scramOut, prmLTEPDSCH.modType);
% Map modulated symbols  to layers
numTx=prmLTEPDSCH.numTx;
LayerMapOut = LayerMapper(modOut, [], prmLTEPDSCH);
% Precoding
PrecodeOut = SpatialMuxPrecoderOpenLoop(LayerMapOut, prmLTEPDSCH);
% Generate Cell-Specific Reference (CSR) signals
csr = CSRgenerator(nS, numTx);
csr_ref=complex(zeros(2*prmLTEPDSCH.Nrb, 4, numTx));
for m=1:numTx
    csr_ pre=csr(1:2*prmLTEPDSCH.Nrb,:,:,m);
    csr_ref(:,:,m)=reshape(csr_ pre,2*prmLTEPDSCH.Nrb,4);
end
% Resource grid filling
txGrid = REmapper_mTx(PrecodeOut, csr_ref, nS, prmLTEPDSCH);
% OFDM transmitter
txSig = OFDMTx(txGrid, prmLTEPDSCH);
%% Channel
% MIMO Fading channel
[rxFade, chPathG] = MIMOFadingChan(txSig, prmLTEPDSCH, prmMdl);
% Add AWG noise
sigPow = 10*log10(var(rxFade));
nVar = 10.^(0.1.*(sigPow-snrdB));
rxSig =  AWGNChannel(rxFade, nVar);
%% RX
% OFDM Rx
rxGrid = OFDMRx(rxSig, prmLTEPDSCH);
% updated for numLayers -> numTx
[dataRx, csrRx, idx_data] = REdemapper_mTx(rxGrid, nS, prmLTEPDSCH);
% MIMO channel estimation
if prmMdl.chEstOn
    chEst = ChanEstimate_mTx(prmLTEPDSCH, csrRx,  csr_ref, prmMdl.chEstOn);
    hD     = ExtChResponse(chEst, idx_data, prmLTEPDSCH);
else
    idealChEst = IdChEst(prmLTEPDSCH, prmMdl, chPathG);
    hD =  ExtChResponse(idealChEst, idx_data, prmLTEPDSCH);
end
% Frequency-domain equalizer
if (numTx==1)
    % Based on Maximum-Combining Ratio (MCR)
    yRec = Equalizer_simo(dataRx, hD,mean(nVar), prmLTEPDSCH.Eqmode);
else
    % Based on Spatial Multiplexing
    yRec = MIMOReceiver_OpenLoop(dataRx, hD, prmLTEPDSCH, nVar);
end
% Demap received codeword(s)
[cwOut, ˜] = LayerDemapper(yRec, prmLTEPDSCH);
if prmLTEPDSCH.Eqmode < 3
    % Demodulate
    demodOut = DemodulatorSoft(cwOut, prmLTEPDSCH.modType, mean(nVar));
else
    demodOut = cwOut;
end
% Descramble received codeword
rxCW =  lteDescramble(demodOut, nS, 0, prmLTEPDSCH.maxG);
% Channel decoding includes - CB segmentation, turbo decoding, rate dematching
[decTbData1, ˜,˜] = lteTbChannelDecoding(nS, rxCW, Kplus1, C1,  prmLTEDLSCH, prmLTEPDSCH);
% Transport block CRC detection
[dataOut, ˜] = CRCdetector(decTbData1);
end

6.7.8.1 Structure of the Transceiver Model

The MATLAB script below is the testbench that calls the MIMO transceiver function commlteMIMO. First it calls the initialization function (commlteMIMO_initialize) to set all relevant parameter structures (prmLTEDLSCH, prmLTEPDSCH, prmMdl). Then it uses a while loop to perform subframe processing by calling the MIMO transceiver function commlteMIMO_SM_Mode3_step. Finally, it computes the BER and calls the visualization function to illustrate the channel response and modulation constellation before and after equalization.


Algorithm
MATLAB script
% Script for MIMO LTE (mode 3)
%
% Single or Two codeword transmission
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode,
chanMdl, corrLvl, 
    chEstOn, numCodeWords, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter
fullDecode chanMdl corrLvl chEstOn numCodeWords snrdB maxNumErrs
maxNumBits
%%
disp('Simulating the LTE Mode 3: Multiple Tx & Rx antrennas with Spatial
Multiplexing');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
hPBer = comm.ErrorRate;
snrdB=prmMdl.snrdB;
maxNumErrs=prmMdl.maxNumErrs;
maxNumBits=prmMdl.maxNumBits;
%% Simulation loop
tic;
nS = 0; % Slot number, one of [0:2:18]
Measures = zeros(3,1); %initialize BER output
while (( Measures(2)< maxNumErrs) && (Measures(3) < maxNumBits))
   [dataIn, dataOut, txSig, rxSig, dataRx, yRec, csr] = 
       commlteMIMO_SM_Mode3_step(nS, snrdB, prmLTEDLSCH, prmLTEPDSCH,
prmMdl);
    % Calculate bit errors
    Measures = step(hPBer, dataIn, dataOut);
     % Visualize constellations and spectrum
    if (visualsOn && prmLTEPDSCH.Eqmode˜=3)
        zVisualize( prmLTEPDSCH, txSig, rxSig, yRec, dataRx, csr, nS);
    end;
    % Update subframe number
    nS = nS + 2; if nS > 19, nS = mod(nS, 20); end;
end
disp(Measures);
toc;

6.7.8.2 Verifying Transceiver Performance

By executing the MATLAB script of the MIMO transceiver model (commlteMIMO) we can examine various signals to assess the performance of the system. The parameters used in simulation are summarized in the following MATLAB script (commlteMIMO_ params). This parameter set copies the common MIMO parameters used in Section 6.7.1. The parameters that are different reflect the use of spatial-multiplexing MIMO mode 3 with a single codeword and of the MMSE equalizer for MIMO receiver processing. In this simulation, 1 million bits of user data are processed, the SNR of the AWGN channel is set to 16 dB, and the visualization function is turned on.


Algorithm
MATLAB script
% PDSCH
txMode             = 3;   % Transmission mode one of {1, 2, 4}
numTx              = 2;    % Number of transmit antennas
numRx              = 2;    % Number of receive antennas
chanBW            = 4;         % [1,2,3,4,5,6] maps to [1.4, 3, 5, 10, 15, 20]MHz
contReg            = 1;         % {1,2,3} for >=10MHz, {2,3,4} for <10Mhz
modType           = 2;         % [1,2,3] maps to ['QPSK','16QAM','64QAM']
% DLSCH
cRate                = 1/3; % Rate matching target coding rate
maxIter              = 6;     % Maximum number of turbo decoding terations
fullDecode         = 0;    % Whether "full" or "early stopping" turbo decoding is performed
% Channel model
chanMdl             =  'frequency-selective-high-mobility';
% one of {'flat-low-mobility', 'flat-high-mobility','frequency-selective-low-mobility',
% 'frequency-selective-high-mobility', 'EPA 0Hz', 'EPA 5Hz', 'EVA 5Hz', 'EVA 70Hz'}
corrLvl                 = 'Medium';
% Simulation parameters
Eqmode               = 2;      % Type of equalizer used [1,2,3] for ['ZF', 'MMSE','Sphere Decoder']
chEstOn              = 1;          % use channel estimation or ideal channel
snrdB                  = 16;    % Signal to Noise Ratio in dB
maxNumErrs       = 1e6; % Maximum number of errors found before simulation stops
maxNumBits       = 1e6;  % Maximum number of bits processed before simulation stops
visualsOn            = 1;      % Whether to visualize channel response and constellations
numCodeWords  = 1; % Number of codewords in PDSCH
enPMIfback         = 0;     % Enable/Disable Precoder Matrix Indicator (PMI) feedback
cbIdx                   = 1;      % Initialize PMI index

Figure 6.17 shows the constellation diagrams before (first row) and after (second row) equalization of user data obtained from each of the two receive antennas in a subframe. It shows that the equalizer can compensate for the effect of a fading channel to result in a constellation that more closely resembles that of the 16QAM modulator.

Figure 6.17 LTE model: MIMO spatial-multiplexing constellation diagram of the user data before and after equalization

c06f017

Figure 6.18 illustrates the spectra of user data obtained from each of the two receive antennas in a subframe. It shows the transmitted signal and the received signal before and after equalization. The received signal before equalization (showing the effects of frequency-selective fading) is effectively equalized by the open-loop spatial multiplexing used in transmission mode 3 (showing a more frequency-flat nature), which closely resembles the transmitted signal spectrum.

Figure 6.18 LTE MIMO spatial-multiplexing spectra of the transmited signal and of the received signal before and after equalization

c06f018

6.7.8.3 BER Measurements

In order to verify the BER performance of the transceiver, we create a testbench called commlteMIMO_test_timing_ber, which first initializes the LTE system parameters and then iterates through a range of SNR values and calls the commlteMIMO_ fcn function in the loop in order to compute the corresponding BER values.


Algorithm
MATLAB script: commlteMIMO_test_timing_ber
% Script for MIMO LTE (mode 4)
%
% Single codeword transmission only
%
clear all
clear functions
%% Set simulation parameters & initialize parameter structures
commlteMIMO_ params;
maxNumErrs=5e7;
maxNumBits=5e7;
[prmLTEPDSCH, prmLTEDLSCH, prmMdl] = commlteMIMO_initialize(txMode, 
chanBW, contReg, modType, Eqmode,numTx, numRx,cRate,maxIter, fullDecode,
chanMdl, corrLvl, 
    chEstOn, numCodeWords, enPMIfback, cbIdx, snrdB, maxNumErrs, maxNumBits);
clear txMode chanBW contReg modType Eqmode numTx numRx cRate maxIter
fullDecode chanMdl corrLvl chEstOn numCodeWords enPMIfback cbIdx snrdB
maxNumErrs maxNumBits
%%
disp('Simulating the LTE Mode 3: Multiple Tx & Rx antrennas with Spatial Multiplexing');
zReport_data_rate(prmLTEPDSCH, prmLTEDLSCH);
%% Geerate code and setup parallelism
disp('Generating code for commlteMIMO_ fcn.m …');
arg1=coder.Constant(prmLTEPDSCH);
arg2=coder.Constant( prmLTEDLSCH);
arg3=coder.Constant(prmMdl);
codegen commlteMIMO_ fcn -args {16, arg1, arg2, arg3} -report
disp('Done.');
parallel_setup;
%%
MaxIter=8;
snr_vector=getSnrVector(prmLTEPDSCH.modType, MaxIter);
ber_vector=zeros(size(snr_vector));
maxNumBits=prmMdl.maxNumBits;
tic;
parfor n=1:MaxIter
    fprintf(1,'Iteration %2d out of %2d:  Processing %10d bits. SNR = %3d
', 
        n, MaxIter, maxNumBits, snr_vector(n));
    [ber, ˜] = commlteMIMO_ fcn_mex(snr_vector(n), prmLTEPDSCH, prmLTEDLSCH, prmMdl);
    ber_vector(n)=ber;
end;
toc;
semilogy(snr_vector, ber_vector);
title('BER - commlteMIMO SM');xlabel('SNR (dB)');ylabel('ber');grid;

Figure 6.19 shows the BER of the transceiver as a function of the SNR values after processing of 50 million bits of user data in each of eight iterations.

Figure 6.19 BER results: LTE mode 3 spatial-multiplexing single-codeword (2 × 2) MIMO channel

c06f019

6.8 Chapter Summary

In this chapter we studied the multi-antenna MIMO techniques used in the LTE standard. MIMO techniques are integral components of LTE. The nine distinct modes used in downlink transmission, for example, are differentiated based on the choice of MIMO technique they feature. We have focused on MIMO algorithms of the first four transmission modes of the LTE standard and their modeling in MATLAB. These transmission modes exploit two algorithms: (i) transmit diversity (such as SFBC) and (ii) spatial multiplexing, with or without delay-diversity coding. Transmit-diversity techniques improve the link quality and reliability but do not increase the data rate or spectral efficiency of a system. Spatial-multiplexing techniques make possible a substantial boost in data rates.

We first examined the MIMO multipath fading channel models and then presented the functional elements of MIMO transmission schemes that are common between transmit diversity and spatial multiplexing. This involved making updates to the OFDM functional elements presented in the previous chapter, due to the introduction of multiple antennas. Since LTE is a MIMO–OFDM system, we essentially transformed the 2D time–frequency representation of data in a single-antenna scheme into a 3D time–frequency–space representation. Updated common MIMO algorithms included resource-element mapping, channel estimation, and channel-response extraction.

Then we studied those functional elements that are different between transmit-diversity and spatial-multiplexing MIMO techniques. The LTE standard refers to these transmitter-side functional elements as layer-mapping and precoding operations. We examined the receiver-side operations, which invert the transmitter-side operations in order to recover best estimates of the 3D resource grid. We examined three MIMO receivers – ZF, MMSE, and SD algorithms – that provide estimates of the transmitted data on multiple antennas at every subcarrier at a given point in time.

Finally, we integrated all of the functional elements to create in MATLAB a transceiver model for the second, third, and fourth transmission modes of the LTE standard. The second transmission mode is based on transmit diversity, the third uses open-loop spatial multiplexing, and the fourth uses closed-loop spatial multiplexing. Through simulations, we performed both qualitative assessments and BER performance measurements. The results show that the transceiver effectively combats the effects of intersymbol interference caused by multipath fading, and depending on the mode it can achieve high data rates.

References

[1] Dahlman, E., Parkvall, S. and Sköld, J. (2011) 4G LTE/LTE-Advanced for Mobile Broadband, Elsevier.

[2] Jafarkhani, H. (2005) Space-Time Coding; Theory and Practice, Cambridge University Press, Cambridge.

[3] 3GPP Evolved Universal Terrestrial Radio Access (E-UTRA); Base Station (BS) Radio Transmission and Reception, May 2011, TS 36.104.

[4] Scaglione, P., Stoica, S., Barbarossa, G. et al. (2002) Optimal designs for space-time linear precoders and decoders. IEEE Transactions on Signal Processing, 50, 5, 1051–1064.

[5] Browne, M. and Fitz, M. (2006) Singular value decomposition of correlated MIMO channels. IEEE Global Telecommunications Conference (GLOBECOM) 2006.

[6] Adhikari, S. (2011) Downlink transmission mode selection and switching algorithm for LTE. Proceedings of 3rd International Conference on Communication Systems and Networks (COMSNETS), January 2011.

[7] 3GPP (2011) Evolved Universal Terrestrial Radio Access (E-UTRA); Physical Channels and Modulation V10.0.0. TS 36.211, January 2011.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset