Time of Arrival (ToA)/Delay Estimation
This modules is used for estimating delays or time of arrival (ToA) of a received signal with respect to transmitted signal. The details about the input arguments of this module is provide in table below:
The following examples demonstrates the way to estimate delays an ToA using 5G Toolkit.
Code example for ToA Estimation based on ESPRIT Method
# shape of Hf: (numSubcarriers, numObservations)
# scs is number storing sub-carrier spacing
# ``numberOfPath`` or L denotes number of strongest paths whose ToA is to be estimated.
toaEstimation = ToAEstimation("ESPRIT", shape = Hf.shape)
Lpath = 4
delays = np.sort(toaEstimation(H = Hf, numberOfPath=Lpath, subCarrierSpacing=scs))
toaEst = delays[0]
Code example for ToA Estimation based on MUSIC Algorithm
# shape of Hf: (numSubcarriers, numObservations)
# ``scs`` is number storing sub-carrier spacing
# ``numberOfPath`` or L denotes number of strongest paths whose ToA is to be estimated.
L = 12
min_delay = 10**(-8)
max_delay = 2.5*10**(-6)
toaEstimation = ToAEstimation("MUSIC", numSamples=1024)
delays = np.sort(toaEstimation(H = Hf, numberOfPath=L, subCarrierSpacing=scs,
min_delay=min_delay, max_delay=max_delay,
prominence=0.05, height = 0.05))
toaEst = delays[0]
toaEstimation.display()
Code example for ToA Estimation based on DFT Method
# shape of Hf: (numSubcarriers, numObservations)
# ``scs`` is number storing sub-carrier spacing
# ``numberOfPath`` or L denotes number of strongest paths whose ToA is to be estimated.
L = 12
toaEstimation = ToAEstimation("DFT", oversamplingFactor=8)
delays = np.sort(toaEstimation(H = Hf, numberOfPath=L, subCarrierSpacing=scs,
prominence=0.05, height = 0.05))
toaEst = delays[0]
toaEstimation.display()
API Documentation
The following section provides the detailed documentation of the API for ToAEstimation Class.
- class toolkit5G.Positioning.ToAEstimation(method=None, shape=None, numSamples=1000, oversamplingFactor=1)[source]
This module is used for estimation the time or arrival/delays between the transmitter and receiver based on the channel state information (CSI).
Note
shape
is relevant only for “ESPRIT” method.oversamplingFactor
is relevant only for “DFT” method.numSamples
is relevant only for “MUSIC” method.
- Parameters:
method – str Defines the method for ToA estimation \(\{\) “ESPRIT”, “MUSIC”, “DFT” \(\}\)
shape – (2,), tuple shape of channel estimates matrix which has a dimension of \(\text{N}_\text{sc} \times \text{N}_\text{obs}\) where \(\text{N}_\text{sc}\) denotes the number of subcarriers and \(\text{N}_\text{obs}\) number of diverse observations/measurements of channel estimates available. For example shape = (1024, 16) if channel is estimated over 1024 subcarriers and 16 independent channel observations.
oversamplingFactor – int Defines the time domain oversampling factor. Default value is 1. It also represents the factor for the DFT interpolation.
numSamples – int Number of samples for MUSIC spectrum computation. Default value is 1000.
- Input:
H ((
numSubcarriers
,:), np.complex) – Frequency domain (OFDM) channel state information acrossnumSubcarriers
. The second dimension provides the information diversity (time domain, space domain etc.).numberOfPath (int) – Number of paths. The delay/ToA of each path in estimated. Default value is 1.
subCarrierSpacing (int or float) – Subcarrier spacing in Hz.
min_delay=0 – minimum possible values of delay. Default value is 0. It is used for computing the MUSIC spectrum.
max_delay=10**(-5) – maximum possible values of delay. Default value is 0. It is used for computing the MUSIC spectrum.
height (float) – Heigth value used for identifying the spikes in the MUSIC spectrum. Default value is 0.05. For more details, read
height
infind_peaks
module ofSciPy
.prominence (float) – Prominence value used for identifying the spikes in the MUSIC spectrum. Default value is 0.05. For more details, read
prominence
infind_peaks
module ofSciPy
.
- Output:
(
numPaths
, ), float – Delays of numPaths-strongest multi-paths.
Note
min_delay
is relevant only for “MUSIC” method.max_delay
is relevant only for “MUSIC” method.height
is relevant only for “MUSIC” and “DFT” method.prominence
is relevant only for “MUSIC” and “DFT” method.
- Raises:
ValueError – [Error-ToAEstimation]: ‘method’ must be one from the set {‘ESPRIT’, ‘MUSIC’, ‘DFT’}!
Warning – [Warning-ToAEstimation]: Nothing to display for ‘ESPRIT’ method!
ValueError – [Error-DFT_ToA]: ‘H’ should be a 2D NumPy array!
ValueError – [Error-DFT_ToA]: ‘numPaths’ must be a positive integer less than number of Nfft!
ValueError – [Error-DFT_ToA]: ‘subcarrierSpacing’ must be non-negative integer or float!
ValueError – [Error-DFT_ToA]: ‘height’ must be non-negative number!
ValueError – [Error-DFT_ToA]: ‘prominence’ must be non-negative number!
ValueError – [Error-DFT_ToA]: ‘Num-subcarriers’(Nfft) must be a positive integer!
ValueError – [Error-DFT_ToA]: ‘xMin’ must be a positive number!
ValueError – [Error-DFT_ToA]: ‘xMax’ must be a positive number larger than ‘xMin’!
ValueError – [Error-MUSIC_ToA]: ‘H’ should be a 2D NumPy array!
ValueError – [Error-MUSIC_ToA]: ‘subCarrierSpacing’ must be non-negative integer or float!
ValueError – [Error-MUSIC_ToA]: ‘numSamples’ must be a positive integer!
ValueError – [Error: MUSIC-ToA]: numberOfPath (number of paths) must be a positive integer less than number of subcarriers!
ValueError – [Error-MUSIC_ToA]: ‘numSubcarriers’ must be a positive integer!
ValueError – [Error-MUSIC_ToA]: ‘numberOfPath’ must be a positive integer less than number of subcarriers!
ValueError – [Error-MUSIC_ToA]: ‘min_delay’ must be non-negative integer or float!
ValueError – [Error-MUSIC_ToA]: ‘max_delay’ must be non-negative integer or float greater than ‘min_delay’
ValueError – [Error-MUSIC_ToA]: ‘idxLow’ must be an integer from interval [0, numSubcarriers]!
ValueError – [Error-MUSIC_ToA]: ‘idxHigh’ must be an integer from interval [idxLow, numSubcarriers]!
ValueError – [Error-ESPRIT_ToA]: ‘H’ should be a 2D NumPy array!
ValueError – [Error-ESPRIT_ToA]: shape of H must be tuple of size 2!
ValueError – [Error-ESPRIT_ToA]: Neither of the two dimensions in ‘shape’ can be zero!
ValueError – [Error-ESPRIT_TOA]: The ‘shape[0]’ must be Even!
ValueError – [Error-ESPRIT_ToA]: ‘subCarrierSpacing’ must be non-negative integer or float!
ValueError – [Error-ESPRIT_ToA]: numSubcarriers must be a positive integer!
ValueError – [Error-ESPRIT_ToA]: ‘numberOfPath’ must be a positive integer less than number of subcarriers!
The details about the ToA estimation methods used in this package are discussed below.
TOA/Delay Estimation Methods