waterblu 发表于 2023-9-15 18:20:44

关于AOA相位差读取求教

请问有没有人能提供一下DW1000的AOA的代码,我按照手册计算相位差波动太大,一直弄不对,请问哪里有相关的代码,谢谢大佬

蓝点无限 发表于 2023-9-15 20:34:44

我们目前还没有AOA产品。
是否可以将代码发出来一起看下

waterblu 发表于 2023-9-18 09:52:42

Decawave have patent pending a method of estimating AOA using phase difference of
arrival. This method can be implemented using 2 x DW1000 ICs (anchor master and slave)
clocked from the same 38.4 MHz reference clock input. Each DW1000 is connected to an
antenna and the antennas are optimally separated by approximately λ/2. Using this hardware
set up the phase difference (and hence angle of arrival) between the signals received at
each antenna can be calculated.
The Phase difference (PD) is calculated as follows:
1. When a frame is received, read the first path index from each DW1000 (A and B) and
the complex sample from accumulator at FP index.
- read register 0x15, offset 5, two bytes (The 10 most significant bits of
FP_INDEX represent the integer portion of the number and the 6 least
significant bits represent the fractional part)
- convert to float value (e.g. 745.67) and then add 0.5
- then truncate the resultant value (e.g. 746)
- get the accumulator index i.e. location in the accumulator at which to
calculate phase difference, (e.g. 2984) (=746 x 4 because they are 16-bit
complex numbers)
- read accumulator value at this index (reading 5 bytes to get 2 byte real and 2
byte imaginary value)
- treating the accumulator value as a complex number
- get arctan of the complex number to get (accangleA, accangleB)
2. Then read SFD angle (register 0x14, offset 3, one byte) from each (sfdangleA,
sfdangleB). The SFD angle (in radians) is obtained by multiplying by π/64
3. Next calculate the Phase Difference, PDx we use following formula:
PDx = ((accangleA - sfdangleA) – (accangleB - sfdangleB)) + π;
4. Then modulo 2π as the range should be 0 to 2π, and finally subtract π, to get PD.
5. The angle is then obtained by formula:
AOA (in radians) = PD/2 (Derived using a straight-line formula from Figure 3)

waterblu 发表于 2023-9-18 09:56:55

我是照着这个文档写的,感觉写得不太对,一个第1条的复数怎么计算arctan   我是直接虚部除以实部,当有符号数算的,,自己也不太清楚是实部和虚部是有符号还是无符号数
另一个不太清楚的地方是第2条0x14寄存器偏置3,我看着手册这段描述的像是0x14寄存器偏置4的位置数据,搞不明白
页: [1]
查看完整版本: 关于AOA相位差读取求教