kicad2ems.pcbqs.pdn.models¶
A part's impedance from a file (R-E14): a vendor's capacitor model (a .s2p
measured through it, or a .s1p / .z1p), or a regulator's output impedance, as
the PDN's elements take it (cavity.element_z: el['Zf'] = (f, Z)).
f, Z = read_impedance('grm155.s2p') # a 2-port: shunt- or series-through,
# told by its |S21|
f, Z = read_impedance('vrm.csv') # f, Re, Im (or f, |Z|, deg with a
# header saying deg)
Z_at = table_z(f, Z, f_sweep) # interpolated in log f; beyond the
# table, its ends held
S, z0 = to_s(Z, z0) # (the port matrix's subcircuit: spice_subcircuit)
- kicad2ems.pcbqs.pdn.models.coverage_note(name, ft, f)[source]¶
A note where the sweep reaches past a file's band (its ends are held there), else None.
- kicad2ems.pcbqs.pdn.models.read_impedance(path, mode='auto')[source]¶
(f Hz, Z) of a part from a file: a Touchstone 1-port (S, Z or Y), a 2-port measured through it (two_port_z), or a CSV of f, Re, Im (or f, |Z|, deg when its header says deg or phase). Also the 2-port's mode ('' else).
- kicad2ems.pcbqs.pdn.models.spice_subcircuit(path, f, Z, names, z0=1.0, name='pdn_ports', log=<built-in function print>)[source]¶
A SPICE subcircuit of the impedance matrices Z (nf, n, n): vector fitted (scikit-rf), made passive where it was not, written to path (its pins: the ports in order, each against the reference). Returns dict(poles, rms error, passive). z0: the fit's reference (an ohm: PDN impedances are milliohms to ohms).
- kicad2ems.pcbqs.pdn.models.table_z(ft, Zt, f)[source]¶
Zt (at ft Hz) at f: real and imaginary parts interpolated in log f, the table's ends held beyond it.
- kicad2ems.pcbqs.pdn.models.two_port_z(S, z0, mode='auto')[source]¶
A part's impedance from a 2-port measured through it: 'shunt' (the part from the line to ground: Z = z0 S21 / (2 (1 - S21))), 'series' (in the line: Z = 2 z0 (1 - S21) / S21), 'auto' (shunt where |S21| is mostly under 0.5, as a decap's is shunt-through and near 1 in series). Returns (Z, the mode taken).