DWM1001 spacing of raw distances

Im trying to write a location-algorithm for the DWM1001-modules in Matlab. I get the raw-distances from each tag to its 4 anchors over mqtt-messages. First i’m trying do do some statistics. I find there is a spacing in the data. Not every milimeter is measured, there is a space, sometimes 4 mm, sometimes 5 mm. In the data I collected in tests. It averages to something like 4.68 mm. I believe it has to do with the duration of a clock-cycle and some rounding. But for my work and curiosity, does anybody know the exact average-space and the reason?
Thanks horst

… if one devides the speed of light in air by the observed 4.68mm, the result is about the UWB-frequency.
That even makes some sense.

Hi Horst,

just for curiosity, what did you mean with “Not every millimeter is measured, there is a space, sometimes 4 mm, sometimes 5 mm”?

Cheers, TDK

Hello TDK,

I hope a Picture tells more than words:

The Raw-Distances come as integers, so i expected the width of the whitespace to be 1 mm, but they are 4 and 5 mm wide…

cheers horst

Hi Horst,

I am having difficulties to understand the picture. In which units are the axes?

Cheers, TDK

So you are saying that there is a quantization in the distance number that is larger than the output resolution of 1 mm?

This is to be expected.
Internally the DW1000 has a timing resolution of around 15.65 ps. If you multiply that by the speed of light you get a distance resolution of around 4.5 mm.

hi TDK,
sorry, i forgot that. it’s basically the numbers as they come out of the unit.
from what i understand the [Y-axis-values] is ‘mm’ for the distance, and the [X-axis-values] is ’us’ from the time stamps.
to check deviation, i tried to create equal sized ‘bins’ and ran into the question…

cheers horst

thank you for the answer, i thought something like this

1 Like

Hi Horst,
You mentioned you have got the raw-distances from each tag to its 4 anchors over mqtt-messages. We want to do it too. Could you please share how you got these data?
Thank you!

Hi jeremycuo,

I’m not the best coder, so there might be better ways, but I added a few lines of code to the dwm-simple example:

void on_dwm_evt(dwm_evt_t *p_evt)

        uint8_t len;
        uint8_t i;
        // Current Idc to store in data (2 bytes for id, 4bytes for timestamp)
        uint8_t idx = 6;
        // TimeStamp
        uint32_t tim;

        switch (p_evt->header.id) {
        /* New location data */
        case DWM_EVT_LOC_READY:


                idx = idx + 1;
               // console
                printf("\nT:%lu (0x%lx)\ti:%u",tim,tim, p_evt->loc.anchors.dist.cnt);

                for (i = 0; i < p_evt->loc.anchors.dist.cnt; ++i)
                        idx = idx + 2;
                        idx = idx + 4;

                        printf("\tID:%04X\tDist:%ld", p_evt->loc.anchors.dist.addr[i], p_evt->loc.anchors.dist.dist[i]);

                        DWM_EVT_BH_INITIALIZED_CHANGED |
                        DWM_EVT_UWBMAC_JOINED_CHANGED, NULL);

                // write just 31!


this wrote out the tag-timestamp, number of ancors, ancor-address, and distance on terminal and into Iot. (the 2 bytes of ID were written somewhere previously, and kept.)
hope it helps,

Hi horst,
Got it, we will try it.
Thank you very much for your help!