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
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 pageg.1= 2, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageg.2= 1, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.0.C_F= 3.183099 × 10⁻⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.1.L_H= 1.591549 × 10⁻⁵, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.2.C_F= 3.183099 × 10⁻⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageload_ohm50 ± 5 × 10⁻¹¹50lockedunder 0.01 % of the tolerance usededge_attenuation_dB3.0103 ± 10⁻⁹3.0103lockedunder 0.01 % of the tolerance usedhalf_power_high_Hz10⁶ ± 0.00110⁶lockedunder 0.01 % of the tolerance usedr0002Butterworth 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 pageg.1= 1.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageg.2= 2, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageg.3= 1.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageg.4= 0.618034, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagestop_attenuation_dB30.1072 ± 3 × 10⁻⁸30.1072lockedunder 0.01 % of the tolerance usededge_attenuation_dB3.0103 ± 10⁻⁹3.0103lockedunder 0.01 % of the tolerance usedr0003Pozar, 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 matchmeets_stop= truetruelockedexact matchelements.0.C_F= 9.840000 × 10⁻¹³, within 5.000000 × 10⁻¹⁶reading not recorded on this pageelements.1.L_H= 6.438000 × 10⁻⁹, within 5.000000 × 10⁻¹³reading not recorded on this pageelements.2.C_F= 3.183000 × 10⁻¹², within 5.000000 × 10⁻¹⁶reading not recorded on this pageelements.3.L_H= 6.438000 × 10⁻⁹, within 5.000000 × 10⁻¹³reading not recorded on this pageelements.4.C_F= 9.840000 × 10⁻¹³, within 5.000000 × 10⁻¹⁶reading not recorded on this pagestop_attenuation_dB17.6838 ± 1.8 × 10⁻⁸17.6838lockedunder 0.01 % of the tolerance usedr0004Butterworth 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 pageelements.1.L_H= 0.003979, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.2.C_F= 3.183099 × 10⁻⁶, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagestop_attenuation_dB18.1291 ± 1.8 × 10⁻⁸18.1291lockedunder 0.01 % of the tolerance usededge_attenuation_dB3.0103 ± 10⁻⁹3.0103lockedunder 0.01 % of the tolerance usedr0005Chebyshev 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 pageg.1= 1.0967, within 6.000000 × 10⁻⁵reading not recorded on this pageg.2= 1.5963, within 6.000000 × 10⁻⁵reading not recorded on this pageg_load1 ± 10⁻¹²1lockedunder 0.01 % of the tolerance usededge_attenuation_dB0.5 ± 10⁻⁹0.5lockedunder 0.01 % of the tolerance usedstop_attenuation_dB19.2161 ± 1.9 × 10⁻⁸19.2161lockedunder 0.01 % of the tolerance usedhalf_power_high_Hz1.16749 × 10⁶ ± 0.00121.16749 × 10⁶lockedunder 0.01 % of the tolerance usedpassband_return_loss_min_dB9.63574 ± 9.6 × 10⁻⁹9.63574lockedunder 0.01 % of the tolerance usedr0006Chebyshev 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 pageedge_attenuation_dB0.5 ± 10⁻⁹0.5lockedunder 0.01 % of the tolerance usedr0007Chebyshev 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 pageg.1= 0.7071, within 6.000000 × 10⁻⁵reading not recorded on this pageg_load1.9841 ± 6 × 10⁻⁵1.98406locked74 % of the tolerance usededge_attenuation_dB0.5 ± 10⁻⁹0.5lockedunder 0.01 % of the tolerance usedstop_attenuation_dB15.5947 ± 1.6 × 10⁻⁸15.5947lockedunder 0.01 % of the tolerance usedr0008Pozar, 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 pageelements.0.C_F= 1.990000 × 10⁻¹³, within 5.000000 × 10⁻¹⁶reading not recorded on this pageelements.1.L_H= 7.260000 × 10⁻¹⁰, within 5.000000 × 10⁻¹³reading not recorded on this pageelements.1.C_F= 3.491000 × 10⁻¹¹, within 5.000000 × 10⁻¹⁵reading not recorded on this pageelements.2.L_H= 1.270000 × 10⁻⁷, within 5.000000 × 10⁻¹¹reading not recorded on this pageelements.0.resonance_Hz= 1.000000 × 10⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.1.resonance_Hz= 1.000000 × 10⁹, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageedge_attenuation_dB0.5 ± 10⁻⁸0.5lockedunder 0.01 % of the tolerance usededge_low_attenuation_dB0.5 ± 10⁻⁸0.5lockedunder 0.01 % of the tolerance usedfractional_bandwidth0.1 ± 10⁻¹⁰0.1lockedunder 0.01 % of the tolerance usedr0009Butterworth 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 pageelements.0.L_H= 1.607626 × 10⁻⁷, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.1.L_H= 7.957747 × 10⁻⁶, within 1.000000 × 10⁻⁹ relativereading not recorded on this pageelements.1.C_F= 3.215251 × 10⁻¹¹, within 1.000000 × 10⁻⁹ relativereading not recorded on this pagecenter_Hz9.94987 × 10⁶ ± 0.00999.94987 × 10⁶lockedunder 0.01 % of the tolerance usedstop_normalised1.875 ± 1.9 × 10⁻⁹1.875lockedunder 0.01 % of the tolerance usededge_attenuation_dB3.0103 ± 10⁻⁸3.0103lockedunder 0.01 % of the tolerance usededge_low_attenuation_dB3.0103 ± 10⁻⁸3.0103lockedunder 0.01 % of the tolerance usedstop_attenuation_dB16.4789 ± 1.6 × 10⁻⁷16.4789lockedunder 0.01 % of the tolerance used
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
| Name | Unit | Default | Meaning |
|---|---|---|---|
family | butterworth | Butterworth (maximally flat, cutoff at -3.01 dB) or Chebyshev (equal ripple, cutoff at the ripple edge). | |
response | lowpass | ||
order | 1 | 3 | Number of reactive elements (low/high-pass) or resonators (band-pass). |
cutoff_Hz | Hz | 1000000.0 | Passband edge of a low-pass or high-pass. Not used for a band-pass. |
band_low_Hz | Hz | Band-pass: lower passband edge (with band_high_Hz). | |
band_high_Hz | Hz | Band-pass: upper passband edge (with band_low_Hz). | |
center_Hz | Hz | Band-pass, instead of the two edges: centre frequency, the geometric mean of the edges (with bandwidth_Hz). | |
bandwidth_Hz | Hz | Band-pass, with center_Hz: upper edge minus lower edge. | |
impedance_ohm | ohm | 50.0 | Source resistance. The load is the same except for an even-order Chebyshev (see load_ohm). |
ripple_dB | 0.5 | Chebyshev passband ripple. Ignored for Butterworth. | |
first_element | shunt | shunt: π ladder (low-pass starts with a capacitor to ground). series: T ladder (low-pass starts with an inductor). | |
stop_Hz | Hz | Optional: a frequency to read the attenuation at. | |
stop_attenuation_min_dB | Optional, with stop_Hz: the attenuation wanted there. Gives meets_stop and order_needed. | ||
points | 1 | 201 | Rows of response.csv, log spaced. |
sweep_min_Hz | Hz | Optional: start of the response sweep (default a decade below the cutoff). | |
sweep_max_Hz | Hz | Optional: end of the response sweep (default a decade above the cutoff). |
Readings
| Name | Unit | Meaning |
|---|---|---|
order | 1 | |
g | 1 | Prototype values g_1..g_n (1 Ω, 1 rad/s). |
g_load | 1 | g_(n+1): 1, or coth²(β/4) for an even-order Chebyshev. |
ripple_dB | ||
source_ohm | ohm | |
load_ohm | ohm | |
elements | The ladder, source side first: name, branch (series or shunt), type, g, L_H, C_F, resonance_Hz, value as text. | |
cutoff_Hz | Hz | |
band_low_Hz | Hz | |
band_high_Hz | Hz | |
center_Hz | Hz | |
fractional_bandwidth | 1 | |
edge_attenuation_dB | Attenuation of the ladder as built at the cutoff (band-pass: at the upper edge). | |
edge_low_attenuation_dB | Band-pass: the same at the lower edge. | |
half_power_low_Hz | Hz | |
half_power_high_Hz | Hz | |
passband_return_loss_min_dB | Chebyshev: worst passband return loss, -10 log10(1 - 10^(-ripple/10)). | |
stop_Hz | Hz | |
stop_normalised | 1 | The low-pass prototype frequency stop_Hz maps to. |
stop_attenuation_dB | Attenuation of the ladder as built at stop_Hz (circuit analysis). | |
stop_attenuation_formula_dB | The closed form at stop_Hz: 10 log10(1 + w²n), or 10 log10(1 + eps² Tn(w)²). | |
stop_attenuation_min_dB | ||
meets_stop | true when the attenuation at stop_Hz reaches stop_attenuation_min_dB. | |
order_needed | 1 | Smallest order whose closed-form attenuation at stop_Hz reaches the requirement. |
synthesis_error_dB | Largest gap between the ladder's response and the closed form over the sweep and the band edges. | |
points_compared | 1 | |
sweep_min_Hz | Hz | |
sweep_max_Hz | Hz | |
all_ok | true when the ladder reproduces the closed form within 10⁻⁶ dB and any stop requirement is met. | |
warnings | ||
notes | ||
files | out/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.