RF Metrics and Delays

Calculate return loss, insertion loss, VSWR, impedance, group delay, and phase delay from RF network parameters.

Signs and scales

Return loss and insertion loss are −20 log₁₀ of the magnitude of the relevant coefficient. Loss is usually positive for a passive network. For insertion loss, the default destination port is 2 and the default source port is 1. Group delay is −dφ/dω. Phase delay is −φ/ω and requires positive frequencies. Use phase in radians and frequency in Hz, with steps fine enough to unwrap the phase reliably.

Operation reference

Jump to an operation

metric.return_loss

A is S. The one-based port selects Spp. The result is −20 log₁₀|Spp| in dB.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Return loss
gxtxt_api_call("RF_NETWORK_API_v1", "metric.return_loss", args)
Recorded result · metric.return_loss

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 20.0,
  "value_imaginary": 0.0
}

metric.insertion_loss

A is S. The defaults are port=2 and source_port=1. The result is −20 log₁₀|Spq| in dB and requires at least two ports.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Insertion loss
gxtxt_api_call("RF_NETWORK_API_v1", "metric.insertion_loss", args)
Recorded result · metric.insertion_loss

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 4.436974992327127,
  "value_imaginary": 0.0
}

metric.isolation

A is S. The default reads S12. A larger value indicates less reverse transmission in the selected direction.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Isolation
gxtxt_api_call("RF_NETWORK_API_v1", "metric.isolation", args)
Recorded result · metric.isolation

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 4.436974992327127,
  "value_imaginary": 0.0
}

metric.vswr

A is S. The operation takes the port reflection coefficient and calculates (1+|Γ|)/(1−|Γ|). Its supported domain is |Γ|<1.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Voltage standing-wave ratio
gxtxt_api_call("RF_NETWORK_API_v1", "metric.vswr", args)
Recorded result · metric.vswr

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 1.2222222222222223,
  "value_imaginary": 0.0
}

metric.reflection

A is S. The operation returns the complex coefficient Spp. The default is port=1.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Reflection coefficient
gxtxt_api_call("RF_NETWORK_API_v1", "metric.reflection", args)
Recorded result · metric.reflection

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 0.1,
  "value_imaginary": 0.0
}

metric.transmission

A is S. Use port and source_port to extract the complex coefficient Spq. Set both to select the required direction.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Transmission coefficient
gxtxt_api_call("RF_NETWORK_API_v1", "metric.transmission", args)
Recorded result · metric.transmission

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 0.1,
  "value_imaginary": 0.0
}

metric.impedance

A is S and B gives the reference impedance. The operation converts the port reflection coefficient to complex impedance in Ω. At Γ=1 the calculation is singular.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Impedance
gxtxt_api_call("RF_NETWORK_API_v1", "metric.impedance", args)
Recorded result · metric.impedance

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 61.11111111111111,
  "value_imaginary": 0.0
}

metric.admittance

A is S and B gives the reference impedance. The operation returns the reciprocal of the port impedance in siemens and requires Z≠0.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Admittance
gxtxt_api_call("RF_NETWORK_API_v1", "metric.admittance", args)
Recorded result · metric.admittance

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": 0.016363636363636365,
  "value_imaginary": 0.0
}

metric.group_delay

A is the ordered complex response and C is the increasing frequency axis in Hz. The operation unwraps the phase and returns −dφ/d(2πf) in seconds.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Group delay
gxtxt_api_call("RF_NETWORK_API_v1", "metric.group_delay", args)
Recorded result · metric.group_delay:10ns

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      0.4990133642141358,
      0.4974755084906501,
      0.4952307128483256,
      0.49228216726460267,
      0.48863406178409674,
      0.48429158056431554,
      0.4792608945086879,
      0.47354915249737217,
      0.467164471228306,
      0.4601159236829352
    ],
    "imaginary": [
      -0.03139525976465669,
      -0.05018085742560744,
      -0.06889514534231904,
      -0.08751152948763802,
      -0.10600355496102731,
      -0.1243449435824274,
      -0.14250963123498805,
      -0.16047180490360474,
      -0.17820593935662538,
      -0.19568683341860119
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0
    ]
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      9.999999999999999e-09,
      1.0000000000000004e-08,
      1.0000000000000002e-08,
      9.999999999999992e-09,
      1.0000000000000002e-08,
      1.0000000000000002e-08,
      9.999999999999995e-09,
      1.000000000000001e-08,
      1e-08,
      9.999999999999994e-09,
      1.0000000000000005e-08,
      9.999999999999994e-09
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0
    ]
  }
}

metric.phase_delay

A is the complex response and C is the positive frequency in Hz. Phase delay is −φ/(2πf) in seconds.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Phase delay
gxtxt_api_call("RF_NETWORK_API_v1", "metric.phase_delay", args)
Recorded result · metric.phase_delay

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      0.4990133642141358,
      0.4974755084906501,
      0.4952307128483256,
      0.49228216726460267,
      0.48863406178409674,
      0.48429158056431554,
      0.4792608945086879,
      0.47354915249737217,
      0.467164471228306,
      0.4601159236829352
    ],
    "imaginary": [
      -0.03139525976465669,
      -0.05018085742560744,
      -0.06889514534231904,
      -0.08751152948763802,
      -0.10600355496102731,
      -0.1243449435824274,
      -0.14250963123498805,
      -0.16047180490360474,
      -0.17820593935662538,
      -0.19568683341860119
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0
    ]
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1.0000000000000002e-08,
      1e-08,
      1.0000000000000002e-08,
      1e-08,
      9.999999999999999e-09,
      1.0000000000000002e-08,
      1e-08,
      1e-08,
      1.0000000000000002e-08,
      1e-08,
      1e-08,
      1e-08
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0
    ]
  }
}

metric.transducer_gain

A is a two-port S matrix. Specify the source and load reflection coefficients with source_gamma and load_gamma. The operation returns the transducer power gain ratio.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Square matrix or sweep vector (square_matrix_or_sweep_vector)
Units
dB, Ω, S, s
Result
Numerical and diagnostic fields
Purpose
Two-port transducer power gain for specified source and load reflections
gxtxt_api_call("RF_NETWORK_API_v1", "metric.transducer_gain", args)
Recorded result · metric.transducer_gain

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      2,
      2
    ],
    "real": [
      0.1,
      0.6,
      0.6,
      0.2
    ],
    "imaginary": [
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      50
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "struct",
    "fields": {
      "source_gamma": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          0.1
        ]
      },
      "load_gamma": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          0.2
        ]
      }
    }
  }
]

Result preview

{
  "value_real": 0.36,
  "value_imaginary": 0.0
}