Chuyển đến nội dung

Bài 3 · Getting Started

Complex Numbers and Phasors

Review the complex numbers you need for signals and systems: rectangular and polar form, Euler's formula, complex exponentials and phasors, with runnable Python.

Complex numbers look like an optional extra, but in signals and systems they are the main character. A single complex exponential e^(j w t) describes a sinusoid, its amplitude, its phase and (with a real part added) its decay, all at once. Fourier, Laplace and Z transforms are built from them. This lesson gives you just enough complex arithmetic to follow the rest of the course.

In engineering the imaginary unit is written j (because i means current). Python also uses j: 3 + 4j.

Rectangular and polar form

A complex number z = a + jb has a real part a and an imaginary part b. Plot it as a point (a, b) in the plane and you get a second description: the distance from the origin, the magnitude |z| = sqrt(a^2 + b^2), and the angle from the positive real axis, the phase angle(z) = atan2(b, a).

flowchart LR
    R["rectangular<br/>z = a + jb"] <--> P["polar<br/>z = r e^(j theta)"]

The same number in two notations: rectangular for adding, polar for multiplying.

Adding is easiest in rectangular form. Multiplying is easiest in polar form: magnitudes multiply and angles add.

Python Rectangular, polar and back

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The complex conjugate z* flips the sign of the imaginary part: (3+4j)* = 3-4j. Useful facts: z z* = |z|^2 and (z + z*) / 2 = real part.

Euler's formula

The bridge between exponentials and trigonometry is

e^(j theta) = cos(theta) + j sin(theta).

So e^(j theta) is a point on the unit circle at angle theta. Solving for cosine and sine gives the identities that the Fourier series uses constantly:

  • cos(theta) = (e^(j theta) + e^(-j theta)) / 2
  • sin(theta) = (e^(j theta) - e^(-j theta)) / (2j)
Python Checking Euler's formula

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The complex exponential signal

Put time into the angle: x(t) = e^(j w t) with w = 2 pi f. It is an arrow of length 1 that spins counter-clockwise f times per second. Its real part is cos(w t) and its imaginary part is sin(w t). A negative frequency simply spins the other way, which is why the Fourier transform has a mirror image at -f.

More generally, x(t) = A e^(j phi) e^(j w t) = A e^(j (w t + phi)) is a spinning arrow with starting length A and starting angle phi.

Phasors

A real cosine A cos(w t + phi) equals Re{ A e^(j phi) e^(j w t) }. The constant P = A e^(j phi) is the phasor: it stores amplitude and phase and drops the common e^(j w t). Systems that are linear and time-invariant do not change the frequency of a sinusoid, they only scale its amplitude and shift its phase, so a phasor is a complex multiplier: output phasor = system gain times input phasor. That single idea is the reason frequency response exists.

Python Adding sinusoids with phasors

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The two input amplitudes 3 and 4 are 90 degrees apart here, so the sum has amplitude 5 (a 3-4-5 triangle). Phasors turn a trigonometry problem into vector addition.

Damped exponentials and the s-plane preview

Allowing a real part gives x(t) = e^(s t) with s = sigma + j w. If sigma < 0 the arrow spirals inward (decay), if sigma > 0 it spirals outward (growth). This complex number s is the variable of the Laplace transform; its discrete-time cousin z is the variable of the Z-transform. Both appear in later chapters.

Python A decaying spiral

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Roots of unity

The numbers e^(j 2 pi k / N) for k = 0 ... N-1 are the N-th roots of unity: N equally spaced points on the unit circle. They are the building blocks of the discrete Fourier transform. They sum to zero for N > 1, a fact behind the orthogonality we use later.

Python Roots of unity sum to zero

Press Run (or Ctrl + Enter) to see the result here.

Program input · what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Check your understanding

Quick check · 5 questions

of 5 answered You scored / 5 · perfect!

  1. 1. What is the magnitude of 3 + 4j?

    |z| = sqrt(3^2 + 4^2) = sqrt(25) = 5.
  2. 2. Which expression equals cos(theta)?

    Adding Euler's formulas for theta and -theta cancels the sine terms and leaves 2 cos(theta), so divide by 2.
  3. 3. When multiplying two complex numbers in polar form, what happens to the angles?

    Magnitudes multiply and angles add, because e^(j a) e^(j b) = e^(j (a + b)).
  4. 4. A phasor stores which two properties of a sinusoid at a known frequency?

    The phasor A e^(j phi) holds amplitude A and phase phi; the frequency is known and shared.
  5. 5. If s = sigma + j w with sigma < 0, what does e^(s t) do as t grows?

    The real part sigma sets the envelope e^(sigma t), which shrinks when sigma is negative.

Summary

  • Complex numbers have rectangular (a + jb) and polar (r e^(j theta)) forms; use each where it is easier.
  • Euler's formula links exponentials with sine and cosine.
  • e^(j w t) is a spinning arrow; its negative-frequency twin spins the other way.
  • A phasor A e^(j phi) captures amplitude and phase; adding same-frequency sinusoids is adding phasors.
  • e^(s t) with s = sigma + j w combines oscillation and decay or growth.

Next: Classifying Signals

Theo dõi tiến độ của bạn

Tạo tài khoản miễn phí để đánh dấu bài đã học và tiếp tục từ chỗ bạn dừng lại trên mọi thiết bị.