1.2. Introduction to Complex Numbers#
Understanding complex numbers is crucial in acoustics for describing and analyzing oscillatory processes. Complex numbers provide an efficient way to represent quantities that oscillate sinusoidally, such as sound waves, by combining magnitude and phase into a single representation.
What are Complex Numbers?#
A complex number is expressed in the form:
where:
\(a\) is the real part.
\(b\) is the imaginary part.
\(j\) is the imaginary unit, satisfying \(j^2 = -1\).
Complex numbers are fundamental in representing sinusoidal vibrations, where the real and imaginary components often correspond to physical amplitudes and phase shifts.
Geometric Representation#
Complex numbers can be represented geometrically as points or vectors in the complex plane, with:
The x-axis representing the real part.
The y-axis representing the imaginary part.
Polar Form#
In polar coordinates, a complex number is expressed as:
where:
\(r = |z| = \sqrt{a^2 + b^2}\) is the magnitude.
\(\theta = \tan^{-1}(b/a)\) is the phase angle.
The exponential form is particularly useful for analyzing oscillatory signals in acoustics, as it directly ties amplitude and phase into a compact representation.
Basic Operations#
Addition and Subtraction#
For two complex numbers \(z_1 = a_1 + b_1j\) and \(z_2 = a_2 + b_2j\):
Addition:
Subtraction:
Multiplication and Division#
Multiplication:
Division:
These operations are straightforward in polar form and emphasize the role of magnitude and phase in acoustic signal analysis.
Complex Conjugate#
The complex conjugate of \(z = a + bj\) is:
The conjugate is crucial in calculating power, impedance, and energy relationships in oscillatory systems.
Quiz: Understanding Complex Numbers#
Convert the complex number \(3 + 4j\) into its polar form. Determine its magnitude and phase angle.
Solution
The magnitude is calculated as:
The phase angle is:
Interactive Demonstration
Below is a Python code that displays the amplitude, real and imaginary part of a complex function \(s(t) = A \cdot e^{j(\omega t + \phi)}\)
import numpy as np
import matplotlib.pyplot as plt
import ipywidgets as widgets
from ipywidgets import interact, fixed
freq =10# Frequency of the sine wave (Hz)
s_amp = 1 # Amplitude of the sine wave
phi = 0 # Phase shift of the sine wave (radians)
@interact(t=widgets.FloatSlider(min=1e-3, max=0.1, step=0.01, continuous_update=True), s_amp=fixed(s_amp), f=fixed(freq), phi=fixed(phi))
def complex_numbers(f, s_amp, t, phi):
omega = 2 * np.pi * f
# Animation complex numbers
s = s_amp * np.exp(1j * (omega * t + phi))
# Close any existing figures and create a new one
# plt.close("all")
# Plotting the complex number components
plt.plot([0, s.real], [0, s.imag], "ko-", linewidth=1, label="abs(s)")
plt.plot([0, 0], [0, s.imag], "ro-", linewidth=1, label="imag(s)")
plt.plot([0, s.real], [0, 0], "bo-", linewidth=1, label="real(s)")
# Set axis limits and formatting
plt.axis([-1.5 * s_amp, 1.5 * s_amp, -1.5 * s_amp, 1.5 * s_amp])
plt.grid(True)
plt.gca().set_aspect("equal", adjustable="box")
plt.xlabel("Real(s)")
plt.ylabel("Imag(s)")
plt.legend()
plt.xticks(fontsize=12)
plt.yticks(fontsize=12)
plt.title("Complex Number Animation", fontsize=16)
# Show the plot
plt.show()