Understanding Bode plots.
A Bode plot describes how a linear system responds to sinusoidal inputs at different frequencies.
A first-order example
For an ideal first-order low-pass response with angular corner frequency ωc:
Substitute s = jω to obtain the frequency response. Magnitude is expressed in decibels, and phase is usually expressed in degrees. At the corner frequency the magnitude is approximately −3 dB and phase is −45°. Far above it, the magnitude approaches a slope of −20 dB per decade.
Calculate the magnitude
import numpy as np
w = np.logspace(0, 4, 400)
wc = 100
H = 1 / (1 + 1j * w / wc)
magnitude_db = 20 * np.log10(np.abs(H))
phase_deg = np.angle(H, deg=True)Explore how changing the corner frequency shifts the response in the interactive Bode plot.