AoA IQ Data soundness

Hi, I'm currently using the Direction Finding Connectionless examples to evaluate using the nRF5340 for numerous projects we have lined up, and I'm having difficulty ascertaining whether or not I'm actually collecting valuable data.

I've made minimal changes to the example, just set up the GPIO overlay to match the antenna array we are using and setting up a very basic switching sequence.

My overlay file is currently set to use 3 antenna, with 0x3 set as the reference antenna.

	dfe-antenna-num = <3>;
	dfe-pdu-antenna = <0x3>;

My switching sequence is then set to {0x5,0x9}.

My understanding then is that of the 45 samples I receive from the CTE, the first 8 would be using ANT 0x3, allowing me to ascertain a reference phase using arctan2(Q,I), then the remaining would alternate between ANT0x5 and ANT0x9. From the switching samples I calculate a phase offset and use the basic θ = arccos((ψλ)/(2πd)) formula to calculate an angle.

My first 2 most basic questions are so:

1. Obviously, this approach is going to struggle with noise and reflections etc, but I'm unsure as to how big those effects might be - how flakey I should expect this naive appraoch to be. 

2.  The IQ samples themselves, I'm unsure as to what range of values I should be expecting. In most of my testing so far the majority of my samples are in the range 0±50, which from looking around on this site seems to be low.

I'm reasonably confident the data I've collected so far is garbage, and will have more equipment available soon to properly interogate my hardware setup (WFH introduces some unfortunate delays at times), but I want to check it's not my analysis of the data that's the issue.

When calculating the reference phase, I use atan(Q,I) and see that odd samples are consistently ~180° out of phase with even samples. Is this expected behaviour, and if not how am supposed to ascertain the reference phase, are there supposed to be two reference phases for odd an even sample slots? My intuition is no but as I'm sure is obvious, I'm very much learning on the job here.

Parents
  • Hi

    As mentioned already here, you need to add a switching pattern for the number of antennas you want to use which seem to be 3 antennas here. If you're new to Direction Finding we also have a whitepaper here with some more in-depth information on how Direction Finding works

    1. Indeed, 3 antennas are not likely to give a very accurate result as the triangulation will be very rough. I don't think you can expect better than ~1 meter worth of accuracy. As "how flakey" is very much a case of definition, and will vary very on the range from transmitter to receiver and the environment it operates in, I'm not sure what I can share on this.

    2. The raw IQ data that is transmitted must be converted into vector form to be reviewed properly. We don't have have any specific sample code showing this, but you can check out this page for information on the various formulas used to translate IQ data between polar and rectangular form. Nordic will not provide a Direction Finding algorithm for you I'm afraid. 

    Best regards,

    Simon

  • Apologies, I don't think I made my enquiry very clear. I'm familiar with the whitepaper, but as I'm using the NCS as that would be what we use in production, certain things are unclear. In the whitepaper, the switching sequence the first 2 writes to the SWITCHPATTERN register are used to set the antenna's used in the Guard then Reference periods. Subsequent writes are used to set the sequence that will be repeated if there are slots remaining after having being traversed. In NCS however, we set the "PDU" antenna in the .overlay file, and the README.rst says "If the number of switch-sample periods is greater than the number of stored switching patterns, then the radio loops back to the first pattern." This to me implies that the ant_patterns array shouldn't contain the Guard and Reference antenna patterns, however from your response I assume this is incorrect, and the format of the ant_patterns array should instead be [GUARD, REFERENCE, SWITCH1, SWITCH2...]. Can you confirm this is correct?

Reply
  • Apologies, I don't think I made my enquiry very clear. I'm familiar with the whitepaper, but as I'm using the NCS as that would be what we use in production, certain things are unclear. In the whitepaper, the switching sequence the first 2 writes to the SWITCHPATTERN register are used to set the antenna's used in the Guard then Reference periods. Subsequent writes are used to set the sequence that will be repeated if there are slots remaining after having being traversed. In NCS however, we set the "PDU" antenna in the .overlay file, and the README.rst says "If the number of switch-sample periods is greater than the number of stored switching patterns, then the radio loops back to the first pattern." This to me implies that the ant_patterns array shouldn't contain the Guard and Reference antenna patterns, however from your response I assume this is incorrect, and the format of the ant_patterns array should instead be [GUARD, REFERENCE, SWITCH1, SWITCH2...]. Can you confirm this is correct?

Children
No Data
Related