Magic numbers in TREK1000 DecaRangeRTLS ARM Demo Project


In TREK1000 DecaRangeRTLS ARM Demo project there are many raw values used in calculations. For example in the following statement

respframe_sy = (DW_RX_ON_DELAY + (int)((preamblelen + ((msgdatalen_resp + margin)/1000.0))/ 1.0256)) ;

In functions like below

float calc_length_data(float msgdatalen)
instance_data_t* inst = instance_get_local_structure_ptr(0);

int x = 0;

x = (int) ceil(msgdatalen*8/330.0f);

msgdatalen = msgdatalen*8 + x*48;

//assume PHR length is 172308ns for 110k and 21539ns for 850k/6.81M
if(inst->configData.dataRate == DWT_BR_110K)
	msgdatalen *= 8205.13f;
	msgdatalen += 172308; // PHR length in nanoseconds

else if(inst->configData.dataRate == DWT_BR_850K)
	msgdatalen *= 1025.64f;
	msgdatalen += 21539; // PHR length in nanoseconds
	msgdatalen *= 128.21f;
	msgdatalen += 21539; // PHR length in nanoseconds

return msgdatalen ;


There are many values used as raw values. Where can I find the details(meaning) of these values. Is there any document explains about this?

Shijo Thomas

All the frame symbol times/data-bit rates are noted in the DW1000 Datasheet.

Where can I find the details of these numbers.

330.0f, x*48, 8205.13f, 172308…etc…

Frame length calculation, the IEEE frame structure is described in:

  1. DW1000 User Manual - APPENDIX 1: The IEEE 802.15.4 UWB physical layer

And as mentioned earlier
2. DW1000 DataSheet - Frame Format section