skrf.network.fix_z0_shape

skrf.network.fix_z0_shape(z0, nfreqs, nports)[source]

Make a port impedance of correct shape for a given network’s matrix

This attempts to broadcast z0 to satisfy
npy.shape(z0) == (nfreqs,nports)
Parameters:
  • z0 (number, array-like) – z0 can be: * a number (same at all ports and frequencies) * an array-like of length == number ports. * an array-like of length == number frequency points. * the correct shape ==(nfreqs,nports)
  • nfreqs (int) – number of frequency points
  • nports (int) – number of ports
Returns:

z0 – z0 with the right shape for a nport Network

Return type:

array of shape ==(nfreqs,nports)

Examples

For a two-port network with 201 frequency points, possible uses may be

>>> z0 = rf.fix_z0_shape(50 , 201,2)
>>> z0 = rf.fix_z0_shape([50,25] , 201,2)
>>> z0 = rf.fix_z0_shape(range(201) , 201,2)