Recovering the Time-Domain Waveform from IQ Data

Hi. After I modified the function static void ranging_data_cb(struct bt_conn *conn, uint16_t ranging_counter, int err), I exported the IQ data, as shown in the figure below. Is the IQ data I exported now correct? I would then like to use this IQ data in MATLAB to recover the time-domain waveform shown in the second figure. Is this possible? Could you please explain it to me in detail? Thank you very much!

Parents
  • Hie,

    Sorry for the delay in the response and thanks for your patience.
    Yes, the IQ data exported from your ranging_data_cb is correct, properly formatted, and contains valid quadrature RF samples suitable for calculating the time domain signal. 

    1. You will need to seperate the values of I and Q from your sample  I: IQ, 136, 0, Sn, I1​,Q1​,I2​,Q2​.
    2. Once you collect all I and Q values in a single vector like below

    I=[I1,line0​,I2,line0​,I1,line1​,I2,line1​,…] 

    Q=[Q1,line0​,Q2,line0​,Q1,line1​,Q2,line1​,…]

    3. Identify the sampling frequency fs from firmware configurations or system documentation. and convert it into time samples

    5.  To get phase, you use atan2(Q, I), and to get amplitude, you use sqrt(I² + Q²).
    Plot amplitude vs time.

    Please let me know if this approach works.

    Regards

    Pallavi

Reply
  • Hie,

    Sorry for the delay in the response and thanks for your patience.
    Yes, the IQ data exported from your ranging_data_cb is correct, properly formatted, and contains valid quadrature RF samples suitable for calculating the time domain signal. 

    1. You will need to seperate the values of I and Q from your sample  I: IQ, 136, 0, Sn, I1​,Q1​,I2​,Q2​.
    2. Once you collect all I and Q values in a single vector like below

    I=[I1,line0​,I2,line0​,I1,line1​,I2,line1​,…] 

    Q=[Q1,line0​,Q2,line0​,Q1,line1​,Q2,line1​,…]

    3. Identify the sampling frequency fs from firmware configurations or system documentation. and convert it into time samples

    5.  To get phase, you use atan2(Q, I), and to get amplitude, you use sqrt(I² + Q²).
    Plot amplitude vs time.

    Please let me know if this approach works.

    Regards

    Pallavi

Children
No Data
Related