# wlanBCCEncode

Convolutionally encode binary data

## Syntax

``y = wlanBCCEncode(bits,rate)``

## Description

example

````y = wlanBCCEncode(bits,rate)` convolutionally encodes the binary input `bits` using a binary convolutional code (BCC) at the specified `rate`.```

## Examples

collapse all

Encode a sequence of data bits by using a BCC of rate 3/4.

Create the sequence of data bits.

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

BCC-encode the data bits.

```encodedData = wlanBCCEncode(dataBits,'3/4'); size(encodedData)```
```ans = 1×2 400 1 ```

Encode two streams of data bits by using a BCC of rate 1/2.

Create the sequence of data bits.

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

Parse the sequence of bits for the specified number of encoded streams.

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

BCC-encode the parsed sequence.

```rate = 1/2; encodedData = wlanBCCEncode(parsedData,rate); size(encodedData)```
```ans = 1×2 100 2 ```

## Input Arguments

collapse all

Input sequence with data bits to encode, specified as a binary matrix. The number of columns must equal the number of encoded streams. Each stream is encoded separately.

For more information on BCC, see sections 17.3.5.6 and 19.3.11.6 in .

Data Types: `double` | `int8`

Code rate of the binary convolutional code (BCC), specified as a numeric scalar, character vector, or string scalar. To select a code rate, specify this input as a value in accordance with the table.

Code RateScalarCharacter VectorString
1/2`1/2``'1/2'``"1/2"`
2/3`2/3``'2/3'``"2/3"`
3/4`3/4``'3/4'``"3/4"`
5/6`5/6``'5/6'``"5/6"`

Example: `'3/4'`

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

## Output Arguments

collapse all

Binary convolutionally encoded output, returned as a binary matrix of the same type as the `bits` input. The number of rows of `y` is the result of dividing the number of rows of input `bits` by `rate`, rounded to the next integer. The number of columns of `y` is equal to the number of columns of `bits`.

Data Types: `double` | `int8`

 IEEE Std 802.11™-2020 (Revision of IEEE Std 802.11-2016). “Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications.” IEEE Standard for Information technology — Telecommunications and information exchange between systems. Local and metropolitan area networks — Specific requirements.
{"ft_lang_label":"__label__en","ft_lang_prob":0.6481764,"math_prob":0.97585994,"size":2197,"snap":"2022-27-2022-33","text_gpt3_token_len":633,"char_repetition_ratio":0.12266302,"word_repetition_ratio":0.06395349,"special_character_ratio":0.2835685,"punctuation_ratio":0.13211845,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.984033,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2022-07-03T05:23:36Z\",\"WARC-Record-ID\":\"<urn:uuid:2f270ab4-3cd6-44fc-af02-5d02d04cc87e>\",\"Content-Length\":\"89475\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:b0b92da1-575f-401b-8f66-ee0c34672337>\",\"WARC-Concurrent-To\":\"<urn:uuid:1631abf2-02ab-4b7c-bf4a-e6ad197291d6>\",\"WARC-IP-Address\":\"104.68.243.15\",\"WARC-Target-URI\":\"https://it.mathworks.com/help/wlan/ref/wlanbccencode.html\",\"WARC-Payload-Digest\":\"sha1:KDACDJNE7FG3B6RNAESHQV4K5MYLC4B4\",\"WARC-Block-Digest\":\"sha1:BGQ2AUZBNJSKBMFXJI4KV2KXKG4O6UOW\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2022/CC-MAIN-2022-27/CC-MAIN-2022-27_segments_1656104215790.65_warc_CC-MAIN-20220703043548-20220703073548-00499.warc.gz\"}"}