UWB中TOF测距法的公式推导

UWB中TOF测距法的公式推导

UWB常用测距方法有两种:飞行时间测距法(TOF)和到达时间差法(TDOA)。这里说一下TOF。网上很多地方都给了公式,但是缺了过程推导,这里补上,有像我一样纠结公式是怎么来的同学可以参考。

TOF

飞行时间法(Time of Flight,TOF)是一种双向测距技术,它通过测量UWB信号在基站与标签之间往返的飞行时间来计算距离。根据数学关系,一点到已知点的距离为常数,那么这点一定在以已知点为圆心,以该常数为半径的圆上。有两个已知点,就有两个交点。以三个已知点和距离作三个圆,他们交于同一个点,该点就是标签的位置。

TOF定位方式需要基站和标签往返通信,因此就造成了TOF功耗大大提高,续航时间相对较短.

TOF又分为两种:单边双向测距和双边双向测距。

单边双向测距

单边双向测距(Single-sided Two-way Ranging: SS-TWR)是对单个往返消息时间上的简单测量,设备A主动发送数据到设备B,设备B返回数据响应设备A。如下图所示:
SS-TWR
单边双向测距的流程是这样的:设备A(Device A)主动发送(TX)数据,同时记录发送时间戳,设备B(Device B)接收到之后记录接收时间戳;延时 T r e p l y T_{reply} Treply 之后,设备B发送数据,同时记录发送时间戳,设备A接收数据,同时记录接收时间戳。

所以可以拿到两个时间差数据,设备A的时间差 T r o u n d T_{round} Tround 和设备B的时间差 T r e p l y T_{reply} Treply ,最终得到无线信号的飞行时间 T p r o p T_{prop} Tprop 如下:
T p r o p = 1 2 ( T r o u n d − T r e p l y ) T_{prop} = \frac{1}{2}(T_{round}-T_{reply}) Tprop=21(TroundTreply)

两个差值时间都是基于本地的时钟计算得到的,本地时钟误差可以抵消,但是不同设备之间会存在微小的时钟偏移,假设设备A和B的时钟偏移分别为 e A e_A eA e B e_B eB,则飞行时间测量值为:
T ^ p r o p = 1 2 [ T r o u n d ( 1 + e A ) − T r e p l y ( 1 + e B ) ] \hat{T}_{prop} = \frac{1}{2}[T_{round}(1+e_A)-T_{reply}(1+e_B)] T^prop=21[Tround(1+eA)Treply(1+eB)]
于是测距误差如下:
E r r o r = T ^ p r o p − T p r o p = 1 2 ( T r o u n d ⋅ e A − T r e p l y ⋅ e B ) = 1 2 T r e p l y ( e A − e B ) + T p r o p ⋅ e A Error = \hat{T}_{prop} - T_{prop} = \frac{1}{2}(T_{round}\cdot e_A-T_{reply}\cdot e_B) = \frac{1}{2}T_{reply}(e_A-e_B) + T_{prop}\cdot e_A Error=T^propTprop=21(TroundeATreplyeB)=21Treply(eAeB)+TpropeA
因为 T r e p l y > > T p r o p T_{reply} >> T_{prop} Treply>>Tprop, 所以可以忽略后一项,得到
E r r o r = T ^ p r o p − T p r o p ≈ 1 2 T r e p l y ( e A − e B ) Error = \hat{T}_{prop} - T_{prop} \approx \frac{1}{2}T_{reply}(e_A-e_B) Error=T^propTprop21Treply(eAeB)
由此可以看出,随着 T r e p l y T_{reply} Treply 和时钟偏移的增加,会增加飞行时间的误差,从而使得测距不准确。因此单边双向测距(SS-TWR)并不常用,但对于特定的应用,如果对于精度要求不是很高,但是需要更短的测距时间可以采用。注意 T r e p l y T_{reply} Treply 不仅仅是设备B接收到发送的时间,也包括装载数据和发送数据耗费的时间(UWB除了支持定位之外,也可以传输数据,标准可以装载128字节,扩展模式可以装载1024字节数据)。

双边双向测距

双边双向测距(Double-sided Two-way Ranging)是单边双向测距的一种扩展测距方法,记录了两个往返的时间戳,最后得到飞行时间,虽然增加了响应的时间,但会降低测距误差。

双边双向测距分为两次测距,设备A主动发起第一次测距消息,设备B响应,当设备A收到数据之后,再返回数据,最终可以得到如下四个时间差: T r o u n d 1 T_{round1} Tround1 T r e p l y 1 T_{reply1} Treply1 T r o u n d 2 T_{round2} Tr<

  • 28
    点赞
  • 141
    收藏
    觉得还不错? 一键收藏
  • 9
    评论
UWB (Ultra-Wideband) TOF (Time of Flight) is a technique used for measuring the time it takes for a signal to travel from a transmitter to a receiver and back. This technique is commonly used in applications such as indoor positioning, radar systems, and wireless communication. To implement UWB TOF in MATLAB, you can follow these general steps: 1. Define the UWB waveform: Generate a UWB pulse waveform with specific characteristics such as pulse width, center frequency, and modulation scheme. 2. Simulate the channel: Model the propagation channel between the transmitter and receiver, considering factors like signal attenuation, multipath fading, and noise. 3. Transmit and receive signals: Simulate the transmission and reception of UWB signals by convolving the generated waveform with the channel response. 4. Measure TOF: Use cross-correlation or other time-domain techniques to estimate the time delay between the transmitted and received signals, which represents the TOF. Here is a sample MATLAB code snippet to illustrate these steps: ```matlab % Define UWB waveform parameters pulseWidth = 10e-9; % Pulse width in seconds centerFrequency = 4e9; % Center frequency in Hz % Generate UWB pulse waveform uwbWaveform = uwbwaveform('PulseWidth', pulseWidth, 'CenterFrequency', centerFrequency); % Simulate channel and obtain channel response channel = rayleighchan(1/centerFrequency, 100); % Example channel model channelResponse = filter(channel, ones(1000, 1)); % Transmit and receive signals through the channel txSignal = uwbWaveform(); rxSignal = filter(channelResponse, txSignal); % Measure TOF using cross-correlation [crossCorr, lag] = xcorr(rxSignal, txSignal); [~, maxIndex] = max(abs(crossCorr)); estimatedTOF = abs(lag(maxIndex)); % Display the estimated TOF disp(['The estimated TOF is ' num2str(estimatedTOF) ' seconds.']); ``` Please note that this is just a simplified example, and you may need to adapt it to your specific requirements and channel model. Additionally, you can enhance the code with additional processing techniques, such as synchronization and signal processing algorithms, depending on your application.

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值