Skip to content

RF Touchstone / touchstone / TouchstoneMatrix

Type Alias: TouchstoneMatrix

TouchstoneMatrix = Complex[][][]

Defined in: src/touchstone.ts:88

Network parameter matrix stored as complex numbers.

Remarks

The matrix is a 3D array with the following dimensions:

  • First dimension [i]: Output port index (0 to nports-1) - where the signal exits
  • Second dimension [j]: Input port index (0 to nports-1) - where the signal enters
  • Third dimension [k]: Frequency point index

For example:

  • matrix[i][j][k] represents the parameter from port j+1 to port i+1 at frequency k
  • For S-parameters: matrix[1][0][5] is S₂₁ at the 6th frequency point (signal enters at port 1, exits at port 2)

Example

typescript
// Access S21 (port 1 → port 2) at first frequency
const s21 = touchstone.matrix[1][0][0]

// Access S11 (port 1 → port 1, reflection) at first frequency
const s11 = touchstone.matrix[0][0][0]