Split View: 공업수학 완전 정복 3편: 복소해석학과 Z-변환 - 제어/신호처리의 핵심
공업수학 완전 정복 3편: 복소해석학과 Z-변환 - 제어/신호처리의 핵심
공업수학 완전 정복 3편: 복소해석학과 Z-변환
전자/제어 공학에서 복소수는 단순한 수학적 추상이 아닙니다. 교류 회로 분석의 페이저(phasor), 라플라스 변환의 , Z-변환의 단위원, 보드 선도의 복소 주파수 응답 — 이 모든 것이 복소해석학에 뿌리를 두고 있습니다. 이번 글에서는 복소수 체계부터 유수 정리, Z-변환과 디지털 필터 설계까지 완전히 정복합니다.
1. 복소수 체계 완전 정복
1.1 복소수의 표현
직교형(Rectangular Form):
(전기공학에서는 대신 를 사용합니다. 는 전류를 나타내기 때문)
- 실부:
- 허부:
극형(Polar Form):
- 절댓값(크기):
- 편각(위상): (사분면 고려)
오일러 공식(Euler's Formula):
이로부터:
수학 역사상 가장 아름다운 공식으로 꼽히는 오일러 항등식:
다섯 가지 가장 중요한 수(, , , , )가 하나의 식에 연결됩니다.
드 무아브르 공식(De Moivre's Formula):
n제곱근: ,
단위원 위의 등분점을 나타냅니다. (1의 n제곱근: - FFT에서 등장!)
1.2 복소수 연산
덧셈/뺄셈 (직교형이 편리):
곱셈 (극형이 편리):
크기는 곱, 위상은 합 — 전기공학에서 임피던스 곱셈의 기반입니다.
나눗셈:
켤레복소수(Complex Conjugate):
유용한 성질:
- ,
1.3 공학 응용: 페이저 해석
교류 회로 분석에서 복소수의 위력이 발휘됩니다.
를 페이저로 표현:
임피던스(Impedance):
직렬 RLC 임피던스:
크기:
위상:
공진 조건: → , (순저항)
전달 함수(Transfer Function):
이것이 라플라스 도메인에서 이며, 보드 선도의 기반입니다.
2. 복소함수와 해석 함수
2.1 복소함수
여기서 는 실수 값 함수입니다.
예시:
2.2 복소 미분과 코시-리만 방정식
의 복소 미분:
실수와 달리 가 복소 평면에서 어느 방향으로도 0에 접근할 수 있어야 극한값이 같아야 합니다.
x축 방향 ():
y축 방향 ():
두 표현이 같으려면:
이것이 **코시-리만 방정식(Cauchy-Riemann Equations)**입니다.
의 편미분이 연속이고 코시-리만 방정식을 만족하면 는 **해석 함수(Analytic Function)**입니다.
2.3 조화 함수
해석 함수의 실부와 허부는 각각 라플라스 방정식을 만족합니다:
증명: 코시-리만에서 , 이므로 (혼합 편미분의 순서 교환).
를 알면 코시-리만으로 를 구할 수 있습니다 (조화 켤레 함수).
공학적 의미: 포텐셜 흐름에서 속도 포텐셜과 유선 함수의 관계, 정전기학에서 전위와 전기력선의 관계.
2.4 중요한 해석 함수들
지수 함수 :
- 전체 복소 평면에서 해석적
- ,
삼각 함수:
- , 는 전체 복소 평면에서 해석적
- 실수 삼각함수와 달리 크기가 무한대가 될 수 있음:
쌍곡 함수:
로그 함수 (다가 함수):
주값(principal value): ,
과 음의 실수축에서 특이성 발생 (가지 절단, branch cut).
3. 복소 적분
3.1 경로 적분 (Line Integral)
: 복소 평면의 곡선 (매개변수 , )
예시: (: 원점에서 까지 직선)
매개변수화: , ,
3.2 코시 적분 정리 (Cauchy's Integral Theorem)
조건: 가 단순 폐곡선 위와 그 내부에서 해석적.
직관: 해석 함수는 경로에 무관하게 적분됩니다.
그린 정리와의 관계:
그린 정리와 코시-리만 방정식을 적용하면 두 항 모두 0이 됩니다.
경로 독립성: 폐곡선 적분이 0 ↔ 적분이 경로에 무관
원시 함수(antiderivative): 이면
3.3 코시 적분 공식 (Cauchy's Integral Formula)
조건: 가 위와 내부에서 해석적, 는 내부.
해석: 는 에서 극점을 가집니다. 코시 공식은 극점 주변의 적분이 함수값과 직접 연결됨을 보여줍니다.
고차 미분 공식:
이는 해석 함수가 무한히 미분 가능함을 보여줍니다!
4. 로랑 급수와 유수 정리
4.1 테일러 급수와 로랑 급수
테일러 급수: 가 근방에서 해석적이면:
로랑 급수(Laurent Series): 가 고리 영역 에서 해석적이면:
음의 거듭제곱 부분을 **주요부(principal part)**라고 합니다.
4.2 특이점 분류
가 에서 해석적이지 않은 경우:
제거가능 특이점(Removable Singularity): 로랑 급수에 음의 거듭제곱 항이 없음.
에 함수값 1을 부여하면 해석적이 됩니다.
m극(Pole of Order m): 유한개의 음의 거듭제곱 항.
본질적 특이점(Essential Singularity): 무한히 많은 음의 거듭제곱 항.
피카르 정리: 본질적 특이점 근방에서 함수값이 거의 모든 복소수를 취합니다.
4.3 유수(Residue)와 유수 정리
유수의 정의: 의 로랑 급수에서 항의 계수.
유수 계산법:
단순극 ():
유리함수 (단순극):
m중극:
유수 정리(Residue Theorem):
는 내부의 모든 특이점.
4.4 유수 정리로 실수 적분 계산
복소 해석학의 가장 강력한 응용 중 하나: 어려운 실수 적분을 쉽게 계산합니다.
예제 1:
상반 평면에서 반원 경로를 사용합니다. 가 상반 평면의 단순극:
반원 호의 기여는 에서 0이 됩니다 (조르당 보조정리).
따라서 (검증: )
예제 2:
상반 평면의 극점:
실부만 취하면:
예제 3:
, , :
극점: . 단위원 내부:
4.5 역 라플라스 변환에의 응용
브로미치 적분(Bromwich Integral):
이는 평면에서 수직선을 따른 경로 적분으로, 왼쪽의 모든 극점을 포함하는 반원으로 경로를 닫으면 유수 정리 적용이 가능합니다:
예시: 의 역 라플라스 변환
극점:
확인: ✓
5. Z-변환
5.1 정의와 수렴 영역
이산 시간 신호 의 Z-변환:
는 복소 변수. 수렴 조건:
수렴 영역(ROC, Region of Convergence):
- 단측 인과 신호: (극점의 밖)
- 단측 반인과 신호: (극점의 안)
- 양측 신호: 고리 영역
5.2 주요 Z-변환 쌍
단위 임펄스:
단위 계단:
지수 신호:
정현파:
단위 램프:
5.3 Z-변환의 성질
선형성:
시간 이동:
이 단위 지연 연산자입니다. 차분 방정식을 대수 방정식으로!
z 스케일링 (주파수 이동):
시간 반전:
합성곱(Z-변환의 핵심):
LTI 시스템 분석의 핵심: 합성곱이 곱셈으로!
초기값 정리:
최종값 정리:
5.4 역 Z-변환
부분 분수법:
는 극점,
예제:
멱급수 전개법 (장제법):
를 의 멱급수로 전개하면 직접 을 읽을 수 있습니다.
5.5 Z-변환으로 차분 방정식 풀기
예제: , 초기 정지 상태,
Z-변환 적용 (초기조건 0):
부분 분수로 역변환 (위 예제와 동일):
에서 (최종값 정리로 확인: )
5.6 디지털 필터 설계
전달 함수 H(z):
LTI 시스템의 출력-입력 비:
영점(zero): 인 값
극점(pole): 인 값
안정성 조건: 모든 극점이 단위원 내부에 있어야 합니다.
FIR 필터 (유한 임펄스 응답):
극점이 원점에만 있어 항상 안정. 선형 위상 특성 가능.
IIR 필터 (무한 임펄스 응답):
극점이 단위원 내부에 있으면 안정. 적은 계수로 날카로운 특성 구현 가능.
5.7 Python으로 디지털 필터 설계 및 분석
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
# 1. IIR 필터: 버터워스 저역통과
N_order = 4 # 필터 차수
Wn = 0.2 # 정규화 차단 주파수 (0~1, 1 = Nyquist)
b, a = signal.butter(N_order, Wn, btype='low')
print("버터워스 LPF 계수:")
print(f" b = {b}")
print(f" a = {a}")
# 2. 주파수 응답
w, h = signal.freqz(b, a, worN=2048)
# 3. 극-영점 도표
zeros, poles, gain = signal.tf2zpk(b, a)
print(f"\n영점: {zeros}")
print(f"극점: {poles}")
print(f"이득: {gain:.4f}")
print(f"극점 크기: {np.abs(poles)}")
fig, axes = plt.subplots(2, 2, figsize=(14, 10))
# 주파수 응답 (크기)
axes[0, 0].plot(w/np.pi, 20*np.log10(abs(h) + 1e-15), 'b-', linewidth=2)
axes[0, 0].axhline(y=-3, color='r', linestyle='--', label='-3dB')
axes[0, 0].set_xlabel('정규화 주파수 (x pi rad/샘플)')
axes[0, 0].set_ylabel('크기 (dB)')
axes[0, 0].set_title('버터워스 LPF 주파수 응답 (크기)')
axes[0, 0].set_xlim([0, 1])
axes[0, 0].set_ylim([-80, 5])
axes[0, 0].legend()
axes[0, 0].grid(True, alpha=0.3)
# 위상 응답
angles = np.unwrap(np.angle(h))
axes[0, 1].plot(w/np.pi, angles*180/np.pi, 'g-', linewidth=2)
axes[0, 1].set_xlabel('정규화 주파수 (x pi rad/샘플)')
axes[0, 1].set_ylabel('위상 (도)')
axes[0, 1].set_title('버터워스 LPF 위상 응답')
axes[0, 1].set_xlim([0, 1])
axes[0, 1].grid(True, alpha=0.3)
# 극-영점 도표
unit_circle = np.exp(1j * np.linspace(0, 2*np.pi, 200))
axes[1, 0].plot(unit_circle.real, unit_circle.imag, 'k--', alpha=0.5)
axes[1, 0].scatter(zeros.real, zeros.imag, s=100, marker='o',
color='blue', zorder=5, label='영점')
axes[1, 0].scatter(poles.real, poles.imag, s=100, marker='x',
color='red', linewidths=2, zorder=5, label='극점')
axes[1, 0].axhline(0, color='gray', alpha=0.3)
axes[1, 0].axvline(0, color='gray', alpha=0.3)
axes[1, 0].set_xlabel('실수부')
axes[1, 0].set_ylabel('허수부')
axes[1, 0].set_title('극-영점 도표 (z 평면)')
axes[1, 0].legend()
axes[1, 0].grid(True, alpha=0.3)
axes[1, 0].set_aspect('equal')
# 임펄스 응답
imp = np.zeros(50)
imp[0] = 1.0
h_imp = signal.lfilter(b, a, imp)
axes[1, 1].stem(h_imp, markerfmt='bo', linefmt='b-', basefmt='k-')
axes[1, 1].set_xlabel('샘플 n')
axes[1, 1].set_ylabel('h[n]')
axes[1, 1].set_title('임펄스 응답 (IIR 무한)')
axes[1, 1].grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('digital_filter_analysis.png', dpi=150)
plt.show()
5.8 FIR vs IIR 필터 비교
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
# FIR 필터 (윈도우 방법)
N_fir = 50
Wn = 0.2
h_fir = signal.firwin(N_fir + 1, Wn, window='hamming')
# IIR 필터 (버터워스)
b_iir, a_iir = signal.butter(6, Wn, btype='low')
# 주파수 응답 비교
w_fir, H_fir = signal.freqz(h_fir, [1], worN=2048)
w_iir, H_iir = signal.freqz(b_iir, a_iir, worN=2048)
fig, axes = plt.subplots(1, 2, figsize=(14, 5))
axes[0].plot(w_fir/np.pi, 20*np.log10(abs(H_fir)+1e-15),
'b-', linewidth=2, label=f'FIR (N={N_fir})')
axes[0].plot(w_iir/np.pi, 20*np.log10(abs(H_iir)+1e-15),
'r-', linewidth=2, label='IIR 버터워스 6차')
axes[0].set_xlabel('정규화 주파수')
axes[0].set_ylabel('크기 (dB)')
axes[0].set_title('FIR vs IIR 주파수 응답')
axes[0].set_xlim([0, 1])
axes[0].set_ylim([-80, 5])
axes[0].legend()
axes[0].grid(True, alpha=0.3)
# 위상 응답 비교 (FIR의 선형 위상 특성)
ph_fir = np.unwrap(np.angle(H_fir))
ph_iir = np.unwrap(np.angle(H_iir))
axes[1].plot(w_fir/np.pi, ph_fir*180/np.pi,
'b-', linewidth=2, label='FIR (선형 위상)')
axes[1].plot(w_iir/np.pi, ph_iir*180/np.pi,
'r-', linewidth=2, label='IIR (비선형 위상)')
axes[1].set_xlabel('정규화 주파수')
axes[1].set_ylabel('위상 (도)')
axes[1].set_title('FIR vs IIR 위상 응답')
axes[1].set_xlim([0, 0.5])
axes[1].legend()
axes[1].grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('fir_vs_iir.png', dpi=150)
plt.show()
print("계수 개수 비교:")
print(f" FIR: {len(h_fir)} 계수")
print(f" IIR: b={len(b_iir)}, a={len(a_iir)} 계수 합계 {len(b_iir)+len(a_iir)}")
6. 라플라스 변환과 Z-변환의 대응
6.1 s 평면과 z 평면의 관계
에서:
| s 평면 특성 | z 평면 특성 | | -------------------------------------- | ------------- | --- | ---- | | 축 () | 단위원 | | 좌반평면 () | 단위원 내부 | | 우반평면 () | 단위원 외부 | | DC () | | | 나이퀴스트 주파수 () | |
안정성 대응:
- 연속: 모든 극점이 좌반평면 → 이산: 모든 극점이 단위원 내부
6.2 쌍일차 변환 (Bilinear Transform)
아날로그 필터를 디지털 필터로 변환하는 방법:
주파수 워핑(frequency warping) 발생:
사전 워핑으로 보정 후 설계합니다.
from scipy import signal
import numpy as np
# 아날로그 버터워스 프로토타입
N = 4 # 필터 차수
Wn_analog = 2 * np.pi * 1000 # 1000 Hz 아날로그 차단 주파수
z_a, p_a, k_a = signal.buttap(N)
b_analog, a_analog = signal.zpk2tf(z_a, p_a, k_a)
b_analog, a_analog = signal.lp2lp(b_analog, a_analog, Wn_analog)
# 쌍일차 변환으로 디지털 필터 변환
fs = 8000 # 샘플링 주파수
b_digital, a_digital = signal.bilinear(b_analog, a_analog, fs)
print("아날로그 필터 극점:", np.roots(a_analog))
print("디지털 필터 극점:", np.roots(a_digital))
print("디지털 극점 크기:", np.abs(np.roots(a_digital)))
7. 제어 시스템에서의 응용
7.1 전달 함수와 안정성 분석
연속 시스템 전달 함수:
루스-허르비츠 판별법(Routh-Hurwitz Criterion):
특성 다항식 의 루스 배열을 이용해 우반 평면의 극점 수를 판별합니다.
나이퀴스트 판별법:
의 나이퀴스트 선도에서 점의 감싸기 횟수로 안정성 판별.
7.2 이산 제어 시스템
디지털 제어기의 전달 함수 :
PID 디지털 구현 (후방 오일러 근사):
정리 및 다음 단계
이번 글에서 다룬 내용:
- 복소수 체계: 직교형, 극형, 오일러 공식, 드 무아브르, 페이저 해석, 임피던스
- 복소함수와 해석 함수: 복소 미분, 코시-리만 방정식, 조화 함수
- 복소 적분: 경로 적분, 코시 정리, 코시 공식
- 로랑 급수와 유수 정리: 특이점 분류, 유수 계산, 실수 적분 응용, 역 라플라스
- Z-변환: 정의, 수렴 영역, 주요 변환쌍, 차분 방정식 풀기
- 디지털 필터 설계: FIR/IIR, 극-영점 도표, 안정성, 쌍일차 변환
- s 평면 vs z 평면: 안정성 조건 대응
다음 편에서는 **수치해석(Numerical Methods)**을 다룹니다. 방정식 풀기, 수치 미분/적분, ODE 수치 풀이, 선형 시스템, 보간까지 Python으로 완전 구현합니다.
참고 자료
- Churchill, R. & Brown, J. "Complex Variables and Applications", 9th Edition
- Oppenheim, A. & Schafer, R. "Discrete-Time Signal Processing", 3rd Edition
- Proakis, J. & Manolakis, D. "Digital Signal Processing", 4th Edition
- Ogata, K. "Modern Control Engineering", 5th Edition
- SciPy 신호처리 공식 문서
Engineering Mathematics: Complex Analysis Complete Guide - Cauchy Theorem to Residues
Engineering Mathematics: Complex Analysis and Z-Transform Complete Guide
In electrical and control engineering, complex numbers are far more than a mathematical abstraction. Phasors in AC circuit analysis, in the Laplace transform, the unit circle in the Z-transform, complex frequency response in Bode plots — all of these are rooted in complex analysis. This guide takes you from the complex number system through the residue theorem, Z-transform, and digital filter design.
1. The Complex Number System
1.1 Representations of Complex Numbers
Rectangular Form:
(Electrical engineers use instead of , since denotes current.)
- Real part:
- Imaginary part:
Polar Form:
- Magnitude:
- Argument (phase): (accounting for quadrant)
Euler's Formula:
From this:
Often called the most beautiful formula in mathematics, Euler's Identity:
Five of the most important numbers (, , , , ) united in a single equation.
De Moivre's Formula:
n-th roots: ,
These represent equally-spaced points on the unit circle. (The n-th roots of unity: — you will see these in the FFT!)
1.2 Complex Arithmetic
Addition/Subtraction (rectangular form is convenient):
Multiplication (polar form is convenient):
Magnitudes multiply, phases add — the foundation of impedance multiplication in electrical engineering.
Division:
Complex Conjugate:
Useful properties:
1.3 Engineering Application: Phasor Analysis
The power of complex numbers is on full display in AC circuit analysis.
Expressing as a phasor:
Impedance:
Series RLC impedance:
Resonance condition: implies , (pure resistance).
2. Complex Functions and Analytic Functions
2.1 Complex Functions
where and are real-valued functions.
Examples:
2.2 Complex Differentiation and the Cauchy-Riemann Equations
The complex derivative of :
Unlike real analysis, can approach 0 from any direction in the complex plane, and the limit must be the same regardless of direction.
Along the real axis ():
Along the imaginary axis ():
For these two expressions to be equal:
These are the Cauchy-Riemann Equations.
If the partial derivatives of and are continuous and satisfy the Cauchy-Riemann equations, is an analytic function.
2.3 Harmonic Functions
The real and imaginary parts of an analytic function each satisfy Laplace's equation:
From Cauchy-Riemann: and , so .
Given , the Cauchy-Riemann equations allow you to find the harmonic conjugate .
Engineering significance: velocity potential and stream function in potential flow; electric potential and field lines in electrostatics.
import numpy as np
import matplotlib.pyplot as plt
# Visualize Cauchy-Riemann orthogonality for f(z) = z^2
x = np.linspace(-2, 2, 400)
y = np.linspace(-2, 2, 400)
X, Y = np.meshgrid(x, y)
U = X**2 - Y**2 # Re(z^2)
V = 2 * X * Y # Im(z^2)
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
for ax, data, title in zip(axes, [U, V],
['Re(z^2) = x^2 - y^2', 'Im(z^2) = 2xy']):
c = ax.contour(X, Y, data, levels=20, cmap='RdBu')
ax.set_title(title)
ax.set_xlabel('x')
ax.set_ylabel('y')
ax.set_aspect('equal')
plt.colorbar(c, ax=ax)
plt.suptitle('Level curves of f(z)=z^2: orthogonal grids (Cauchy-Riemann)', fontsize=12)
plt.tight_layout()
plt.savefig('cauchy_riemann_z2.png', dpi=150)
plt.show()
2.4 Important Analytic Functions
Trigonometric functions:
Unlike their real counterparts, they can become unbounded: .
Logarithm (multi-valued):
Principal value: , . Singularities occur at and along the negative real axis (branch cut).
3. Complex Integration
3.1 Contour Integrals
: a curve parameterized by ,
Example: along the straight line from to
Parameterization: , ,
3.2 Cauchy's Integral Theorem
Condition: analytic on and inside the simple closed curve .
Intuition: the integral of an analytic function is path-independent. Using Green's theorem together with the Cauchy-Riemann equations forces both real parts of the integral to vanish.
Antiderivative: if , then .
3.3 Cauchy's Integral Formula
Conditions: analytic on and inside ; lies inside .
Higher-order derivative formula:
This proves that analytic functions are infinitely differentiable.
import numpy as np
def cauchy_integral_formula(f, a, R=1.0, N=2000):
"""Numerically verify f(a) = (1/2pi*i) integral f(z)/(z-a) dz."""
theta = np.linspace(0, 2*np.pi, N, endpoint=False)
z = a + R * np.exp(1j * theta)
dz = np.diff(np.append(z, z[0]))
integrand = f(z[:-1]) / (z[:-1] - a)
return np.sum(integrand * dz) / (2 * np.pi * 1j)
a = 1 + 1j
numerical = cauchy_integral_formula(np.exp, a)
print(f"Cauchy formula result : {numerical:.6f}")
print(f"Exact exp(1+j) : {np.exp(a):.6f}")
print(f"Error : {abs(numerical - np.exp(a)):.2e}")
4. Laurent Series and the Residue Theorem
4.1 Taylor Series vs Laurent Series
Taylor series (analytic at ):
Laurent series (annular region ):
The negative-power terms form the principal part. The difference: Laurent series can represent functions with singularities; the structure of the principal part classifies the singularity.
4.2 Classification of Singularities
Removable: no negative-power terms. Example: at .
Pole of order m: finitely many negative-power terms; with analytic and .
Essential singularity: infinitely many negative-power terms. Example: at .
Picard's theorem: near an essential singularity, takes almost every complex value.
4.3 The Residue Theorem
Residue: the coefficient of in the Laurent expansion.
Computing residues:
Simple pole:
Rational at a simple pole:
Pole of order :
Residue Theorem:
where are all singularities inside .
4.4 Evaluating Real Integrals
Example 1:
Pole in the upper half-plane: . Residue: . By the residue theorem and Jordan's lemma:
Example 2:
Consider . Pole at , residue . Taking the real part: .
Example 3:
Substitute , :
4.5 Inverse Laplace Transform via Residues
Bromwich Integral:
Example: , poles
5. Conformal Mappings
5.1 Definition and Angle Preservation
An analytic function with defines a conformal mapping: it preserves angles and orientation between curves at every point.
5.2 Mobius Transformation
Properties:
- Maps circles and lines to circles and lines
- Any three distinct points can be mapped to any other three
- Composition of Mobius maps is again a Mobius map
Key examples:
- : inversion
- : maps the unit disk to itself
- : maps the unit disk to the right half-plane
5.3 Engineering Applications
Potential flow: conformal mappings transform complicated domain geometries (e.g., airfoils) into simple ones (half-plane, disk), enabling analytic solutions.
Electrostatics: find field distributions between irregular electrodes by mapping to standard geometries.
Digital filter design: the bilinear transform is a conformal map converting the axis exactly onto the unit circle.
import numpy as np
import matplotlib.pyplot as plt
def mobius(z, a=1, b=-1, c=1, d=1):
return (a * z + b) / (c * z + d)
theta = np.linspace(0, 2*np.pi, 300)
r_vals = [0.3, 0.6, 0.9, 1.0]
fig, axes = plt.subplots(1, 2, figsize=(12, 6))
for r in r_vals:
z_c = r * np.exp(1j * theta)
w_c = mobius(z_c)
axes[0].plot(z_c.real, z_c.imag, linewidth=1.5)
axes[1].plot(w_c.real, w_c.imag, linewidth=1.5)
for phi in np.linspace(0, 2*np.pi, 12, endpoint=False):
r_line = np.linspace(0.01, 0.99, 100)
z_l = r_line * np.exp(1j * phi)
w_l = mobius(z_l)
axes[0].plot(z_l.real, z_l.imag, 'gray', alpha=0.4, linewidth=0.8)
axes[1].plot(w_l.real, w_l.imag, 'gray', alpha=0.4, linewidth=0.8)
for ax, title in zip(axes, ['z-plane (unit disk)', 'w-plane: w = (z-1)/(z+1)']):
ax.set_xlim([-2, 2])
ax.set_ylim([-2, 2])
ax.axhline(0, color='k', linewidth=0.5)
ax.axvline(0, color='k', linewidth=0.5)
ax.set_aspect('equal')
ax.set_title(title)
ax.grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('mobius_transform.png', dpi=150)
plt.show()
6. Z-Transform
6.1 Definition and Region of Convergence
Region of Convergence (ROC):
- Causal signal:
- Anti-causal signal:
- Two-sided signal: annular region
6.2 Key Z-Transform Pairs
| Signal | | ROC | | --------------------------- | ------------------------------------------ | ------- | --- | --- | --- | --- | | | | all | | | | | | | | | | | | | | | | |
6.3 Properties of the Z-Transform
- Time shift: ( = unit delay operator)
- Convolution:
- Final value:
6.4 Digital Filter Design
Transfer function:
Stability: all poles must satisfy .
FIR: poles only at origin — always stable, can achieve linear phase.
IIR: feedback poles can be anywhere — sharper characteristics with fewer coefficients, but requires stability check.
from scipy import signal
import numpy as np
import matplotlib.pyplot as plt
b, a = signal.butter(4, 0.2, btype='low')
w, h = signal.freqz(b, a, worN=2048)
zeros, poles, gain = signal.tf2zpk(b, a)
fig, axes = plt.subplots(1, 2, figsize=(12, 5))
axes[0].plot(w/np.pi, 20*np.log10(abs(h) + 1e-15), 'b-', linewidth=2)
axes[0].axhline(-3, color='r', linestyle='--', label='-3 dB')
axes[0].set_xlabel('Normalized Frequency')
axes[0].set_ylabel('Magnitude (dB)')
axes[0].set_title('Butterworth LPF (order 4)')
axes[0].set_xlim([0, 1])
axes[0].legend()
axes[0].grid(True, alpha=0.3)
unit_circle = np.exp(1j * np.linspace(0, 2*np.pi, 200))
axes[1].plot(unit_circle.real, unit_circle.imag, 'k--', alpha=0.5)
axes[1].scatter(zeros.real, zeros.imag, s=100, marker='o', color='blue', label='Zeros')
axes[1].scatter(poles.real, poles.imag, s=100, marker='x', color='red', linewidths=2, label='Poles')
axes[1].set_title('Pole-Zero Plot (z-plane)')
axes[1].set_aspect('equal')
axes[1].legend()
axes[1].grid(True, alpha=0.3)
plt.tight_layout()
plt.savefig('butterworth_lpf.png', dpi=150)
plt.show()
print(f"Pole magnitudes: {np.abs(poles)}")
6.5 s-Plane to z-Plane Correspondence
| s-plane | z-plane | | ------------------------------- | ------------- | --- | ---- | | axis () | Unit circle | | Left half-plane () | Interior | | Right half-plane () | Exterior |
Stability: continuous poles in left half-plane correspond to discrete poles inside the unit circle.
Bilinear transform (analog to digital without aliasing):
7. Applications to AI and Signal Processing
7.1 Complex-Valued Neural Networks
Complex-valued neural networks process signals in the amplitude-phase domain. The Wirtinger derivative generalizes complex differentiation to non-analytic functions used in machine learning, enabling gradient-based optimization in the complex domain.
7.2 Loss Landscape Geometry
Complex analysis tools characterize critical points of neural network loss functions. Saddle points, local minima, and their basins of attraction can be studied through the lens of analytic function theory and conformal geometry.
import numpy as np
import matplotlib.pyplot as plt
# Domain coloring of sin(z)/z — removable singularity at z=0
x = np.linspace(-5, 5, 600)
y = np.linspace(-3, 3, 600)
X, Y = np.meshgrid(x, y)
Z = X + 1j * Y
with np.errstate(invalid='ignore', divide='ignore'):
F = np.where(np.abs(Z) < 1e-10, 1.0 + 0j, np.sin(Z) / Z)
fig, axes = plt.subplots(1, 2, figsize=(14, 5))
im1 = axes[0].pcolormesh(X, Y, np.abs(F), cmap='viridis', vmax=2.5)
axes[0].set_title('|sin(z)/z| — modulus')
axes[0].set_xlabel('Re(z)')
axes[0].set_ylabel('Im(z)')
axes[0].set_aspect('equal')
plt.colorbar(im1, ax=axes[0])
im2 = axes[1].pcolormesh(X, Y, np.angle(F), cmap='hsv')
axes[1].set_title('arg(sin(z)/z) — phase')
axes[1].set_xlabel('Re(z)')
axes[1].set_ylabel('Im(z)')
axes[1].set_aspect('equal')
plt.colorbar(im2, ax=axes[1])
plt.suptitle('Domain coloring of sin(z)/z (removable singularity at 0)', fontsize=12)
plt.tight_layout()
plt.savefig('domain_coloring_sinc.png', dpi=150)
plt.show()
Summary and Next Steps
Topics covered in this guide:
- Complex number system: rectangular form, polar form, Euler's formula, De Moivre, phasor analysis, impedance
- Complex functions and analytic functions: Cauchy-Riemann equations, harmonic functions
- Complex integration: contour integrals, Cauchy's theorem, Cauchy's integral formula
- Laurent series and the residue theorem: singularity classification, residue computation, real integrals, inverse Laplace
- Conformal mappings: Mobius transformation, angle preservation, engineering applications
- Z-transform: ROC, key transform pairs, solving difference equations
- Digital filter design: FIR/IIR, pole-zero plots, stability, bilinear transform
- AI applications: complex-valued networks, optimization landscape geometry
The next installment covers Numerical Methods: solving equations, numerical differentiation and integration, ODE solvers, and interpolation — all implemented in Python.
References
- Churchill, R. & Brown, J. "Complex Variables and Applications", 9th Edition
- Oppenheim, A. & Schafer, R. "Discrete-Time Signal Processing", 3rd Edition
- Proakis, J. & Manolakis, D. "Digital Signal Processing", 4th Edition
- Ogata, K. "Modern Control Engineering", 5th Edition
- SciPy signal processing documentation
Quiz
Q1. What do the Cauchy-Riemann equations state, and what do they imply about analytic functions?
Answer: The Cauchy-Riemann equations are and .
Explanation: For the complex derivative to exist, the limit must be the same regardless of the direction in which approaches 0. Taking horizontal and vertical limits and equating them yields these two PDE conditions. When satisfied (with continuous partials), is analytic — infinitely differentiable and locally representable as a convergent power series. A key consequence is that both and satisfy Laplace's equation (they are harmonic functions), linking complex analysis to potential theory in physics and engineering.
Q2. Why does Cauchy's theorem say the integral of an analytic function around a closed contour is zero?
Answer: Because analytic functions have path-independent integrals, so any closed-loop integral vanishes.
Explanation: Writing in terms of and , one obtains two real line integrals. Green's theorem converts each to a double integral over the enclosed region, and the Cauchy-Riemann equations force both integrands to zero. Geometrically, since the integral depends only on endpoints, starting and ending at the same point gives zero. This is the complex-analysis counterpart of conservative vector fields: the work integral around any closed loop is zero.
Q3. What is the difference between a Taylor series and a Laurent series?
Answer: A Taylor series contains only non-negative powers of ; a Laurent series also includes negative powers.
Explanation: A Taylor series is valid when is analytic at . A Laurent series is valid in an annular region and is necessary when has a singularity at . The negative-power terms (the principal part) classify the singularity: no negative terms means removable, finitely many means a pole, and infinitely many means an essential singularity. The coefficient of is the residue, the central quantity in the residue theorem.
Q4. How does the residue theorem simplify real integral calculations?
Answer: It converts a real integral into a contour integral in the complex plane, reducing the calculation to finding residues at poles — a straightforward algebraic step.
Explanation: Many definite real integrals are difficult by real-variable methods. By extending the integrand to the complex plane, choosing a contour (e.g., a large semicircle in the upper half-plane), and showing the extra arc contributes nothing (Jordan's lemma), the residue theorem gives the answer as times the sum of enclosed residues. For this approach reduces what might be an intractable antiderivative problem to computing limits at poles.
Q5. Conformal mappings preserve angles — what are their practical applications?
Answer: Conformal mappings are used in fluid dynamics, electrostatics, and digital filter design to transform complex geometries into tractable ones while preserving governing equations.
Explanation: Because conformal maps preserve angles and the Laplacian structure, boundary-value problems in complicated domains (fluid around an airfoil, field between irregular electrodes) can be mapped to simple domains (half-plane, disk) where solutions are known. In digital signal processing, the bilinear transform is a conformal map converting the axis exactly onto the unit circle, enabling analog-to-digital filter conversion while preserving stability. The Mobius transformation class is especially versatile because it maps circles and lines to circles and lines.