Tools · Passive filters and loading
Connect two resistor–capacitor low-pass sections directly and the second section changes the first. Keep both isolated time constants unchanged while scaling the second section’s impedance, then calculate what improves, what remains different, and why one matching phase reading can hide a gain error.
A resistor–capacitor (RC) low-pass filter uses resistance and capacitance to pass slowly changing signals more readily than fast changes. Its frequency response describes the output amplitude and phase for a steady sinusoidal input at each frequency. Phase is the position of one repeating wave relative to another; negative output phase here means a lag behind the source. A cascade connects one section’s output to the next section’s input. A cascade does not automatically preserve each section’s response when measured alone.
Complete offline experiment: use Python 3.9 or later and the supplied standard-library program. Every result and plotted point is an ideal-network calculation. No physical circuit, instrument, component, target firmware or measurement is tested or qualified here. The program neither controls hardware nor fits noisy waveform captures.
The equal-stage and tenfold impedance-scaling control are explicitly adapted from the Analog Devices university activity on cascaded RC filters. The original diagrams and program below use their own values and calculated data. We add full complex node solutions, shared-corner versus off-corner phase comparisons, nominal combined half-power points, finite source/load controls and a separate power audit.
Let G0 be the common zero-volt reference. An ideal sinusoidal voltage source Vg has its negative terminal at G0 and its positive terminal feeding R1. R1 leads to node A. C1 connects A to G0. R2 connects A to node B, the output. C2 connects B to G0. The source return and both capacitor returns are the same net, meaning an electrically connected set of terminals.
Start with R1 = 10 kΩ and C1 = 100 nF. A kiloohm (kΩ) is one thousand ohms; a nanofarad (nF) is one billionth of a farad. In the equal case, R2 = 10 kΩ and C2 = 100 nF. In the tenfold-scaled case, R2 = 100 kΩ and C2 = 10 nF. These are two alternative circuits evaluated separately.
The time constant τ, the Greek letter tau, is RC and sets a single ideal section’s frequency scale. Both sections in both cases have τ = 0.001 second, or 1 millisecond (ms). Their common isolated corner is f0 = 1/(2πRC) ≈ 159.154943 hertz (Hz), where one hertz means one cycle per second. An isolated corner is not automatically the corner of the combined circuit.

Loading means that a connected circuit draws current and changes the voltage delivered by the preceding circuit. The second section presents a frequency-dependent impedance, the complex voltage-to-current ratio for a sinusoid. Even though the output has no external load, R2 and C2 together still load node A. “No output load” does not mean “no interstage loading.”
The nominal comparison assumes a source resistance Rs of zero and an open external output, RL absent. Source resistance models a voltage drop inside the source path; load resistance RL draws current from B to G0. The program can add Rs in series before R1 and RL from B to G0. Those are declared model elements, not a claim about any particular generator or meter. There is no physical buffer or amplifier in these circuits.
A transfer function is the output-to-input ratio as a function of frequency. For one isolated section driven by an ideal source and with no load, H1 = 1/(1 + jωR1C1). Here ω = 2πf is angular frequency, and j is the imaginary unit, satisfying j² = −1. Complex arithmetic retains both amplitude and phase. The isolated second section similarly has H2 = 1/(1 + jωR2C2).
Multiplying H1 and H2 describes two separately unloaded section responses. It does not describe the directly connected circuit unless the interaction has been removed by an ideal isolating assumption. The program calls that product isolated_product as a comparison; it does not simulate a particular buffer or guarantee a real buffer’s input impedance, output impedance or bandwidth.
Kirchhoff’s current law (KCL) states that currents entering a node equal currents leaving it. With Rs zero and RL absent, applying it at A and B gives:
(Vg − VA)/R1 = (VA − VB)/R2 + jωC1 VA
(VA − VB)/R2 = jωC2 VB
Eliminating VA gives the actual connected transfer:
H = VB/Vg = 1 / [1 + jω(R1C1 + R1C2 + R2C2) − ω²R1R2C1C2]
The cross term R1C2 is missing from the product of isolated responses. It expresses the extra current path through the second capacitor acting on the first resistor. The exact node equations and polynomial are also developed on pages 5–7 of P. Fischer’s Heidelberg higher-order-filter notes. Their page-5 drawing repeats the label R1 on the second resistor, while the equations use R2; this lesson uses the equations’ unambiguous R1/R2 naming and the complete topology above.
For equal R and C, define x = ωRC = f/f0. The connected response is 1/(1 − x² + j3x). The isolated product is 1/(1 − x² + j2x). Their difference is present at finite frequencies even though both have unity gain at zero frequency and both fall approximately as 1/f² at high frequency.
Set R2 = kR1 and C2 = C1/k, where k is a positive scaling factor. R2C2 stays equal to R1C1, but R1C2 becomes RC/k. The connected response becomes:
Hk = 1 / [1 − x² + jx(2 + 1/k)]
At x = 1, the real part of the denominator is zero. Thus Hk = −j/(2 + 1/k). Equal sections give a magnitude of 1/3; k = 10 gives 10/21 ≈ 0.476190; k = 100 gives 100/201 ≈ 0.497512. The isolated product gives 1/2. Tenfold scaling reduces loading but still differs from independence. Increasing k without bound is a mathematical limit, not a hardware recommendation.
| Response | Magnitude at f0/2 | Phase at f0/2 | Magnitude at f0 | Phase at f0 |
|---|---|---|---|---|
| Connected k = 1 | 0.596285 | −63.434949° | 0.333333 | −90° |
| Connected k = 10 | 0.774984 | −54.462322° | 0.476190 | −90° |
| Connected k = 100 | 0.797446 | −53.267173° | 0.497512 | −90° |
| Isolated product | 0.800000 | −53.130102° | 0.500000 | −90° |
All four phases coincide at f0, while their magnitudes differ. A phase measurement at that one frequency cannot establish independent stage behavior. At f0/2, the equal connected circuit lags by about 10.305° more than the isolated product. At 2f0 it instead has phase −116.565051°, versus −126.869898° for the isolated product. Matching phase at the shared corner is a special crossing, not agreement across a band.
Node A is also affected. At f0 the equal connected circuit has VA/Vg = (1 − j)/3, with magnitude √2/3 ≈ 0.471405. The first section alone would have magnitude 1/√2 ≈ 0.707107. Multiplying an unloaded first-stage value by the second-stage value would miss the changed first-stage voltage.

The half-power point here means |H|² = 1/2 relative to the unity low-frequency voltage gain, equivalently magnitude 1/√2 and about −3.0103 dB. It is a response convention: it does not claim that exactly half of the source’s real power reaches an unloaded output. Let a = 2 + 1/k and u = x². From |H|² = 1/[(1 − x²)² + a²x²], the equation is u² + (a² − 2)u − 1 = 0. A numerically convenient positive solution avoids subtracting nearly equal large numbers:
u = 2 / [(a² − 2) + √((a² − 2)² + 4)]
fhalf = f0 √u
The nominal values are 59.562011 Hz for k = 1, 95.611504 Hz for k = 10, and 101.711267 Hz for k = 100. The isolated-product limit is about 102.431207 Hz, not 159.154943 Hz. These are ideal coefficient solutions, not corners estimated from a coarse plotted grid. The tests check the actual solver’s magnitude at each crossing and on both sides. With a finite output load, low-frequency gain is no longer unity; this particular formula and reference must not be reused unchanged.
The solver’s general form includes the source and load resistances. Let YB = 1/RL + jωC2, using 1/RL = 0 for the open-output case. Admittance is current divided by voltage, the reciprocal of impedance. Then VA = (1 + R2YB)VB, and the source current is jωC1 VA + YB VB. Combining this with the drop through Rs + R1 gives the denominator used by the code. This calculation retains both node equations; it does not replace the second section with an isolated gain.
For a concrete load control, use k = 100, so R2 = 1 MΩ and C2 = 1 nF. A megaohm (MΩ) is one million ohms. Add a purely resistive RL = 1 MΩ from B to G0 and keep Rs zero. At the original f0, the denominator becomes 1.01 + j3.01, giving magnitude about 0.314967 and phase −71.450916°. Without that load, the magnitude is about 0.497512 and phase −90°. This is a resistive-only meter model; probe capacitance, cable capacitance and meter frequency behavior are excluded. A fixed 1 MΩ input becomes more consequential as the circuit’s resistor values grow.
For finite RL at zero frequency, the capacitors draw no steady current and the output ratio is RL/(Rs + R1 + R2 + RL). Increasing Rs likewise changes the connected frequency response. A generator’s selected display termination does not establish its actual voltage at the circuit. If translating this offline lesson to a bench, measure the input at the actual circuit terminals and include the source and instrument loading; the ideal curves alone do not qualify a physical setup.
The program reports a separate power audit using the declared source root-mean-square (RMS) voltage, the square root of the mean squared voltage over a complete cycle. For an ideal resistor, average power is current RMS squared times resistance. Ideal capacitors store and return energy but consume zero average real power over complete steady cycles. Real power is the average energy transfer rate; it is not simply the product of voltage and current magnitudes when their phases differ.
At f0 with equal sections and a declared source of 0.1 V RMS, calculated R1 power is about 0.555556 microwatt and R2 power is about 0.111111 microwatt; their sum and the source’s delivered real power are about 0.666667 microwatt. A microwatt is one millionth of a watt. With Rs or RL present, their powers are separately included. These are model powers, not measured heating, temperature rises or device ratings. Changing source amplitude scales voltages and currents together and powers by the amplitude squared; the ideal transfer ratios stay unchanged.
preview.html, and run the tests from the extracted directory. Only Python’s standard library is needed.calculated-checkpoints.csv for f0/2, f0 and 2f0; inspect the sweep for the whole band.The command-line interface (CLI) is the set of terminal commands. A comma-separated values (CSV) file stores table cells as text separated by commas. Point results use JavaScript Object Notation (JSON), a structured text format; complex numbers are exported as named real and imaginary parts.
python3 -m unittest discover -s code -p 'test_*.py'
python3 code/rc_cascade.py point
python3 code/rc_cascade.py point --r2-ohm 100000 --c2-f 1e-8
python3 code/rc_cascade.py point --frequency-hz 79.5774715 --r2-ohm 100000 --c2-f 1e-8
python3 code/rc_cascade.py demo my-calculated-run
python3 code/rc_cascade.py point --r2-ohm 1000000 --c2-f 1e-9 --load-ohm 1000000
python3 code/rc_cascade.py sweep --start-hz 1 --stop-hz 10000 --points 101 --source-ohm 50
The demo writes two calculated CSV files into a new directory and refuses an existing directory. Sweep writes CSV to standard output. No command consumes noisy waveform data or infers a measured corner. A blank observation worksheet is provided for separately recorded conditions and readings; it contains no observations and is not silently treated as a measured input by the solver.
The declared numerical domain is R1 and R2 from 1 Ω through 1 GΩ, C1 and C2 from 1 picofarad through 1 millifarad, Rs from zero through 1 GΩ, and RL from 1 Ω through 1 teraohm or the exact token open. A gigaohm is one billion ohms, a picofarad is one trillionth of a farad, a millifarad is one thousandth of a farad, and a teraohm is one trillion ohms. Source RMS voltage is from one microvolt through one volt. Frequency is zero, or from 10⁻¹² Hz through 10⁹ Hz. Those wide bounds are computational limits, not a validity claim for ideal real components at such extremes.
The solver refuses nonfinite numbers, wrong types, out-of-domain parameters and nonzero decimal literals that disappear to floating-point zero. Sweeps require 2–1001 integer points, increasing positive endpoints and a representable strictly increasing logarithmic grid. An interval only one floating-point step wide cannot contain three distinct points and is refused. Malformed text such as noisy is an error, not a missing value or zero. Refusals exit with code 2 and a concise message.
Binary floating-point arithmetic is rounded. The bounded model avoids unconstrained extremes but does not provide arbitrary precision, an uncertainty analysis, capacitor loss or parasitics. A physical capacitor has leakage and other frequency-dependent behavior; a resistor has tolerance and stray effects. Real source and probe properties, noise and finite observation duration can obscure differences. A finite-frequency ideal calculation is not a measurement, even when it agrees with an expected limiting case.
The complete rc_cascade.py follows. The reader includes the behavior tests, both calculated tables and the original figure generator.
#!/usr/bin/env python3
"""Ideal passive two-section RC cascade; Python 3.9+, standard library only.
Calculate a grounded source, optional series source resistance and optional
resistive output load. No waveform fitting, instrument control or physical test.
"""
import argparse
import cmath
import csv
from decimal import Decimal, InvalidOperation
import json
import math
from pathlib import Path
import sys
SCOPE='Calculated ideal steady-state sinusoidal response; no measured/noisy waveform is fitted.'
FIELDS=['f_hz','a_magnitude','a_phase_deg','b_real','b_imag','b_magnitude','b_phase_deg',
'b_db','isolated_magnitude','isolated_phase_deg','source_real_power_w','resistor_sum_power_w']
def bounded(value,name,low,high):
if isinstance(value,bool) or not isinstance(value,(int,float)):
raise ValueError(name+' must be numeric')
try:value=float(value)
except OverflowError:raise ValueError(name+' is outside the declared numeric domain') from None
if not math.isfinite(value) or not low<=value<=high:
raise ValueError(name+' must lie in ['+str(low)+', '+str(high)+']')
return value
def literal(text):
try:
value=float(text)
if value==0 and Decimal(str(text))!=0:
raise ValueError('Nonzero literal underflows to zero')
except (InvalidOperation,OverflowError):
raise ValueError('Invalid numeric literal') from None
return value
def corner_hz(r,c):
r=bounded(r,'resistance/ohm',1,1e9);c=bounded(c,'capacitance/F',1e-12,1e-3)
return 1/(2*math.pi*r*c)
def response(f_hz,r1=10000.,c1=1e-7,r2=10000.,c2=1e-7,rs=0.,rl=None,input_rms=.1):
"""Return phasor ratios for a 1 V source; powers use declared input_rms.
Source negative, C1 bottom, C2 bottom and optional RL bottom all share G0.
Rs and R1 are in series; A is after R1, B after R2. No probe capacitance.
Domain is deliberately bounded, not a general extreme-value circuit solver.
"""
f_hz=bounded(f_hz,'frequency/Hz',0,1e9)
if 0<f_hz<1e-12:raise ValueError('Nonzero frequency must be at least 1e-12 Hz')
r1=bounded(r1,'R1/ohm',1,1e9);r2=bounded(r2,'R2/ohm',1,1e9)
c1=bounded(c1,'C1/F',1e-12,1e-3);c2=bounded(c2,'C2/F',1e-12,1e-3)
rs=bounded(rs,'source resistance/ohm',0,1e9)
if rl is not None:rl=bounded(rl,'load resistance/ohm',1,1e12)
input_rms=bounded(input_rms,'input RMS/V',1e-6,1)
jw=complex(0,2*math.pi*f_hz);y1=jw*c1;yb=jw*c2+(0 if rl is None else 1/rl)
downstream=1+r2*yb
# Downstream current and both capacitors are retained: no isolated-stage shortcut.
denominator=downstream*(1+(rs+r1)*y1)+(rs+r1)*yb
b=1/denominator;a=downstream*b
i2=yb*b;i1=y1*a+i2
isolated=1/((1+jw*r1*c1)*(1+jw*r2*c2))
scale=input_rms*input_rms
p_rs=abs(i1)**2*rs*scale;p_r1=abs(i1)**2*r1*scale;p_r2=abs(i2)**2*r2*scale
p_rl=0 if rl is None else abs(b)**2/rl*scale
result={'f_hz':f_hz,'a':a,'b':b,'isolated_product':isolated,'input_current_per_v':i1,
'second_current_per_v':i2,'a_magnitude':abs(a),'a_phase_deg':math.degrees(cmath.phase(a)),
'b_real':b.real,'b_imag':b.imag,'b_magnitude':abs(b),
'b_phase_deg':math.degrees(cmath.phase(b)),'b_db':20*math.log10(abs(b)),
'isolated_magnitude':abs(isolated),'isolated_phase_deg':math.degrees(cmath.phase(isolated)),
'input_rms_v':input_rms,'source_real_power_w':i1.real*scale,'rs_power_w':p_rs,
'r1_power_w':p_r1,'r2_power_w':p_r2,'load_power_w':p_rl,
'resistor_sum_power_w':math.fsum([p_rs,p_r1,p_r2,p_rl]),'scope':SCOPE}
for value in result.values():
if isinstance(value,(float,complex)):
if not (math.isfinite(value.real) and math.isfinite(value.imag)):
raise ValueError('Nonfinite calculated result')
return result
def matched_half_power_hz(r=10000.,c=1e-7,k=1.):
"""Nominal unity-DC half-power point only: Rs0, RLopen, R2=kR, C2=C/k."""
k=bounded(k,'impedance ratio k',1e-6,1e6)
response(0,r,c,r*k,c/k)
a=2+1/k;coefficient=a*a-2
u=2/(coefficient+math.sqrt(coefficient*coefficient+4))
f=corner_hz(r,c)*math.sqrt(u)
response(f,r,c,r*k,c/k)
return f
def sweep(start_hz=1.,stop_hz=100000.,points=101,**settings):
start_hz=bounded(start_hz,'sweep start/Hz',1e-12,1e9)
stop_hz=bounded(stop_hz,'sweep stop/Hz',1e-12,1e9)
if start_hz>=stop_hz:raise ValueError('Sweep start must precede stop')
if isinstance(points,bool) or not isinstance(points,int) or not 2<=points<=1001:
raise ValueError('Sweep requires an integer from 2 through 1001 points')
log_start=math.log10(start_hz);log_stop=math.log10(stop_hz)
frequencies=[10**(log_start+(log_stop-log_start)*i/(points-1))for i in range(points)]
frequencies[0]=start_hz;frequencies[-1]=stop_hz
if any(a>=b for a,b in zip(frequencies,frequencies[1:])):
raise ValueError('Requested logarithmic grid is not representable as strictly increasing')
return [response(f,**settings)for f in frequencies]
def write_csv(stream,rows):
writer=csv.DictWriter(stream,fieldnames=FIELDS,lineterminator='\n',extrasaction='ignore')
writer.writeheader();writer.writerows(rows)
def complex_json(value):
if isinstance(value,complex):return {'real':value.real,'imag':value.imag}
raise TypeError('Unsupported JSON value')
def add_settings(parser):
for name,default in [('r1-ohm','10000'),('c1-f','1e-7'),('r2-ohm','10000'),('c2-f','1e-7'),('source-ohm','0'),('load-ohm','open'),('input-rms-v','0.1')]:
parser.add_argument('--'+name,default=default)
def main():
parser=argparse.ArgumentParser(description=__doc__);sub=parser.add_subparsers(dest='command',required=True)
point=sub.add_parser('point',help='one ideal steady-state response');add_settings(point)
point.add_argument('--frequency-hz',default=str(corner_hz(10000,1e-7)))
scan=sub.add_parser('sweep',help='CSV sweep to standard output');add_settings(scan)
scan.add_argument('--start-hz',default='1');scan.add_argument('--stop-hz',default='100000');scan.add_argument('--points',type=int,default=101)
demo=sub.add_parser('demo',help='write two calculated files in a NEW directory');demo.add_argument('output_directory',type=Path)
args=parser.parse_args()
try:
if args.command=='demo':
f0=corner_hz(10000,1e-7);rows=[];cases=[]
for k in [1,10,100]:
for r in sweep(f0/100,f0*100,161,r2=10000*k,c2=1e-7/k):
rows.append(dict(r,k=k))
for ratio in [.5,1,2]:
cases.append(dict(response(f0*ratio,r2=10000*k,c2=1e-7/k),k=k,f_over_f0=ratio,half_power_hz=matched_half_power_hz(k=k)))
args.output_directory.mkdir(parents=True,exist_ok=False)
for name,values,extra in [('calculated-sweep.csv',rows,['k']),('calculated-checkpoints.csv',cases,['k','f_over_f0','half_power_hz'])]:
with (args.output_directory/name).open('x',newline='')as stream:
writer=csv.DictWriter(stream,fieldnames=extra+FIELDS,lineterminator='\n',extrasaction='ignore');writer.writeheader();writer.writerows(values)
print('Wrote two calculated, noiseless ideal-network CSV files; no physical observations.');return 0
settings={'r1':literal(args.r1_ohm),'c1':literal(args.c1_f),'r2':literal(args.r2_ohm),'c2':literal(args.c2_f),
'rs':literal(args.source_ohm),'rl':None if args.load_ohm=='open'else literal(args.load_ohm),'input_rms':literal(args.input_rms_v)}
if args.command=='point':
print(json.dumps(response(literal(args.frequency_hz),**settings),default=complex_json,indent=2,allow_nan=False))
else:write_csv(sys.stdout,sweep(literal(args.start_hz),literal(args.stop_hz),args.points,**settings))
except (ValueError,OSError,OverflowError,ZeroDivisionError)as exc:
parser.exit(2,'Calculation refused: '+str(exc)+'\n')
return 0
if __name__=='__main__':raise SystemExit(main())
In the ideal matched-time-constant, zero-source-resistance, open-output case, require the magnitude at f0 to be no more than 1% below the isolated product’s 1/2. What minimum k is needed? Does meeting that one condition establish agreement at every frequency or with a meter attached?
The ratio of the connected magnitude to 1/2 is 2/(2 + 1/k) = 2k/(2k + 1). Its relative deficit is 1/(2k + 1). Requiring this to be at most 0.01 gives k ≥ 49.5. With R1 = 10 kΩ and C1 = 100 nF, that boundary uses R2 = 495 kΩ and C2 ≈ 2.020202 nF. This is a nominal mathematical boundary at f0, not a component-tolerance design or a guarantee for the full response. A finite meter load changes the premise.
The host suite checks exact complex corner values, both node current laws, a separate matrix solution, general component values, source/load changes, RMS power scaling and real-power balance, off-corner phase, half-power crossings, the increasing impedance-ratio limit, domain boundaries and actual CLI errors. It also checks that unrepresentable sweep grids are refused. A temporary mutation that removes the interstage-loading term must fail the same delivered tests. These checks validate the numerical implementation within its stated scope, not physical component performance.
Start with reader contents and reproduction instructions. SVG originals are editable text drawings; PNG copies are the displayed raster images. They are original functional figures generated from the delivered ideal calculations. Further basics are available in Learn and Circuitpedia.
Primary references: Analog Devices, Activity: Cascaded RC Low Pass Filters—ADALM2000, especially Background and its tenfold scaling control; and P. Fischer, Heidelberg, Higher Order Filters, pages 5–7, exact connected equations and impedance scaling. The lesson uses its own implementation and figures; no source illustration is redistributed in the reader.