Direction finding: PI shift in phase difference for 2M PHY

Hi!

I am using v2.6.1/nrf/samples/bluetoothdirection_finding_connectionless_tx/rx sample, and NCS v2.6.1 for AoA. I made some modification on the rx side to stream I/Q data via serial port, and read and calculate AoA on Ubuntu using a python script.

RX board: nrf5340 devkit + antenna

TX board: nrf5340/nrf52833 devkit

Antenna: 2 patterns with a distance of 5.3 cm (ant0: reference ant, ant1: sample ant), with settling time after switching within 100~250ns

Problem Description:

Right now the angle calculation works well if tx uses 1M PHY. But if I switch it to 2M, it will get wrong results. After looking into the phase data, I find a 180 degree shift for every calculated phase difference, so I manually eliminate that shift and then 2M works. I wonder if anyone has met the same problem and what could cause that, any thoughts will be appreciated!

About CTE configuration:

I am using 1 us sample slot for both 1M and 2M

TSAMPLESPACINGREF = 1us

TSAMPLESPACING = 2us

TSWITCHSPACING = 2us

Details of Calculation:

I have read the white paper nWP-036 and understand the antennas are going to be switched in order [0,0,0,0,0,0,0,0] (8 for ref period) followed by [1, 0, 1, 0, ...](sample period). Besides the reference period, I am also using the sample period for calibration since ant0 will be visited again during the sample period.

Here the figure (x-axis: time in us; y-axis: phase in rad) shows how I calculate the phase diff and AoA for a 160us CTE report when using 1M PHY. The red dots are phases of each I/Q data from ant0 during the reference period; and the dots marked as orange stars are the calibrated reference phases, which are prepared for phase difference calculation for each sample from ant1 (yellow dots); calculated phase diff will be shifted by N*2pi to make sure it is within range [-pi, pi]; finally calculated AoA using the arccos formula as the white paper does.

Note that the first sample during the ref period is aligned with time=0, and the first sample during the sample period (first yellow dot) is aligned with time=9 (equals to time of the last ref sample(7us) + TSAMPLESPACINGREF + TSWITCHSPACING/2, according to nWP-036), please correct me if I made any mistake.

If using 2M PHY, the calculation should be the same as 1M theoretically, except the wavelength for calculating AoA will be different. But it turns out calculated phase diff with 2M PHY always gives a 180 degree shift.

Parents Reply Children
No Data
Related