, k: int, ntwkB:, l: int, num: int = 1) →[source]

connect two n-port networks together.

specifically, connect ports k thru k+num-1 on ntwkA to ports l thru l+num-1 on ntwkB. The resultant network has (ntwkA.nports+ntwkB.nports-2*num) ports. The port indices (‘k’,’l’) start from 0. Port impedances are taken into account. When the two networks have overlapping frequencies, the resulting network will contain only the overlapping frequencies.

  • ntwkA (Network) – network ‘A’
  • k (int) – starting port index on ntwkA ( port indices start from 0 )
  • ntwkB (Network) – network ‘B’
  • l (int) – starting port index on ntwkB
  • num (int) – number of consecutive ports to connect (default 1)

ntwkC – new network of rank (ntwkA.nports + ntwkB.nports - 2*num)

Return type:


See also

actual S-parameter connection algorithm.
actual S-parameter connection algorithm.


the effect of mis-matched port impedances is handled by inserting a 2-port ‘mismatch’ network between the two connected ports. This mismatch Network is calculated with the impedance_mismatch() function.


To implement a cascade of two networks

>>> ntwkA = rf.Network('ntwkA.s2p')
>>> ntwkB = rf.Network('ntwkB.s2p')
>>> ntwkC = rf.connect(ntwkA, 1, ntwkB,0)