grokkingstuff Home Blog Projects Wiki Calculators About

Frequency Response: Bode & Nyquist

date2026-07-24tags:ele: :control:

Frequency response is the steady-state answer a linear time-invariant system gives to a sinusoid, once every transient has died away and the only thing left is the sinusoid the system itself produces at its output - same frequency, new amplitude, new phase. It is, in a slogan, the transfer function evaluated on the imaginary axis[fn::More precisely: the steady-state sinusoidal response, because the homogeneous part of the solution has decayed for any stable system. For an unstable system the notion is still formally defined but physically meaningless - there is no "steady state" to converge to.].

This sounds like a narrow construction - "what does the system do to a cosine?" - but it turns out to be one of the richest lenses in control theory. The reason is the Fourier inversion theorem: any reasonable input is a superposition of sinusoids, and for an LTI system superposition is linear, so if you know the response at every frequency you know the response to everything. Frequency response is thus the full input/output behaviour of an LTI system, just decomposed along a different axis than the impulse response.

From the transfer function to H(jω)

Start with the transfer function G(s), a rational function of the complex variable s = σ + jω that we met in Transfer Functions & Block Diagrams. The frequency response is obtained by restricting s to the imaginary axis:

H(jω) := G(s)|_{s = jω} = G(jω).

Because G is rational in s with real coefficients, G(jω) is a complex-valued function of the real variable ω. It has a magnitude |G(jω)| and an argument arg G(jω), and both vary with ω. By convention:

The two together are a *Bode plot*[fn::Hendrik Wade Bode, Network Analysis and Feedback Amplifier Design (1945). Bode worked at Bell Labs on feedback amplifier design for long-distance telephony; the plots were a practical tool for engineers who had slide rules and graph paper, not MATLAB.]. Why log scales everywhere? Because magnitude factors multiply (a product of terms gives a sum of decibels) and log-frequency lets you span six decades on a single sheet. The whole plot becomes piecewise-linear, and pieces you can draw with a ruler.

Why evaluation on the imaginary axis is enough

Substitute e^{jωt} into a stable LTI system described by G(s). The output, after transients, is G(jω) e^{jωt}. This is the eigenfunction property of exponentials under convolution operators: complex exponentials are eigenfunctions of LTI systems, and G(jω) is the eigenvalue at frequency ω.

So |G(jω)| is the gain at ω - the factor by which the input sinusoid is amplified or attenuated - and arg G(jω) is the phase shift, the lead or lag the system imparts. The Bode plot is just this eigenvalue drawn against ω[fn::The same machinery underlies the Fourier transform: G(jω) is precisely the Fourier transform of the impulse response g(t), evaluated at ω. The transfer function and the frequency response are the same object seen from two angles.].

Bode plots: the asymptotic construction

For a transfer function written in factored zero/pole form

G(s) = K · ∏(s + z_i) / ∏(s + p_j)

each factor contributes independently to magnitude (in dB) and phase. This is the entire reason the construction works: log turns products into sums.

FactorMagnitude (dB)Phase (deg)
Constant K20 log K (flat)0 (or 180 if K < 0)
(s/ω₀ + 1)0 then +20 dB/dec above ω₀0 then +90 asymptotically
1/(s/ω₀ + 1)0 then −20 dB/dec above ω₀0 then −90
(s/ω₀ + 1)² etc.doubled slopesdoubled phase swings

At the "corner frequency" ω₀ the true curve deviates from the asymptotes by ~3 dB (for a first-order factor); the asymptotic Bode plot is a sketch, accurate away from breakpoints, qualitatively right everywhere, and easy to draw. The deviation matters; see When it breaks.

The elementary second-order factor with a pair of complex poles is the place where the sketch and the truth diverge most violently. A factor

1 / (s²/ω_n² + 2ζ s/ω_n + 1)

has a resonance peak of magnitude ≈ 1/(2ζ√(1−ζ²)) near ω_n when ζ is small. The first-order asymptote gives no peak at all. For ζ = 0.1 the resonant peak is +14 dB, which is the difference between a system that works and a system that oscillates. You can't see it on the ruler-and-pencil sketch; you have to know to look for it[fn::This is why the Bode plot's reputation as a "back-of-envelope" tool is half-truthful: the envelope hides exactly the kind of high-Q behaviour that bites you in audio, in mechanical resonance, and in lightly damped structural modes.].

Worked example: second-order loop

Consider a unity-feedback loop with open-loop

L(s) = K / (s (s/10 + 1) (s/100 + 1)), K = 10.

Poles at s = 0, s = −10, s = −100; one integrator gives −20 dB/dec out of the gate. Cascading the asymptotes: −20 dB/dec up to ω = 10, −40 dB/dec from 10 to 100, −60 dB/dec above 100. The magnitude crosses 0 dB somewhere in (10, 100); solving the asymptotic equation gives ω_gc ≈ √(K · 10) ≈ 31.6 rad/s, but the exact crossover is somewhat higher because the second pole bends the curve down.

At ω_gc the phase is roughly −90° (integrator) − arctan(ω_gc/10) − arctan(ω_gc/100) ≈ −90° − 72° − 17° ≈ −179°. The loop is just barely stable; phase margin is essentially zero at the asymptotic crossover, and a small perturbation in K tips it over.

The gain crossover ω_gc is where |L| = 1; the phase crossover ω_pc is where arg L = −180°, which here is at ω → ∞ asymptotically but in practice near ω ≈ 100. The gain margin is how much you can multiply K by before |L(jω_pc)| reaches 1; the phase margin is how much phase lag you can add at ω_gc before the loop hits −180°. For this K = 10 design both margins are tiny - a textbook example of marginal stability that Routh-Hurwitz would call "stable" without telling you how close to the cliff you are.

The Nyquist criterion: stability from one closed curve

The Routh-Hurwitz test of Stability: Routh-Hurwitz tells you whether the characteristic polynomial 1 + L(s) has roots in the right half-plane. It is a finite tabular algorithm and it gives a yes/no answer. But it has two limitations it never apologises for:

1. It needs the polynomial coefficients explicitly. If your system has a transport delay e^{−sT}, L(s) is no longer rational - there is no polynomial - and Routh-Hurwitz simply does not apply. 2. It gives no sense of how close to instability you are. It is a binary verdict.

The Nyquist criterion[fn::Harry Nyquist, "Regeneration Theory", Bell System Technical Journal 11 (1932). Predates Bode by over a decade; both came out of the same Bell Labs feedback-amifier programme.] sidesteps both. Its statement:

Let L(s) be the open-loop transfer function. Trace s once around the standard Nyquist D-contour (the right half-plane boundary: up the imaginary axis from −j∞ to +j∞, then a semicircle of infinite radius to the right). The closed loop 1 + L(s) = 0 has Z poles in the RHP iff the Nyquist plot L(jω) encircles the point −1 a net N = Z − P times clockwise, where P is the number of open-loop RHP poles of L.

For a stable open loop (P = 0), the rule simplifies to: no net encirclements of −1 ⇔ stable closed loop. This is the form most engineers memorise.

The mathematical engine is the argument principle of complex analysis: the number of times a meromorphic function's image winds around zero equals the number of zeros minus poles inside the contour. Here the function is 1 + L(s), its zeros are the closed-loop poles, and its poles are the open-loop poles; the contour is the RHP boundary; the image is the Nyquist plot shifted by +1, so "zeros minus poles inside" becomes "encirclements of −1".

Why Nyquist handles delay and Routh-Hurwitz doesn't

A transport delay contributes the factor e^{−sT}, which on s = jω becomes e^{−jωT} - a pure phase lag that grows without bound as ω increases. The Nyquist plot spirals inward toward the origin while rotating forever, making an infinite number of encirclements (or zero, depending on gain). Routh-Hurwitz cannot count these because there is no polynomial to build the table from; the delay is irrational in s. Nyquist, by working from the evaluated frequency response L(jω), handles it natively - the plot is the data, encirclements and all.

The same goes for distributed-parameter systems (transmission lines, heat equation kernels), for systems with measured-but-unmodelled dynamics, and for any case where you have L(jω) tabulated from experiment but no analytic model. Nyquist will give you a verdict from a frequency-sweep measurement alone. This is why it dominated practical stability analysis for half a century.

Gain and phase margin: scalar robustness measures

The Nyquist plot gives you a curve; you want a number. Two scalar summaries dominate practice:

Both are distances from the Nyquist curve to the critical point −1, measured along two specific directions (radial and angular). They answer "how much can I perturb the loop before it goes unstable?" with two numbers - useful, conventional, and deeply incomplete.

Design rules of thumb: PM ≈ 30°–60°, GM ≈ 6 dB or 2× . These survive because they correlate with closed-loop damping ratio - a phase margin of about 60° corresponds to roughly ζ ≈ 0.6 in a second-order equivalent, which feels well-damped to most engineers. The correlation is rough and breaks for high-order loops, but it is a useful rule.

When it breaks

Asymptotic Bode plots systematically hide resonant peaks. A pair of lightly damped poles at 10 rad/s with ζ = 0.05 produces a +20 dB spike the straight-line sketch will not show. If that spike crosses 0 dB in a feedback loop you have an oscillator you didn't draw. The fix is to plot the actual magnitude, not the asymptote; the fix in design is to ensure the loop is attenuating at the resonance, or to add a notch filter.

Nyquist with time delay creates infinite encirclements - the spiral toward the origin never quite stops rotating. Whether the count is finite-and-stabilising or infinite-and-destabilising depends on the gain relative to the delay-induced phase lag. For L(s) = K e^{−sT} / (s+1), every integer multiple of 2π of phase lag corresponds to another encirclement, and the stability boundary is the transcendental equation K sin(ωT) / √(1+ω²) = −1, ωT + arctan ω = π, which has no closed-form solution. You solve it graphically - exactly what Nyquist intended.

Gain and phase margin are scalar summaries of a multidimensional robustness landscape. They measure distance to instability along two chosen directions; real perturbations (parametric uncertainty, unmodelled dynamics, simultaneous gain and phase variation) move you off those axes. A system with PM = 45° and GM = 8 dB can still be made unstable by a combined 5 dB gain increase and 30° phase lag at a frequency that is neither ω_gc nor ω_pc. The disk margin and structured singular value (μ) frameworks were invented precisely to repair this. The scalar margins are still useful - but treat them as screening tests, not certificates.

A subtler failure: margins computed from the nominal plant say nothing about robustness to structured uncertainty. A loop can have 60° of phase margin on the nominal model and zero robustness margin in the presence of an unmodelled 5 ms delay, because the delay's phase lag accumulates in exactly the high-frequency band where the nominal phase margin was being measured.

The Nichols chart

The Nichols chart is Bode in a different coordinate system: magnitude (dB) on the y-axis, phase (deg) on the x-axis, frequency as a parameter along the curve. It looks like a Lissajous figure and is denser per square inch than any other plot in control theory.

Its power is that contours of constant closed-loop magnitude |T(jω)| = |L/(1+L)| and constant closed-loop phase are pre-drawn on the chart. Slide your open-loop Nichols curve against the grid and you read off the closed-loop bandwidth, peaking, and phase behaviour directly. The M-peak contour the curve touches gives the closed-loop resonance peak M_r, which (for a second-order-ish loop) maps back to a damping ratio.

In the era of `bode`, `nyquist`, and `margin` commands the Nichols chart is less used, but it remains the cleanest single-figure summary of "what does the closed loop do across frequency" - and it makes the relationship between open-loop shape and closed-loop response geometrically visible in a way neither Bode nor Nyquist manages alone.

Minimum-phase vs non-minimum-phase

A transfer function is minimum-phase if all its zeros are in the left half-plane. It is non-minimum-phase (NMP) if any zero is in the RHP or at the origin, or if it contains a pure time delay.

The "minimum" refers to phase: for a given magnitude response, a minimum-phase system has the least phase lag of any system with that magnitude. Bode proved a remarkable theorem: for minimum-phase systems, magnitude and phase are a Hilbert-transform pair - either one determines the other uniquely[fn::Strictly, this is the Bode gain-phase relation: arg G(jω) = −(π/2) d|G|/d(log ω) averaged with the Hilbert kernel. It only holds for minimum-phase systems; any RHP zero adds extra phase lag that the magnitude cannot see.]. This is why the Bode plot of an NMP system looks ordinary but behaves pathologically: you can read the magnitude, infer the phase you expect, and be short by 180° because of an invisible RHP zero.

Practically, NMP behaviour appears in:

NMP systems have a fundamental limitation: the waterbed effect. The Bode integral constraint says ∫_{0}^{∞} log |S(jω)| dω = π Σ Re(p_i) for RHP poles p_i of the loop, where S = 1/(1+L) is the sensitivity. You cannot push sensitivity down at one frequency without pushing it up somewhere else - and for NMP systems the trade-off is more severe. This is the formal statement of "there's no free lunch in feedback".

Loop shaping: design as drawing

The design philosophy that grew out of Bode and Nyquist is loop shaping: sketch the desired open-loop L(jω) - high gain at low frequency for disturbance rejection and reference tracking, low gain at high frequency for noise rejection and unmodelled-dynamics robustness, cross over near 0 dB with adequate slope and phase margin - and then synthesise a controller C(s) such that C·P ≈ L_desired.

The qualitative targets:

The slope at crossover being −20 dB/dec is the engineering reflex that buys phase margin: a single pole at crossover contributes −90° of phase, leaving ~90° of room before −180°; a −40 dB/dec slope eats that down to ~0° margin. You cross over gently.

Loop shaping is the way PID tuning (PID Control: Theory & Tuning) and lead/lag compensation and the quantitative feedback theory (QFT) of Horowitz all think about design: you are drawing the loop you want, in Bode space, and then asking what controller makes the plant produce that drawing. It is engineering as graphic art, with stability and robustness read off the picture.

Meta-observation: why these pre-computer methods survive

Bode (1945) and Nyquist (1932) predate the digital computer by a generation. They were pencil-and-paper tools for engineers who had slide rules and a deadline. By every computational criterion they are obsolete: `margin(sys)` in MATLAB or Python gives you the margins to six decimals in microseconds; Routh-Hurwitz has been automated since the 1960s; root locus (Root Locus: Evans Construction) is plotted instantly.

And yet they survive - in every control textbook, in every `bodeplot` call, in every design review. The reason is that they are not, fundamentally, computational tools. They are intuition tools. A computer can tell you that the loop is unstable; it cannot tell you why. It cannot tell you that the phase is collapsing because of a high-frequency pole at 80 rad/s that you forgot to model, or that the gain margin is thin because the crossover is too close to a second pole, or that adding a lead compensator at 3 rad/s will buy you 35° of phase margin and let you push the gain up by 6 dB.

The intuition comes from the picture. The Bode plot shows you the loop's shape - where it is strong, where it is weak, where it crosses over, where it rolls off. The Nyquist plot shows you the loop's topology - how the curve approaches −1, from which direction, with how much margin. These are geometric facts about the feedback system that a numbers-only output conceals. To fix an unstable loop you need to know what to change; the picture tells you, the number does not.

This is the deeper reason these methods persist in the curriculum and in practice: they encode a way of thinking about feedback that is qualitative, pictorial, and robust to model uncertainty, in a way that exact numerical methods are not. A control engineer who can read a Bode plot can diagnose a loop by inspection; one who can only run `margin(sys)` cannot. The pre-computer tools survive because they teach you to see.

Related