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(carrier,waveform,refInd,refSym) specifies carrier configuration parameters.

[offset,mag] = nrTimingEstimate(carrier,waveform,refGrid) specifies a carrier resource grid.

[offset,mag] = nrTimingEstimate(___,'CyclicPrefix',cpl) specifies the cyclic prefix length for the OFDM modulation in addition to the input arguments in any of the previous syntaxes that do not include the carrier input.

[offset,mag] = nrTimingEstimate(___,Name,Value) specifies options by using one or more name-value pair arguments in addition to any combination of input arguments from 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.

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 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

Carrier configuration parameters for a specific OFDM numerology, specified as an nrCarrierConfig object. The function uses only these properties of this input.

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

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

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

Name-Value Pair Arguments

Specify optional comma-separated pairs of Name,Value arguments. Name is the argument name and Value is the corresponding value. Name must appear inside quotes. You can specify several name and value pair arguments in any order as Name1,Value1,...,NameN,ValueN.

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

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

If you do not specify this input, or if you specify 'Nfft',[], the function sets a default value satisfying these conditions.

  • The value of this input is an integer power of 2.

  • The maximum occupancy is 85%.

  • The minimum value of this input is 128.

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.

  • Nfft is the value of the 'Nfft' input.

  • SCS is the subcarrier spacing specified in the SubcarrierSpacing property of the config input for the first function syntax, or the scs input for the other syntaxes.

Data Types: double

Carrier frequency, in Hz, specified as the comma-separated pair consisting of 'CarrierFrequency' and a nonnegative scalar. This input corresponds to f0, defined in Section 5.4 of [1].

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.

Extended Capabilities

Introduced in R2019b