Generate SPICE file from rationalfit of S-parameters
Read a file named
passive.s2p and fit the 2-by-2 S-parameters. Generate a SPICE file of these S-parameters.
S = sparameters('passive.s2p'); fit = rationalfit(S); generateSPICE(fit,'passive.ckt')
The circuit is saved in your current folder.
fit— Rationalfit of S-parameters
Rationalfit of S-parameters, specified as an
N-by-N array of
rfmodel.rational objects as returned by the
rationalfit with S-parameters as input.
filename— Name of file for SPICE subcircuit
Name of file in which to store the SPICE subcircuit, specified as a string or a character vector. The SPICE subcircuit is constructed out of passive resistor (R) and capacitor (C) SPICE elements and controlled-source SPICE elements voltage-controlled voltage source (E), current-controlled current source (F), voltage-controlled current source (G), and current-controlled voltage source (H).
zref— Reference impedance
50(default) | real scalar
Reference impedance, specified as a real scalar in ohms.