RC Circuit and Low-Pass Filter: From Time Domain to Bode Plot
This article is available in English only.
Why the RC Circuit Is the Perfect Teaching Tool
The RC low-pass filter is simultaneously the simplest dynamic system you can build and a gateway to understanding every more complex system. Its transfer function is a first-order lag. Its Bode plot shows -20 dB/decade rolloff. Its step response is a decaying exponential. These are the building blocks upon which PID controllers, mechanical vibration theory, and thermal dynamics all rest.
But more practically: RC filters appear in every sensor interface (noise filtering), every audio system (EQ), every power supply (output filtering), and every control system (derivative filtering). Understanding RC filter behavior deeply is foundational.
The Mathematics
For a series RC circuit with input voltage Vi and output measured across the capacitor:
Vi ──[─R─]──┬── Vo
│
[C]
│
GND
The transfer function (Laplace domain):
Vo(s) 1
──── = ─────────────── = ────────
Vi(s) RCs + 1 τs + 1
τ = RC = time constant (seconds)
fc = 1/(2πτ) = cutoff frequency (Hz)
For R = 1 kΩ, C = 100 nF: τ = 10^3 × 10^-7 = 10^-4 s, fc = 1591 Hz.
Building the RC Filter in Twinsys
Two equivalent approaches:
Approach 1: Transfer Function block (most compact)
┌──────────┐ ┌─────────────────┐ ┌───────┐
│ Input │ │ │ │ Scope │
│ Signal │───────────────► │ 1/(τs+1) │────────► │ Vi,Vo │
└──────────┘ └─────────────────┘ └───────┘
(Sine Wave or Step)
Approach 2: Physical model (Integrator + Gain)
The voltage across the capacitor: Vc = (1/C) ∫ i dt and i = (Vi-Vc)/R
Vi──┐ ┌────────┐ i ┌─────────┐ Vc
│ e │ 1/R │─────► │ 1/(Cs) │────►
(─)► │ Sum ─► │ Gain │ └─────────┘
│ └────────┘ │
└────────────────────────────────────────┘
(Vc feedback)
With a small enough time step — about τ/100 — both produce the same result. Approach 1 is faster to build; Approach 2 gives more physical insight.
Step Response Analysis
With a step input at t=0 (Vi steps from 0 to 1V):
Vo(t) = 1 - e^(-t/τ) = 1 - e^(-t/0.0001)
Voltage (V)
1.0 | *********************
0.9 | *********** ← 95% at t = 3τ = 300μs
0.8 | *****
0.7 | ***
0.6 | *** ← 63.2% at t = τ = 100μs
0.5 | **
0.4 | *
0.3 | **
0.2 | *
0.1 | *
0.0 |*
└─────────────────────────────────────────────────── Time (μs)
0 100 200 300 400 500
Key milestones:
t = 1τ: Vo = 63.2% of final value
t = 2τ: Vo = 86.5%
t = 3τ: Vo = 95.0%
t = 5τ: Vo = 99.3% (considered settled)
Frequency Response: The Bode Plot
To generate a Bode plot in Twinsys, drive the filter with a Sine Wave block, sweep the frequency from 100 Hz to 100 kHz, and record the output amplitude at each frequency. Plot in dB:
Magnitude (dB)
0 |**************
-5 | *****
-10 | ***
-15 | ***
-20 | ***
-25 | ***
-30 | ***
-35 | ***
-40 |
└───────────────────────────────────── Frequency (Hz, log scale)
100 1k 10k 100k
↑
fc = 1591 Hz (-3 dB)
Phase (degrees)
0 |****
-15 | ******
-30 | ****
-45 | ** ← -45° at fc
-60 | ****
-75 | *****
-90 | ************
└───────────────────────────────────── Frequency (Hz, log scale)
100 1k 10k 100k
The rolloff of exactly -20 dB per decade above fc is the hallmark of a first-order low-pass filter.
Cascading Filters: Second-Order Response
Connect two RC sections in series (two Transfer Function blocks in cascade), both with the same fc:
1/(τs+1) ─► 1/(τs+1) = 1/(τs+1)²
Combined rolloff: -40 dB/decade (steeper!)
Combined phase: -180° maximum
-3dB frequency: shifts to 0.644·fc (two identical stages, no loading)
The second-order response forms the basis for Butterworth and Chebyshev filter designs. Two real poles never oscillate on their own, but together they bring the phase lag close to −180°: put the cascade inside a feedback loop with enough gain and the response rings. Add a third lag or a dead time, and the loop can oscillate outright.
Practical Application: Sensor Signal Conditioning
A pressure sensor outputs a 0-10V signal but with 200 mV of high-frequency electrical noise (from a nearby motor VFD). The noise frequency is 8-20 kHz. You need a clean signal for your control system sampling at 100 Hz.
Design target: two RC stages at 50 Hz each, attenuating 10 kHz noise by at least 40 dB:
Two-pole RC filter: fc = 50 Hz per stage
Attenuation at 10 kHz: -20·log(10000/50)² = -20·log(40000) = -92 dB ✔
Required components: R=10kΩ, C=318nF (use 330nF standard)
Time constant per stage: τ = 10k×330n = 3.3ms
Actual fc per stage: f = 1/(2π×3.3×10^-3) = 48 Hz
Both stages together: -3dB at 0.644 × 48 ≈ 31 Hz
In Twinsys, model the noisy sensor signal as a Sine Wave (0-10V, low frequency) summed with a high-frequency Sine Wave (noise), pass it through two cascaded Transfer Function blocks, and observe the clean output on the Scope.
Connection to Derivative Filtering in PID
The PID derivative term with filter has exactly the RC filter structure:
D(s) = Kd · Ns / (s + N)
This is a high-pass filter with cutoff at f = N/(2π).
Above this frequency, gain is constant (Kd·N) — limiting noise amplification.
This is literally an RC circuit: the derivative filter
coefficient N is the reciprocal of the filter time constant.
Understanding the RC filter means understanding why PID derivative filtering works and how to choose the N parameter.
Conclusion
The RC filter, despite its simplicity, teaches the most important concepts in linear systems: time constants, first-order dynamics, frequency response, phase shift, and filter cascading. Every more complex system — the PID controller, the mechanical spring-damper, the thermal lag — has a first-order lag somewhere in it.
Twinsys makes this concrete: place a Transfer Function block with numerator 1 and denominator 0.0001 1 — that is 1/(0.0001s+1) — and you're simulating 1591 Hz filter behavior. Add a Sine Wave input and a Scope, and you have a complete frequency response testbench in under 2 minutes.
Try this: build the RC filter and apply a square wave input instead of a sine wave. Observe the output: it's a series of exponential rises and falls. The filter is "smoothing" the sharp edges, which is exactly what it does to noise in real circuits.