Main Content


Encode input using orthogonal space-time block code


The comm.OSTBCEncoder System object™ encodes an input symbol sequence using orthogonal space-time block code (OSTBC). This system object maps the input symbols block-wise and concatenates the output codeword matrices in the time domain.

To encode an input symbol sequence using OSTBC:

  1. Create the comm.OSTBCEncoder 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?




ostbcenc = comm.OSTBCEncoder creates an OSTBC encoder System object, ostbcenc. This object maps the input symbols block-wise and concatenates the output codeword matrices in the time domain.

ostbcenc = comm.OSTBCEncoder(N) creates an OSTBC encoder object with the NumTransmitAntennas property set to N.

ostbcenc = comm.OSTBCEncoder(___,Name=Value) creates an OSTBC encoder object using any of the previous syntaxes and sets properties using one or more name-value arguments. For example, SymbolRate=1/2 sets the symbol rate of the code to 1/2.


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.

Number of transmit antennas, specified as 2, 3, or 4.

Data Types: double

Symbol rate of the code, specified as 3/4 or 1/2.


To enable this property, set the NumTransmitAntennas property to a value greater than 2. When you set NumTransmitAntennas to 2, the symbol rate is 1.

Data Types: double

Fixed-Point Properties

Action when fixed-point numeric values overflow, specified as "Wrap" or "Saturate". This property specifies the action to be taken in the case of an overflow. Overflow occurs when the magnitude of a fixed-point calculation result does not fit into the range of the data type and scaling that stores the result.




Y = ostbcenc(X) applies OSTBC encoding to the input data X, and returns the OSTBC-encoded data Y.

Input Arguments

expand all

Input data, specified as a complex-valued column vector or matrix of data type double, single, or signed fixed-point with power-of-two slope and zero bias. The input matrix can be of size F-by-T, where F is the additional dimension (typically the frequency domain) over which the encoding calculation is independent. Specify F as a positive integer. If you do not specify the additional dimension, specify the input as a T-by-1 column vector. The time domain length, T, of X must be a multiple of the number of symbols in each codeword matrix. Specifically, when you set the NumTransmitAntennas property to 2 or the SymbolRate property to 1/2, T must be a multiple of two, and when the SymbolRate property is 3/4, T must be a multiple of 3.

This object accepts variable-size inputs. After the object is locked, you can change the size of each input channel, but you cannot change the number of channels. For more information, see Variable-Size Signal Support with System Objects.

Data Types: single | double | fi
Complex Number Support: Yes

Output Arguments

expand all

Output data, returned as a matrix or 3-D array. For a time or spatial domain input of size T-by-1, the encoded output data, Y, is a (T/SymbolRate)-by-NumTransmitAntennas matrix. When the input matrix size is F-by-T, the output is an F-by-(T/SymbolRate)-by-NumTransmitAntennas 3-D array.

Data Types: double | single | fi

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:


expand all

stepRun System object algorithm
releaseRelease resources and allow changes to System object property values and input characteristics
cloneCreate duplicate System object
isLockedDetermine if System object is in use
resetReset internal states of System object


collapse all

Generate random binary data, modulate using the BPSK modulation scheme, and encode the modulated data using OSTBC.

Generate an 8-by-1 vector of random binary data.

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

Create a BPSK modulator System object and modulate the data.

bpskMod = comm.BPSKModulator;
modData = bpskMod(data);

Create an OSTBC encoder object and encode the modulated signal. As the default number of transmit antennas is 2, you can see that encData is an 8-by-2 matrix.

ostbcEnc = comm.OSTBCEncoder;
encData = ostbcEnc(modData)
encData = 8×2 complex

  -1.0000 + 0.0000i  -1.0000 + 0.0000i
   1.0000 + 0.0000i  -1.0000 - 0.0000i
   1.0000 + 0.0000i  -1.0000 + 0.0000i
   1.0000 + 0.0000i   1.0000 + 0.0000i
  -1.0000 + 0.0000i   1.0000 + 0.0000i
  -1.0000 + 0.0000i  -1.0000 - 0.0000i
   1.0000 + 0.0000i  -1.0000 + 0.0000i
   1.0000 + 0.0000i   1.0000 + 0.0000i


The OSTBC encoder System object supports five different OSTBC encoding algorithms. Depending on the selection for SymbolRate and NumTransmitAntennas, the System object implements one of the algorithms in this table:

Transmit AntennaRateOSTBC Codeword Matrix










In each matrix, its (l, i) entry indicates the symbol transmitted from the ith antenna in the lth time slot of the block. Values for i are in the range [1, N], where N is the number of transmit antennas. Values for l are in the range [1, L], where L is the codeword block length.

When processing variable-size signals:

  • If the input signal is a column vector, the first dimension can change, but the second dimension must remain fixed at 1.

  • If the input signal is a matrix, both dimensions can change.

Extended Capabilities

Version History

Introduced in R2012a