RF Frequency Sweeps and Mixed-Mode Conversion

Prepare a frequency sweep, convert each network matrix, and combine four single-ended ports into differential and common modes.

Frequency axis and matrix components

Represent a sweep as an N×P×P array with strictly increasing frequencies in Hz. Preserve the axes, reference impedances, and port order. For four-port mixed-mode conversion, pair ports (1,2) and (3,4) and use the returned ordering to identify differential and common modes. A test with unequal diagonal elements makes the differences between the pairs visible.

Operation reference

Jump to an operation

sweep.describe

A contains increasing frequencies in Hz and B is an N×P×P array. The result reports the shape and frequency-axis checks. Keep the version of the source file for reference.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Frequency vector | N × P × P array (frequency_vector;N_by_P_by_P)
Units
Hz for frequency. Other units depend on the representation.
Result
Numerical and diagnostic fields
Purpose
Frequency sweep description
gxtxt_api_call("RF_NETWORK_API_v1", "sweep.describe", args)
Recorded result · sweep.describe:one-port

Download the example script (ZIP).

Example operands preview

[
  {
    "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
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      1,
      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"
  }
]

Result preview

{
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0,
      7000000.0,
      7600000.0
    ]
  },
  "real": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.4990133642141358,
      0.4974755084906501,
      0.4952307128483256,
      0.49228216726460267,
      0.48863406178409674,
      0.48429158056431554,
      0.4792608945086879,
      0.47354915249737217,
      0.467164471228306,
      0.4601159236829352,
      0.4524135262330098,
      0.44406822440677224
    ]
  },
  "imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      -0.03139525976465669,
      -0.05018085742560744,
      -0.06889514534231904,
      -0.08751152948763802,
      -0.10600355496102731,
      -0.1243449435824274,
      -0.14250963123498805,
      -0.16047180490360474,
      -0.17820593935662538,
      -0.19568683341860119,
      -0.21288964578253633,
      -0.22978993031074393
    ]
  },
  "magnitude": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.5,
      0.5,
      0.5,
      0.5,
      0.5,
      0.5,
      0.49999999999999994,
      0.5,
      0.5,
      0.5,
      0.5,
      0.5
    ]
  },
  "phase_rad": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      -0.06283185307179587,
      -0.10053096491487337,
      -0.13823007675795093,
      -0.1759291886010284,
      -0.2136283004441059,
      -0.25132741228718347,
      -0.289026524130261,
      -0.3267256359733385,
      -0.3644247478164161,
      -0.4021238596594935,
      -0.43982297150257105,
      -0.4775220833456486
    ]
  }
}

sweep.mixed_mode

A is the frequency axis and B is the four-port S sweep. The differential and common modes use port pairs 1–2 and 3–4.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Frequency vector | N × P × P array (frequency_vector;N_by_P_by_P)
Units
Hz for frequency. Other units depend on the representation.
Result
Numerical and diagnostic fields
Purpose
Differential- and common-mode conversion
gxtxt_api_call("RF_NETWORK_API_v1", "sweep.mixed_mode", args)
Recorded result · sweep.mixed_mode:asymmetric

Download the example script (ZIP).

Example operands preview

[
  {
    "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
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      4,
      4
    ],
    "real": [
      0.2,
      0.2,
      0.2,
      0.2,
      0.2,
      0.2,
      0.2,
      0.2,
      0.2,
      0.2
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      4,
      4
    ],
    "values": [
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3,
      0.3
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      4,
      4
    ],
    "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
    ]
  },
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0,
      7000000.0,
      7600000.0
    ]
  }
}

sweep.convert

A and B form the sweep. Set source, target, and reference_impedance to convert each frequency while keeping the rows aligned.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Frequency vector | N × P × P array (frequency_vector;N_by_P_by_P)
Units
Hz for frequency. Other units depend on the representation.
Result
Numerical and diagnostic fields
Purpose
Conversion of each complex network matrix in a frequency sweep
gxtxt_api_call("RF_NETWORK_API_v1", "sweep.convert", args)
Recorded result · sweep.convert

Download the example script (ZIP).

Example operands preview

[
  {
    "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
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      2,
      2
    ],
    "real": [
      0.09980267284282716,
      0.09949510169813003,
      0.09904614256966512,
      0.09845643345292054,
      0.09772681235681935,
      0.09685831611286311,
      0.09585217890173758,
      0.09470983049947444,
      0.0934328942456612,
      0.09202318473658705
    ],
    "imaginary": [
      -0.006279051952931338,
      -0.010036171485121488,
      -0.01377902906846381,
      -0.017502305897527604,
      -0.021200710992205465,
      -0.02486898871648548,
      -0.028501926246997614,
      -0.03209436098072095,
      -0.03564118787132508,
      -0.03913736668372024
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "struct",
    "fields": {
      "source": {
        "kind": "text",
        "value": "s"
      },
      "target": {
        "kind": "text",
        "value": "z"
      },
      "reference_impedance": {
        "kind": "array",
        "shape": [
          2,
          1
        ],
        "real": [
          50,
          70
        ]
      }
    }
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      2,
      2
    ],
    "values": [
      164.76802173875248,
      154.42849952741747,
      141.6044025572148,
      127.8725093143405,
      114.41422432553112,
      101.94515383713686,
      90.79928931452544,
      81.05648327888659,
      72.65283309036931,
      65.45687913243377,
      59.31528281439245,
      54.07716947295988
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      2,
      2
    ],
    "values": [
      -32.87275101883915,
      -48.94285332055936,
      -61.064000332536686,
      -69.2207863879282,
      -73.9358635569684,
      -75.94623363334564,
      -75.9804694878772,
      -74.65241581703124,
      -72.43423160801485,
      -69.66881745808105,
      -66.59562243090105,
      -63.3769562460901
    ]
  },
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0,
      7000000.0,
      7600000.0
    ]
  }
}

sweep.renormalize

A and B contain the S-parameter sweep. Set old_z0 and new_z0 as scalars or per-port values according to the contract.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Frequency vector | N × P × P array (frequency_vector;N_by_P_by_P)
Units
Hz for frequency. Other units depend on the representation.
Result
Numerical and diagnostic fields
Purpose
Renormalization of each complex S matrix in a frequency sweep
gxtxt_api_call("RF_NETWORK_API_v1", "sweep.renormalize", args)
Recorded result · sweep.renormalize

Download the example script (ZIP).

Example operands preview

[
  {
    "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
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      2,
      2
    ],
    "real": [
      0.09980267284282716,
      0.09949510169813003,
      0.09904614256966512,
      0.09845643345292054,
      0.09772681235681935,
      0.09685831611286311,
      0.09585217890173758,
      0.09470983049947444,
      0.0934328942456612,
      0.09202318473658705
    ],
    "imaginary": [
      -0.006279051952931338,
      -0.010036171485121488,
      -0.01377902906846381,
      -0.017502305897527604,
      -0.021200710992205465,
      -0.02486898871648548,
      -0.028501926246997614,
      -0.03209436098072095,
      -0.03564118787132508,
      -0.03913736668372024
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "struct",
    "fields": {
      "old_z0": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          50
        ]
      },
      "new_z0": {
        "kind": "array",
        "shape": [
          2,
          1
        ],
        "real": [
          75,
          60
        ]
      }
    }
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      2,
      2
    ],
    "values": [
      -0.06898852681426175,
      -0.0697590651468508,
      -0.07088032612089153,
      -0.07234683332686241,
      -0.07415145572806538,
      -0.07628546740843457,
      -0.07873861999157779,
      -0.0814992267174878,
      -0.08455425702147885,
      -0.08788944034359086,
      -0.0914893778077317,
      -0.09533766034919348
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      2,
      2
    ],
    "values": [
      -0.010632862029718613,
      -0.01696791256766425,
      -0.023241428470160405,
      -0.029430914771332153,
      -0.03551441856612699,
      -0.041470666230924755,
      -0.04727919328077912,
      -0.05292046557401015,
      -0.05837599072915814,
      -0.06362841878983556,
      -0.06866163135530515,
      -0.07346081858389278
    ]
  },
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0,
      7000000.0,
      7600000.0
    ]
  }
}

sweep.group_delay

A is the frequency axis in Hz and B is the complex sweep. The operation unwraps phase for the selected series. Specify the ports if you need a channel other than the default.

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Frequency vector | N × P × P array (frequency_vector;N_by_P_by_P)
Units
Hz for frequency. Other units depend on the representation.
Result
Numerical and diagnostic fields
Purpose
Frequency derivative of the selected transmission phase
gxtxt_api_call("RF_NETWORK_API_v1", "sweep.group_delay", args)
Recorded result · sweep.group_delay

Download the example script (ZIP).

Example operands preview

[
  {
    "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
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      2,
      2
    ],
    "real": [
      0.09980267284282716,
      0.09949510169813003,
      0.09904614256966512,
      0.09845643345292054,
      0.09772681235681935,
      0.09685831611286311,
      0.09585217890173758,
      0.09470983049947444,
      0.0934328942456612,
      0.09202318473658705
    ],
    "imaginary": [
      -0.006279051952931338,
      -0.010036171485121488,
      -0.01377902906846381,
      -0.017502305897527604,
      -0.021200710992205465,
      -0.02486898871648548,
      -0.028501926246997614,
      -0.03209436098072095,
      -0.03564118787132508,
      -0.03913736668372024
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1.0000000000000002e-08,
      1e-08,
      1.0000000000000004e-08,
      9.999999999999999e-09,
      9.999999999999999e-09,
      9.999999999999999e-09,
      9.999999999999989e-09,
      1.0000000000000002e-08,
      1.0000000000000007e-08,
      1e-08,
      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
    ]
  },
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      1000000.0,
      1600000.0,
      2200000.0,
      2800000.0,
      3400000.0,
      4000000.0,
      4600000.0,
      5200000.0,
      5800000.0,
      6400000.0,
      7000000.0,
      7600000.0
    ]
  }
}
Rejected input or attempted run · sweep.group_delay:decreasing

Download the example script (ZIP).

Example operands preview

[
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      10000000.0,
      9400000.0,
      8800000.0,
      8200000.0,
      7600000.0,
      7000000.0,
      6400000.0,
      5800000.0,
      5200000.0,
      4600000.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      2,
      2
    ],
    "real": [
      0.09980267284282716,
      0.09949510169813003,
      0.09904614256966512,
      0.09845643345292054,
      0.09772681235681935,
      0.09685831611286311,
      0.09585217890173758,
      0.09470983049947444,
      0.0934328942456612,
      0.09202318473658705
    ],
    "imaginary": [
      -0.006279051952931338,
      -0.010036171485121488,
      -0.01377902906846381,
      -0.017502305897527604,
      -0.021200710992205465,
      -0.02486898871648548,
      -0.028501926246997614,
      -0.03209436098072095,
      -0.03564118787132508,
      -0.03913736668372024
    ]
  },
  {
    "kind": "empty"
  }
]

Result preview

"GXTXT:ScriptBridge:RemoteError: RF_NETWORK_API_v1/sweep.group_delay: frequency axis must strictly increase and match first data dimension"