Documentation

### This is machine translation

Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

# wlanBCCDecode

Convolutionally decode input data

## Syntax

``y = wlanBCCDecode(sym,rate) ``
``y = wlanBCCDecode(sym,rate,decType) ``
``y = wlanBCCDecode(sym,rate,tDepth) ``
``y = wlanBCCDecode(sym,rate,decType,tDepth) ``

## Description

example

````y = wlanBCCDecode(sym,rate) `convolutionally decodes the input `sym` using a binary convolutional code (BCC) at the specified `rate`. The BCC is defined in IEEE® 802.11™-2012 Sections 18.3.5.6 and 20.3.11.6.```
````y = wlanBCCDecode(sym,rate,decType) `specifies the decoding type of the Viterbi decoding algorithm. ```

example

````y = wlanBCCDecode(sym,rate,tDepth) `specifies the traceback depth of the Viterbi decoding algorithm. ```

example

````y = wlanBCCDecode(sym,rate,decType,tDepth) `specifies the decoding type and the traceback depth. `decType` and `tDepth` can be placed in any order after `rate`.```

## Examples

collapse all

Decode two encoded streams of soft bits by using a BCC of rate 1/2.

Create the sequence of data bits.

`dataBits = randi([0 1],100,1,'int8');`

Parse the data bits as defined in IEEE® 802.11™-2012 Section 20.3.11.5 and IEEE® 802.11ac™-2013 Section 22.3.10.5.2. `numES` is the number of encoded streams.

```numES = 2; parsedData = reshape(dataBits,numES,[]).';```

BCC-encode the parsed sequence.

`encodedData = wlanBCCEncode(parsedData,'1/2');`

Convert the encoded bits to soft bits (i.e. LLR demodulation).

`demodData = double(1-2*encodedData);`

BCC-decode the demodulated data.

`decodedData = wlanBCCDecode(demodData,'1/2');`

Deparse the decoded data.

`deparsedData = reshape(decodedData.',[],1);`

Verify that the decoded data matches the original data.

`isequal(dataBits,deparsedData)`
```ans = logical 1 ```

Decode a sequence of soft bits by using a BCC of rate 3/4 and a traceback depth of 60.

Create the sequence of data bits.

`dataBits = randi([0 1],300,1);`

BCC-encode the sequence of bits.

`encodedData = wlanBCCEncode(dataBits,3/4);`

Convert the encoded bits to soft bits (i.e. LLR demodulation).

`demodData = 1-2*encodedData;`

BCC-decode the demodulated bits.

```tDepth = 60; decodedData = wlanBCCDecode(demodData,3/4,tDepth);```

Verify that the decoded data matches the original data.

`isequal(dataBits,decodedData)`
```ans = logical 1 ```

Decode a sequence of hard bits by using a BCC of rate 3/4 and a traceback depth of 45.

Create the sequence of data bits.

`dataBits = randi([0 1],300,1,'int8');`

BCC-encode the sequence of bits.

`encodedData = wlanBCCEncode(dataBits,'2/3');`

Perform hard BCC decoding on the encoded bits. Specify a traceback depth 45.

```tDepth = 45; decodedBits = wlanBCCDecode(encodedData,'2/3','hard',tDepth);```

Verify that the decoded bits match the original bits.

`isequal(dataBits,decodedBits)`
```ans = logical 1 ```

## Input Arguments

collapse all

Input sequence of symbols to decode, specified as a numeric matrix of integers. The number of columns must be the number of encoded streams. Each stream is encoded separately. When `decType` is `'soft'` or not specified, `sym` must be a real matrix with log-likelihood ratios. Positive values represent a logical 0 and negative values represent a logical 1.

Data Types: `double` | `int8`

Code rate of the binary convolutional code (BCC), specified as a scalar, character array, or string scalar. `rate` must be a numeric value equal to 1/2, 2/3, 3/4, or 5/6, or a character vector or string scalar equal to `'1/2'`, `'2/3'`, `'3/4'`, or `'5/6'`.

Example: `'3/4'`

Data Types: `double` | `char` | `string`

Decoding type of the binary convolutional code (BCC), specified as a character vector or a string scalar. It can be `'hard'` for a hard input Viterbi algorithm, or `'soft'` for a soft input Viterbi algorithm without any quantization.

Data Types: `char` | `string`

Traceback depth of the Viterbi decoding algorithm, specified as a positive integer less than or equal to the number of input symbols in `sym`.

Example: ```y = wlanBCCDecode(sym,'1/2','hard',50)```

Data Types: `double`

## Output Arguments

collapse all

Binary convolutionally decoded output, returned as a binary matrix of integers. The number of rows of `y` is equal to the number of rows of input `sym` multiplied by `rate`, rounded to the next integer. The number of columns of `y` is equal to the number of columns of `sym`.

Data Types: `int8`

## See Also

#### Introduced in R2017b

##### Support Get trial now