# How do I process IQ data received from a signal analyzer

I used a signal analyzer to get IQ sample data from a blue tooth device. The IQ data received is in the form of a .MAT file and I examined the file contents and see an + ibn samples where a, b are constants, n is the sample number and the format is a complex number. I was told the real part is the I and the imaginary part is the Q. Are these samples received baseband I Q data? I am trying to determine the carrier frequency offset. I was trying to determine the frequency of the signal. I felt I could measure the phase difference between samples per time. However, I have the angles being only between pi/2 and -pi/2 when I do arctan(b/a). I assume I should unwrap the signal phase. In MATLAB there is the unwrap command (var = unwrap(phase)). But that does nothing to the values I received. I am unsure of how to proceed with my search for the carrier frequency offset. Any help?

• without you even telling us what specific device that data comes from, how are we supposed what the data is? Also, this feels like a bit of a bad match for this website but really something to look up with the device documentation. – Marcus Müller Sep 2 '19 at 15:18
• Oh I am sorry. The spectrum analyzer was Tektronix 306B USB and the bluetooth device I was studying was a EKO core bluetooth attachment for stethescopes. The .MAT file that I obtained from the device is obtained by using SignalVu software. The software used saves the data as a sequence of I and Q samples in as a complex number: a1 + ib1, a2 + ib2, a3 + ib3...just a 1 x n matrix. It can be easily separated to real and imaginary using real(Y) and imag(Y). I didnt see how that affected it, sorry – Peter E Sep 2 '19 at 15:53
• so, please edit your question to include that info. While you're editing that question, also make sure that you make clear, through structure and highlighting, what your actual question is. – Marcus Müller Sep 2 '19 at 17:33
• Completely unknown without knowing the sample rate and any (down)modulation done between RF frequency and baseband IQ. – hotpaw2 Sep 4 '19 at 2:36

If you're looking for the phase progression I would recommend not using atan() in MATLAB to extract the phase angle. Use the built-in function angle() to extract the phase from the complex samples properly accounting for the quadrant of the complex plane in which each sample appears. This resulting phase can then be unwrapped.
unwrappedPhaseRad = unwrap(angle(inputComplexSamples));
where unwrappedPhaseRad is the unwrapped phase in radians and inputComplexSamples is a vector (1 dimensional array) of your complex input data samples.