Complex Sinusoids: The Doorway to DSP

Understand how complex sinusoids (the fundamental signals in DSP applications) are constructed in software.

From our knowledge of complex representation, we know that a complex number V=ejθV=e^{j\theta} in an IQIQ plane is a constant number. Let’s investigate how it changes with time.

A complex signal

Imagine the same complex number V=ejθV=e^{j\theta} rotating counterclockwise in a circle at a constant rate with time as drawn in the figure below. The constant VV now becomes a function of time V(t)V(t) with the time axis in a direction and appears to be coming out of the screen.

Press + to interact
A complex sinusoid as a function of time
A complex sinusoid as a function of time
  • The complex number VV has now become a complex signal V(t)V(t) with time as independent variable. This signal is known as a complex sinusoid.
  • The change in phase Δθ\Delta \theta during an interval Δt\Delta t is a constant known as the angular velocity.

angular velocity=ω=ΔθΔt \begin{equation*} \textmd{angular velocity} =\omega= \frac{\Delta\theta}{\Delta t} \end{equation*}

Let’s explore the real and imaginary parts of this signal.

Inphase and quadrature components

For a complex number V=ejθV=e^{j\theta}, the real and imaginary components are cosθ\cos \theta and sinθ\sin\theta.

  • The projection on x-axis is cosθ\cos \theta.
  • The projection on y-axis is sinθ\sin \theta.

The signal, V(t)V(t) is shown in the figure above and appears to be coming out of the screen.

  • Its projection from a 33-dimensional plane to a 22-dimensional plane downwards gives the real or II part:

VI(t)=cos2πFtV_I(t)= \cos 2\pi F t

  • The projection from a 33-dimensional plane to a 22-dimensional plane on the side gives the imaginary or QQ part:

VQ(t)=sin2πFtV_Q(t)= \sin 2\pi F t

The II part is known as the inphase component and the QQ part is known as the quadrature component. This is due to the convention of choosing cos()\cos(\cdot) as our reference sinusoid and that sin()\sin(\cdot) is in quadrature – i.e., 9090^ \circ apart with cos()\cos(\cdot).

Let’s explore this further with the help of some code.

Press + to interact
from mpl_toolkits import mplot3d
import numpy as np
import matplotlib.pyplot as pl
figWidth = 20
figHeight = 10
f = 1.4
A = 0.8
t = np.arange(0, 2.8, 0.01)
iwave = A*np.cos(2*np.pi*f*t)
qwave = A*np.sin(2*np.pi*f*t)
# Plotting
fig = pl.figure(1, figsize=(figWidth,figHeight), constrained_layout=True)
ax = pl.axes(projection='3d')
ax.plot3D(t, iwave, qwave, linewidth=2, color='b')
ax.plot3D(t, iwave, -2*np.ones(len(qwave)), color='r')
ax.plot3D(t, 2*np.ones(len(iwave)), qwave, color='r')
ax.xaxis.set_ticklabels([])
ax.yaxis.set_ticklabels([])
ax.zaxis.set_ticklabels([])
ax.set_xlim(t[0], t[-1])
ax.set_xticks(np.arange(t[0], t[-1], 0.5))
ax.set_ylim(-2, 2)
ax.set_yticks(np.arange(-2, 2, 1))
ax.set_zlim(-2, 2)
ax.set_zticks(np.arange(-2, 2, 1))
ax.tick_params(labelsize=18)
ax.text(0, 0.5, 1, '$V(t)$', fontsize=18)
ax.text(1.5, -3.5, -0.5, '$V_I(t)=\cos (2\pi ft)$', fontsize=18)
ax.text(1.5, 0.6, 2, '$V_Q(t)=\sin(2\pi ft)$', fontsize=18)
# Hide the right and top spines
ax.spines['right'].set_visible(False)
ax.spines['top'].set_visible(False)
ax.set_xlabel("Time", fontsize=18)
ax.set_ylabel("I", fontsize=18)
ax.set_zlabel("Q", fontsize=18)
ax.grid()
pl.savefig('output/complex-sinusoid.png', bbox_inches='tight')

In complex notation, this complex sinusoid is given as:

V(t)=ejωt=ej2πFt\begin{equation*} V(t) = e^{j\omega t}=e^{j2\pi F t} \end{equation*}

Using the fact that quadrature is the perpendicular direction and jj is a rotation by 9090^\circ, this can also be written as:

ej2πFt=cos2πFt+jsin2πFt\begin{equation*} e^{j2\pi F t} = \cos {2\pi F t} + j\sin {2\pi F t} \end{equation*}

This is known as Euler’s identity.

Example

When you turn on a microwave on to heat food, it transmits waves at a frequency of 2.4×1092.4\times10^9 Hz, which means that the oscillator frequency is 2,400,000,0002,400,000,000 cycles per second. The period of a wave like this is:

12,400,000,000=0.42 ns\frac{1}{2,400,000,000}=0.42 \text{~ns}

While this electromagnetic wave is real, a complex sinusoid incorporates the phase information in a convenient manner for signal processing. We will see later that complex sinusoids can act as a doorway to understanding signals and DSP operations.