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 Ω: g = 2 sin((2k-1) π/(2n)) = 1, 2, 1; C = g/(2 π fc R), L = g R/(2 π fc); 10 log10(2) = 3.0103 dB at cutoff read off the ladder (closed forms, 10⁻⁹)passed

    g.0= 1, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    g.1= 2, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    g.2= 1, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.0.C_F= 3.183099 × 10⁻⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.1.L_H= 1.591549 × 10⁻⁵, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.2.C_F= 3.183099 × 10⁻⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    load_ohm50 ± 5 × 10⁻¹¹50lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 10⁻⁹3.0103lockedunder 0.01 % of the tolerance used
    half_power_high_Hz10⁶ ± 0.00110⁶lockedunder 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¹⁰) = 30.107239 dB (closed forms, 10⁻⁹)passed

    g.0= 0.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    g.1= 1.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    g.2= 2, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    g.3= 1.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    g.4= 0.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    stop_attenuation_dB30.1072 ± 3 × 10⁻⁸30.1072lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 10⁻⁹3.0103lockedunder 0.01 % of the tolerance used
  3. r0003Pozar, Microwave Engineering, maximally flat low-pass example: 2 GHz, 50 Ω, at least 15 dB at 3 GHz → N = 5, C₁ = 0.984 pF, L₂ = 6.438 nH, C₃ = 3.183 pF (tolerance: half the last printed digit); 10 log10(1 + 1.5¹⁰) = 17.6838 dBpassed

    order_needed= 55lockedexact match
    meets_stop= truetruelockedexact match
    elements.0.C_F= 9.840000 × 10⁻¹³, within 5.000000 × 10⁻¹⁶reading not recorded on this page
    elements.1.L_H= 6.438000 × 10⁻⁹, within 5.000000 × 10⁻¹³reading not recorded on this page
    elements.2.C_F= 3.183000 × 10⁻¹², within 5.000000 × 10⁻¹⁶reading not recorded on this page
    elements.3.L_H= 6.438000 × 10⁻⁹, within 5.000000 × 10⁻¹³reading not recorded on this page
    elements.4.C_F= 9.840000 × 10⁻¹³, within 5.000000 × 10⁻¹⁶reading not recorded on this page
    stop_attenuation_dB17.6838 ± 1.8 × 10⁻⁸17.6838lockedunder 0.01 % of the tolerance used
  4. r0004Butterworth n=3 high-pass T, 1 kHz, 50 Ω: C = 1/(g R 2 π fc), L = R/(g 2 π fc); ladder at fc/2 gives 10 log10(1 + 2⁶) = 18.129134 dB; 3.0103 dB at cutoff (closed forms, 10⁻⁹)passed

    elements.0.C_F= 3.183099 × 10⁻⁶, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.1.L_H= 0.003979, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.2.C_F= 3.183099 × 10⁻⁶, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    stop_attenuation_dB18.1291 ± 1.8 × 10⁻⁸18.1291lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 10⁻⁹3.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 6 × 10⁻⁵); ladder ripple at the passband edge = 0.5 dB; at 2 fc 10 log10(1 + eps² T₃(2)²), T₃(2) = 26 → 19.216057 dB; half-power at fc cosh(acosh(1/eps)/3)passed

    g.0= 1.5963, within 6.000000 × 10⁻⁵reading not recorded on this page
    g.1= 1.0967, within 6.000000 × 10⁻⁵reading not recorded on this page
    g.2= 1.5963, within 6.000000 × 10⁻⁵reading not recorded on this page
    g_load1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB0.5 ± 10⁻⁹0.5lockedunder 0.01 % of the tolerance used
    stop_attenuation_dB19.2161 ± 1.9 × 10⁻⁸19.2161lockedunder 0.01 % of the tolerance used
    half_power_high_Hz1.16749 × 10⁶ ± 0.00121.16749 × 10⁶lockedunder 0.01 % of the tolerance used
    passband_return_loss_min_dB9.63574 ± 9.6 × 10⁻⁹9.63574lockedunder 0.01 % of the tolerance used
  6. r0006Chebyshev n=1: g₁ = 2 eps = 2 √(10^(0.5/10) - 1) = 0.698623 exactly (closed form, 10⁻⁹); ripple 0.5 dB at the edgepassed

    g.0= 0.698623, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    edge_attenuation_dB0.5 ± 10⁻⁹0.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² T₂(3)²), T₂(3) = 17 → 15.594677 dBpassed

    g.0= 1.4029, within 6.000000 × 10⁻⁵reading not recorded on this page
    g.1= 0.7071, within 6.000000 × 10⁻⁵reading not recorded on this page
    g_load1.9841 ± 6 × 10⁻⁵1.98406locked74 % of the tolerance used
    edge_attenuation_dB0.5 ± 10⁻⁹0.5lockedunder 0.01 % of the tolerance used
    stop_attenuation_dB15.5947 ± 1.6 × 10⁻⁸15.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 Ω → L₁ = 127.0 nH, C₁ = 0.199 pF, L₂ = 0.726 nH, C₂ = 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= 1.270000 × 10⁻⁷, within 5.000000 × 10⁻¹¹reading not recorded on this page
    elements.0.C_F= 1.990000 × 10⁻¹³, within 5.000000 × 10⁻¹⁶reading not recorded on this page
    elements.1.L_H= 7.260000 × 10⁻¹⁰, within 5.000000 × 10⁻¹³reading not recorded on this page
    elements.1.C_F= 3.491000 × 10⁻¹¹, within 5.000000 × 10⁻¹⁵reading not recorded on this page
    elements.2.L_H= 1.270000 × 10⁻⁷, within 5.000000 × 10⁻¹¹reading not recorded on this page
    elements.0.resonance_Hz= 1.000000 × 10⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.1.resonance_Hz= 1.000000 × 10⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    edge_attenuation_dB0.5 ± 10⁻⁸0.5lockedunder 0.01 % of the tolerance used
    edge_low_attenuation_dB0.5 ± 10⁻⁸0.5lockedunder 0.01 % of the tolerance used
    fractional_bandwidth0.1 ± 10⁻¹⁰0.1lockedunder 0.01 % of the tolerance used
  9. r0009Butterworth n=3 band-pass 9-11 MHz, 50 Ω: shunt C₁ = g/(2 π bw R), series L₂ = g R/(2 π bw), each resonant at √(f₁ f₂); 3.0103 dB at both edges; at 12 MHz w = (f² - f₁ f₂)/(f bw) = 1.875 → 10 log10(1 + 1.875⁶) = 16.478892 dB (closed forms; 10⁻⁸ because L - 1/C nearly cancel in band)passed

    elements.0.C_F= 1.591549 × 10⁻⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.0.L_H= 1.607626 × 10⁻⁷, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.1.L_H= 7.957747 × 10⁻⁶, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    elements.1.C_F= 3.215251 × 10⁻¹¹, within 1.000000 × 10⁻⁹ relativereading not recorded on this page
    center_Hz9.94987 × 10⁶ ± 0.00999.94987 × 10⁶lockedunder 0.01 % of the tolerance used
    stop_normalised1.875 ± 1.9 × 10⁻⁹1.875lockedunder 0.01 % of the tolerance used
    edge_attenuation_dB3.0103 ± 10⁻⁸3.0103lockedunder 0.01 % of the tolerance used
    edge_low_attenuation_dB3.0103 ± 10⁻⁸3.0103lockedunder 0.01 % of the tolerance used
    stop_attenuation_dB16.4789 ± 1.6 × 10⁻⁷16.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: π 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 Ω, 1 rad/s).
g_load1g_(n+1): 1, or coth²(β/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²n), or 10 log10(1 + eps² Tn(w)²).
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 10⁻⁶ 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