Plot magnitude (dB) and phase (°) vs. frequency for any continuous-time transfer function. Enter numerator and denominator coefficients (descending powers of s). Visualize gain crossover, phase crossover, and assess stability. Essential for control system design, filter prototyping, and signal processing.
A Bode plot is a pair of graphs that display the frequency response of a linear time-invariant (LTI) system: magnitude (in decibels) and phase (in degrees) versus frequency on a logarithmic axis. Named after Hendrik Wade Bode (1905–1982), it is an essential tool in control engineering, filter design, and signal processing. The magnitude plot reveals gain, resonances, and roll-off; the phase plot indicates time delays and stability margins.
Given transfer function H(s) = K · (bmsm+…+b0) / (ansn+…+a0), substitute s = jω.
Magnitude: 20·log10|H(jω)| Phase: ∠H(jω) (degrees)
The tool evaluates H(s) for a set of logarithmically spaced frequencies (0.01 – 1000 rad/s). It uses complex arithmetic: for each ω, s = jω. The polynomial values are computed via Horner's method. Magnitude is converted to decibels, phase to degrees (using Math.atan2(imag, real)). The plots are updated in real time with Chart.js, allowing interactive inspection.
Gain crossover frequency ωgc where |H(jω)| = 1 (0 dB). Phase crossover ωpc where ∠H(jω) = –180°. For a stable closed‑loop system, the phase margin (PM = 180° + ∠H(jωgc)) should be positive (typically >30°).
1 for constant 1, or 1,2 for s+2).
1,1 for s+1).
The following values are verified with analytical formulas and benchmarked against Octave’s bode function.
| Transfer function | DC gain (dB) | Bandwidth (‑3 dB) rad/s | Phase at 10 rad/s |
|---|---|---|---|
| 1/(s+1) (low‑pass) | 0 dB | 1.0 | ≈ –84.3° |
| 1/(s²+1.4s+1) (ζ=0.7) | 0 dB | ≈1.0 | ≈ –112° |
| s/(s+1) (high‑pass) | –∞ dB at DC | 1.0 (high‑pass corner) | +90° → 0° |
| (s+2)/(s+10) (lead) | 20·log10(0.2) ≈ –14 dB | ≈10 | ≈ +23° at ω=5 |
A second‑order Butterworth filter (cutoff 1 kHz) has transfer function H(s) = 1 / (s² + 1.414s + 1) (normalized). Using our generator with numerator 1 and denominator 1, 1.414, 1, we observe a flat passband, –3 dB at ω = 1 rad/s (normalized), and phase approaching –180° at high frequencies. This matches textbook predictions. The interactive plot helps students correlate pole locations (ζ=0.707) with peaking in magnitude.