Main Content

nrTimingEstimate

Practical timing estimation

Since R2019b

Syntax

``[offset,mag] = nrTimingEstimate(carrier,waveform,refGrid)``
``[offset,mag] = nrTimingEstimate(carrier,waveform,refInd,refSym)``
``[offset,mag] = nrTimingEstimate(waveform,nrb,scs,initialNSlot,refGrid)``
``[offset,mag] = nrTimingEstimate(waveform,nrb,scs,initialNSlot,refInd,refSym)``
``[offset,mag] = nrTimingEstimate(___,Name,Value)``

Description

````[offset,mag] = nrTimingEstimate(carrier,waveform,refGrid)` performs practical timing estimation by cross-correlating input waveform `waveform` with a reference waveform. The function obtains the reference waveform by modulating reference resource grid `refGrid` using orthogonal frequency division multiplexing (OFDM). `carrier` specifies the parameters for the OFDM modulation. The function returns the estimated timing offset, `offset`, and the estimated impulse response magnitude, `mag`, for each receive antenna in the input waveform.```
````[offset,mag] = nrTimingEstimate(carrier,waveform,refInd,refSym)` obtains the reference waveform by modulating a reference resource grid containing reference symbols `refSym` at locations `refInd` and using the OFDM modulation specified by `carrier`.```

example

````[offset,mag] = nrTimingEstimate(waveform,nrb,scs,initialNSlot,refGrid)` obtains the reference waveform by modulating reference resource grid `refGrid` and using OFDM modulation that spans `nrb` resource blocks at subcarrier spacing `scs` and initial slot number `initialNSlot`. ```
````[offset,mag] = nrTimingEstimate(waveform,nrb,scs,initialNSlot,refInd,refSym)` obtains the reference waveform by modulating a resource grid containing reference symbols `refSym` at locations `refInd` and using the OFDM modulation specified by `nrb`, `scs`, and `initialNSlot`.```
````[offset,mag] = nrTimingEstimate(___,Name,Value)` specifies options by using one or more name-value pair arguments in addition to the input arguments in any of the previous syntaxes.```

Examples

collapse all

Generate primary synchronization signal (PSS) symbols for physical layer cell identity number 42.

```ncellid = 42; pssSym = nrPSS(ncellid);```

Obtain resource element indices for the PSS.

`pssInd = nrPSSIndices();`

Create a resource grid containing the generated PSS symbols.

```nrb = 20; scs = 15; carrier = nrCarrierConfig('NSizeGrid',nrb,'SubcarrierSpacing',scs); txGrid = nrResourceGrid(carrier); txGrid(pssInd) = pssSym;```

OFDM modulate the resource grid.

`txWaveform = nrOFDMModulate(carrier,txGrid);`

Transmit the waveform through a TDL-C channel model by using a sample rate of 7.68 MHz.

```ofdmInfo = nrOFDMInfo(carrier); channel = nrTDLChannel; channel.SampleRate = ofdmInfo.SampleRate; channel.DelayProfile = 'TDL-C'; rxWaveform = channel(txWaveform);```

Estimate timing offset for the transmission by using the PSS symbols as reference symbols. The OFDM modulation of the reference symbols uses initial slot number 0.

```initialNSlot = 0; offset = nrTimingEstimate(rxWaveform,nrb,scs,initialNSlot,pssInd,pssSym);```

Input Arguments

collapse all

Carrier configuration parameters for a specific OFDM numerology, specified as an `nrCarrierConfig` object. Only these object properties are relevant for this function.

Number of RBs in the carrier resource grid, specified as an integer from 1 to 275. The default value of `52` corresponds to the maximum number of RBs of a 10 MHz carrier with 15 kHz SCS.

Data Types: `double`

Subcarrier spacing in kHz, for all channels and reference signals of the carrier, specified as `15`, `30`, `60`, `120`, `240`, `480`, or `960`.

Data Types: `double`

Slot number, specified as a nonnegative integer. You can set `NSlot` to a value larger than the number of slots per frame. For example, you can set this value using transmission loop counters in a MATLAB® simulation. In this case, you may have to ensure that the property value is modulo the number of slots per frame in a calling code.

Data Types: `double`

Cyclic prefix length, specified as one of these options.

• `'normal'` — Use this value to specify normal cyclic prefix. This option corresponds to 14 OFDM symbols in a slot.

• `'extended'` — Use this value to specify extended cyclic prefix. This option corresponds to 12 OFDM symbols in a slot. For the numerologies specified in TS 38.211 Section 4.2, extended cyclic prefix length applies for only 60 kHz subcarrier spacing.

Data Types: `char` | `string`

Received waveform, specified as a T-by-NR complex matrix.

• T is the number of time-domain samples.

• NR is the number of receive antennas.

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

Predefined reference grid, specified as a K-by-N-by-P complex array. `refGrid` can span multiple slots.

• K is the number of subcarriers equal to `nrb` × 12.

• N is the number of OFDM symbols in the reference grid.

• P is the number of reference signal ports.

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

Reference symbol indices, specified as an integer matrix. The number of rows equals the number of resource elements. You can specify all indices in a single column or distribute them across several columns. The number of elements in `refInd` and `refSym` must be the same but their dimensionality can differ. The function reshapes `refInd` and `refSym` into column vectors before mapping them into a reference grid: `refGrid(refInd(:)) = refSym(:)`.

The elements of `refInd` are 1-based linear indices addressing a K-by-L-by-P resource array.

• K is the number of subcarriers equal to `nrb` × 12.

• L is the number of OFDM symbols in a slot. L is 12 or 14, depending on the cyclic prefix length specified in the `cpl` input or the `CyclicPrefix` property of the `carrier` input.

• P is the number of reference signal ports, inferred from the range of values in `refInd`.

Data Types: `double`

Reference symbols, specified as a complex matrix. The number of rows equals the number of resource elements. You can specify all symbols in a single column or distribute them across several columns. The number of elements in `refInd` and `refSym` must be the same but their dimensionality can differ. The function reshapes `refInd` and `refSym` into column vectors before mapping them into a reference grid: ```refGrid(refInd(:)) = refSym(:)```.

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

Number of resource blocks, specified as an integer from 1 to 275.

Data Types: `double`

Subcarrier spacing in kHz, specified as `15`, `30`, `60`, `120`, `240`, `480`, or `960`.

Data Types: `double`

Initial slot number, 0-based, specified as a nonnegative integer. The function selects the appropriate cyclic prefix length for the OFDM modulation based on the value of `initialNSlot` modulo the number of slots per subframe.

Data Types: `double`

Name-Value Arguments

Specify optional pairs of arguments as `Name1=Value1,...,NameN=ValueN`, where `Name` is the argument name and `Value` is the corresponding value. Name-value arguments must appear after other arguments, but the order of the pairs does not matter.

Before R2021a, use commas to separate each name and value, and enclose `Name` in quotes.

Example: `'SampleRate','1e9'` specifies a sample rate of 1×109 Hz.

Cyclic prefix length, specified as the comma-separated pair consisting of `'CyclicPrefix'` and one of these values:

• `'normal'` — Use this value to specify normal cyclic prefix. This option corresponds to 14 OFDM symbols in a slot.

• `'extended'` — Use this value to specify extended cyclic prefix. This option corresponds to 12 OFDM symbols in a slot. For the numerologies specified in TS 38.211 Section 4.2, the extended cyclic prefix length only applies to 60 kHz subcarrier spacing.

Note

If you specify the `carrier` input, use the `CyclicPrefix` property of the `carrier` input to specify the cyclic prefix length. You cannot use this name-value pair argument together with the `carrier` input.

Data Types: `char` | `string`

Number of fast Fourier transform (FFT) points, specified as the comma-separated pair consisting of `'Nfft'` and a nonnegative integer greater than 127 or `[]`. The value you specify must result in integer-valued cyclic prefix lengths and a maximum occupancy of 100%. The occupancy is defined as the value of (12 × NRB)/`Nfft`, where NRB is the number of resource blocks.

If you do not specify this input, or if you specify `'Nfft',[]`, the function sets an integer value greater than 127 as a default value for this input. The actual default value depends on other input values.

• If you do not specify the `SampleRate` input, or if you specify `'SampleRate',[]`, the function sets `Nfft` satisfying these conditions.

• `Nfft` is an integer power of 2.

• `Nfft` results in a maximum occupancy of 85%.

• If you specify the `SampleRate` input, the function sets `Nfft` satisfying these conditions.

• `Nfft` results in integer-valued cyclic prefix lengths.

• `Nfft` maximises the value of `gcd` (`Nfft` × SCS, `SampleRate`), where SCS is specified by the `carrier``.SubcarrierSpacing` property or the `scs` input.

For more information, see Configure OFDM Sample Rate and FFT Size.

Data Types: `double`

Waveform sample rate, specified as the comma-separated pair consisting of `'SampleRate'` and either a positive scalar or `[]`.

If you do not specify this input, or if you specify `'SampleRate',[]`, then the function sets this input to the value of Nfft × SCS.

For more information, see Configure OFDM Sample Rate and FFT Size.

Data Types: `double`

Carrier frequency in Hz, specified as the comma-separated pair consisting of `'CarrierFrequency'` and a real number. This input corresponds to f0, defined in TS 38.211 Section 5.4.

Data Types: `double`

Output Arguments

collapse all

Estimated timing offset in samples, returned as a nonnegative integer. The number of samples is relative to the first sample of the input waveform `waveform`.

Data Types: `double`

Estimated impulse response magnitude, for each receive antenna in the input waveform `waveform`, returned as a T-by-NR real matrix.

• T is the number of time-domain samples.

• NR is the number of receive antennas.

`mag` inherits the data type of the input `waveform`.

Data Types: `single` | `double`

References

[1] 3GPP TS 38.211. “NR; Physical channels and modulation.” 3rd Generation Partnership Project; Technical Specification Group Radio Access Network.

Version History

Introduced in R2019b

expand all