The meaning of IQ data in the channel sounding example:Why not a conjugate multiplication?

The meaning of IQ data in the channel sounding example

I am trying to use IQ data to calculate distance using the routines `channel_sounding_ras_initiator` and `channel_sounding_ras_reflector`. In the code, the structure `cs_de_report_t` contains `cs_de_iq_tones_t`, which stores four arrays: local I/Q and peer I/Q. I have some confusion about the processing of the IQ data.

According to the webpage (www.bluetooth.com/.../):

1. Device A transmits a signal at a known frequency, f1. The initial phase of this signal is known to Device A, and, for the purpose of illustration, let's assume that this signal is transmitted with a phase of zero radians.
2. Device B receives the f1 signal at its antenna and notes its phase, which we will refer to as the receive phase.
3. Device B then echoes the received signal back to Device A by transmitting on the same frequency, f1 and, critically, ensuring that the initial phase of this transmission is exactly the same as the receive phase of the signal received from Device A. This results in the return signal being a continuation of the signal from Device A in terms of phase and frequency.
4. Device A measures the receive phase of the signal arriving from Device B. We'll call this value Pf1.

If for a certain frequency f1, the local I/Q is what Device A transmitted, and the peer I/Q is what Device B sent back to Device A according to the process described above, then to obtain this phase difference, one should perform a conjugate multiplication of these two I/Q samples.

However, in the implementation of V2.9.0, for the Phase-Slope method (`distance_estimation.c`), it uses a direct multiplication form:


static void calc_complex_product(int32_t z_a_real, int32_t z_a_imag, int32_t z_b_real,
int32_t z_b_imag, int32_t *z_out_real, int32_t *z_out_imag)
{
*z_out_real = z_a_real * z_b_real - z_a_imag * z_b_imag;
*z_out_imag = z_a_real * z_b_imag + z_a_imag * z_b_real;
}

for (uint8_t i = 0; i < len; i++) {
if (!data[i].failed) {
calc_complex_product(data[i].local_iq_sample.i, data[i].local_iq_sample.q,
data[i].peer_iq_sample.i, data[i].peer_iq_sample.q,
&combined_i, &combined_q);

theta[num_angles] = atan2(1.0 * combined_q, 1.0 * combined_i);
frequencies[num_angles] = 1.0 * CS_FREQUENCY_MHZ(data[i].channel);
num_angles++;
}
}



This seems to implement the sum of the phases, not the difference. (Note: The phase difference I'm referring to here is the two-way measurement on a single frequency, which is different from the phase difference used in the subsequent formula calculation.)
Parents Reply Children
No Data
Related