Bluetooth AOA IQ samples

I am a BLE beginner and have some confusion about the IQ data of Bluetooth AOA. I used the example direction_finding_connectionless_rx and direction_finding_connectionless_tx from the SDK and I tried to print raw IQ data which contains 45 samples.

1. Why is the data in each frame exactly the same starting from 24? In the picture are 2 sets of data, I used printk("%d+%di\n", report->sample16[i].i, report->sample16[i].q) to print by console.


2. I also saw the existence of TSAMPLEOFFSET in the white paper, and saw CONFIG_BT_CTLR_DF_SAMPLE_OFFSET_PHY_2M_SAMPLING_2US=20 in the project's .config. The CTE of sending the beacon is 160us, but OFFSET is 20us. Does this mean that the effective sampling is 160us - 20us = 140us and the IQ samples the last 20us / 4 = 5 pieces of data are invalid?

3. Another question is about antenna switching. If I set ant_patterns to 0x1 0x2 0x3 0x4, will the sampled IQ array be 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4 ..., because based on the white paper I'm not quite sure whether 0x1 should be included in the loop or not. And because the example uses a 2us slot by default, the first 8 data are sampled once every 1us, followed by every 4us, and part of the intermediate interval switching is 3us, right?And post-data processing requires phase correction due to the delay in sampling.

Kind regards,
Hao

Parents
  • Hello Hao,

    I am glad to see that you've had a look at the whitepaper on direction finding. Multiple customers miss that.

    1. Why is the data in each frame exactly the same starting from 24? In the picture are 2 sets of data, I used printk("%d+%di\n", report->sample16[i].i, report->sample16[i].q) to print by console.

    Maybe the same antenna patch is being sampled twice there. What is your antenna pattern? What antenna matrix are you using?

    2. I also saw the existence of TSAMPLEOFFSET in the white paper, and saw CONFIG_BT_CTLR_DF_SAMPLE_OFFSET_PHY_2M_SAMPLING_2US=20 in the project's .config. The CTE of sending the beacon is 160us, but OFFSET is 20us. Does this mean that the effective sampling is 160us - 20us = 140us and the IQ samples the last 20us / 4 = 5 pieces of data are invalid?

    CONFIG_BT_CTLR_DF_SAMPLE_OFFSET_PHY_2M_SAMPLING_2US is measured in number of 16M cycles. That is 20* 1/16.000.000 = 20* 62.5ns = 1.25µs.

    3. Another question is about antenna switching. If I set ant_patterns to 0x1 0x2 0x3 0x4, will the sampled IQ array be 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4 ..., because based on the white paper I'm not quite sure whether 0x1 should be included in the loop or not. And because the example uses a 2us slot by default, the first 8 data are sampled once every 1us, followed by every 4us, and part of the intermediate interval switching is 3us, right?And post-data processing requires phase correction due to the delay in sampling.

    The pattern continues from how far its gotten after the reference period has ended. So eight samples with 0x1, then it loops from 0x2.

    0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x2 0x3 0x4 

    If you are to make a Bluetooth compliant solution then the pattern should always rotate through the reference antenna, this can be done by having the reference antenna (pattern entry 2) as the last entry in the pattern table. It will then be part of the "looped" pattern. When you have gone through all the patterns loaded then the next IQ sample will be from pattern 3 and this will loop for the length of the CTE duration.

    Regards,

    Elfving

  • Hi Elfving,

    Thank you once again for your help recently!

    I am working with the Direction Finding Connectionless tx/rx Sample in the ncs.

    You mentioned that the default pattern does not include the reference antenna in the loop. For example, if I set ant_patterns to 0x1 0x2 0x3 0x4, the antenna switching pattern in one CTE would be:

    0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x2 0x3 0x4 

    Here, 0x1 is only used for reference, and the actual direction finding data comes from only three antennas, right?

    To include 0x1 in the loop, you said:

    f you are to make a Bluetooth compliant solution then the pattern should always rotate through the reference antenna, this can be done by having the reference antenna (pattern entry 2) as the last entry in the pattern table. It will then be part of the "looped" pattern. 

    However, I am unsure how to configure this. I could not find information about that in the whitepaper.

    Additionally, I would like to confirm whether setting ant_patterns to 0x1 0x1 0x2 0x3 0x4 in the default sample would successfully include 0x1 in the loop. Would the antenna switching pattern then be:

    0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4

    And are there any other potential disadvantages to this way?

    Thank you!

Reply
  • Hi Elfving,

    Thank you once again for your help recently!

    I am working with the Direction Finding Connectionless tx/rx Sample in the ncs.

    You mentioned that the default pattern does not include the reference antenna in the loop. For example, if I set ant_patterns to 0x1 0x2 0x3 0x4, the antenna switching pattern in one CTE would be:

    0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x2 0x3 0x4 

    Here, 0x1 is only used for reference, and the actual direction finding data comes from only three antennas, right?

    To include 0x1 in the loop, you said:

    f you are to make a Bluetooth compliant solution then the pattern should always rotate through the reference antenna, this can be done by having the reference antenna (pattern entry 2) as the last entry in the pattern table. It will then be part of the "looped" pattern. 

    However, I am unsure how to configure this. I could not find information about that in the whitepaper.

    Additionally, I would like to confirm whether setting ant_patterns to 0x1 0x1 0x2 0x3 0x4 in the default sample would successfully include 0x1 in the loop. Would the antenna switching pattern then be:

    0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4

    And are there any other potential disadvantages to this way?

    Thank you!

Children
  • Hi, Zihao
    I am also interested in bluetooth aoa. From my experiment,if I set ant_patterns to 0x1 0x1 0x2 0x3 0x4, the antenna switching pattern will be 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 (8 times) 0x2 0x3 0x4 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4(include 0x01). When I set this ant_patterns, and according to my point of view,plotting the IQ of the same antenna will give a sine wave (although it should be a straight line in theory, the clock deviation causes it to look like a sine wave).

  • Hi,

    OK, thank you for your reply! I still don't understand the benefit of excluding the antenna with index 0 from the loop. With this setup, even though I have 4 antennas, only 3 are used to collect IQ data for DF. I will try experimenting by including 0x1 twice in the ant_patterns.

  • Hi,

    Thanks again for the reply.

    I tried to set the ant_patterns={ 0x1 0x1 0x2 0x3 0x4}, but the phase_diff seems no rules...

    1、May I ask what is the setting of dfe-antenna-num when you use this ant_patterns? Is it 4 or 5?

    2、Meanwhile, we expect that different antennas are simultaneously acquiring IQ data, but in reality, it is a time division process. Therefore, when calculating the phase difference between different antennas, the error introduced by this time division needs to be corrected.

    According to WP036, my understanding is that the time interval for sampling IQ data between adjacent antennas is consistent. For example, if the switch slot is set to 2us, then the IQ sampling interval between two antennas will always be 4us. When processing IQ samples, I directly retain the phase for ant1. For ant2, I subtract this △phase; for ant3, I subtract 2* △phases. But how do I calculate △phase? I only know that the CTE frequency is offset by 250 kHz from the center frequency of the channel being used, but BLE has frequency hopping. How do I determine the channel being used?

    3、Previously, I set all twelve antennas in ant_patterns to 0x1, then measured the phase difference from the same antenna to estimate this △phase, but the results seem irregular, possibly due to frequency hopping effects. 

    So, did you disable frequency hopping when you were doing direction finding?

    I appreciate anything you relpy!

  • Hi Zihao,

    Sorry, I accidentally typed an extra 0x01. Actually, what I meant was if I set ant_patterns to 0x1 0x2 0x3 0x4, the antenna switching pattern will be 0x1 0x1 0x1 0x1 0x1 0x1 0x1 0x1 (8 times) 0x2 0x3 0x4 0x1 0x2 0x3 0x4 0x1 0x2 0x3 0x4(include 0x01). 

  • Hi Zihao,

    1. If you set ant_patterns={ 0x1 0x2 0x3 0x4 }, the setting of dfe-antenna-num should be 4.

    2. Yes, you are correct. We need to phase correction. The method of phase correction is to rotate the IQ value on the IQ plane. In your case, f = 250KHZ, sampling interval = 4us, that means we need shift 2*pi*f*t = 6.28. This means that the second antenna needs to be rotated 2PI in the IQ plane relative to the first antenna. In other words, you don't need to correction under the current parameters, because one rotation is actually equal to the phase before correction.

    3. If you set all twelve antennas in ant_patterns to 0x1, that means all IQ samples comes from 0x1. And according to white paper, the intervel of first 8 samples is 1us, and other samples in your case is 4us. In other words, the first 8 points sample sine at 1M sampling rate, and the following sine is sampled at 250KHZ. Note that the frequency of your sine is set to 250KHZ. This means that if you plot the first 8 points, you will see 4 cycles. Plot the following points and theoretically you will see a straight line. Since the sampling rate is the same as the signal frequency, this means that the same IQ sample is always taken in each cycle. 

    4. You mentioned frequency hopping. Frequency hopping is the different carrier frequencies used in Bluetooth communication and has nothing to do with the frequency here. You can imagine that a 250KHZ single tone signal is RF-converted to a certain 2.4G channel. However, there will be a reverse operation during reception, which we call down-conversion, to 250KHZ. The signal we sampled after downconversion. Because the high-frequency 2.4G does not have such a fast ADC, low-frequency signals can be sampled.

    If you have any other questions, I'd be happy to discuss them together.

    Kind regards,

    Hao

     

Related