kicad2ems.core.deembed

De-embedding (R-E1): a port's reference plane moved along its own trace, or a
fixture removed, from any solver's S.

    --deembed P1=2.5           P1's reference 2.5 mm further in along its trace
                               (the line model's sections from the port: their
                               Z0, eeff, the mode's tan d and, with --sigma, the
                               copper's loss); a negative length moves it out,
                               the line continued as its first section
    --deembed-file P1=fix.s2p  a measured or simulated fixture removed at P1
                               (its port 1 at P1, its port 2 the device's side)

Each is a 2-port F at the port; the device's S is S with F's inverse connected
there (the inverse of a line is the same line of minus its length).
<name>_<solver>_deembedded.sNp is written beside the solver's own, which stands.
Single-ended ports only: a differential pair's legs are mixed into modes before
this step.
kicad2ems.core.deembed.abcd_to_s(T, z0)[source]
S (nf, 2, 2) of ABCD T in a reference z0 at both ports.
kicad2ems.core.deembed.apply(S, names, zref, f, lines=None, files=None, lm=None, sigma=None)[source]
S with each port's reference moved (lines {port: mm}) and its fixture
removed (files {port: Touchstone}). Returns (S, what was done: [str]).
kicad2ems.core.deembed.connect(S, k, G)[source]
S (nf, n, n) with 2-port G (nf, 2, 2) connected at port k: G's port 2 to
S's port k, G's port 1 the new port k (one reference impedance
throughout).
kicad2ems.core.deembed.line_abcd(z0, eeff, length_m, f, tand=0.0, r_per_m=None)[source]
ABCD (nf, 2, 2) of a line of characteristic impedance z0 (ohm, lossless),
eeff and loss: R per metre (an array over f, or None) and the mode's tan
d.
kicad2ems.core.deembed.path_abcd(lm, port, length_mm, f, sigma=None, sheet=True)[source]
ABCD of the first `length_mm` of the port's trace in the line model,
section by section (the last in part); a negative length: the first section
continued outwards (its inverse). ValueError where the path is shorter.