nrTimingEstimate

Practical timing estimation

Description

example

[offset,mag] = nrTimingEstimate(waveform,nrb,scs,initialSlot,refInd,refSym) performs practical timing estimation by cross-correlating the input waveform waveform with a reference waveform. The function obtains the reference waveform by modulating a reference resource grid containing reference symbols refSym at locations refInd using orthogonal frequency division multiplexing (OFDM). The OFDM modulation spans nrb resource blocks at subcarrier spacing scs and initial slot number initialSlot. 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(waveform,nrb,scs,initialSlot,refGrid) specifies a predefined reference resource grid refGrid.

[offset,mag] = nrTimingEstimate(___,'CyclicPrefix',cpl) also specifies the cyclic prefix length for the OFDM modulation 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.

txGrid = zeros([240 4]);
txGrid(pssInd) = pssSym;

OFDM modulate the resource grid.

txWaveform = ofdmmod(txGrid,512,[40 36 36 36],[1:136 377:512].');

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

SR = 7.68e6;
channel = nrTDLChannel;
channel.SampleRate = SR;
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 spans 20 resource blocks at 15-kHz subcarrier spacing and uses initial slot number 0.

nrb = 20;
scs = 15;
initialSlot = 0;
offset = nrTimingEstimate(rxWaveform,nrb,scs,initialSlot,pssInd,pssSym);

Input Arguments

collapse all

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

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, or 240.

Data Types: double

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

Data Types: double

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 one-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 cpl.

  • 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

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

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, the extended cyclic prefix length only applies to 60 kHz subcarrier spacing.

Data Types: char | string

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

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2019b