I’m trying to compare the POA calculated from CIR and the POA from dwt_readdiagnostics().
In DW3000, POA readings are uint16 type in the diagnostic data. But there is no explanation on how it can be converted to radians in the manual.
The manual says POA is stored as a 14-digit number. I’ve tried 2-digit integer + 12-digit fractional part, and 3-digit integer + 11-digit fractional part. But the first one gives a max POA of 4 radians, and the latter one gives a max POA larger than 2pi.
Could someone explain how to translate the POA reading in the result of dwt_readdiagnostics()?
Thanks.
Hi @BC0023 ,
Actually the POA from dwt_readdiagnostics() is calculated from the CIR:
See example for ipatovPOA below:
I’m not sure I understood which 2 values you would like to compare?
FYI, the source code of the driver is available as part of the DW3/QM33 SDK https://www.qorvo.com/products/d/da008582
Hi @Wassim_Qorvo ,
Thanks for pointing out the source code. I have a question about interpreting the ipatovPOA value. The comment says it is signed rad*2-12
. Does it mean that it is the raw radians value times 2^-12? So to convert it back to radians, I should divide this value by 4096?
However, the ipatovPOA is defined as an uint16_t
, which is unsigned. Is this conflicting with the comment? Or should I interpret the ipatovPOA as an int16_t
to convert it back to radians?
Secondly, I am curious about the physical meaning of ipatovPOA value. Is it the phase of the CIR value at the first path index (e.g., 740.39)? Then because of existence of the fraction part, this POA value should be more precise compared to directly reading CIR data and calculating the phase myself?
Thanks in advanced!
Shanmu
- It is true that POAs are defined as uint16_t, but actually they are signed numbers. So you need to do something like this: p_ipatov = (int16_t)((rxdiag.ipatovPOA & 0x3FFF)|((rxdiag.ipatovPOA & 0x2000)?0xC000:0x0000)); And to convert it to radian by dividing (1<<11).
- For LOS, the POA values around the FP index are almost same. It should not matter whether you use ipatovPOA or you calculate it from CIR, if you don’t need super precise results.
Thanks @BC0023! This is really helpful!
Thanks for your reply.
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?