I read your post, and based on that, I added logic to check the sign using the 14th bit (MSB) and apply appropriate adjustments. I also included the division by (2**11)
as mentioned.
After that, I calculated the phase of the sample at the First Path Index (FP_INDEX) and compared it, only to find that there’s a noticeable discrepancy. I also computed the PDOA between STS_1 and STS_2 and observed that the result differed somewhat from the (PDOA / 2**11)
value provided in the diagnostics.
I suspect this is because FP_INDEX refers to samples at 1 ns resolution, rather than the finer 1/64 ns resolution. As a result, the derived phase may be slightly inaccurate. I believe that if we compensate for the fractional part of the FP_INDEX as a phase shift, the result might align more closely with the diagnostics value. What do you think about this approach?
This is my poa_uint16_to_radian function in my python project:
def poa_uint16_to_radian(poa_uint16):
"""
Convert a 14-bit signed POA value (stored in uint16) to radians.
POA format: signed 14-bit fixed-point (rad × 2^11)
Parameters:
poa_uint16 (int): Raw POA value (0–16383 range assumed)
Returns:
float: Phase in radians (range: -π to +π)
"""
# 1. Extract 14-bit value
poa_14bit = poa_uint16 & 0x3FFF
# 2. Convert to signed 14-bit integer
if poa_14bit >= 8192:
poa_signed = poa_14bit - 16384 # Two's complement for negative values
else:
poa_signed = poa_14bit
# 3. Convert fixed-point value to radians
phase_rad = poa_signed / 2048.0 # Since value is in rad × 2^11
return phase_rad
And this is the result of two samples.
Sample 1:
[sts_1_fp_sample, sts_2_fp_sample]
2.826986177688784 2.997290328233547
[diag_stsPOA, diag_sts2POA]
2.501953125 2.666015625
[sts_1_fp_sample - sts_2_fp_sample]
-0.1703041505447631
[diag_stsPOA - diag_sts2POA]
-0.1640625
[diag_pdoa]
-0.18603515625
Sample 2:
[sts_1_fp_sample, sts_2_fp_sample]
-1.3774794636095957 -1.5226034746003427
[diag_stsPOA, diag_sts2POA]
0.705078125 0.5537109375
[sts_1_fp_sample - sts_2_fp_sample]
0.145124010990747
[diag_stsPOA - diag_sts2POA]
0.1513671875
[diag_pdoa]
0.17333984375
I’m conducting the measurements in a clear LOS environment with a 50 cm distance, but the values still vary each time. What do you think could be the reason for this?
Additionally, the results of 1000 samples’ PDOA is:
Thanks!