QuarterWaveFilterParams#

class simpleEMS.quarterwave_stub_filter.QuarterWaveFilterParams(min_freq: float, max_freq: float, centre_freq: float, bandwidth_freq: float, filter_type: str, filter_response: str, filter_order: int, ripple_db: float | None = None, elec_length_deg: int = 90, via_diameter_mm: float = 0.6, *, substrate_eps_r: float, substrate_tand: float, substrate_thickness_mm: float, substrate_cells: int = 7, unit: float = 0.001, num_points: int = 1000, backend_engine: str = 'FDTD', simulation_box: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None, FEM_num_solve_points: int = 10, FEM_max_solve_points: int | None = None, FEM_boundary: str = 'silver_muller', FEM_symmetry: tuple | None = None, FEM_fe_order: int = 1, FEM_air_pad_frac: float = 0.25, FEM_air_pad_mm: float | tuple | None = None, FEM_elems_per_wavelength: float = 16.0, FEM_mesh_freq: float | None = None, FEM_mesh_fine_scale: float = 1.0, FEM_min_layers: int = 3, FEM_port_type: str = 'lumpedport', FEM_port_mode_modes: int = 6, FEM_port_mode_index: int = 0, FEM_port_mode_zc: float | None = None, FEM_port_mode_eps_eff: float | None = None, FEM_waveport_width_mm: float | None = None, FEM_waveport_height_mm: float | None = None, FDTD_timestep: int = 90000000, FDTD_end_criteria: float = 0.0001, FDTD_mesh_resolution_factor: int = 10, FDTD_metal_mesh_resolution_factor: int = 40, copper_thickness_mm: float = 0.035, min_trace_width_mm: float = 0.1, min_trace_spacing_mm: float = 0.089, fp_precision: int = 3, charac_imp: float = 50)#

Bases: SimParams

Parameters for a quarter-wave stub band-pass or band-stop filter.

Extends SimParams and computes the derived geometric parameters (series line, shunt stub widths and lengths) required to build and simulate a quarter-wave stub filter, using Bessel, Butterworth, or Chebyshev prototype coefficients to size each shunt stub.

Parameters:
  • min_freq (float) – Minimum simulation frequency in Hz.

  • max_freq (float) – Maximum simulation frequency in Hz.

  • centre_freq (float) – Centre frequency of the filter in Hz.

  • bandwidth_freq (float) – Bandwidth in Hz.

  • filter_type (str) – Filter type: "bandpass" or "bandstop".

  • filter_response (str) – Filter response prototype: "bessel", "butterworth", or "chebyshev".

  • filter_order (int) – Order of the filter (number of shunt stubs).

  • ripple_db (float, optional) – Passband ripple in dB, used only for the Chebyshev response. Default is None, which is treated as 0.1 dB.

  • elec_length_deg (int, optional) – Electrical length, in degrees, of the series line section and of each shunt stub. Default is 90 (quarter-wave).

  • via_diameter_mm (float, optional) – Finished outer diameter of the vias that ground each band-pass shunt stub, in millimeters. Must not exceed the narrowest stub; wider stubs get more vias. Ignored for band-stop. Default 0.6.

frac_bandwidth#

Fractional bandwidth (bandwidth_freq / centre_freq).

Type:

float

series_line_width_mm#

Width of the series transmission line in mm.

Type:

float

shunt_line_width_mm#

Widths of each shunt stub in mm.

Type:

list of float

shunt_line_length_mm#

Lengths of each shunt stub in mm.

Type:

list of float

line_length_mm#

Physical length of each series line section in mm.

Type:

float

Raises:

ValueError – If filter_type is not "bandpass" or "bandstop"; if the resulting fractional bandwidth is not in (0, 1]; if the series line or any shunt stub width falls below min_trace_width_mm; if adjacent shunt stubs would overlap; or if a required characteristic impedance cannot be realized on this substrate.

Notes

As a subclass of SimParams, this class also accepts all of SimParams’s keyword-only constructor arguments (e.g. substrate_eps_r, substrate_tand, substrate_thickness_mm, charac_imp); see that class’s docstring for details.

Attributes Summary

Attributes Documentation

FDTD_end_criteria: float = 0.0001#
FDTD_mesh_resolution_factor: int = 10#
FDTD_metal_mesh_resolution_factor: int = 40#
FDTD_timestep: int = 90000000#
FEM_air_pad_frac: float = 0.25#
FEM_air_pad_mm: float | tuple | None = None#
FEM_boundary: str = 'silver_muller'#
FEM_elems_per_wavelength: float = 16.0#
FEM_fe_order: int = 1#
FEM_max_solve_points: int | None = None#
FEM_mesh_fine_scale: float = 1.0#
FEM_mesh_freq: float | None = None#
FEM_min_layers: int = 3#
FEM_num_solve_points: int = 10#
FEM_port_mode_eps_eff: float | None = None#
FEM_port_mode_index: int = 0#
FEM_port_mode_modes: int = 6#
FEM_port_mode_zc: float | None = None#
FEM_port_type: str = 'lumpedport'#
FEM_symmetry: tuple | None = None#
FEM_waveport_height_mm: float | None = None#
FEM_waveport_width_mm: float | None = None#
backend_engine: str = 'FDTD'#
charac_imp: float = 50#
copper_thickness_mm: float = 0.035#
elec_length_deg: int = 90#
fem_options#

Bundle the flat FEM_* fields into a FEMOptions instance.

fp_precision: int = 3#
freq_range#

Return the simulation frequency range.

Returns:

A tuple containing (min_freq, max_freq).

Return type:

tuple of (float, float)

main_freq#

Return the primary frequency of interest for analysis.

Returns:

The centre frequency of the filter.

Return type:

float

min_trace_spacing_mm: float = 0.089#
min_trace_width_mm: float = 0.1#
num_points: int = 1000#
ripple_db: float | None = None#
simulation_bounds#

Return simulation_box as per-axis [min, max] bounds.

A (3,) box of sizes is centred on the origin.

Returns:

Array of shape (3, 2), [[xmin, xmax], [ymin, ymax], [zmin, zmax]] in mm, or None when no simulation box is defined.

Return type:

NDArray or None

simulation_box: ndarray[tuple[Any, ...], dtype[_ScalarT]] | None = None#
substrate_cells: int = 7#
substrate_length_mm#

Return the total substrate length based on filter geometry.

Returns:

Substrate length in mm.

Return type:

float

substrate_width_mm#

Return the substrate width based on filter geometry.

Computed as the series line width plus one line-section length, which approximates the space needed for the series line and a shunt stub extending alongside it.

Returns:

Substrate width in mm.

Return type:

float

unit: float = 0.001#
via_diameter_mm: float = 0.6#