Main Content

comm.SphereDecoder

Decode input using sphere decoder

Description

The comm.SphereDecoder System object™ decodes the symbols sent over NT antennas using the sphere decoding algorithm.

To decode symbols using the sphere decoding algorithm:

  1. Create the comm.SphereDecoder object and set its properties.

  2. Call the object with arguments, as if it were a function.

To learn more about how System objects work, see What Are System Objects?

Creation

Description

spheredecod = comm.SphereDecoder creates a sphere decoder System object, spheredecod. This object decodes the symbols using the sphere decoding algorithm.

spheredecod = comm.SphereDecoder(const,bitTab) sets the Constellation property to const and the BitTable property to bitTab.

spheredecod = comm.SphereDecoder(___,Name=Value) sets properties using one or more optional name-value arguments in addition to any of the input argument combinations in the previous syntaxes. For example, spheredecod(InitialRadius="ZF solution") sets the initial search radius of the decoding algorithm to "ZF solution".

example

Properties

expand all

Unless otherwise indicated, properties are nontunable, which means you cannot change their values after calling the object. Objects lock when you call them, and the release function unlocks them.

If a property is tunable, you can change its value at any time.

For more information on changing property values, see System Design in MATLAB Using System Objects.

Signal constellation per transmit antenna, specified as a column vector. The object maps the bits to the constellation points. The length of the vector must be a power of two. The object assumes that each transmit antenna uses an identical constellation.

Data Types: double
Complex Number Support: Yes

Bit mapping used for each constellation point, specified as a ConstellationLength-by-bitsPerSymbol matrix. ConstellationLength represents the length of the Constellation property, and bitsPerSymbol represents the number of bits that each symbol encodes.

Data Types: double

Initial search radius of the decoding algorithm, specified as one of these options:

  • "Infinity" — Sets the initial radius to Inf.

  • "ZF solution" — Sets the initial search radius to the zero-forcing (ZF) solution. This calculation uses the pseudo-inverse of the input channel when decoding. The reduction in the initial search radius is particularly beneficial for systems with large constellations or a high number of antennas. However, in many scenarios, the additional computational effort required for the ZF solution does not yield significant benefits.

Decoding decision method, specified as "Soft" or "Hard".

  • "Soft" — The decoder outputs log-likelihood ratios (LLRs), or soft bits.

  • "Hard" — The decoder converts the soft LLRs to bits. The hard-decision output creates a logical array, assigning a zero to negative log-likelihood ratio (LLR) values and a one to all nonnegative LLR values.

Usage

Description

Y = spheredecod(X,chan) applies the soft decoding algorithm to the input signal, X, and returns decoded symbols, Y.

example

Input Arguments

expand all

Received symbols, specified as an NS-by-NR matrix. The algorithm can decode received symbols for NS channel realizations in a single invocation, with each realization comprising NR received symbols.

Data Types: single | double
Complex Number Support: Yes

Flat-fading multiple-input multiple-output (MIMO) channel, specified as one of these options:

  • NS-by-NT-by-NR array — The algorithm applies a unique channel matrix to each corresponding set of NR received symbols.

  • 1-by-NT-by-NR array — The object applies a single-channel matrix to all received symbols.

Data Types: double
Complex Number Support: Yes

Output Arguments

expand all

Output, returned as an NS×bitsPerSymbol-by-NT matrix. To specify whether the object outputs LLRs of the decoded bits or the bits themselves, use DecisionType the property.

Data Types: double | logical

Object Functions

To use an object function, specify the System object as the first input argument. For example, to release system resources of a System object named obj, use this syntax:

release(obj)

expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
resetReset internal states of System object

Examples

collapse all

Modulate a set of bits using a 16-QAM constellation, transmit the signal in two parallel streams over a MIMO channel, and decode the bits using a sphere decoder with perfect channel knowledge.

Specify the modulation order, the number of transmitted bits, and the symbol mapping.

bps = 4;                                               % Bits per symbol
M = 2^bps;                                             % Modulation order
nBits = 1e3*bps;                                       % Number of transmitted bits
symMap = [11 10 14 15 9 8 12 13 1 0 4 5 3 2 6 7];      % Symbol mapping

Generate and display the symbol mapping of the 16-QAM modulator by using the qammod function and the custom symbol map.

sym = qammod(symMap(1:M)',M,symMap, ...
    UnitAveragePower=true,PlotConstellation=true);

Figure contains an axes object. The axes object with title 16-QAM, Custom Mapping, UnitAveragePower=true, xlabel In-phase Amplitude, ylabel Quadrature Amplitude contains 19 objects of type line, text. One or more of the lines displays its values using only markers

Convert the decimal values of the symbol map to binary bits, using the leftmost bit as the most significant bit (MSB). The sphere decoder utilizes the M-by-bps matrix, bitTable, for this purpose.

bitTable = int2bit(symMap,bps)';

Create a 2-by-2 MIMO Channel System object. To use the path gains as a channel estimate, set PathGainsOutputPort to true. To ensure the repeatability of results, set the object to use the global random number stream.

mimo = comm.MIMOChannel( ...
    PathGainsOutputPort=true, ...
    RandomStream="Global stream");

Create a Sphere Decoder System object to process bits using hard-decision decoding, and configure it with the custom bit table and symbol map.

sphDec = comm.SphereDecoder(Constellation=sym, ...
    BitTable=bitTable,DecisionType="Hard");

Create an error rate System object.

berRate = comm.ErrorRate;

Set the global random number generator seed.

rng(37)

Generate a random data stream.

data = randi([0 1],nBits,1);

Modulate the data and reshape it into two streams for the 2x2 MIMO channel.

modData = qammod(data,M,symMap, ...
    InputType="bit",UnitAveragePower=true);
modData = reshape(modData,[],2);

Pass the modulated data through the MIMO fading channel and add white Gaussian noise.

[fadedSig,pathGains] = mimo(modData);
rxSig = awgn(fadedSig,10);

Decode the received signal using pathGains as a perfect channel estimate.

decodedData = sphDec(rxSig,squeeze(pathGains));

Convert the decoded hard-decision data, which is a logical matrix, into a double-precision column vector to enable the calculation of error statistics. Then, calculate and display the bit error rate and the number of errors.

dataOut = double(decodedData(:));
errorStats = berRate(data,dataOut);
errorStats(1:2)
ans = 2×1

    0.1660
  664.0000

Limitations

The output LLR values are not scaled by the noise variance. For coded links employing iterative coding (LDPC or turbo) or MIMO OFDM with Viterbi decoding, scale the output LLR values by the channel state information to achieve better performance.

Algorithms

This object uses a soft-output Schnorr-Euchner sphere decoder (SESD), executed as a single tree search (STS) for tree traversal, to implement a soft-output max-log a posteriori probability (APP) detector for MIMO systems. The algorithm operates under the assumption that all transmit antennas use the same constellation and bit table. It takes the received symbol vector and the estimated channel matrix as inputs and outputs the log-likelihood ratios (LLRs) of the transmitted bits.

The algorithm models a MIMO system with NT transmit antennas and NR receive antennas. It assumes the system simultaneously transmits NT symbols, described by the equation y = Hs + n, where y is the received symbols, H is the MIMO channel matrix, s is the transmitted symbol vector, and n is the thermal noise.

The MIMO detector seeks the maximum-likelihood (ML) solution, s^ML, such that:

s^ML=argminsoyHs2

where O is the complex-valued constellation from which the detector selects the NT elements of s.

Soft detection also computes a log-likelihood ratio (LLR) for each bit that serves as a measure of the reliability of the estimate for each bit. The calculation of the LLR employs the max-log approximation:

L(xj,b)=minsxj,b(0)yHs2λMLminsxj,b(1)yHs2λj,bML¯

where,

  • L(xj,b) is the LLR estimate for each bit.

  • xj,b is each sent bit, the bth bit of the jth symbol.

  • xj,b(0) and xj,b(1) are the disjoint sets of vector symbols that have the bth bit in the label of the jth scalar symbol equal to 0 and 1, respectively. The two λ symbols denote the distance calculated as norm squared, specifically:

    • λML is the distance s^ML.

    • λj,bML¯ is the distance to the counter-hypothesis, which denotes the binary complement of the bth bit in the binary label of the jth entry of s^ML, specifically the minimum of the symbol set xj,b(xj,bML¯), which contains all of the possible vectors for which the bth bit of the jth entry is flipped compared to the same entry of s^ML.

The equation for calculating the LLR estimate of bit xj,b varies depending on whether xj,b(xj,bML) is 0 or 1:

L(xj,b)={λMLλj,bML¯,xj,bML=0λj,bML¯λML,xj,bML=1

The design of a decoder strives to efficiently find s^ML, λML, and λj,bML¯.

The search can transform into a tree search through the sphere decoding algorithm. This involves decomposing the channel matrix into H=QR by means of a QR decomposition. Then, by left-multiplying y by QH, the problem reformulates as:

λML=argminsoy¯Rs2λj,bML¯=sxj,b(xj,bML¯)argminy¯Rs2

Using this reformulated problem statement, the triangular structure of R can be exploited to arrange a tree structure such that each of the leaf nodes corresponds to a possible s vector and the partial distances to the nodes in the tree can be calculated cumulatively adding to the partial distance of the parent node.

The STS algorithm searches the λML and λj,bML¯ metrics concurrently. The goal is to have a list containing the metric λML, along with the corresponding bit sequence xML and the metrics xj,b(xj,bML) of all counter-hypotheses. The subtree originating from a given node is searched only if the result can lead to an update of either λML or λj,bML¯.

The STS algorithm essentially involves these steps:

  1. If when reaching a leaf node, a new ML hypothesis is found (d(x)<λML), all λj,bML¯ for which xj,b=xj,bML¯ are set to λML which now turns into a valued counter-hypothesis. Then, λML is set to the current distance, d(x).

  2. If d(x)λML, only the counter-hypotheses have to be checked. For all j and b for which (d(x)<λML) and xj,b=xj,bML¯, the decoder updates λj,bML¯ to be d(x).

  3. When a node's partial distance surpasses the current λj,bML¯ value—a value subject to change during subtree traversal—the algorithm decides to prune that sub-tree.

  4. The STS algorithm stops when it has either visited each tree node once or pruned them.

References

[1] Studer, C., A. Burg, and H. Bolcskei. “Soft-Output Sphere Decoding: Algorithms and VLSI Implementation.” IEEE Journal on Selected Areas in Communications 26, no. 2 (February 2008): 290–300. https://doi.org/10.1109/JSAC.2008.080206.

[2] Cho, Yong Soo, ed. MIMO-OFDM Wireless Communications with MATLAB. Singapore ; Hoboken, NJ: IEEE Press : J. Wiley & Sons (Asia), 2010.

[3] Hochwald, B.M., and S. Ten Brink. “Achieving Near-Capacity on a Multiple-Antenna Channel.” IEEE Transactions on Communications 51, no. 3 (March 2003): 389–99. https://doi.org/10.1109/TCOMM.2003.809789.

[4] Agrell, E., T. Eriksson, A. Vardy, and K. Zeger. “Closest Point Search in Lattices.” IEEE Transactions on Information Theory 48, no. 8 (August 2002): 2201–14. https://doi.org/10.1109/TIT.2002.800499.

Extended Capabilities

Version History

Introduced in R2013a