skrf.media.media.Media.random

Media.random(n_ports=1, reciprocal=False, matched=False, symmetric=False, rng=None, **kwargs)[source]

Complex random network.

Creates a n-port network whose s-matrix is filled with random complex numbers. Optionally, result can be matched or reciprocal.

Parameters:
  • n_ports (int) – number of ports.

  • reciprocal (bool) – makes s-matrix symmetric ($S_{mn} = S_{nm}$)

  • symmetric (bool) – makes s-matrix diagonal have single value ($S_{mm}=S_{nn}$)

  • matched (bool) – makes diagonals of s-matrix zero

  • rng (numpy.random.Generator or None) – override the global numpy random number generator, useful for multi-threaded programs since skrf.mathFunctions.set_rand_rng() is not thread-safe.

  • **kwargs (passed to Network) – initializer

Returns:

result – the network

Return type:

Network object