Main Content


Estimates the target position using TOA measurements

Since R2024a



    tgtposest = toaposest(toaest,toavar,anchorpos) estimates the position tgtposest of a target using multiple anchors with known positions anchorpos based on time of arrival (TOA) measurements between the target and anchors. toavar represents the variance of the time of arrival measurement.

    tgtposest = toaposest(___,'PropagationSpeed',C) specifies the signal propagation speed C.

    [tgtposest,tgtposcov] = toaposest(___) returns the target position covariance matrix tgtposcov.


    collapse all

    Perform MUSIC-based TOA estimation to obtain position estimates using received signals from five anchors with known positions. The data is loaded from the TOAEstimatorExampleData file whose variables are listed here:

    • toa Anchor TOAs

    • N Number of sub-bands

    • M Number of channel samples

    • freqspacing Frequency spacing

    • npow Noise power

    • anchorpos Anchor positions

    • tgtpos Actual target position

    Load signal data.

    load TOAEstimatorExampleData; 

    Create the noise-free exponential signal models for all channels.

    expsignal = exp(-1j*2*pi*(1:N)'*(freqspacing*toa));

    Add Gaussian white noise.

      X = cell(1,L);
      for l = 1:L
          X{l} = expsignal(:,l)*ones(1,M) + ...

    Configure TOA estimator for MUSIC-based spectrum analysis.

    toaEstimator = phased.TOAEstimator('Measurement','TOA', ...
    'SpectrumMethod','MUSIC','VarianceOutputPort',true, ...
    'NoisePower',npow,'ForwardBackwardAveraging',true, ...

    Perform TOA estimation.

    [toaest,toavar] = toaEstimator(X,freqspacing);

    Perform TOA-based position estimation.

    [tgtposest,tgtposcov] = toaposest(toaest,toavar,anchorpos);

    Compute the RMSE target position estimate.

    rmsepos = rmse(tgtposest,tgtpos);
    disp(['RMS TOA positioning error = ', num2str(rmsepos), ' meters.'])
    RMS TOA positioning error = 0.10669 meters.

    Input Arguments

    collapse all

    Estimated time of arrival of signals between anchors and single target, specified as a 1-by-L real-valued vector. Units are in seconds.

    Data Types: single | double

    Variance of estimated time of arrival at anchors, specified as a 1-by-L real-valued vector.

    When toavar is unknown, you can set it to be a row vector with identical finite values without affecting the solution tgtposest.

    Data Types: single | double

    Anchor positions, specified as 2-by-L real-valued matrix or 3-by-L real-valued matrix. A 2-by-L matrix represent the anchor positions in 2-D Cartesian space while a 3-by-L matrix represents the anchor positions in 3-D Cartesian space.

    Data Types: single | double

    Signal propagation speed, specified as a positive real scalar. Units are in meters per second.

    Example: 3e8

    Data Types: single | double

    Output Arguments

    collapse all

    Estimated target positions, returned as a Q-by-1 vector representing the estimated target position obtained from TOA and TDOA measurements. Units are in meters.

    Target position covariance matrix, returned as a real-valued positive semi-definite Q-by-Q matrix. The covariance matrix represents the estimated target position covariance based on TOA measurements. tgtposcov is calculated through Cramer-Rao lower bound (CRLB) of the TOA position estimator. Calculation of the covariance requires the knowledge of toavar. When toavar is inaccurate, tgtposcov is also inaccurate. When toavar is accurate and small, the tgtposcov achieves the TOA position estimate CRLB. Units are in ㎡eters-squared.

    Data Types: single | double


    collapse all


    This function supports single and double precision for input arguments. If the input argument toaest is single precision, the outputs are single precision. If the input argument toaest is double precision, the outputs are double precision. The precision of the outputs are independent of the precision of the other arguments.

    Positioning Estimation

    This function uses a two-step weighted linear least squares (WLLS) algorithm to fuse TOA measurements toaest and the known anchor positions anchorpos into a target position tgtposest, where the weights used in the WLLS algorithm are calculated from toaest and the TOA estimation variance toavar. The two-step WLLS algorithm is an approximate realization of the maximum-likelihood estimation algorithm and can attain the TOA position estimation Cramer-Rao lower bound (CRLB) when the TOA estimation errors are small.


    [1] Reza Zekavat and R. Michael Buehrer, Handbook of Position Location: Theory, Practice, and Advances, 2019

    [2] Andreas F. Molisch. Wireless Communications: From Fundamentals to Beyond 5G, 3rd Edition, 2023

    [3] Y. T. Chan and K. C. Ho, "A simple and efficient estimator for hyperbolic location," in IEEE Transactions on Signal Processing, vol. 42, no. 8, pp. 1905-1915, Aug. 1994

    [4] P. Stoica and A. Nehorai, "MUSIC, maximum likelihood, and Cramer-Rao bound," in IEEE Transactions on Acoustics, Speech, and Signal Processing, vol. 37, no. 5, pp. 720-741, May 1989

    Extended Capabilities

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

    Version History

    Introduced in R2024a