Main Content

802.11az Three-Dimensional Tracking Using Time of Arrival Estimation

Since R2024b

This example shows how to use an IEEE 802.11az Wi-Fi network to track Wi-Fi devices in a three-dimensional space using time of arrival (TOA) estimation.

Introduction

Tracking is the process of localizing targets of interest in space over time. Indoor tracking has been the topic of interest for real-world applications, such as indoor navigation, virtual reality, etc. The tracking system can be realized using a variety of sensors, like cameras, motion sensors, and wireless sensors. Recently, Wi-Fi-based tracking have become increasingly popular. This is because such tracking systems rely on existing Wi-Fi networks and users to be tracked are not required to wear any other dedicated sensors by using the existing Wi-Fi devices, such as mobile phones and smart watches.

The IEEE 802.11az standard, commonly referred to as next generation positioning (NGP) Wi-Fi standard, enables stations (STAs, devices having the capability to use the IEEE 802.11 protocol, such as laptops, mobile phones, smart watches, etc.) to identify their positions relative to multiple Wi-Fi access points (APs, Wi-Fi modems that have connection to routers and allow other Wi-Fi devices to connect to a network). These Wi-Fi APs' locations are fixed and are known to the STAs, and hence these APs are also referred to as anchors. The localization method in the IEEE 802.11az standard is the TOA-based localization. For TOA-based localization, the STAs are required to synchronize with APs using IEEE 802.11az protocol and estimate the time delay between STAs and APs. Geometrically, the time delay between a STA and each AP defines a circle or sphere where the STA must lie in the two-dimensional (2-D) or three-dimensional (3-D) space. The STA position is given by the intersection of multiple circles or spheres.

In the example 802.11az Positioning Using Super-Resolution Time of Arrival Estimation (WLAN Toolbox), we demonstrate the performance of TOA-based localization for a single STA in a 2-D static 802.11az network using Monte-Carlo simulations. In this example, we extend the scenario to a 3-D 802.11az network where STAs are moving.

Network Configurations

Consider a shopping mall scenario with multiple APs and multiple STAs. The APs can be Wi-Fi modems located in different areas of the shopping mall, and the STAs can be 802.11az supported mobile phones held by different shoppers. The goal of the IEEE 802.11az network is to track 3-D positions of STAs over time.

11az tracking scenario

In this example, we configure an IEEE 802.11az network with 5 APs and 2 STAs.

% Configure number of APs and STAs in the network
numAPs = 5; % Number of APs
numSTAs = 2; % Number of STAs

The TOA estimation and localization performance depends on multiple factors in the channel. The channel multipath delay profile can affect the number of multipath components. Ideally, the true TOA from an AP to a STA can be found from the first peak on the TOA spectrum that corresponds to the line-of-sight (LOS) propagation path. The multipath components create additional non-line-of-sight (NLOS) peaks on the TOA spectrum, and can interfere with the first peak, degrading the true TOA detection performance. The signal-to-noise ratio (SNR) may affect the detection performance of the TOA peak on the TOA spectrum. The higher SNR, the better peak detection performance. The channel bandwidth directly affects the resolution of the TOA estimation. Larger bandwidth can lead to higher TOA estimation resolution and more accurate TOA estimation result. When the bandwidth is not large enough, multiple close multipath peaks may blur together, causing a large bias in TOA estimation.

In this example, we configure SNR to be 25 dB, choose a 40 MHz Wi-Fi bandwidth, and set the multipath delay profile to be the TGax channel model-B. For more information on the configurations of channel bandwidth and multipath delay profile, please see the configurations of the wlanTGaxChannel (WLAN Toolbox) system object.

% Configure channel
delayProfile = 'Model-B'; % TGax channel multipath delay profile
snr = 25; % SNR, in dB
chanBW = 'CBW40'; % Channel bandwidth

Specify antenna and transmission configurations. Larger number of antennas and space-time streams can provide more channel estimate snapshots, which can enhance TOA estimation performance. Larger number of high efficiency long training field (HE-LTF) repetitions can reduce the noise variance in the channel estimate and can also improve TOA estimation performance.

% Configure antennas, streams and LTF repetitions for each AP and STA
numAntennaAP  = 2; % Number of antennas in each AP
numAntennaSTA  = 2; % Number of antennas in each STA
numSTS = 2; % Number of space-time streams
numLTFRepetitions = 3; % Number of HE-LTF repetitions

Configure IEEE 802.11az high-efficiency (HE) waveform and TGax channel.

% Configure HE waveform and channel
[ofdmInfo,propagationSpeed,sampleRate,...
    delayULDL,linkType,numLinks,chans,cfgSTA,cfgAP] = ...
    helperWiFiWaveformChannel(numAPs,numSTAs,chanBW, ...
    delayProfile,numAntennaAP,numAntennaSTA,numSTS,numLTFRepetitions);

Use the system object phased.TOAEstimator (Phased Array System Toolbox) for estimating TOA. There are two spectrum estimation methods in phased.TOAEstimator: FFT and MUSIC. MUSIC is a high-resolution spectrum estimation method that can distinguish closely arrived paths. This high-resolution capability can make MUSIC-based TOA estimation work well in a multipath environment, even with limited bandwidth. Thus, in this example, we choose the MUSIC spectrum estimation method for TOA estimation.

The high-resolution performance of the MUSIC spectrum estimation method is achieved via estimating the covariance matrix of channel estimates over multiple snapshots. However, it typically requires a large number of snapshots to obtain a full-rank covariance matrix for MUSIC processing. When the number of snapshots is not large enough, we can enable forward-backward averaging and increase the value of spatial smoothing to increase the rank of the covariance matrix used for MUSIC processing.

% Define the SNR per active subcarrier to account for noise energy in nulls
snrVal = snr - pow2db(ofdmInfo.FFTLength/ofdmInfo.NumTones);

% Noise power
noisePow = 1/db2pow(snrVal);

% Configure TOA estimator
toaEstimator = phased.TOAEstimator('SpectrumMethod','MUSIC', ...
    'DelayOffsetInputPort',true, ...
    'VarianceOutputPort',true, ...
    'ForwardBackwardAveraging',true, ...
    'NoisePower',noisePow, ...
    'SpatialSmoothing',ceil(ofdmInfo.FFTLength/2));

Configure the 3-D dimensions of the shopping mall and initialize the helper system object HelperTOATrackingExampleDisplay for displaying the tracking results.

% 3-D dimensions of the shopping mall in meters
xDim = 2e2; 
yDim = 2e2; 
zDim = 1e2;

% Initialize the tracking display system object
display = HelperTOATrackingExampleDisplay ...
    (XLimits=[-xDim/2 xDim/2], ...
    YLimits=[-yDim/2 yDim/2], ...
    ZLimits=[-zDim/2 zDim/2], ...
    Title = ''); % records new GIF if name specified

TOA Estimation and 3-D Tracking For a Single STA

In a big or multi-layer shopping mall scenario where the stores are dense, shoppers wish to accurately track the 3-D positions of themselves to know where they are and which stores they have already visited for easier finding the stores of interest. In this case, each shopper only wishes to know the shopper's own location and trajectory. A single-target tracking algorithm can be used on each shopper's own 802.11az supported mobile device (STA).

We first create a single-target tracking scenario.

% Generate a single-target tracking scenario
[scenario, apIDs] = helperCreateSingleTargetScenario(numAPs);

% Obtain STA ID
[staID,platIDs,isAP] = helperSTAIDs(scenario,apIDs);

% Display setup
release(display);
display.Title = 'Single Target Tracking';

Initialize a constant-velocity extended Kalman filter (EKF) initcvekf for single-target tracking.

% Initialize STA detection result
initDetection = objectDetection(0,[0;0;0],'MeasurementNoise',diag([xDim,yDim,zDim].^2));

% Initialize EKF
ekf = initcvekf(initDetection);

% Initialize single-target track report 
track = objectTrack('State',ekf.State,'StateCovariance',ekf.StateCovariance);

Advance the single-STA tracking scenario over time. The signal processing workflow can be broken into four main steps described below.

while advance(scenario)

Step 1: Updating Single-Target Scenario.

In each advance, as the STA has a new position, we update the delays between the STA and APs.

    % Elapsed time
    time = scenario.SimulationTime;

    % Update range-based delay and output AP positions
    [sampleDelay,positionAP] = helperRangeBasedDelay(scenario,isAP,propagationSpeed,sampleRate);

Step 2: Processing IEEE 802.11az Signals to Estimate TOAs.

In each advance, the STA collaborates with each AP to estimate the propagation time delays between itself and all APs via the following procedure.

  • At a random time-of-departure (TOD), the STA first transmits an uplink (UL) null data packet (NDP) to the channel and records the time t1 (TOD UL).

  • Each AP captures the NDP and estimates the time t2 (TOA UL) using MUSIC.

  • After a specified time delay, each AP sends downlink (DL) NDP back to the STA at the time t3 (TOD DL).

  • The STA captures the NDP and estimates the time t4 (TOA DL) using MUSIC.

The following figure shows the TOA measurement procedure between a STA and an AP.

11az two-way handshake protocol

The STA calculates the round-trip time (RTT) from each AP using the following equation

tRTT=(t4-t1)-(t3-t2).

In the following code, the RTT can be estimated using phased.TOAEstimator system object.

    % Estimated TOA and estimated TOA variance
    toaEst = zeros(1,numAPs);
    toaVar = zeros(1,numAPs);

    % TOD of UL NDP
    todUL = randsrc(1,1,0:1e-9:1e-6);

    % Loop over the number of APs
    for apIdx = 1:numAPs
        % Time of flight
        tof = zeros(1,numLinks);
        tofvar = zeros(1,numLinks);

        % Loop for both UL and DL transmission
        for l = 1:numLinks
            % Get UL or DL configuration according to link type
            [chan,chDelay,cfg] = helperULDLConfig(chans,cfgAP,cfgSTA,linkType,apIdx,1,l);

            % Generate HE Ranging NDP transmission
            txWaveform = heRangingWaveformGenerator(cfg);

            % Introduce time delay (fractional and integer) in the transmit waveform
            txDelay = heDelaySignal(txWaveform,sampleDelay(apIdx));

            % Pad signal and pass through multipath channel
            txMultipath = chan([txDelay;zeros(50,cfg.NumTransmitAntennas)]);

            % Pass waveform through AWGN channel
            rx = awgn(txMultipath,snrVal);

            % Perform synchronization and channel estimation
            [chanEstActiveSC,integerOffset] = heRangingSynchronize(rx,cfg);

            % Estimate the transmission time between UL and DL
            if ~isempty(chanEstActiveSC) % If packet detection is successful
                % Subcarrier spacing
                subcarrierSpacing = sampleRate/ofdmInfo.FFTLength;

                % Reshape and interpolate channel estimate for TOA estimation
                chanEst = helperChanEstInterpolation(chanEstActiveSC,ofdmInfo);

                % TOA estimation
                integerOffset = integerOffset - chDelay; % Account for channel filter delay
                intDelay = integerOffset/sampleRate; % Estimate integer time delay
                release(toaEstimator);
                [tof(l),tofvar(l)] = toaEstimator(chanEst,subcarrierSpacing,intDelay); % Transmission time
            else % If packet detection fails
                tof(l) = NaN;
                tofvar(l) = NaN;
            end
        end

        % Record TOA estimates and TOA estimation variances
        [toaEst(apIdx),toaVar(apIdx)] = helperRecordTOAEstResult(todUL,tof,tofvar,delayULDL,1);
    end

    % Record valid TOA detections
    toaDets = helperValidTOADetections(scenario,toaEst,toaVar,platIDs,apIDs,staID);

Step 3: Estimating STA Position Using TOAs.

Once the RTTs are obtained from all APs, the STA estimates its current position and current position estimation covariance matrix using the estimated RTTs and the known AP positions. This can be achieved using the TOA-based position estimator toaposest (Phased Array System Toolbox). After obtaining the current position and current position estimation covariance matrix, we convert them into the objectDetection format for position record.

    % TOA position estimate
    [pos,posCov] = toaposest(toaEst,toaVar,positionAP);

    % Record position estimate information into objectDetection format
    posDet = objectDetection(time,pos,'MeasurementNoise',posCov);

Step 4: Tracking Single-STA Position.

Finally, use EKF to fuse the position predicted by the constant-velocity motion model and the TOA-based position estimate. We show the single-STA tracking animation result below.

    % Predict and correct the TOA position estimate using EKF
    predict(ekf,scenario.UpdateRate);
    ekf.MeasurementNoise = posCov;
    correct(ekf, pos);
    
    % Update the track reports with filter states
    track.State = ekf.State;
    track.StateCovariance = ekf.StateCovariance;

    % Display results
    display(scenario,apIDs,toaDets,{posDet},track);
end

Figure contains an axes object. The axes object with title Single Target Tracking, xlabel X (m), ylabel Y (m) contains 13 objects of type line, patch, text. One or more of the lines displays its values using only markers These objects represent STAs (Targets), APs (Anchors), Static Fused Position, Tracks, (history).

In the above animation result, the 5 APs are depicted with the upward-pointing triangles, and the STA is depicted with the downward-pointing triangle. Each sphere centered at an AP describes the surface with the same range (the same TOA) from the AP to the STA. The dark solid trajectory is the true trajectory of the STA. The growing blue bold curve shows how the STA is tracked by the 5 APs. We can see that the STA can localize and track itself in 3-D space accurately.

TOA Estimation and 3-D Tracking For Multiple STAs

In a smart shopping mall scenario where the shoppers can use their mobile devices for cash-free shopping, the store owners wish to track the positions and trajectories of the shoppers in their stores. Multi-target tracking algorithms can be used in the store owners' data centers.

We first create a multi-STA tracking scenario. We assume the IDs of different STAs are known to the 802.11az network. For more background information of tracking multiple objects with known IDs, please refer to the example Object Tracking Using Time Difference of Arrival (TDOA).

% Generate a multi-target tracking scenario
[scenario,apIDs] = helperCreateMultipleTargetScenario(numAPs,numSTAs);

% Obtain STA IDs
[staIDs,platIDs,isAP] = helperSTAIDs(scenario,apIDs);

% Reset display 
release(display);
display.Title = 'Multiple Targets Tracking';

Use the global nearest neighbor (GNN) based tracker trackerGNN for multi-target tracking. Initialize the filter as the EKF.

% Create a GNN tracker
tracker = trackerGNN(FilterInitializationFcn=@initcvekf, ...
                     AssignmentThreshold=100);

Advance the multi-STA tracking scenario and track the 3-D positions of STAs. The signal processing workflow follows four main steps similar to those introduced in the previous section. We remark the difference in the workflow below.

while advance(scenario)

Step 1: Updating Multi-Target Scenario.

    % Elapsed time
    time = scenario.SimulationTime;

    % Update range-based delay
    sampleDelay = helperRangeBasedDelay(scenario,isAP,propagationSpeed,sampleRate);

Step 2: Processing IEEE 802.11az Signals to Obtain TOAs.

To estimate TOAs from APs to different STAs, we need an additional loop for all the STAs.

    % Estimated TOA and TOA variance
    toaEst = nan(numSTAs,numAPs);
    toaVar = nan(numSTAs,numAPs);

    % TODs of UL NDPs
    todUL = randsrc(1,numSTAs,0:1e-9:1e-6);

    % Loop over the number of APs
    for apIdx = 1:numAPs
        % Loop over the number of STAs
        for staIdx = 1:numSTAs
            % Time of flight
            tof = zeros(1,numLinks);
            tofvar = zeros(1,numLinks);

            % Loop for both UL and DL transmission
            for l = 1:numLinks
                % Get UL or DL configuration according to link type
                [chan,chDelay,cfg] = helperULDLConfig(chans,cfgAP,cfgSTA,linkType,apIdx,staIdx,l);

                % Generate HE Ranging NDP transmission
                txWaveform = heRangingWaveformGenerator(cfg);

                % Introduce time delay (fractional and integer) in the transmit waveform
                txDelay = heDelaySignal(txWaveform,sampleDelay(apIdx,staIdx));

                % Pad signal and pass through multipath channel
                txMultipath = chan([txDelay;zeros(50,cfg.NumTransmitAntennas)]);

                % Pass waveform through AWGN channel
                rx = awgn(txMultipath,snrVal);

                % Perform synchronization and channel estimation
                [chanEstActiveSC,integerOffset] = heRangingSynchronize(rx,cfg);

                % Estimate the transmission time between UL and DL
                if ~isempty(chanEstActiveSC) % If packet detection is successful
                    % Subcarrier spacing
                    subcarrierSpacing = sampleRate/ofdmInfo.FFTLength;

                    % Reshape and interpolate channel estimate for TOA estimation
                    chanEst = helperChanEstInterpolation(chanEstActiveSC,ofdmInfo);

                    % TOA estimation
                    integerOffset = integerOffset - chDelay; % Account for channel filter delay
                    intDelay = integerOffset/sampleRate; % Estimate integer time delay
                    release(toaEstimator);
                    [tof(l),tofvar(l)] = toaEstimator(chanEst,subcarrierSpacing,intDelay); % Transmission time
                else % If packet detection fails
                    tof(l) = NaN;
                    tofvar(l) = NaN;
                end
            end

            % Record TOA estimates and TOA estimation variances
            [toaEst(staIdx,apIdx),toaVar(staIdx,apIdx)] = helperRecordTOAEstResult(todUL,tof,tofvar,delayULDL,staIdx);
        end
    end

    % Record valid TOA detection results
    toaDets = helperValidTOADetections(scenario,toaEst,toaVar,platIDs,apIDs,staIDs);

Step 3: Estimating STA Positions Using TOAs.

For each STA with a unique STA ID, estimate its position using TOA detection results and record the position estimation result in the objectDetection format for multi-target tracking.

    % Estimate the position and covariance of each STA as objectDection
    detectedSTAIDs = cellfun(@(x)x.ObjectClassID,toaDets);
    posDets = cell(numel(staIDs),1);
    for i = 1:numSTAs
        thisEmitterTOADets = toaDets(detectedSTAIDs == staIDs(i));
        posDets{i} = helperTOA2Pos(thisEmitterTOADets, true);
    end

Step 4: Tracking Multi-STA Positions.

Finally, we use the position estimation record as the input to the GNN tracker trackerGNN to update the tracking information. We show the multi-STA tracking animation result below.

    % Update the tracker with position detections
    tracks = tracker(posDets,time);

    % Display results
    display(scenario,apIDs,toaDets,posDets,tracks);
end

Figure contains an axes object. The axes object with title Multiple Targets Tracking, xlabel X (m), ylabel Y (m) contains 15 objects of type line, patch, text. One or more of the lines displays its values using only markers These objects represent STAs (Targets), APs (Anchors), Static Fused Position, Tracks, (history).

From the above animation result, we can see that the tracker is able to maintain tracks on all 2 STAs in a 3-D space.

Summary

This example shows how to track Wi-Fi STAs in a 3-D space using an IEEE 802.11az network. In particular, this example shows: 1) how to propagate IEEE 802.11az waveforms and synchronize STAs and APs using IEEE 802.11az protocols; 2) how to estimate 3-D positions of STAs in a IEEE 802.11az network; 3) how to advance a tracking scenario and track a single STA or multiple STAs in a 3-D space for different application scenarios.

Reference

[1] S. Tan, Y. Ren, J. Yang and Y. Chen, "Commodity WiFi Sensing in Ten Years: Status, Challenges, and Opportunities," in IEEE Internet of Things Journal, vol. 9, no. 18, pp. 17832-17843, 15 Sept.15, 2022, doi: 10.1109/JIOT.2022.3164569.

[2] Xinrong Li and K. Pahlavan, "Super-resolution TOA estimation with diversity for indoor geolocation," in IEEE Transactions on Wireless Communications, vol. 3, no. 1, pp. 224-234, Jan. 2004, doi: 10.1109/TWC.2003.819035.

[3] IEEE Std 802.11az™-2022. IEEE Standard for Information technology— Telecommunications and information exchange between systems Local and metropolitan area networks— Specific requirements - Amendment 3: Enhancements for positioning.

[4] IEEE Std 802.11ax™-2021. IEEE Standard for Information Technology - Telecommunications and Information Exchange between Systems - Local and Metropolitan Area Networks - Specific Requirements - Part 11: Wireless LAN Medium Access Control (MAC) and Physical Layer (PHY) Specifications - Amendment 1: Enhancements for High Efficiency WLAN.