Skip to content
Tutorials Center
My learning

Topics

Lesson 21 of 37 Ā· Root Locus and Frequency Response

Bode Plots and Frequency Response

Understand frequency response and Bode plots: compute magnitude and phase of a transfer function, read corner frequencies and slopes, and find bandwidth in Python.

Feed a sine wave into a stable linear system and wait for transients to die. The output is a sine wave of the same frequency, scaled by some gain and shifted in time. Repeat for every frequency and you get the frequency response: gain and phase shift as functions of ω. It is a complete description of the system, and it is the main design tool of classical control because it can be measured on real hardware, even when you have no model.

A Bode plot draws the two curves: magnitude in decibels (20Ā·log10|G(jω)|) and phase in degrees, both against ω on a logarithmic axis. The log scale is the trick: when you multiply transfer functions, you simply add their dB magnitudes and phases. That lets you build a plot from simple pieces.

From transfer function to frequency response

To find the response to sin(ωt), substitute s = jω into G(s). The result is a complex number: its length is the gain and its angle is the phase.

Python Gain and phase at chosen frequencies

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.

At low frequency the gain is 10 (20 dB) with phase near 0°. Past the pole at ω = 1 the magnitude falls at -20 dB per decade; past the second pole at ω = 10 it falls at -40 dB per decade. The phase slides from 0° toward -180°.

The building blocks

Every transfer function factors into a few simple terms. Each has a known Bode shape.

Factor Magnitude Phase
Constant K flat at 20 log K 0° (or 180° if negative)
Integrator 1/s -20 dB/dec, through 0 dB at ω = 1 -90°
Differentiator s +20 dB/dec +90°
Simple pole 1/(1 + s/ωc) flat, then -20 dB/dec after ωc 0° to -90°, -45° at ωc
Simple zero 1 + s/ωc flat, then +20 dB/dec after ωc 0° to +90°, +45° at ωc
Second-order ωn²/(s²+2ζωn s+ωn²) -40 dB/dec after ωn, resonant peak if ζ < 0.707 0° to -180°, -90° at ωn
Time delay e^(-sT) 0 dB -ωT (grows without bound)

The corner frequency ωc is where the straight-line asymptotes meet. The true curve is 3 dB off there for a first-order factor.

flowchart LR
    A["G(s)"] --> B["Factor into poles, zeros, gain"]
    B --> C["Draw each asymptote"]
    C --> D["Add dB curves and phases"]
    D --> E["Smooth corners (-3 dB, ±45°)"]

Sketching a Bode plot by hand.

Asymptotes versus the true curve

Let us build the magnitude by adding the pieces, and compare with the exact curve.

Python Asymptotic Bode magnitude versus exact

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 error peaks at the corners (about -3 dB at both ω = 1 and ω = 10) and is still about -1 dB a factor of two from each corner. Far from the corners the asymptote is nearly exact.

Bandwidth and resonance

Two numbers summarize a low-pass frequency response:

  • Bandwidth ωb: the frequency where the gain first falls 3 dB below its DC value. Larger bandwidth means a faster step response (roughly, rise time ā‰ˆ 2.2/ωb for a first-order-like system).
  • Resonant peak Mr: the maximum gain. A tall peak means a lightly damped, overshooting system.

For a second-order system with damping ζ, the peak exists only for ζ < 1/√2 ā‰ˆ 0.707, at ωr = ωn√(1 - 2ζ²) with height 1/(2ζ√(1-ζ²)).

Python Bandwidth and resonant peak by scanning

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.

As ζ falls the peak grows sharply (ζ = 0.1 gives a peak of about 5, or 14 dB), which is the frequency-domain signature of a ringing step response. The link between damping, peak and overshoot lets you read time-domain behavior off a Bode plot.

Why phase matters

Gain tells you how much a frequency is amplified; phase tells you whether feedback will push or fight. A feedback loop turns unstable when the loop gain is 1 and the phase is -180°, because negative feedback then becomes positive feedback. That is the key idea behind gain and phase margins in the next lesson.

Phase is not independent of magnitude for minimum-phase systems (all poles and zeros in the left half plane): the slope of the magnitude plot determines the phase. A slope of -20 dB/dec means about -90°, -40 dB/dec about -180°. Right-half-plane zeros and delays add phase lag without changing the magnitude, so they are harder to control.

Measuring a response without a model

Real engineers often measure G(jω) by injecting sine waves and logging input and output amplitudes. The simulation below does the same on a numerical first-order plant, estimating gain and phase from a long run.

Python Measure the frequency response by simulation

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 measured values match theory closely. This is the idea behind a real frequency-response analyzer and behind system identification.

Check your understanding

Quick check Ā· 5 questions

of 5 answered You scored / 5 Ā· perfect!

  1. 1. Why are Bode plots drawn on logarithmic axes with dB magnitude?

    log(|G1 G2|) = log|G1| + log|G2|, and phases add, so a complicated plot is a sum of simple ones.
  2. 2. A simple pole at 10 rad/s has what magnitude slope far above 10 rad/s?

    Each simple pole contributes -20 dB/decade above its corner frequency.
  3. 3. At the corner frequency of a simple pole, the phase is about:

    A first-order lag has phase -arctan(w/wc), which is -45 degrees at w = wc.
  4. 4. Second-order system with damping ratio 0.1 has a resonant peak that is:

    The peak height is 1/(2 zeta sqrt(1 - zeta^2)), which is about 5.03 for zeta = 0.1.
  5. 5. What does a pure time delay do to a Bode plot?

    e^(-j w T) has magnitude 1 and phase -wT, so it eats phase margin at high frequency.

Summary

  • Frequency response is G(jω): its magnitude is the gain, its angle the phase shift.
  • Bode plots use log frequency and dB gain, so cascaded blocks add.
  • Poles and zeros bend the magnitude by āˆ“20 dB/dec and the phase by āˆ“90° around their corner frequency.
  • Bandwidth (the -3 dB point) relates to speed; the resonant peak relates to damping.
  • Delays and right-half-plane zeros add lag without changing gain.

Next: Nyquist Plots and Stability Margins