cancel
Showing results for 
Search instead for 
Did you mean: 

Is it possible to extract phase from "direction finding"?

JasonYang
Associate II

Hi all,

As IQ samples are used in the direction-finding feature, I am wondering how I can extract the phase information from the sampled IQ data. I tried to extract the phase by arctan(Q/I), but it changed very quickly. Is this because of the low IF architecture in Rx mode? and where can I find the IF so I can propose a digital mixer on the IQ?

Thanks,

Jason

2 REPLIES 2
STTwo-32
ST Employee

Hello @JasonYang 

Could you give a full description of your use case. the code you are using. your application... what is the equation you are talking about what is the use case .... I'm not able to understand it.

Best Regards.

STTwo-32

 

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

Hi,

Sorry about the confusion. I tried using Bluetooth to see the magnitude and phase changes when the signal permeates through a specific material. For my current setup, I have one Tx and one Rx (both are BlueNRG-332AC eval board) close to each other, with the material in between

I extracted the IQ data of the CTE from the direction-finding code (profile.c):

void hci_le_connection_iq_report_event(uint16_t Connection_Handle,
                                       uint8_t RX_PHY,
                                       uint8_t Data_Channel_Index,
                                       int16_t RSSI,
                                       uint8_t RSSI_Antenna_ID,
                                       uint8_t CTE_Type,
                                       uint8_t Slot_Durations,
                                       uint8_t Packet_Status,
                                       uint16_t Connection_Event_Counter,
                                       uint8_t Sample_Count,
                                       Samples_t Samples[])

 where Samples[] contains Samples[].I_Sample,Samples[].Q_Sample

I then implemented the following in Python after obtaining the data:

magnitude = round(math.sqrt(I_sample ** 2 + Q_sample ** 2), 2)
phase = round(math.degrees(math.atan2(Q_sample, I_sample)), 2)

When I look at the plot, the magnitude seems fine as it has reasonable changes when I move the Tx and Rx locations (for instance, mag drops when I move Rx further away from Tx), but the phase does not make sense as it rapidly changes from -pi to pi, even if there's nothing between Tx and Rx.

Here what I am expecting is the θ: like sin(wt+θ), which should not fluctuate very rapidly.

Is there any post-processing that needs to be added to the IQ data?

(I am sorry, I am not in the lab now, so I can not provide the plot of the phase. I will update the plot later if needed)