Invntr
Source

All instruments

filter_design

Passive LC ladder filter synthesis: Butterworth or Chebyshev, low-pass, high-pass or band-pass of order n for a cutoff and impedance. Prototype g values from the closed forms, inductors and capacitors, load resistance, attenuation at a stop frequency and the order a stop requirement needs. The response is computed from the finished ladder as a circuit (ABCD chain between the terminations) and compared with the closed form; response and element csv.

Field
Waves, optics and circuits
Version
0.1.0
Runs as
Compiled (Rust)
Typical run
0.05 s

Compiled from source: run sh packs/install.sh once before admitting it.

Known answers it must pass

Admission replayfilter_design 0.1.0 · files 2266710d17f1…5b68
  1. r0001Butterworth n=3 low-pass, 1 MHz, 50 ohm: g = 2 sin((2k-1) pi/(2n)) = 1, 2, 1; C = g/(2 pi fc R), L = g R/(2 pi fc); 10 log10(2) = 3.0103 dB at cutoff read off the ladder (closed forms, 1e-9)passed

    g.0{"value": 1.0, "rel_tol": 1e-09}
    g.1{"value": 2.0, "rel_tol": 1e-09}
    g.2{"value": 1.0, "rel_tol": 1e-09}
    elements.0.C_F{"value": 3.183098861837907e-09, "rel_tol": 1e-09}
    elements.1.L_H{"value": 1.5915494309189534e-05, "rel_tol": 1e-09}
    elements.2.C_F{"value": 3.183098861837907e-09, "rel_tol": 1e-09}
    load_ohm50 ± 5e-1150lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 1e-093.0103lockedunder 0.01 % of the tolerance used
    half_power_high_Hz1e+06 ± 0.0011e+06lockedunder 0.01 % of the tolerance used
  2. r0002Butterworth n=5: g = 0.618034, 1.618034, 2, 1.618034, 0.618034 (golden ratio, (sqrt5 -+ 1)/2); ladder at 2 fc gives 10 log10(1 + 2^10) = 30.107239 dB (closed forms, 1e-9)passed

    g.0{"value": 0.6180339887498949, "rel_tol": 1e-09}
    g.1{"value": 1.618033988749895, "rel_tol": 1e-09}
    g.2{"value": 2.0, "rel_tol": 1e-09}
    g.3{"value": 1.618033988749895, "rel_tol": 1e-09}
    g.4{"value": 0.6180339887498949, "rel_tol": 1e-09}
    stop_attenuation_dB30.1072 ± 3e-0830.1072lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 1e-093.0103lockedunder 0.01 % of the tolerance used
  3. r0003Pozar, Microwave Engineering, maximally flat low-pass example: 2 GHz, 50 ohm, at least 15 dB at 3 GHz -> N = 5, C1 = 0.984 pF, L2 = 6.438 nH, C3 = 3.183 pF (tolerance: half the last printed digit); 10 log10(1 + 1.5^10) = 17.6838 dBpassed

    order_needed= 55lockedexact match
    meets_stop= truetruelockedexact match
    elements.0.C_F{"value": 9.84e-13, "abs_tol": 5e-16}
    elements.1.L_H{"value": 6.438e-09, "abs_tol": 5e-13}
    elements.2.C_F{"value": 3.183e-12, "abs_tol": 5e-16}
    elements.3.L_H{"value": 6.438e-09, "abs_tol": 5e-13}
    elements.4.C_F{"value": 9.84e-13, "abs_tol": 5e-16}
    stop_attenuation_dB17.6838 ± 1.8e-0817.6838lockedunder 0.01 % of the tolerance used
  4. r0004Butterworth n=3 high-pass T, 1 kHz, 50 ohm: C = 1/(g R 2 pi fc), L = R/(g 2 pi fc); ladder at fc/2 gives 10 log10(1 + 2^6) = 18.129134 dB; 3.0103 dB at cutoff (closed forms, 1e-9)passed

    elements.0.C_F{"value": 3.183098861837907e-06, "rel_tol": 1e-09}
    elements.1.L_H{"value": 0.0039788735772973835, "rel_tol": 1e-09}
    elements.2.C_F{"value": 3.183098861837907e-06, "rel_tol": 1e-09}
    stop_attenuation_dB18.1291 ± 1.8e-0818.1291lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 1e-093.0103lockedunder 0.01 % of the tolerance used
  5. r0005Chebyshev 0.5 dB n=3: g = 1.5963, 1.0967, 1.5963 (Matthaei-Young-Jones table 4.05-2, also Pozar table 8.4; 4 printed decimals, tolerance 6e-5); ladder ripple at the passband edge = 0.5 dB; at 2 fc 10 log10(1 + eps^2 T3(2)^2), T3(2) = 26 -> 19.216057 dB; half-power at fc cosh(acosh(1/eps)/3)passed

    g.0{"value": 1.5963, "abs_tol": 6e-05}
    g.1{"value": 1.0967, "abs_tol": 6e-05}
    g.2{"value": 1.5963, "abs_tol": 6e-05}
    g_load1 ± 1e-121lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB0.5 ± 1e-090.5lockedunder 0.01 % of the tolerance used
    stop_attenuation_dB19.2161 ± 1.9e-0819.2161lockedunder 0.01 % of the tolerance used
    half_power_high_Hz1.16749e+06 ± 0.00121.16749e+06lockedunder 0.01 % of the tolerance used
    passband_return_loss_min_dB9.63574 ± 9.6e-099.63574lockedunder 0.01 % of the tolerance used
  6. r0006Chebyshev n=1: g1 = 2 eps = 2 sqrt(10^(0.5/10) - 1) = 0.698623 exactly (closed form, 1e-9); ripple 0.5 dB at the edgepassed

    g.0{"value": 0.6986228003778959, "rel_tol": 1e-09}
    edge_attenuation_dB0.5 ± 1e-090.5lockedunder 0.01 % of the tolerance used
  7. r0007Chebyshev 0.5 dB n=2 (even order, unequal terminations): g = 1.4029, 0.7071, load 1.9841 (Matthaei-Young-Jones table 4.05-2 / Pozar table 8.4, 4 decimals); ladder ripple 0.5 dB at the edge; at 3 fc 10 log10(1 + eps^2 T2(3)^2), T2(3) = 17 -> 15.594677 dBpassed

    g.0{"value": 1.4029, "abs_tol": 6e-05}
    g.1{"value": 0.7071, "abs_tol": 6e-05}
    g_load1.9841 ± 6e-051.98406locked74 % of the tolerance used
    edge_attenuation_dB0.5 ± 1e-090.5lockedunder 0.01 % of the tolerance used
    stop_attenuation_dB15.5947 ± 1.6e-0815.5947lockedunder 0.01 % of the tolerance used
  8. r0008Pozar, Microwave Engineering, band-pass example: 0.5 dB equal ripple, N = 3, 1 GHz centre, 10 % bandwidth, 50 ohm -> L1 = 127.0 nH, C1 = 0.199 pF, L2 = 0.726 nH, C2 = 34.91 pF (tolerance: half the last printed digit); ladder ripple 0.5 dB at both band edges; every resonator at 1 GHzpassed

    elements.0.L_H{"value": 1.27e-07, "abs_tol": 5e-11}
    elements.0.C_F{"value": 1.99e-13, "abs_tol": 5e-16}
    elements.1.L_H{"value": 7.26e-10, "abs_tol": 5e-13}
    elements.1.C_F{"value": 3.491e-11, "abs_tol": 5e-15}
    elements.2.L_H{"value": 1.27e-07, "abs_tol": 5e-11}
    elements.0.resonance_Hz{"value": 1000000000.0, "rel_tol": 1e-09}
    elements.1.resonance_Hz{"value": 1000000000.0, "rel_tol": 1e-09}
    edge_attenuation_dB0.5 ± 1e-080.5lockedunder 0.01 % of the tolerance used
    edge_low_attenuation_dB0.5 ± 1e-080.5lockedunder 0.01 % of the tolerance used
    fractional_bandwidth0.1 ± 1e-100.1lockedunder 0.01 % of the tolerance used
  9. r0009Butterworth n=3 band-pass 9-11 MHz, 50 ohm: shunt C1 = g/(2 pi bw R), series L2 = g R/(2 pi bw), each resonant at sqrt(f1 f2); 3.0103 dB at both edges; at 12 MHz w = (f^2 - f1 f2)/(f bw) = 1.875 -> 10 log10(1 + 1.875^6) = 16.478892 dB (closed forms; 1e-8 because L - 1/C nearly cancel in band)passed

    elements.0.C_F{"value": 1.5915494309189535e-09, "rel_tol": 1e-09}
    elements.0.L_H{"value": 1.6076256877969226e-07, "rel_tol": 1e-09}
    elements.1.L_H{"value": 7.957747154594767e-06, "rel_tol": 1e-09}
    elements.1.C_F{"value": 3.215251375593845e-11, "rel_tol": 1e-09}
    center_Hz9.94987e+06 ± 0.00999.94987e+06lockedunder 0.01 % of the tolerance used
    stop_normalised1.875 ± 1.9e-091.875lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 1e-083.0103lockedunder 0.01 % of the tolerance used
    edge_low_attenuation_dB3.0103 ± 1e-083.0103lockedunder 0.01 % of the tolerance used
    stop_attenuation_dB16.4789 ± 1.6e-0716.4789lockedunder 0.01 % of the tolerance used
9 of 9 cases passed · sandbox macos-seatbeltrecorded from the kernel in a fresh lab

Each line is one reading the kernel checked. The bright band is the tolerance; the needle is the value the instrument actually returned when it was admitted. A needle near the centre line used little of its tolerance.

Inputs

NameUnitDefaultMeaning
familybutterworthButterworth (maximally flat, cutoff at -3.01 dB) or Chebyshev (equal ripple, cutoff at the ripple edge).
responselowpass
order13Number of reactive elements (low/high-pass) or resonators (band-pass).
cutoff_HzHz1000000.0Passband edge of a low-pass or high-pass. Not used for a band-pass.
band_low_HzHzBand-pass: lower passband edge (with band_high_Hz).
band_high_HzHzBand-pass: upper passband edge (with band_low_Hz).
center_HzHzBand-pass, instead of the two edges: centre frequency, the geometric mean of the edges (with bandwidth_Hz).
bandwidth_HzHzBand-pass, with center_Hz: upper edge minus lower edge.
impedance_ohmohm50.0Source resistance. The load is the same except for an even-order Chebyshev (see load_ohm).
ripple_dB0.5Chebyshev passband ripple. Ignored for Butterworth.
first_elementshuntshunt: pi ladder (low-pass starts with a capacitor to ground). series: T ladder (low-pass starts with an inductor).
stop_HzHzOptional: a frequency to read the attenuation at.
stop_attenuation_min_dBOptional, with stop_Hz: the attenuation wanted there. Gives meets_stop and order_needed.
points1201Rows of response.csv, log spaced.
sweep_min_HzHzOptional: start of the response sweep (default a decade below the cutoff).
sweep_max_HzHzOptional: end of the response sweep (default a decade above the cutoff).

Readings

NameUnitMeaning
order1
g1Prototype values g_1..g_n (1 ohm, 1 rad/s).
g_load1g_(n+1): 1, or coth^2(beta/4) for an even-order Chebyshev.
ripple_dB
source_ohmohm
load_ohmohm
elementsThe ladder, source side first: name, branch (series or shunt), type, g, L_H, C_F, resonance_Hz, value as text.
cutoff_HzHz
band_low_HzHz
band_high_HzHz
center_HzHz
fractional_bandwidth1
edge_attenuation_dBAttenuation of the ladder as built at the cutoff (band-pass: at the upper edge).
edge_low_attenuation_dBBand-pass: the same at the lower edge.
half_power_low_HzHz
half_power_high_HzHz
passband_return_loss_min_dBChebyshev: worst passband return loss, -10 log10(1 - 10^(-ripple/10)).
stop_HzHz
stop_normalised1The low-pass prototype frequency stop_Hz maps to.
stop_attenuation_dBAttenuation of the ladder as built at stop_Hz (circuit analysis).
stop_attenuation_formula_dBThe closed form at stop_Hz: 10 log10(1 + w^2n), or 10 log10(1 + eps^2 Tn(w)^2).
stop_attenuation_min_dB
meets_stoptrue when the attenuation at stop_Hz reaches stop_attenuation_min_dB.
order_needed1Smallest order whose closed-form attenuation at stop_Hz reaches the requirement.
synthesis_error_dBLargest gap between the ladder's response and the closed form over the sweep and the band edges.
points_compared1
sweep_min_HzHz
sweep_max_HzHz
all_oktrue when the ladder reproduces the closed form within 1e-6 dB and any stop requirement is met.
warnings
notes
filesout/response.csv (f_Hz, attenuation_dB, formula_dB, return_loss_dB, phase_deg), out/elements.csv

Try the call

Change a value and the command updates. Nothing runs here; paste it into your terminal or give it to your agent.

Terminal
MCP call