TExcelTAD
Home › Circuit Theory & Network Analysis › Frequency Response and Transfer Functions

Frequency Response and Transfer Functions

A sensor amplifier passes a slow temperature signal perfectly but turns a 3 kHz vibration into a weaker, delayed copy. An audio cable sounds fine with one amplifier and dull with another. Both effects have the same cause: circuits with capacitors and inductors treat each frequency differently. Instead of solving the circuit again for every frequency, we solve it once with ω\omega left as a variable. The result, the transfer function H(jω)H(j\omega), tells you the gain and the phase shift at every frequency. This lesson defines it, computes it for a small network, and shows how to read and measure it. The signal-processing view of the same idea is in Frequency Response of the Fourier course.

The idea: one sine in, the same sine out

In a linear circuit driven by a sinusoid, after the transient has died away every voltage and current is a sinusoid of the same frequency (Sinusoids and Phasors). Only two things can change between input and output: the amplitude and the phase. So for each frequency the circuit is described by two numbers, and as a phasor ratio by one complex number:

H(jω)=VoutVin=∣H(jω)∣ ej∠H(jω)H(j\omega) = \frac{\mathbf{V}_\text{out}}{\mathbf{V}_\text{in}} = \lvert H(j\omega) \rvert \, e^{j \angle H(j\omega)}

If vin(t)=Vmcos⁡(ωt)v_\text{in}(t) = V_m \cos(\omega t), then in steady state

vout(t)=∣H(jω)∣ Vmcos⁡(ωt+∠H(jω))v_\text{out}(t) = \lvert H(j\omega) \rvert \, V_m \cos\big(\omega t + \angle H(j\omega)\big)

∣H∣\lvert H \rvert is the magnitude response (gain), ∠H\angle H the phase response. A ratio of two voltages is dimensionless; a ratio of voltage to current would be an impedance and is also a transfer function, just with units of ohms.

+ vin 1 V, f R1 10 kOhm R2 10 kOhm C1 10 nF out + - vout H(jw) = Vout / Vin

Computing the transfer function from the circuit

Replace every element by its impedance, RR, jωLj\omega L, 1/(jωC)1/(j\omega C) (Impedance and Admittance), and solve the circuit as if it were resistive, keeping ω\omega as a symbol. For the lag network above, R2R_2 in parallel with C1C_1 is

Zp=R21+jωR2C1Z_p = \frac{R_2}{1 + j\omega R_2 C_1}

and the divider gives

H(jω)=ZpR1+Zp=R2R1+R2⋅11+jω(R1∥R2)C1=K1+jω/ωpH(j\omega) = \frac{Z_p}{R_1 + Z_p} = \frac{R_2}{R_1 + R_2} \cdot \frac{1}{1 + j\omega (R_1 \parallel R_2) C_1} = \frac{K}{1 + j\omega/\omega_p}

with the DC gain K=R2/(R1+R2)K = R_2/(R_1 + R_2) and the pole frequency ωp=1/((R1∥R2)C1)\omega_p = 1/\big((R_1 \parallel R_2) C_1\big). Two features hold for many circuits:

  • Limits first. At ω→0\omega \to 0 the capacitor is open: H→KH \to K. At ω→∞\omega \to \infty it is a short across the output: H→0H \to 0. Checking these two limits catches most algebra mistakes.
  • The time constant seen by the capacitor sets the corner. The capacitor sees R1∥R2R_1 \parallel R_2 (the Thevenin resistance at its terminals with the source zeroed), so the corner is 1/(2πRThC)1/(2\pi R_\text{Th} C), the same rule as for first-order transients.

Magnitude and phase separately:

∣H∣=K1+(ω/ωp)2,∠H=−arctan⁡ωωp\lvert H \rvert = \frac{K}{\sqrt{1 + (\omega/\omega_p)^2}}, \qquad \angle H = -\arctan\frac{\omega}{\omega_p}

At ω=ωp\omega = \omega_p the gain is K/2K/\sqrt{2} (3 dB below its DC value, see Decibels and Bode Plots) and the phase is −45∘-45^\circ.

Worked example

Given: R1=R2=10 kΩR_1 = R_2 = 10\ \text{k}\Omega, C1=10 nFC_1 = 10\ \text{nF}, input 1 V1\ \text{V} peak.

Find: the DC gain, the pole frequency, and the output amplitude and phase at 1 kHz1\ \text{kHz} and 10 kHz10\ \text{kHz}.

Solve:

K=1010+10=0.500R1∥R2=5 kΩ,fp=12π⋅5 kΩ⋅10 nF=3.183 kHz∣H(1 kHz)∣=0.51+(1/3.183)2=0.477,∠H=−arctan⁡(0.3142)=−17.4∘∣H(10 kHz)∣=0.51+(10/3.183)2=0.152,∠H=−arctan⁡(3.142)=−72.3∘\begin{aligned} K &= \frac{10}{10 + 10} = 0.500 \\ R_1 \parallel R_2 &= 5\ \text{k}\Omega, \quad f_p = \frac{1}{2\pi \cdot 5\ \text{k}\Omega \cdot 10\ \text{nF}} = 3.183\ \text{kHz} \\ \lvert H(1\ \text{kHz}) \rvert &= \frac{0.5}{\sqrt{1 + (1/3.183)^2}} = 0.477, \quad \angle H = -\arctan(0.3142) = -17.4^\circ \\ \lvert H(10\ \text{kHz}) \rvert &= \frac{0.5}{\sqrt{1 + (10/3.183)^2}} = 0.152, \quad \angle H = -\arctan(3.142) = -72.3^\circ \end{aligned}

So a 1 V1\ \text{V} peak sine at 1 kHz1\ \text{kHz} comes out as 0.477 V0.477\ \text{V} peak, lagging by 17.4∘17.4^\circ (a time delay of 17.4/360⋅1 ms=48 μs17.4/360 \cdot 1\ \text{ms} = 48\ \mu\text{s}); at 10 kHz10\ \text{kHz} as 0.152 V0.152\ \text{V} peak, lagging 72.3∘72.3^\circ.

Check: both magnitudes are below the DC value 0.50.5 and fall with frequency, as a capacitor across the output should make them; the phase lies between 0∘0^\circ and −90∘-90^\circ, the range of a single pole.

In Python: evaluate H, then confirm in the time domain

The first part evaluates the formula. The second part drives the circuit's differential equation with a sine using scipy.signal.lsim, waits for the transient to die out, and measures the output amplitude: the same number, reached without phasors.

python · try it yourself
import numpy as np
from scipy import signal

R1 = R2 = 10e3; C1 = 10e-9
K = R2 / (R1 + R2)
tau = (R1 * R2 / (R1 + R2)) * C1
fp = 1 / (2 * np.pi * tau)
print(f"K = {K:.3f}, f_p = {fp:.1f} Hz")

H = lambda f: K / (1 + 1j * 2 * np.pi * f * tau)
print("   f (Hz)    |H|     dB    phase (deg)")
for f in [100, 1e3, fp, 1e4, 1e5]:
    h = H(f)
    print(f"{f:9.0f}  {abs(h):.4f} {20*np.log10(abs(h)):7.2f} {np.degrees(np.angle(h)):9.2f}")

# time domain: H(s) = K / (1 + s*tau), driven by a 1 V, 10 kHz sine for 2 ms
sys = signal.lti([K], [tau, 1])
t = np.linspace(0, 2e-3, 20001)
_, y, _ = signal.lsim(sys, np.sin(2 * np.pi * 1e4 * t), t)
print(f"lsim steady-state amplitude at 10 kHz: {float(y[t > 1e-3].max()):.3f} V")
K = 0.500, f_p = 3183.1 Hz
   f (Hz)    |H|     dB    phase (deg)
      100  0.4998   -6.02     -1.80
     1000  0.4770   -6.43    -17.44
     3183  0.3536   -9.03    -45.00
    10000  0.1517  -16.38    -72.34
   100000  0.0159  -35.97    -88.18
lsim steady-state amplitude at 10 kHz: 0.152 V

The time-domain run agrees with ∣H(jω)∣\lvert H(j\omega) \rvert to three digits. That is the whole point of the phasor method: the steady-state answer without solving a differential equation.

Interactive: sweep the frequency

The netlist lab solves the network with phasors at the frequency on the slider and also plots ∣V(out)∣\lvert V(\text{out}) \rvert against frequency.

0.00.20.4101001k10k100kf (Hz)|V| (V)|V(out)|phasors at f = 1.000 kHz (magnitude @ phase)V(in)1.00 V @ 0.0 degV(out)477 mV @ -17.4 degI(V1)56.3 uA @ -165.3 degI(R1)56.3 uA @ 14.7 degI(R2)47.7 uA @ -17.4 degI(C1)30.0 uA @ 72.6 deg

At 1 kHz1\ \text{kHz} the lab shows V(out)=0.477 VV(\text{out}) = 0.477\ \text{V} at −17.4∘-17.4^\circ, as in the worked example. Make C1C_1 ten times larger and the whole curve shifts one decade down in frequency.

Guided lab: measure a frequency response point by point

Hand calculation. The table above: 0.500 V0.500\ \text{V} at low frequency, 0.354 V0.354\ \text{V} and −45∘-45^\circ at 3.18 kHz3.18\ \text{kHz}, 0.152 V0.152\ \text{V} and −72∘-72^\circ at 10 kHz10\ \text{kHz} for 1 V1\ \text{V} peak in.

Simulation. The Python table and the lab.

What you would measure. Build the network with 1 % resistors and a 5 % C0G/NP0 capacitor. Drive it from a function generator at 2 V2\ \text{V} peak-to-peak, channel 1 of an oscilloscope on the input, channel 2 on the output. At each of 100 Hz, 300 Hz, 1 kHz, 3 kHz, 10 kHz, 30 kHz and 100 kHz record the peak-to-peak ratio and the time shift Δt\Delta t between zero crossings; phase =−360∘⋅fΔt= -360^\circ \cdot f \Delta t. Measure the input at the circuit, not the generator's setting, because the generator's 50 Ω50\ \Omega output resistance drops part of the voltage. Expect the ratios within about ±3 %\pm 3\,\% (scope vertical accuracy) and the corner, where the ratio is 0.354 and the phase −45∘-45^\circ, between about 3.03.0 and 3.4 kHz3.4\ \text{kHz} because of the capacitor's 5 % tolerance. A 10× probe (10 MΩ10\ \text{M}\Omega, about 15 pF15\ \text{pF}) barely loads this network; a 1× probe adds around 100 pF100\ \text{pF} to C1C_1 and moves the corner down by roughly 1 %.

Hazards and safe setup. Signal-level voltages only; the generator and the scope share their earth through the mains leads, so connect both ground clips to the circuit's ground and nowhere else.

Pitfalls

  • Frequency in Hz versus rad/s. ω=2πf\omega = 2\pi f. A formula with ω\omega fed a value in Hz puts the corner off by a factor of 6.28.
  • Forgetting "steady state". H(jω)H(j\omega) says nothing about the first few time constants after a signal starts.
  • Ignoring the source and load. HH belongs to the circuit with its actual source resistance and load; connecting a different load changes it (First-Order Filters shows by how much).
  • Phase wrapping. np.angle returns −180∘-180^\circ to +180∘+180^\circ; a phase that keeps falling past −180∘-180^\circ wraps around. Use np.unwrap for plots.

Practice

  1. For the lag network, find the frequency where ∣H∣=0.25\lvert H \rvert = 0.25.
  2. Swap C1C_1 to sit across R1R_1 instead of R2R_2. What are HH at DC and at very high frequency?
  3. A transfer function is H(jω)=2/(1+jω⋅10−3)H(j\omega) = 2/(1 + j\omega \cdot 10^{-3}). Give its output for an input 3cos⁡(1000t) V3\cos(1000 t)\ \text{V}.
Answer
  1. 0.5/1+x2=0.250.5/\sqrt{1 + x^2} = 0.25 gives x=3x = \sqrt{3}, so f=3⋅3.183 kHz=5.51 kHzf = \sqrt{3} \cdot 3.183\ \text{kHz} = 5.51\ \text{kHz}.
  2. At DC the capacitor is open: H=0.5H = 0.5. At high frequency it shorts R1R_1: H=1H = 1. The network now raises the high frequencies (a lead network).
  3. At ω=1000 rad/s\omega = 1000\ \text{rad/s}: H=2/(1+j)=1.414∠−45∘H = 2/(1 + j) = 1.414 \angle -45^\circ. Output 4.24cos⁡(1000t−45∘) V4.24\cos(1000t - 45^\circ)\ \text{V}.

Test yourself

A linear circuit is driven by a 2 kHz sine. In steady state the output is…

  1. a sine at 2 kHz with a different amplitude and phase
  2. a sine at 4 kHz
  3. a square wave
  4. a decaying exponential

For H(jω)=K/(1+jω/ωp)H(j\omega) = K/(1 + j\omega/\omega_p), what is the phase at ω=ωp\omega = \omega_p?

  1. 0∘0^\circ
  2. −45∘-45^\circ
  3. −90∘-90^\circ
  4. +45∘+45^\circ

In the lag network, which resistance sets the pole frequency together with C1C_1?

  1. R1R_1
  2. R2R_2
  3. R1+R2R_1 + R_2
  4. R1∥R2R_1 \parallel R_2

∣H∣=0.152\lvert H \rvert = 0.152 and ∠H=−72.3∘\angle H = -72.3^\circ at 10 kHz. An input of 1 V1\ \text{V} peak gives an output that…

  1. is 0.152 V0.152\ \text{V} peak and lags the input by 72.3∘72.3^\circ
  2. is 0.152 V0.152\ \text{V} peak and leads by 72.3∘72.3^\circ
  3. is 6.58 V6.58\ \text{V} peak
  4. is 0.152 V0.152\ \text{V} DC