About simple PDOA sample

HI,qorvo team

ex_01h_simple_tx_pdoa
ex_02h_simple_rx_pdoa

static void rx_ok_cb(const dwt_cb_data_t * cb_data)
{
int16_t cpqual;
int stsq = dwt_readstsquality(&cpqual);
NRF_LOG_INFO(“rx_ok_cb:stsq=%d”, stsq);
if(stsq >= 0)
{
pdoa_val = dwt_readpdoa();
NRF_LOG_INFO(“rx_ok_cb:pdoa_val=%d”, pdoa_val);
*float pdoa_deg = ((float) pdoa_val/(1<<11))180/3.1415926;
NRF_LOG_INFO(“rx_ok_cb:pdoa_deg=” NRF_LOG_FLOAT_MARKER, NRF_LOG_FLOAT(pdoa_deg));
}
dwt_rxenable(DWT_START_RX_IMMEDIATE);
}

I used Murata’s EVB directly against DWM3000, but the result is the following data, where am I wrong???

app: rx_ok_cb:pdoa_val= -870
app: rx_ok_cb:pdoa_deg= -24.33
app: rx_ok_cb:stsq=22
app: rx_ok_cb:pdoa_val= -709
app: rx_ok_cb:pdoa_deg= -19.83
app: rx_ok_cb:stsq=22
app: rx_ok_cb:pdoa_val= -571
app: rx_ok_cb:pdoa_deg= -15.97
app: rx_ok_cb:stsq=22
app: rx_ok_cb:pdoa_val= -814
app: rx_ok_cb:pdoa_deg= -22.77
app: rx_ok_cb:stsq=21
app: rx_ok_cb:pdoa_val= -443
app: rx_ok_cb:pdoa_deg= -12.39
app: rx_ok_cb:stsq=22
app: rx_ok_cb:pdoa_val= -633
app: rx_ok_cb:pdoa_deg= -17.70

kk
thanks

What are you suggesting is wrong with the data that you are receiving?

It looks like you are using the DecaWave DW3000 chip and are trying to read the phase of arrival (PoA) of a received signal using the dwt_readpdoa function. The PoA value is returned as a 16-bit signed integer, and it is expressed in units of 1/512 of a chip.

In your code, you are converting the PoA value to degrees by dividing it by (1<<11), which is the same as dividing by 2048. This is not the correct conversion factor, as 1 degree is not equal to 2048/512 = 4 chips.

To convert the PoA value to degrees, you can use the following formula:
float pdoa_deg = (float)pdoa_val * 180 / (3.1415926 * 512);

This formula takes into account the fact that there are 2π radians in a full circle (360 degrees), and that the PoA value is expressed in units of 1/512 of a chip.

I hope this helps! Let me know if you have any further questions.