# Documentation

### This is machine translation

Translated by
Mouse over text to see original. Click the button below to return to the English verison of the page.

# lteFrequencyOffset

Frequency offset estimation using cyclic prefix

## Syntax

• ``foffset = lteFrequencyOffset(cfgdl,waveform)``
• ``foffset = lteFrequencyOffset(cfgul,waveform)``
example
• ``````[foffset, corr] = lteFrequencyOffset(___)``````
• ``````[foffset, corr] = lteFrequencyOffset(___,toffset)``````

## Description

````foffset = lteFrequencyOffset(cfgdl,waveform)` estimates the average frequency offset, `foffset`, of the time-domain waveform, `waveform`, by calculating correlation of the cyclic prefix. The parameters of `waveform` are given in the downlink settings structure, `cfgdl`. `cfgdl` must contain the field `NDLRB` to specify that a downlink signal is expected in `waveform`. ```

example

````foffset = lteFrequencyOffset(cfgul,waveform)` estimates the average frequency offset, `foffset`, of the time-domain waveform, `waveform`, by calculating correlation of the cyclic prefix. The parameters of `waveform` are given in the uplink settings structure, `cfgul`. `cfgul` must contain the field `NULRB` to specify that an uplink signal is expected in `waveform`. ```
``````[foffset, corr] = lteFrequencyOffset(___)``` also returns a complex matrix, `corr`, spanning one slot and containing the same number of antennas, or columns, as `waveform`. `corr` is the signal used to extract the timing of the correlation for the estimation of the frequency offset.```
``````[foffset, corr] = lteFrequencyOffset(___,toffset)``` provides control over the position in the correlator output used to estimate the frequency offset. When present `toffset` is the timing offset in samples from the start of the correlator output to the position used for the frequency offset estimation. This input allows a timing offset to be calculated externally on a signal of longer duration than the input `waveform`. Which allows a short-term frequency offset estimate to be obtained while retaining the benefit of a longer-term timing estimate.Note:   If `toffset` is absent, the quality of the internal timing estimate is subject to the length and signal quality of the input `waveform` and, therefore, it may result in inaccurate frequency offset measurements.```

## Examples

collapse all

Perform frequency offset estimation and correction on an uplink signal, to which a frequency offset has been applied.

```[txWaveform,rgrid,cfg] = lteRMCULTool('A3-2',[1;0;0;1],'Fdd',2); ```

Apply an arbitrary frequency offset of 51.2 Hz.

```t = (0:length(txWaveform)-1).'/cfg.SamplingRate; txWaveform = txWaveform .* exp(1i*2*pi*51.2*t); ```

Estimate and display the frequency offset.

```offset = lteFrequencyOffset(cfg,txWaveform); disp(['Frequency offset: ' num2str(offset) ' Hz']) ```
```Frequency offset: 51.2 Hz ```

Correct for frequency offset.

```rxWaveform = lteFrequencyCorrect(cfg,txWaveform,offset); ```

Perform SC-FDMA demodulation.

```rxGrid = lteSCFDMADemodulate(cfg,rxWaveform); ```

## Input Arguments

collapse all

Downlink configuration, specified as a structure having the following fields.

Parameter FieldRequired or OptionalValuesDescription
`NDLRB`Required

Scalar integer from 6 to 110

Number of downlink resource blocks. (${N}_{\text{RB}}^{\text{DL}}$)

`CyclicPrefix`Optional

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

Cyclic prefix length

`DuplexMode`Optional

`'FDD'` (default), `'TDD'`

Duplexing mode, specified as:

• `'FDD'` for Frequency Division Duplex or

• `'TDD'` for Time Division Duplex

The following apply when `DuplexMode` is set to `'TDD'`.

`TDDConfig`Optional

0 (default), 1, 2, 3, 4, 5, 6

`SSC`Optional

0 (default), 1, 2, 3, 4, 5, 6, 7, 8, 9

Special subframe configuration (SSC)

`NSubframe`Optional

0 (default), nonnegative scalar integer

Subframe number

Data Types: `struct`

Uplink configuration, specified as a structure having the following fields.

Parameter FieldRequired or OptionalValuesDescription
`NULRB`Required

Scalar integer from 6 to 110

Number of uplink resource blocks. (${N}_{\text{RB}}^{\text{UL}}$)

`CyclicPrefixUL`Optional

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

Cyclic prefix length

`DuplexMode`Optional

`'FDD'` (default), `'TDD'`

Duplexing mode, specified as:

• `'FDD'` for Frequency Division Duplex or

• `'TDD'` for Time Division Duplex

The following apply when `DuplexMode` is set to `'TDD'`.

`TDDConfig`Optional

0 (default), 1, 2, 3, 4, 5, 6

`SSC`Optional

0 (default), 1, 2, 3, 4, 5, 6, 7, 8, 9

Special subframe configuration (SSC)

`NSubframe`Optional

0 (default), nonnegative scalar integer

Subframe number

Data Types: `struct`

Input time-domain waveform, specified as a numeric column vector.

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

Timing offset, specified as a scalar value expressed in samples. Use `toffset` to control the position in the correlator output used to estimate the frequency offset. If `toffset` is absent, or empty, the position of the peak magnitude of the correlator output is used.

Data Types: `double` | `single`

## Output Arguments

collapse all

Average frequency offset estimate, returned as a scalar value expressed in Hertz. This function can only accurately estimate frequency offsets of up to ±7.5 kHz (a range of 15 kHz, the subcarrier spacing).

Data Types: `double` | `single`

Correlation timing signal, returned as a numeric matrix. `corr` is a complex matrix that spans one slot and contains the same number of antennas, or columns, as `waveform`. It is the signal used to extract the timing of the correlation for the frequency offset estimation.

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