Demodulating IQ Data
Messages in the Air
Note
Originally posted November 15, 2020 to blog.aunyks.com. The original post contains interactive components that greatly enhance understanding.
In the last post, we covered the basics of complex signals and how they work in digital signal processing (DSP) systems. The next question is how do we demodulate these signals and find the messages in them? To answer that, we need to update our model of the incoming signal.
Previously, we used Euler’s formula as the basis for our model of complex signals. While this is great to keep in mind, it was only correct given a pure sinusoid as the incoming signal. In reality, we can’t make many assumptions about the signal, so modeling it as a simple sinusoid isn’t always accurate. We need a more abstract way to model more realistic signals.
$Ae_{iθ}=Acos(θ)+iAsin(θ)$Recall that $cos(θ)$ represented the inphase, or $I$, portion of our complex signal and $sin(θ)$ represented the quadrature, or $Q$, portion. Since we’re not sure that our $I$ and $Q$ functions will be simple sinusoids like sine and cosine, we can use abstract functions like $I(t)$ and $Q(t)$. This way, we arrive at a new, more abstract way to model any signal we’ll be receiving over the air.
$s(t)=I(t)+jQ(t)$Where $s$ is the incoming signal, $j$ is our imaginary unit, and $t$ is some point in time.
How do we demodulate our signal with this formula? Well, to modulate a signal is to change one of its properties according to the message it encodes. So, to demodulate the signal we must be able to extract these properties from our new signal formula.
Remember the phasor from our last post and how it modeled our wave. We can use it to help calculate how we can get properties like amplitude, phase, and more using our formula. Finding these properties lets us demodulate the signal.
To help us better understand the math and visuals for these concepts, notice that our phasor is always making a triangle.
Here, $A$, $B$, and $C$ are sides of a triangle formed by our phasor. $θ$ is an angle.
We can use algebra and trigonometry to find certain values when given others, which will ultimately give us characteristics of our signal.
Amplitude
$A(t)=I_{2}(t)+Q_{2}(t) $Where $A(t)$ is the amplitude of the signal at a point in time, or instantaneous amplitude.
The Pythagorean Theorem concludes that $A_{2}+B_{2}=C_{2}$. With that in mind, we can get $C$, the hypotenuse of our triangle above, with just $A$, on the horizontal axis, and $B$, on the vertical axis, by rearranging the equation into $C=A_{2}+B_{2} $. Applying this formula to our signal function with $I(t)$ being on the horizontal axis and $Q(t)$ being on the verical axis yields a formula that gives us the amplitude of the signal at a certain point in time.
Phase
$ϕ(t)=tan_{−1}(I(t)Q(t) )$Where $ϕ(t)$ is the phase of the signal at a point in time, or instantaneous phase.
In our triangle above, we can get $θ$ from $A$ and $B$ using the inverse tangent function. That is, $θ=tan_{−1}(AB )$. Applying this formula to our signal function yields a formula that gives us the phase of the signal at a certain point in time.
Frequency
$f(t)=(Δt1 )tan_{−1}(I(t)I(t−1)−Q(t)Q(t−1)I(t)Q(t−1)+Q(t)I(t−1) )$Where $f(t)$ is the frequency at a point in time.
Quite frankly, I’m not going to try and explain this formula. Just know that we can calculate the signal’s instantaneous frequency by calculating the instantaneous change in the signal’s phase^{1}.
But why this way?
Using this I/Q model in our DSP system gives us a relatively easy way to process signals with low or negative frequencies. In my opinion, it also happens to make modeling signal properties easier and more robust, thus making demodulation easier.
To wrap up
I hope this made the concept of RF signal demodulation a bit easier to understand. If you have any questions or would like to offer ways that I can improve this post, feel free to contact me.
Footnotes

As a matter of fact, the frequency function is the first derivative of the phase function. ↩