# ltePUCCH2DRSDecode

PUCCH format 2 DRS decoding

## Syntax

``ack = ltePUCCH2DRSDecode(ue,chs,oack,sym)``

## Description

example

````ack = ltePUCCH2DRSDecode(ue,chs,oack,sym)` returns a vector of hybrid automatic repeat request (HARQ) indicator values, `ack`, obtained by performing PUCCH format 2 DRS decoding of the complex matrix, `sym`. The decoder uses a maximum likelihood (ML) approach, assuming that `sym` has already been equalized, to best restore the originally transmitted complex values. The symbols for each antenna are in the columns of `sym`. The number of columns in `sym` should match the number of PUCCH resource indices specified in the `chs` structure. `oack` specifies the number of HARQ indicator values expected.`ack` is a column vector containing `oack` HARQ indicator (HI) values. ```

## Examples

collapse all

Decode a PUCCH format 2A DM-RS from a synchronized and equalized resource array.

Initialize input configuration structures demonstrating use of `'Name',Value` pair assignment and direct field assignment.

```ue = struct('NULRB',6,'NCellID',0,'NSubframe',0,'Hopping','Off'); pucch2 = struct('ResourceIdx',0);```
```ue.CyclicPrefixUL = 'Normal'; ue.NTxAnts = 1; pucch2.ResourceSize = 0; pucch2.CyclicShifts = 0;```

For the transmitter, create the PUCCH format 2A DM-RS.

```reGrid = lteULResourceGrid(ue); drsIndices = ltePUCCH2DRSIndices(ue,pucch2); txAck = [1;0]; reGrid(drsIndices) = ltePUCCH2DRS(ue,pucch2,txAck);```

On the receiver side, decode the PUCCH format 2 DM-RS symbols and view `rxAck` to confirm it matches `txAck`

```drsSymbols = reGrid(drsIndices); rxAck = ltePUCCH2DRSDecode(ue,pucch2,length(txAck),drsSymbols)```
```rxAck = 2x1 logical array 1 0 ```

## Input Arguments

collapse all

UE-specific configuration settings, specified as a structure that can contain the following fields.

Parameter FieldRequired or OptionalValuesDescription
`NCellID`Required

Integer from 0 to 503

Physical layer cell identity

`NSubframe`Required

0 (default), nonnegative scalar integer

Subframe number

`CyclicPrefixUL`Optional

`'Normal'` (default), `'Extended'`

Cyclic prefix length

`Hopping`Optional

`'Off'` (default), `'Group'`

Frequency hopping method.

`NPUCCHID`Optional

Integer from 0 to 503

PUCCH virtual cell identity. If this field is not present, `NCellID` is used as the identity.

PUCCH channel settings, specified as a structure that can contain the following fields.

Parameter FieldRequired or OptionalValuesDescription
`ResourceIdx`Optional

0 (default), integer from 0 to 1185 or vector of integers.

PUCCH resource indices which determine the physical resource blocks, cyclic shift, and orthogonal cover used for transmission. (${n}_{PUCCH}^{\left(2\right)}$). Define one index for each transmission antenna.

`ResourceSize`Optional

0 (default), integer from 0 to 98.

Size of resource allocated to PUCCH format 2 (${N}_{RB}^{\left(2\right)}$)

`CyclicShifts`Optional

0 (default), integer from 0 to 7

Number of cyclic shifts used for format 1 in resource blocks (RBs) with a mixture of format 1 and format 2 PUCCH, specified as an integer from 0 to 7. (${N}_{cs}^{\left(1\right)}$)

`oack` specifies the number of HARQ indicator values expected, specified as nonnegative integer vector. The number of HARQ indicator values is 1 for PUCCH format 2A and 2 for PUCCH format 2B.

Data Types: `double`

Symbols for each antenna, specified as complex numeric matrix. The number of columns in `sym` should match the number of PUCCH resource indices specified in the `chs` structure.

Example: 0.25881 + 0.9659i

Data Types: `double`
Complex Number Support: Yes

## Output Arguments

collapse all

Hybrid ARQ indicator values, returned as a logical column vector. This output is obtained by performing PUCCH format 1 decoding of the complex matrix, `sym`.

Data Types: `logical`