(Top) An 8-PSK waveform. (Bottom) Two constellation diagrams: one at the Tx shown by thick red lines and the other at the Rx for a phase offset of 17 degrees shown by dotted purple lines

I/Q Signals 101: Neither Complex Nor Complicated

There was a recent discussion on GNU Radio mailing list in regards to the simplest possible intuition behind I/Q signals. Why is I/Q sampling required?

Question: The original question from Kristoff went like this: “… when you mention `GNU Radio complex numbers’, you also have to mention I/Q signals, which is a topic that is very difficult to explain in 10 seconds to an audience who has never seen anything about I/Q sampling before.”
Comment: According to Jeff Long: “This is a great thing to try to figure out. If we can come up with an answer that gives someone a feel for why I/Q is used in SDR in 10 minutes, and does not include

  • phasors,
  • exponentials to a complex power,
  • a derivation of any equation,
  • the concept of orthogonality,

etc., … it will win a Nobel prize in education.”

This comment basically gives us a reasonably comprehensive list of traps to avoid to qualify for a good I/Q signals tutorial. Below, I attempt to explain this concept through one simple route, with an understanding that there are many other (better and more accurate) angles to view the same concept. Some remarks are in order here.

  • There is no assumption of reader’s knowledge about introductory digital communications in this article. Therefore, I hope that SDR beginners will find these concepts easier to understand.
  • Depending on your level of expertise, you can easily skip the sections you already know about.
  • While the concept of I/Q signals applies to both a transmitter and a receiver, it is easier to understand it from a receiver perspective.
  • I/Q signals are also called quadrature signals. We will shortly find out why.

You can watch the video below for an overview. But keep reading the article for interesting finer details not mentioned in the video.

I/Q Signals Video


Let us start with an introduction to an Electromagnetic (EM) wave.

An Electromagnetic Wave


Imagine a long straight wire with an AC source at its center shown in Figure 1. The source forces an acceleration and deceleration of charges in the forward and reverse directions. Since charges radiate whenever accelerated, the wire acts an antenna in which

  • an electric field is produced due to the charge distribution, and
  • a magnetic field is produced due to the varying current in the antenna.

The resulting Electromagnetic (EM) wave exhibits a sinusoidal form because the charges periodically travel back and forth to the ends of the wire. This wave propagates away from the source close to the speed of light in a direction perpendicular to both the electric and magnetic fields. A wireless signal is born.

An electromagnetic wave is generated through acceleration of charged particles in a conductor in which the direction of propagation is perpendicular to both the electric and magnetic fields away from the source

Figure 1: An electromagnetic wave is generated through acceleration of charged particles in a conductor in which the direction of propagation is perpendicular to both the electric and magnetic fields away from the source

A reverse process occurs on the receive side. The impinging EM wave influences the electrons in the antenna through its electric and magnetic fields. The acceleration and deceleration of these electrons under the influence of these fields creates a tiny electrical signal. This signal can be amplified and processed in any desirable manner.

More than 100 years ago, someone (there are some contestants to Marconi for this claim) figured out that a propagating electromagnetic wave can act as an information carrier to far away places without any physical connection, a revolutionary idea for the time. Then, some backed it up with actual demonstrations of wireless signal propagation, changing the world we live in forever. While the initial wireless transmission was based on analog communication like AM and FM, we skip that part and focus on digital modulation because it is both easy and relevant to understand.


https://wirelesspi.com/i-q-signals-101-neither-complex-nor-complicated/


For an unmodulated EM wave, the generated sinusoidal signal is given by
()=cos(2+)

There are three different parameters that can be altered to transmit information.

  • Amplitude 
  • Frequency 
  • Phase 

Such a cosine wave with amplitude =1, frequency =1 and phase =0 is shown at the top left in Figure 2. Also indicated here are the respective phases through the duration of one full cycle. These angles come from the following relations.

cos0=1cos90=0(1)cos180=1cos270=0cos360=1

where the angle 270 is the same as 90. Also drawn in this figure are the cosine waves starting with a particular phase.
A cosine wave with different phases

Figure 2: A cosine wave with different phases

  • Notice that the phase of a sinusoidal wave just indicates the start time of that signal. While this is not necessary to understand this tutorial, ask me this question in the comments below if you are wondering about the reason and I will reply with an explanation.
  • If the bottom right figure resembles a sine wave, this is because
    (2)cos(2+270)=cos(290)=sin(2)

To comprehend I/Q signals, is it helpful if we start with the three basic digital modulation schemes.

Frequency Shift Keying (FSK)


The simplest modulation scheme is Frequency Shift Keying (FSK) for which we discuss the binary case first. Also as far the general demodulation process is concerned, the reader should note that there are several different techniques for extracting the bits from the analog signal but I will only describe the simplest of algorithms in the spirit of this article.

FSK Modulation


In binary FSK, one frequency, say 0, is transmitted for a logic 0 and another frequency, say 1, is sent for a logic 1. An example BFSK waveform is drawn in Figure 3 for a bit stream given by
1  0  1  1  0  0

For each bit duration  (I also call it a `signaling interval’ due to having a possibility of sending multiple bits on one waveform, as we will shortly find out), the modulated cosine waveform is written as
(3)()=cos(2+)

where  is either 0 or 1 depending on the data bit. We represent the phase here as a constant term  but the actual waveform is slightly more complicated because the phase transitions at the boundaries of bit transitions are — in general — discontinuous. Ham radio operators usually call the signal representing the logic 1 as mark frequency and that representing logic 0 as space frequency.

A Frequency Shift Keying (FSK) waveform with a lower frequency representing a 0 and a higher frequency representing a 1

Figure 3: A Frequency Shift Keying (FSK) waveform with a lower frequency representing a 0 and a higher frequency representing a 1

Just as a reminder, one of the most interesting modulation schemes in digital communication, namely Minimum Shift Keying (MSK), is a version of FSK.

FSK Demodulation


In practice, an FSK signal can be demodulated through several methods such as quadrature demod, correlators or matched filtering, a Phase Locked Loop (PLL), bandpass filters, limiter discriminator, and so on. These methods can be broadly categorized as coherent versus non-coherent demodulation techniques. A coherent technique implies that a carrier waveform is available at the Rx that is phase and frequency aligned with the Tx waveform. On the other hand, a non-coherent technique ignores this phase difference between the devices and relies on alternative methods (e.g., envelop detection) for bit decisions. I will only consider a simple coherent technique here which is not only optimal in terms of bit error probability but you will also find it quite sensible when you think about it later.

An FSK waveform was described earlier as
()=cos(2+)

During each bit (or signaling) interval , we receive a waveform with frequency  that is a representation of the underlying bits. Consider a receiver synchronized with the transmitter in terms of carrier phase, carrier frequency and bit timing. The optimum implementation is a coherent demodulation scheme in which the Rx simply correlates two candidate carrier waves with the incoming waveform. By definition, correlation is a measure of similarity between two signals. In our everyday life too, we recognize something by correlating it with a stored image in our heads. As an example, in the The Hound of the Baskervilles, Sherlock Holmes accurately described Dr James Mortimer’s dog through correlating some observations with templates in his mind:

“… and the marks of his teeth are very plainly visible. The dog’s jaw, as shown in the space between these marks, is too broad in my opinion for a terrier and not broad enough for a mastiff. It may have been — yes, by Jove, it is a curly-haired spaniel.”

In the context of demodulating an FSK signal, correlation means that we multiply two candidate carrier waves in parallel at the Rx with the incoming waveform to check which one it resembles the most. One of these waves is 2cos(20+) while the other is 2cos(21+). This is shown in the block diagram of Figure 4.

FSK demodulator block diagram

Figure 4: FSK demodulator block diagram

  • The amplitude factor 2 in these local carriers is included to compensate for the loss of half the amplitude as a result of multiplication, as we shortly see from the following identity.
    cos2=12+12cos2

  • The averaging operation filters out high frequency terms in the output since averaging is a lowpass operation (e.g., averaging one full cycle of a sinusoid gives a zero output).

This whole process is similar to spotting an approaching dog and correlating its features with images of a spaniel and a mastiff in our minds.

To quickly see why this procedure generates the correct output, consider the resulting waveforms drawn in Figure 5 corresponding to the block diagram of Figure 4. The multiplication operation by the same carrier generates two components, one at DC and the other at double the frequency. Suppose that the incoming waveform has a frequency 1 corresponding to bit 1 in the first interval which is a multiple of 0.

FSK demodulator waveforms

Figure 5: FSK demodulator waveforms

  • In the upper arm, the product of cross-terms is a sum of two cosine waves, one at the difference frequency while the other at the sum frequency.
    cos(21+)Incoming waveform2cos(20+)Generated at Rx=cos{2(10)}+cos{2(1+0)+2}Filtered out0

    where we have used the identity 2coscos = cos() + cos(+). After the averaging or filtering operation, a very small signal component remains (under ideal conditions) because sum of samples of a sinusoid in one period is zero. This zero value is shown at the top right of Figure 5 for the first bit.

  • In the lower arm, we have
    cos(21+)Incoming waveform2cos(21+)Generated at Rx=+cos{2(21)+2}Filtered out

    After the averaging or filtering operation, only the DC term  remains (under ideal conditions). This is shown at the bottom right of Figure 5 for the first bit with =1. Keep in mind that if the Tx and Rx frequencies were not aligned, the first term would also be time-varying with the difference frequency and if their phases were not aligned, a term cos() would come with  and potentially wipe it out (e.g., for a phase difference of 90).

Thus for the first interval, the receiver decides in favour of bit 1. A similar process is repeated for the next arriving bits. Note that in the figure plotted here, I have chosen 1 as an exact multiple of 0 (i.e., 1=20) for showing a beautiful figure where both the cross-terms average out to zero. For each bit interval, the receiver carries out this product and averaging operation and chooses the frequency candidate with the largest output. For the chosen example, the receiver makes the following decisions.
Bit interval 01Bit 1Bit interval 10Bit 0Bit interval 21Bit 1

Until now, we are doing just fine with one waveform that can be downcoverted and sampled. We have not encountered any need for I/Q signals yet (although I/Q sampling does make FSK demodulation much easier).

Amplitude Shift Keying (ASK)


In Amplitude Shift Keying (ASK), the signal amplitude  (instead of frequency ) is used to indicate the value of a bit. Let us begin with a binary ASK system.

ASK Modulation


In a binary ASK system, we can transmit a sinusoidal waveform with one amplitude (e.g., 1) for logic 0 and another amplitude (e.g., 2) for logic 1, as shown in Figure 6. On a side note, On-Off Keying (OOK) is a special case of ASK in which the amplitude representing logic 0 is exactly 0. In each signaling interval , the resulting waveform is given by
(4)()=cos(2+)

where  is either 1 or 2 according to the data bit.

(Top) An Amplitude Shift Keying (ASK) waveform with a lower amplitude representing a 0 and a higher amplitude representing a 1. (Bottom) An ASK constellation diagram

Figure 6: (Top) An Amplitude Shift Keying (ASK) waveform with a lower amplitude representing a 0 and a higher amplitude representing a 1. (Bottom) An ASK constellation diagram

You would have noticed in Figure 6 that the choice of the two amplitudes is poor as we focus on their positive values only. Such a representation is commonly known as unipolar ASK. The alternative is bipolar ASK where the amplitudes are instead chosen as +1 and 1. In most cases, bipolar ASK is preferred over unipolar ASK due to power and bit error rate performance. Nevertheless, a negative sign indicates a change in phase of 180 and our main purpose is to clearly distinguish this waveform from Phase Shift Keying (PSK) which comes next.

Here, I introduce you to something known as a constellation diagram. It is a representation of a digital modulation scheme independent of the underlying carrier waveform. For example, a constellation diagram for a binary ASK scheme showing the two information carrying amplitudes, 1 and 2, is drawn in Figure 6. You can relate this to the actual waveform in the following manner. For sending a logic 0, the carrier wave is multiplied with a value of 1 and for a logic 1, it is multiplied with a value of 2.

These points shine like stars in a night sky. The purpose of a constellation diagram is to bypass all the less relevant signals and focus solely on the parameter that carries the actual digital information.

ASK Demodulation


An ASK waveform was described earlier as
()=cos(2+)

During each bit (or signaling) interval , we receive a waveform with amplitude  that is a representation of the underlying bits. Consider a receiver synchronized with the transmitter in terms of carrier phase, carrier frequency and bit timing. For the demodulation of ASK signals, we can follow a similar procedure as FSK and correlate (i.e., multiply and average) the incoming waveform with two carrier waves of different amplitudes generated at the Rx. Consider a received signal with an amplitude 2 (representing bit 1) in the first interval.

  • In the upper arm, we can have
    1cos(2+)20cos(2+)

  • In the lower arm, we can have
    1cos(2+)21cos(2+)

However, the carrier wave in both cases is exactly the same, so why produce it twice and multiply it twice? A better option is to generate a single carrier with frequency  and simply check the output amplitudes after a filtering or averaging operation. It can be easily seen from above that such an output would be  depending on the data bit and the corresponding amplitude.

cos(2+)Incoming waveform2cos(2+)Generated at Rx=+cos{2(2)+2}Filtered out

Observe that the frequency  and phase  must be the same for such a cancellation to happen for the first term. In practice, this is accomplished through carrier phase synchronization and frequency synchronization algorithms while the optimal instants for decision samples are found through timing synchronization procedure. This is drawn in the right column of Figure 7 where the output amplitudes are 2, 1 and 2 corresponding to the three bits are 1, 0 and 1, respectively. The double frequency terms are also visible in the background that are filtered out.

ASK demodulator waveforms

Figure 7: ASK demodulator waveforms

Again observe that we are doing just fine without any I/Q signals. Demodulating the signal from a single carrier waveform seems enough.

Granularity on the Axis


We have learned above that a Tx and Rx agree upon the modulation choice which forms the basis for the algorithms required for the detection of bits. When a digitally modulated waveform is received, the Rx extracts the information carrying parameter and maps those levels at the Rx constellation onto the designated bits. As opposed to the simple constellation diagrams for binary modulations shown above, more than two points are needed in a real constellation as follows.

Higher-Order Modulations


Digital electronics are constrained to work on only two levels by electronic switches which in the simplest case are either on or off. Actual digital communication systems require quite complicated signal processing workload both at the Tx and Rx ends that can be performed only by a device more intelligent than an electronic switch, such as an Application Specific Integrated Circuit (ASIC), Field Programmable Gate Array (FPGA), Digital Signal Processor (DSP) or a General Purpose Processor (GPP).

Hence if a Rx can differentiate between two signal levels to detect which bit was sent, it can also differentiate between more than two signal levels. Being able to do so can result in sending more data during the same amount of time. In this system, multiple bits (say, 2) can be collected during every unit of time, converted into their decimal equivalents and one level out of possible options (e.g., 22=4) can be accordingly selected for transmission.

In the case of 4-FSK for instance, this implies that four different carrier frequencies can be utilized where each of them represents a set of two bits.
000101210311

For example, the Figure 8 shows a new waveform for an FSK modulation with four different frequencies each representing two bits. The bit sequence is as follows.
1  1  0  0  1  0  0  1

From this bit sequence, two bits are collected at each instant as 11, 00, 10 and 01 and carrier waves with the corresponding frequencies 302 and 1, respectively, are sent over the air. These bit assignments are arbitrary (e.g., bits 00 can be sent through frequency 2) as long as the Tx and Rx agree on the same convention.

(Top) An FSK signal with 4 levels. (Bottom) An ASK signal with 4 levels along with its constellation diagram

Figure 8: (Top) An FSK signal with 4 levels. (Bottom) An ASK signal with 4 levels along with its constellation diagram

In Figure 8, carefully map each set of two bits to their respective frequency to grasp how the waveform is generated. For example, according to the assignment on the right, the first two bits 11 are assigned to the frequency 3. Therefore, the frequency 3 (which happens to be the highest) is sent during the first signaling interval. On the same note, 0 is transmitted during the second interval due to the bits being 00, and so on.

A similar phenomenon occurs for ASK modulation systems. More number of bits can be sent through inclusion of higher or lower amplitudes according to the target number of bits. A 4-ASK constellation diagram is shown in Figure 8 where each amplitude represents a set of 2 bits. The difference here as compared to FSK is that these levels are assigned to the amplitude of a carrier wave with a single frequency. Some comments are in order here.

  • The most relevant observation is that these additional amplitudes lie on the same axis of the constellation diagram.
  • What happens when more than 2 bits (e.g., 3) need to be packed in each transmission interval? We can simply increase the number of levels to 23=8. Note that in all these cases, either higher or lower amplitudes are added to this group but the growth stays on the same axis of the constellation diagram.
  • As far as the demodulation is concerned, it follows the same principles described before.

In conclusion, a higher granularity of more than two modulation levels are required for higher-rate schemes.

Mismatches between Parameters


Even for a binary modulation scenario, a finer resolution on the constellation diagram is needed. This is because no two Tx and Rx devices are the same and there is always a mismatch between their parameters. In the FSK case for instance, the frequency of the local oscillator at the Rx is not exactly the same as the carrier of the incoming signal and there is always some difference between the manufacturer’s nominal specification and the real frequency of that device. This is known as a carrier frequency offset. Moreover, this offset keeps varying (slightly) with temperature, pressure, age and other factors. Consequently, instead of only two frequencies, we need a continuum of levels on that frequency axis (you can read about how a Direct Digital Synthesizer (DDS) can be used for signal generation at any frequency).

In an ASK system too, the absolute Rx amplitude is affected by several factors such as channel attenuation and path loss. Again, we need a continuum of amplitudes for Rx constellation mapping. This is where phase as a parameter is different from frequency and amplitude, as we explain now.

Phase Shift Keying (PSK)


In Phase Shift Keying (PSK), the data is transmitted by changing the phase of a constant frequency carrier wave at each signaling interval.

PSK Modulation


In the binary case here, two different phases are employed to represent the bit values. For example, logic 0 and logic 1 are sent with phases 0 and 180 of the carrier wave, respectively. This waveform is drawn below for the same bit sequence as before. Look specifically at the bit boundaries to notice the phase transitions. The waveform for each interval  is
(5)()=cos(2+)
where  is 0 or 180 depending on the data bit. If you have a confusion regarding these phases, refer to the cosine figure at the start of this article where we connected the phase relations of Eq (1) to the waveform values.

(Top) A Phase Shift Keying (PSK) waveform with phase 0 representing a 0 and phase pi representing a 1. (Bottom) A PSK constellation diagram

Figure 9: (Top) A Phase Shift Keying (PSK) waveform with phase 0 representing a 0 and phase pi representing a 1. (Bottom) A PSK constellation diagram

The constellation diagram for a binary PSK scheme is also shown in the same figure where the carrier phase is chosen as either 0 or 180 according to the incoming bit. Otherwise, the waveform frequency and amplitude stay the same in both cases.

PSK Demodulation


Something really interesting happens when it comes to demodulating a PSK signal. Consider a receiver synchronized with the transmitter in terms of carrier phase, carrier frequency and bit timing. For the demodulation of PSK signals, we can

  • either follow a similar procedure as FSK and correlate the incoming waveform with two carrier waves of different phases generated at the Rx,
  • or follow a similar procedure as ASK and correlate (i.e., multiply and average) the received waveform with a single carrier to observe its phase.

Since the amplitude and frequency stay the same for all phases, it makes sense (and can be proved to be optimal) to adopt the second route above. If the Tx and Rx frequencies are exactly the same and their phase difference is also equal to zero except the modulation phase , we can write
cos(2+)Incoming waveform2cos(2)Generated at Rx=cos+cos{2(2)+}Filtered outcos

for =1 and where we have used the identity 2coscos = cos() + cos(+). After the averaging or filtering operation, only the DC term cos remains (under ideal conditions). Looking at this term cos, here is the interesting observation I hinted at earlier.

Since
cos0=1andcos180=1,

such a demodulation process has transformed the phases into amplitudes!

This is drawn in Figure 10 where the three bits are 1, 0 and 1 and the corresponding output amplitudes are -1, +1 and -1.
Bit interval 01180Bit 1Bit interval 1+10Bit 0Bit interval 21180Bit 1

PSK demodulator waveforms

Figure 10: PSK demodulator waveforms

A question that arises is the following. Instead of converting the phase into amplitude, is it possible to build an algorithm that directly detects the phase for each bit interval? This is related to I/Q sampling as we find out next.

From Geometrical Angle to Signal Phase


Observe from the ASK constellation diagram that all the amplitudes still extend on the same axis. On the other hand, for a PSK system, one axis is not enough because an actual angle is formed by two lines, not one. This is shown in Figure 11. In other words, an ASK modulation scheme has a 1-dimensional constellation diagram while a PSK system requires a 2-dimensional constellation diagram. And that has made all the difference, as we shortly see.

An angle is formed by two lines, not one

Figure 11: An angle is formed by two lines, not one

Let us explore this concept with respect to both higher-order modulations and phase offsets.

4-PSK Example


Previously we described a 2-PSK system where a phase of 0 represents bit 0 while a phase of 180 represents bit 1. Now for a 4-PSK modulation, we can send a set of two bits during each signaling interval as follows.
00090011801027011

These phases are shown in the constellation diagram of Figure 12 along with their bit assignments. As noted earlier, these bit assignments are arbitrary and can be altered easily as long as the Tx and Rx keep the same table. Let us explore how the modulated waveform is generated for the same bitstream.
1  1  0  1  1  0  0  0

A PSK signal with 4 levels along with its constellation diagram

Figure 12: A PSK signal with 4 levels along with its constellation diagram

First, refer to the cosine figure at the start of this article that connects the angle relations in Eq (1) to the phases of the sinusoidal waveform. Now the first two bits in the stream are 11 which map to the last phase, i.e., 270. This implies that the cosine wave should start at the second zero crossing. This can also be seen from
cos(+270)=cos(90)=sin
and hence the waveform in the first signaling interval has a sine shape. The next set of bits is 01 which implies that the cosine wave has a phase of 90 in the second interval. You can follow the same logic for the rest of the signal representing the bits 10 and 00.

8-PSK with a Phase Offset


Even for a binary PSK system, a finer phase resolution is needed at the Rx due to a phase offset between the Tx and Rx. Some factors that contribute towards this phase offset are mismatched time references between Tx and Rx local oscillators, overall channel impulse response (including all the analog and digital filtering) and the propagation delay between the two devices.

As an example, an 8-PSK waveform is drawn in Figure 13 for a bit sequence
1  0  04  0  0  11  1  0  15  0  1  02  1  1  06  1  1  17

Notice the phase transitions at the signaling boundaries where the waveform phase is altered to represent each new set of 3 bits entering the modulator. The waveform is not joined at these boundaries to highlight these fine phase changes. With the experience of previous PSK figures, I hope that the reader can map the waveform boundary phases to the Rx constellation diagram. For example, the first 3 bits represent are 100 which represent a decimal value of 4. On the constellation diagram at the bottom, 4 corresponds to an angle of 180 (starting from 0). Therefore, the first signaling interval shows a cosine wave with a 180 phase.

In Figure 13, the Tx constellation can be located at an angle spacing of 45 on the unit circle that dictates the waveform phases drawn above. However, the Rx constellation is drawn with a phase offset of 17 as dotted lines. This is done in order to demonstrate that the actual phase can lie anywhere in this 2-D plane (although this phase offset is not included in the actual top waveform).

(Top) An 8-PSK waveform. (Bottom) Two constellation diagrams: one at the Tx shown by thick red lines and the other at the Rx for a phase offset of 17 degrees shown by dotted purple lines

Figure 13: (Top) An 8-PSK waveform. (Bottom) Two constellation diagrams: one at the Tx shown by thick red lines and the other at the Rx for a phase offset of 17 degrees shown by dotted purple lines

Demodulation with Cosine


Let us apply the same demodulation algorithm used for binary PSK before. This is what happens for each signaling interval.

  1. The incoming signal is multiplied with a single carrier wave.
  2. The output is averaged or filtered.
  3. The resulting amplitudes are marked on the Rx constellation diagram (e.g., +1 and 1 in binary PSK).

With this algorithm, we said that if the Tx and Rx frequencies are exactly the same and their phase difference is also equal to zero except the modulation phase , we can write
cos(2+)Incoming waveform2cos(2)Generated at Rx=cos+cos{2(2)+}Filtered outcos

for =1 and where we have used the identity 2coscos = cos() + cos(+). After the averaging or filtering operation, only the DC term cos remains (under ideal conditions). Now we apply such a demodulation procedure to an 8-PSK waveform of Figure 13 for which the results are drawn in Figure 14.

  • In the first signaling interval, the output amplitude is 1 which refers to a phase of 180. An arrow shows the output amplitude 1 in the third subplot going to 1 in the Rx constellation diagram of the last subplot. Mapping to the Tx constellation diagram of Figure 13 (shown by thick red lines) tell us that the corresponding baud is 4 which translates to a 3-bit sequence of 100. Hence, our first 3 detected bits are 100. So far so good.
  • Let us skip the next interval to avoid having an arrow crossing over other segments. In the time interval between 2 to 3, the output is
    0.707=12=cos135

    Can we map it back to a geometrical angle? Not exactly because cosine of 225 is also exactly the same! We do not have a unique angle and corresponding bit map in this case. This also becomes clear by looking at the Tx constellation diagram of Figure 13 where cosine of both 135 and 225 cast a shadow at 0.707 on the real line.

  • This situation becomes even more tricky in the fourth and fifth signaling intervals where the demodulator output in the third subplot is zero in both instances. This is shown by an arrow mapping the 0 amplitude in both cases to 0 in the Rx constellation diagram. Looking at the top of Figure 14 reveals that cosine wave actually started from different phases (i.e., +90 for (2) and 90 for (6), respectively). However, its shadow on the real line should be at 0 for both points.

Demodulation process of an 8-PSK waveform with a cosine wave

Figure 14: Demodulation process of an 8-PSK waveform with a cosine wave

A Naive Algorithm


It might seem that the problem is with this demodulation procedure which converts the phase into amplitude for decision making. A naive algorithm here could work as follows.

Take many samples of the cosine wave in each signaling interval and record the starting value. Then, compute the slope of the wave at this point to estimate the actual underlying phase. While there are dozens of implementation issues with this approach but suffice it to say that this will require an insanely large number of extremely low-noise samples for each such duration. I mentioned this algorithm here because I remember someone making this suggestion somewhere.

I/Q Sampling


This brings us to the solution. Recall from Figure 11 that an angle is made up of two lines, not one.


This means that we need two points to represent an angle, not one! One such point gives the amplitude on the horizontal axis and the other point gives the amplitude on the vertical axis. When we attempted to tie the concept of a geometrical angle with a waveform phase, we completely forgot during demodulation that only one amplitude is being extracted here — the one representing the horizontal axis.

Question: How should we extract the amplitude on the vertical axis?
Answer: We need another waveform at the Rx!
Question: If the horizontal axis links angle 0 on a 2-D plane to a cosine wave with the starting phase 0, then the vertical axis at an angle 90 on a 2-D plane should be linked to which waveform?
Answer: Another cosine wave with the starting phase of 90.
Question: What is a cosine wave with a starting phase of 90?
Answer: Use the identity cos(+) = coscos – sinsin.
cos(2+90)=cos2cos900sin2sin901=sin2

This second cosine wave comes out to be a negative sine wave!

In conclusion, in parallel with the cosine wave starting with a phase of 0, we need another cosine wave at the Rx starting with a phase of 90, which is a negative sine wave. All this means that a cosine wave measures the x-axis projection of the phase like a ruler and hence cannot measure the actual angle. We need two rulers to estimate the full angle, where  length is provided by the cosine and  length is provided by the negative sine, see the figure below.
()=tan1

Keep in mind that we will see the more technical definition of an angle shortly. In summary, what we are doing here is that instead of measuring the angle (e.g., through a protractor), we are measuring the two amplitudes (represented by lengths below) and estimating the angle through their ratio! This is because amplitudes are much easier to work with as compared to angles.

Two rulers, one each for I and Q amplitudes

Let us run the same demodulation algorithm for the same bit sequence as in Figure 14 but multiply the arriving signal with a negative sine wave (instead of a cosine signal). The results of these operations are plotted in Figure 15.

Demodulation process of an 8-PSK waveform with a negative sine wave

Figure 15: Demodulation process of an 8-PSK waveform with a negative sine wave

If the Tx and Rx frequencies are exactly the same and their phase difference is also equal to zero except the modulation phase , we can write
cos(2+)Incoming waveform{2sin(2)}Generated at Rx=sinsin{2(2)+}Filtered outsin

for =1 and where we have used the identity 2cossin = sin()  sin(+). After the averaging or filtering operation, only the DC term sin remains (under ideal conditions). Consequently, the output amplitudes then map to the correct point in a 2-D plane as
(,)=(cos,sin)

We connect this result to the output waveform in Figure 15 now. For this purpose, we repeat the bit sequence examined earlier for convenience.
1  0  04  0  0  11  1  0  15  0  1  02  1  1  06  1  1  17

  • In the first signaling interval, the output amplitude is 0. Recalling that the result of cosine multiplication in Figure 14 was 1, the point on the 2-D plane is given by
    (,)=(1,0)

    Mapping to the Tx constellation diagram of Figure 13 (shown by thick red lines) gives us the first 3 bits as 100.

  • In the time interval between 2 to 3, the output is 0.707. It was also 0.707 for cosine multiplication due to which the point on 2-D plane is
    (,)=(0.707,0.707)
    While initially we had a confusion between the candidate being 135 or 225, we can simply locate this point in the middle of the 3rd quadrant and hence find the correct angle as 225. Therefore, the data bits are completely resolved corresponding to number (5) as 101.
  • The fourth and fifth signaling intervals, while zero for cosine demodulation, are now +1 and 1, respectively. From the constellation diagram of Figure 13, the points on 2-D plane are (0,+1) and (0,1) which map to data points (2) and (6), respectively. Therefore, the bits in the fourth signaling interval are 010 while those in the fifth signal interval are 110. This can be checked by the top waveform in Figure 15.

Let us now learn the rationale behind the terms  and .

Rationale Behind the Terms  and 


Each phase, like each angle, needs a reference. For the angles, this reference is provided by the horizontal line connecting point (0,0) to point (1,0).

  • For the phases, we choose a cosine wave with phase 0 as the reference (as is clear from the previous sections). Therefore, an amplitude modulated cosine wave is known as the “In-Phase” component, from which the notation  is extracted. Sometimes, the  term refers only to the amplitude riding over this cosine wave and represented by the value on the x-axis.
  • On the same note, an amplitude modulated sine wave, which has a phase difference of 90 with the reference cosine wave, is known as the “quadrature” component, from which the notation  is extracted. Sometimes,  refers only to the amplitude riding over this sine wave and represented by the value on the y-axis. In general, quadrature refers to the position of a planet when it is 90 from the sun as viewed from the earth.

Phase Computation


With points mapped on a 2-D plane, one question is the following. How is phase computed from those  and  components? For this purpose, a function known as four-quadrant inverse tangent is employed. This is different than the regular inverse tangent function because it takes into account all four quadrants. For an amplitude of  on -axis and  on -axis, the angle  is defined in terms of tan1(/) below. If you find it complicated, just remember that it is a way of computing the correct quadrant from the signs of  and  amplitudes.
()={tan1>0tan1+<0 and 0tan1<0 and <0+/2=0 and >0/2=0 and <0

Computing such a function is not easy in real-time at a high rate but many algorithms have sprung up for this purpose after the advent of Software Defined Radios (SDR).

What If You Have Only 5 Minutes?


What will you say if you have only 5 minutes to explain someone the concept of I/Q signals? One suggestion is to explain the implementation of Quadrature Amplitude Modulation (QAM).


 

We have learned that PSK modulation chooses discrete phases on the same circle. Moreover, I/Q refers to points on a 2-D plane and hence I/Q data involves both amplitude and phase of the carrier. So why do modulation points necessarily have to be on the same circle? They don’t have to. Since discrete amplitudes can be chosen in ASK modulation, we can combine one amplitude and one phase at each signaling interval. Such a strategy gives rise to the most widely used digital modulation technique known as Quadrature Amplitude Modulation (QAM). Let us discuss this concept through a QAM modulator and demodulator that form the backbone of your WiFi, cellular and other high rate communication systems.

Modulator


For each signaling interval , start with a waveform modulated in both amplitude and phase as
(6)()=cos(2+)

Using the identity cos(+) = coscos  sinsin, open this up as
()=cos(2)cossin2sin(7)=(cos)I partcos(2)(sin)Q partsin2

Here, the amplitude cos is the projection of the modulation point on  or  axis, while the amplitude sin is the projection of the modulation point on  or  axis. This is plotted in Figure 16. These amplitudes are then modulated on two quadrature carriers, namely cos(2) and sin(2) and summed together to be sent over the air. Notice that both of these carriers are zero-phase sinusoids, as compared to the single amplitude+phase modulated sinusoid in Eq (6)!! And again, it’s much easier to work with amplitudes.

I/Q plane and modulation parameters

Figure 16: I/Q plane and modulation parameters

A modulator can generate a QAM waveform either through direct modulation as in Eq (6), or through  and  waveforms as in Eq (7). The latter route is simpler as it only involves amplitude modulation of two quadrature waveforms with no need to alter the phase. A block diagram for implementing a QAM modulator is shown in Figure 17. The filtering shown here is a specialized operation known as pulse shaping.

A block diagram for a QAM modulator

Figure 17: A block diagram for a QAM modulator

Demodulator


At the Rx side, multiply the incoming signal with the two quadrature waveforms, namely cos(2) and sin2), in parallel. A block diagram for a QAM demodulator is drawn in Figure 18. The filtering shown here is a specialized operation known as matched filtering. The idea is similar to a correlator we saw in FSK demdoulator but matched to the pulse shape at Tx side. An Analog-to-Digital (A/D) conversion is casually shown here, the exact place of which depends on the receiver architecture employed (e.g., a superheterodyne receiver). Also, the whole point of software defined radios was to perform this conversion as close to the antenna as possible. After A/D conversion, the samples are mapped to the Rx constellation shown as four stars. Each decision is made in favour of a star closest to the received data point. You can learn more about QAM here.

A block diagram for a QAM demodulator

Figure 18: A block diagram for a QAM demodulator

With frequency, phase and timing synchronization in place, the process is as follows.

  • In the  arm, we have
    ()2cos(2)=cos(2+)Incoming waveform2cos(2)Generated at Rx=cos+cos{2(2)+}Filtered outcos

  • In the  arm, we have
    (){2sin(2)}=cos(2+)Incoming waveform{2sin(2)}Generated at Rx=sinsin{2(2)+}Filtered outsin

This is drawn in Figure 19 for the following example amplitudes and phases.
={1,2,1}={45,135,270}

The reader can easily trace the arrows to see that for the second signaling interval, for instance, 2cos135 = 1.41 and 2sin135 = +1.41 are correctly being mapped. The same holds true for the last interval where 1cos270 = 0 and 1sin270 = 1.

I/Q demodulation process and projections on I and Q axes

Figure 19: I/Q demodulation process and projections on I and Q axes

We did not go into details here but I/Q signals are very helpful for implementation of any modulation scheme. Also keep in mind that I and Q components of a signal without the carrier wave can be treated as the real and imaginary parts of a complex number.

Concluding Remarks


This concludes our discussion on I/Q signals. Interestingly, only experienced engineers in the past could design such communication systems due to the specialized electronics knowledge required for implementing mathematical relations through electronic circuits. The revolution brought by SDRs is that the same relations can be implemented through any programming language much more conveniently. This has opened the door for hobbyists and amateurs to build close to professional-grade communication systems in just two steps.

  1. You can create the Tx/Rx code in a graphical programming environment like GNU Radio which are called flowgraphs. Example flowgraphs for QAM and PSK modulation schemes can be found here.
  2. Connect an SDR hardware like RTL-SDR, HackRF or ADALM Pluto to your computer (or use a free SDR) and include the relevant device driver (available in the form of a graphical block) into your code above.

SDR hardware: HackRF One, RTL-SDR and ADALM Pluto

If you are further interested in seeing an example of how this knowledge of I/Q signals is applied to build exciting technologies, you can learn about LoRa PHY, the low-power long-range communication technique based on Frequency Shift Chirp Spread Spectrum modulation.