skrf.network.s_error

skrf.network.s_error(ntwkA, ntwkB, error_function='average_l2_norm')[source]

Compute the error between s-parameters of ntwkA and ntwkB.

Parameters:
  • ntwkA (Network object) – The first network.

  • ntwkB (Network object) – A second network used to compute the error with ntwkA

  • error_function (str) – average_l1_norm, average_l2_norm, maximum_l1_norm, or average_normalized_l1_norm.

Returns:

  • error (numpy.ndarray) – The error between ntwkA and ntwkB

  • Description

  • ———–

  • Average L1 Norm. The weighted difference is the average magnitude of the difference between each

  • element of the S-parameter matrix.

  • .. math:: – delta = frac{1}{N^2} sum_{i=1}^{N} sum_{j=1}^{N} |S_{ij}^A - S_{ij}^B|

  • Average L2 Norm. The weighted difference is the average squared magnitude of the difference

  • between each element of the S-parameter matrix.

  • .. math:: – delta = frac{1}{N^2} sum_{i=1}^{N} sum_{j=1}^{N} |S_{ij}^A - S_{ij}^B|^2

  • Maximum L1 Norm. The maximum difference is the magnitude of the maximum difference between each

  • element of the S-parameter matrix (the magnitude of the largest difference between any pair of

  • entries in the S-parameter matrices).

  • .. math:: – delta = max(|S_{ij}^A - S_{ij}^B|)

  • Average Normalized L1 Norm. The magnitude of the difference between each element of the

  • S-parameter matrix is calculated. Each difference is then normalized by the average magnitude of

  • the two matrix elements (one from each set).

  • .. math:: – delta = frac{2}{N^2} sum_{i=1}^{N} sum_{j=1}^{N} frac{|S_{ij}^A - S_{ij}^B|}{|S_{ij}^A| + |S_{ij}^B|}

  • To express these in decibels, use

  • .. math:: – 20log_{10} delta

Return type:

ndarray