Time–Frequency Transforms

Analyze frequencies that change over time using STFT and wavelets. Work with the cepstrum and set axes, scales, and reconstruction options.

STFT and Reconstruction

In the STFT, rows represent frequency bins and columns represent time positions. Reconstruct the complex values from value_real and value_imaginary. For the inverse transform, retain the window, hop, NFFT, pad_left, and original_length from the original Job. The test with a 16-sample Hann window and a hop of 8 reproduces the sequence to within 10⁻¹². If processed samples have zero overlap weight, the inverse rejects the configuration.

Analytic Signal, Cepstrum, and Wavelets

Instantaneous frequency requires a time axis and unwrapped phase. Cepstral quefrency is measured in samples or, when fs is supplied, in time units. For a complex cepstrum, avoid spectral zeros and retain the phase settings. For the DWT, retain the wavelet and the approximation and detail coefficients. For the CWT, retain the scales and sample rate, since the scale-to-frequency conversion depends on the wavelet.

Operation Reference

Jump to an Operation

stft.forward

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Vector or matrix, vector, and integer
Units
Sample bins, or Hz and seconds
Result
Numeric and diagnostic fields.
Purpose
Computes the short-time Fourier transform (STFT).
gxtxt_api_call("SIGNAL_API_v1", "stft.forward", args)
Fields and Options
  • a

    Purpose
    Signal
    Type
    array
    Required
    Yes (1)
    Units
    Signal unit
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Window
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidWindow
  • c

    Purpose
    Hop
    Type
    integer
    Required
    Yes (1)
    Units
    1
    Minimum
    1
    Shape
    At most the window length
    Error
    InvalidHop
  • options.nfft

    Purpose
    FFT length
    Type
    integer
    Required
    No (0)
    Default
    numel(b)
    Units
    1
    Minimum
    1
    Shape
    At least the window length
    Error
    InvalidLength
  • options.sample_rate

    Purpose
    Sample rate
    Type
    number
    Required
    No (0)
    Units
    Hz
    Minimum
    >0
    Error
    InvalidSampleRate
  • options.pad

    Purpose
    Pad endpoints
    Type
    boolean
    Required
    No (0)
    Default
    false
    Units
    1
    Error
    InvalidArguments
Recorded Result · stft.forward

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      0.0,
      0.04322727117869951,
      0.16543469682057105,
      0.34549150281252633,
      0.5522642316338268,
      0.75,
      0.9045084971874737,
      0.9890738003669028,
      0.9890738003669028,
      0.9045084971874737
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      8
    ]
  },
  {
    "kind": "struct",
    "fields": {
      "nfft": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          16
        ]
      },
      "sample_rate": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          128.0
        ]
      },
      "pad": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          1
        ]
      }
    }
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      17
    ],
    "values": [
      2.077584312901788,
      -0.9445436005237977,
      -0.5437087390053246,
      0.6296035795178512,
      -0.28608215254216246,
      0.18934842579796102,
      -0.14727426661972812,
      0.12559159520798552,
      -0.12345399656735756,
      0.12559159520798552,
      -0.14727426661972812,
      0.18934842579796102
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      16,
      17
    ],
    "values": [
      0.0,
      1.5868847544894076,
      -1.1576636952743833,
      0.21576800153733786,
      -0.0019659578064317174,
      0.013570978122238592,
      0.0005093375758812302,
      0.002721719824202884,
      0.0,
      -0.002721719824202884,
      -0.0005093375758812302,
      -0.013570978122238592
    ]
  },
  "sample_positions": {
    "dtype": "float64",
    "shape": [
      17,
      1
    ],
    "values": [
      -8.0,
      0.0,
      8.0,
      16.0,
      24.0,
      32.0,
      40.0,
      48.0,
      56.0,
      64.0,
      72.0,
      80.0
    ]
  },
  "frequency_bins": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  },
  "pad_left": 8.0,
  "pad_right": 8.0,
  "original_length": 128.0,
  "time_seconds": {
    "dtype": "float64",
    "shape": [
      17,
      1
    ],
    "values": [
      -0.0625,
      0.0,
      0.0625,
      0.125,
      0.1875,
      0.25,
      0.3125,
      0.375,
      0.4375,
      0.5,
      0.5625,
      0.625
    ]
  },
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.0,
      8.0,
      16.0,
      24.0,
      32.0,
      40.0,
      48.0,
      56.0,
      64.0,
      72.0,
      80.0,
      88.0
    ]
  }
}

stft.inverse

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Vector or matrix, vector, and integer
Units
Sample bins, or Hz and seconds
Result
Numeric and diagnostic fields.
Purpose
Computes the inverse STFT.
gxtxt_api_call("SIGNAL_API_v1", "stft.inverse", args)
Fields and Options
  • a

    Purpose
    STFT coefficients
    Type
    array
    Required
    Yes (1)
    Units
    Signal unit
    Shape
    Matrix with nfft rows
    Error
    InvalidOperand
  • b

    Purpose
    Window
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidWindow
  • c

    Purpose
    Hop
    Type
    integer
    Required
    Yes (1)
    Units
    1
    Minimum
    1
    Shape
    At most the window length
    Error
    InvalidHop
  • options.nfft

    Purpose
    FFT length
    Type
    integer
    Required
    No (0)
    Default
    numel(b)
    Units
    1
    Minimum
    1
    Shape
    At least the window length
    Error
    InvalidLength
  • options.sample_rate

    Purpose
    Sample rate
    Type
    number
    Required
    No (0)
    Units
    Hz
    Minimum
    >0
    Error
    InvalidSampleRate
  • options.pad_left

    Purpose
    Left trim
    Type
    integer
    Required
    No (0)
    Default
    0
    Units
    1
    Minimum
    0
    Error
    InvalidLength
  • options.original_length

    Purpose
    Retained length
    Type
    integer
    Required
    No (0)
    Default
    Reconstructed length minus pad_left
    Units
    1
    Minimum
    1
    Error
    InvalidLength
Recorded Result · stft.inverse

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      16,
      17
    ],
    "real": [
      2.077584312901788,
      -0.9445436005237977,
      -0.5437087390053246,
      0.6296035795178512,
      -0.28608215254216246,
      0.18934842579796102,
      -0.14727426661972812,
      0.12559159520798552,
      -0.12345399656735756,
      0.12559159520798552
    ],
    "imaginary": [
      0.0,
      1.5868847544894076,
      -1.1576636952743833,
      0.21576800153733786,
      -0.0019659578064317174,
      0.013570978122238592,
      0.0005093375758812302,
      0.002721719824202884,
      0.0,
      -0.002721719824202884
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      0.0,
      0.04322727117869951,
      0.16543469682057105,
      0.34549150281252633,
      0.5522642316338268,
      0.75,
      0.9045084971874737,
      0.9890738003669028,
      0.9890738003669028,
      0.9045084971874737
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      8
    ]
  },
  {
    "kind": "struct",
    "fields": {
      "nfft": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          16
        ]
      },
      "pad_left": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          8.0
        ]
      },
      "original_length": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          128
        ]
      }
    }
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      1.4031094345706467e-17,
      0.4533941104837445,
      0.8071067811865473,
      0.9945902106299415,
      1.0,
      0.8531688543926322,
      0.6071067811865476,
      0.3119727542464351,
      8.41865660742388e-17,
      -0.31197275424643506,
      -0.6071067811865475,
      -0.8531688543926319
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      128,
      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
    ]
  },
  "minimum_overlap_weight": 0.42436016005775895,
  "maximum_overlap_weight": 0.978266982572228
}
Negative Test or Attempt Result · stft.inverse:uncovered-edges

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      16,
      2
    ],
    "real": [
      1.0,
      1.0,
      1.0,
      1.0,
      1.0,
      1.0,
      1.0,
      1.0,
      1.0,
      1.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      0.0,
      0.04322727117869951,
      0.16543469682057105,
      0.34549150281252633,
      0.5522642316338268,
      0.75,
      0.9045084971874737,
      0.9890738003669028,
      0.9890738003669028,
      0.9045084971874737
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      16
    ]
  },
  {
    "kind": "struct",
    "fields": {
      "nfft": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          16
        ]
      }
    }
  }
]

Result Preview

"GXTXT:Signal:InvalidWindow: window and hop leave uncovered output samples"

analytic.signal

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Real vector and positive scalar
Units
Signal unit and Hz
Result
Numeric and diagnostic fields.
Purpose
Builds the analytic signal.
gxtxt_api_call("SIGNAL_API_v1", "analytic.signal", args)
Fields and Options
  • a

    Purpose
    Real signal
    Type
    array
    Required
    Yes (1)
    Units
    Signal unit
    Shape
    Real vector
    Error
    DimensionMismatch
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidSampleRate
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
Recorded Result · analytic.signal

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      1.9721522630525295e-31,
      0.45339411048374456,
      0.8071067811865476,
      0.9945902106299416,
      1.0,
      0.8531688543926321,
      0.6071067811865477,
      0.3119727542464352,
      9.797174393178853e-17,
      -0.311972754246435,
      -0.6071067811865476,
      -0.8531688543926319
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      -1.1000000000000003,
      -0.9945902106299412,
      -0.7071067811865477,
      -0.3119727542464348,
      0.0999999999999999,
      0.4533941104837448,
      0.7071067811865474,
      0.8531688543926323,
      0.8999999999999999,
      0.8531688543926323,
      0.7071067811865475,
      0.4533941104837449
    ]
  }
}

analytic.envelope

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Real vector and positive scalar
Units
Signal unit and Hz
Result
Numeric and diagnostic fields.
Purpose
Computes the analytic-signal envelope.
gxtxt_api_call("SIGNAL_API_v1", "analytic.envelope", args)
Fields and Options
  • a

    Purpose
    Real signal
    Type
    array
    Required
    Yes (1)
    Units
    Signal unit
    Shape
    Real vector
    Error
    DimensionMismatch
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidSampleRate
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
Recorded Result · analytic.envelope

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "amplitude": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      1.1000000000000003,
      1.0930580526679528,
      1.073043035594244,
      1.0423707049188489,
      1.004987562112089,
      0.9661590518786141,
      0.9319756669370132,
      0.9084184572639106,
      0.8999999999999999,
      0.9084184572639106,
      0.9319756669370132,
      0.966159051878614
    ]
  }
}

analytic.phase

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Real vector and positive scalar
Units
Signal unit and Hz
Result
Numeric and diagnostic fields.
Purpose
Computes the analytic-signal phase.
gxtxt_api_call("SIGNAL_API_v1", "analytic.phase", args)
Fields and Options
  • a

    Purpose
    Real signal
    Type
    array
    Required
    Yes (1)
    Units
    Signal unit
    Shape
    Real vector
    Error
    DimensionMismatch
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidSampleRate
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
Recorded Result · analytic.phase

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "phase_rad": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      -1.5707963267948966,
      -1.1430797405827973,
      -0.7194530405976138,
      -0.30395009361267983,
      0.09966865249116193,
      0.4884693732849178,
      0.8613429528839479,
      1.2202360531093637,
      1.5707963267948966,
      1.9213566004804294,
      2.2802497007058453,
      2.653123280304875
    ]
  }
}

analytic.instantaneous_frequency

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Real vector and positive scalar
Units
Signal unit and Hz
Result
Numeric and diagnostic fields.
Purpose
Computes the instantaneous frequency of the analytic signal.
gxtxt_api_call("SIGNAL_API_v1", "analytic.instantaneous_frequency", args)
Fields and Options
  • a

    Purpose
    Real signal
    Type
    array
    Required
    Yes (1)
    Units
    Signal unit
    Shape
    Real vector
    Error
    DimensionMismatch
  • b

    Purpose
    Sample rate
    Type
    number
    Required
    Yes (1)
    Units
    Hz
    Minimum
    >0
    Error
    InvalidSampleRate
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
Recorded Result · analytic.instantaneous_frequency

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "array",
    "shape": [
      1,
      1
    ],
    "real": [
      128.0
    ]
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "frequency_hz": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      8.713370744069941,
      8.671711505049325,
      8.547304397456081,
      8.34350505272839,
      8.071518410175822,
      7.758350715748675,
      7.453714194176312,
      7.226432726473612,
      7.141555252313631,
      7.226432726473613,
      7.453714194176311,
      7.75835071574867
    ]
  }
}

cepstrum.real

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Vector and optional quefrency bounds
Units
Samples
Result
Numeric and diagnostic fields.
Purpose
Computes the real cepstrum using the specified magnitude floor.
gxtxt_api_call("SIGNAL_API_v1", "cepstrum.real", args)
Fields and Options
  • a

    Purpose
    Signal
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidWindow
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
  • options.magnitude_floor

    Purpose
    Magnitude floor
    Type
    number
    Required
    No (0)
    Default
    eps
    Units
    1
    Minimum
    >0
    Error
    InvalidFloor
Recorded Result · cepstrum.real

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      2.0,
      1.4533941104837447,
      1.8071067811865476,
      1.9945902106299416,
      2.0,
      1.853168854392632,
      1.6071067811865476,
      1.311972754246435,
      1.0,
      0.688027245753565
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.13214483957372467,
      0.11864773146884493,
      0.08391823341870772,
      0.0421931199282427,
      0.008774184537762525,
      -0.00754382887581522,
      -0.007983664600555931,
      -0.0014278848849706145,
      0.002175928987054884,
      -0.001427884884968956,
      -0.0079836646005553,
      -0.007543828875815264
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      128,
      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
    ]
  },
  "quefrency_samples": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  }
}

cepstrum.complex

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Vector and optional quefrency bounds
Units
Samples
Result
Numeric and diagnostic fields.
Purpose
Computes the complex cepstrum, removing 2π phase jumps.
gxtxt_api_call("SIGNAL_API_v1", "cepstrum.complex", args)
Fields and Options
  • a

    Purpose
    Signal
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidWindow
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
  • options.magnitude_floor

    Purpose
    Magnitude floor
    Type
    number
    Required
    No (0)
    Default
    eps
    Units
    1
    Minimum
    >0
    Error
    InvalidFloor
Recorded Result · cepstrum.complex

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      2.0,
      1.4533941104837447,
      1.8071067811865476,
      1.9945902106299416,
      2.0,
      1.853168854392632,
      1.6071067811865476,
      1.311972754246435,
      1.0,
      0.688027245753565
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.13214483957372467,
      0.1435892982665467,
      0.12322249396488899,
      0.08028552024447949,
      0.03307375638423748,
      -0.000736475036559802,
      -0.012923141081592834,
      -0.007771364564249203,
      0.002175928987052858,
      0.00491559479430819,
      -0.003044188119519661,
      -0.014351182715071513
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.0,
      -4.930380657631324e-32,
      -1.6023737137301802e-31,
      -2.262967684655002e-32,
      3.851859888774472e-34,
      5.724826759691059e-32,
      -1.0477058897466563e-31,
      -1.1093356479670479e-31,
      -4.930380657631324e-32,
      6.162975822039155e-33,
      9.369649179443902e-32,
      -9.244463733058732e-33
    ]
  },
  "quefrency_samples": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  }
}
Negative Test or Attempt Result · cepstrum.complex

Download the example script (extract the ZIP first).

Result Preview

"GXTXT:Signal:SpectralZero: complex cepstrum requires nonzero spectrum"

cepstrum.inverse

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Vector and optional quefrency bounds
Units
Samples
Result
Numeric and diagnostic fields.
Purpose
Inverts the complex cepstrum.
gxtxt_api_call("SIGNAL_API_v1", "cepstrum.inverse", args)
Fields and Options
  • a

    Purpose
    Cepstrum
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidWindow
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
Recorded Result · cepstrum.inverse

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      32,
      1
    ],
    "real": [
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      32,
      1
    ],
    "values": [
      1.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0,
      0.0
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      32,
      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
    ]
  },
  "quefrency_samples": {
    "dtype": "float64",
    "shape": [
      32,
      1
    ],
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  }
}

cepstrum.lifter

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Vector and optional quefrency bounds
Units
Samples
Result
Numeric and diagnostic fields.
Purpose
Keeps the specified quefrency band.
gxtxt_api_call("SIGNAL_API_v1", "cepstrum.lifter", args)
Fields and Options
  • a

    Purpose
    Cepstrum
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Quefrency bounds
    Type
    array
    Required
    Yes (1)
    Units
    Samples
    Minimum
    0
    Shape
    Two increasing bounds
    Error
    InvalidWindow
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
Recorded Result · cepstrum.lifter

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      16,
      1
    ],
    "real": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0
    ]
  },
  {
    "kind": "array",
    "shape": [
      2,
      1
    ],
    "real": [
      2,
      8
    ]
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.0,
      0.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  },
  "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
    ]
  },
  "mask": {
    "dtype": "bool",
    "shape": [
      16,
      1
    ],
    "values": [
      false,
      false,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true,
      true
    ]
  },
  "quefrency_samples": {
    "dtype": "float64",
    "shape": [
      16,
      1
    ],
    "values": [
      0.0,
      1.0,
      2.0,
      3.0,
      4.0,
      5.0,
      6.0,
      7.0,
      8.0,
      9.0,
      10.0,
      11.0
    ]
  }
}

wavelet.dwt

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Two vectors
Units
Explicit sample rate
Result
Numeric and diagnostic fields.
Purpose
Computes the periodic orthogonal discrete wavelet transform.
gxtxt_api_call("SIGNAL_API_v1", "wavelet.dwt", args)
Fields and Options
  • a

    Purpose
    Signal
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidScale
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
  • options.wavelet

    Purpose
    Wavelet
    Type
    choice
    Required
    No (0)
    Default
    haar
    Units
    1
    Choices
    haar;db1;db2;sym2
    Error
    UnknownWavelet
Recorded Result · wavelet.dwt

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "approximation_real": {
    "dtype": "float64",
    "shape": [
      64,
      1
    ],
    "values": [
      0.3205980500730985,
      1.2739921605568427,
      1.3103882636247357,
      0.6498873719544438,
      -0.22059805007309838,
      -1.0325708043195332,
      -1.4103882636247356,
      -0.8913087281917538,
      0.3205980500730984,
      1.2739921605568427,
      1.3103882636247357,
      0.6498873719544447
    ]
  },
  "approximation_imaginary": {
    "dtype": "float64",
    "shape": [
      64,
      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
    ]
  },
  "detail_real": {
    "dtype": "float64",
    "shape": [
      64,
      1
    ],
    "values": [
      -0.3205980500730985,
      -0.1325708043195336,
      0.10382529874835922,
      0.20869127180824673,
      0.2205980500730985,
      0.17399216055684286,
      -0.0038252987483592404,
      -0.2501126280455559,
      -0.32059805007309883,
      -0.1325708043195335,
      0.10382529874835922,
      0.20869127180824693
    ]
  },
  "detail_imaginary": {
    "dtype": "float64",
    "shape": [
      64,
      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
    ]
  },
  "wavelet": "haar",
  "boundary": "periodic"
}

wavelet.inverse_dwt

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Two vectors
Units
Explicit sample rate
Result
Numeric and diagnostic fields.
Purpose
Computes the inverse periodic orthogonal discrete wavelet transform.
gxtxt_api_call("SIGNAL_API_v1", "wavelet.inverse_dwt", args)
Fields and Options
  • a

    Purpose
    Coefficients
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Detail coefficients
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Same length as a
    Error
    InvalidScale
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
  • options.wavelet

    Purpose
    Wavelet
    Type
    choice
    Required
    No (0)
    Default
    haar
    Units
    1
    Choices
    haar;db1;db2;sym2
    Error
    UnknownWavelet
Recorded Result · wavelet.inverse_dwt

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      64,
      1
    ],
    "real": [
      0.3205980500730985,
      1.2739921605568427,
      1.3103882636247357,
      0.6498873719544438,
      -0.22059805007309838,
      -1.0325708043195332,
      -1.4103882636247356,
      -0.8913087281917538,
      0.3205980500730984,
      1.2739921605568427
    ]
  },
  {
    "kind": "array",
    "shape": [
      64,
      1
    ],
    "real": [
      -0.3205980500730985,
      -0.1325708043195336,
      0.10382529874835922,
      0.20869127180824673,
      0.2205980500730985,
      0.17399216055684286,
      -0.0038252987483592404,
      -0.2501126280455559,
      -0.32059805007309883,
      -0.1325708043195335
    ]
  },
  {
    "kind": "empty"
  }
]

Result Preview

{
  "value_real": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      8.902078611069591e-18,
      0.4533941104837445,
      0.8071067811865472,
      0.9945902106299412,
      0.9999999999999998,
      0.8531688543926319,
      0.6071067811865475,
      0.311972754246435,
      7.59905322122335e-17,
      -0.3119727542464349,
      -0.6071067811865473,
      -0.8531688543926316
    ]
  },
  "value_imaginary": {
    "dtype": "float64",
    "shape": [
      128,
      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
    ]
  },
  "wavelet": "haar"
}

wavelet.cwt

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Two vectors
Units
Explicit sample rate
Result
Numeric and diagnostic fields.
Purpose
Computes the continuous wavelet transform at the specified scales.
gxtxt_api_call("SIGNAL_API_v1", "wavelet.cwt", args)
Fields and Options
  • a

    Purpose
    Signal
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Vector
    Error
    InvalidOperand
  • b

    Purpose
    Scales
    Type
    array
    Required
    Yes (1)
    Units
    1
    Minimum
    >0
    Shape
    Vector of positive scales
    Error
    InvalidScale
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
  • options.wavelet

    Purpose
    Wavelet
    Type
    choice
    Required
    Yes (1)
    Units
    1
    Choices
    morlet;mexican_hat
    Shape
    Explicit continuous wavelet. The discrete-case default does not apply here.
    Error
    UnknownWavelet
  • options.sample_rate

    Purpose
    Sample rate
    Type
    number
    Required
    No (0)
    Default
    1
    Units
    Hz
    Minimum
    >0
    Error
    InvalidSampleRate
Recorded Result · wavelet.cwt

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      128,
      1
    ],
    "real": [
      0.0,
      0.45339411048374456,
      0.8071067811865474,
      0.9945902106299415,
      1.0,
      0.853168854392632,
      0.6071067811865476,
      0.3119727542464351,
      9.797174393178826e-17,
      -0.31197275424643495
    ]
  },
  {
    "kind": "array",
    "shape": [
      3,
      1
    ],
    "real": [
      1.0,
      2.0,
      4.0
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "struct",
    "fields": {
      "wavelet": {
        "kind": "text",
        "value": "morlet"
      },
      "sample_rate": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          128.0
        ]
      }
    }
  }
]

Result Preview

{
  "coefficients_real": {
    "dtype": "float64",
    "shape": [
      3,
      128
    ],
    "values": [
      0.27315214268398147,
      -0.06929570987213889,
      -0.1190771370575715,
      0.7845308661899912,
      0.05900571444087237,
      -0.01808713901179623,
      1.3301843837654912,
      -0.03650156957521405,
      0.09907546183496747,
      1.6530105381872398,
      0.016499264438042945,
      0.042771793418169654
    ]
  },
  "coefficients_imaginary": {
    "dtype": "float64",
    "shape": [
      3,
      128
    ],
    "values": [
      0.10820184107394594,
      -4.196960769361384e-06,
      -0.0016350722833607526,
      0.16345408906368572,
      -0.009887676408541076,
      -0.11445737389322304,
      0.12892264486621557,
      0.012488513561808752,
      -0.03407823697234448,
      0.05023574758214946,
      -0.00879565950740362,
      0.07664694191343296
    ]
  },
  "power": {
    "dtype": "float64",
    "shape": [
      3,
      128
    ],
    "values": [
      0.08631973146464163,
      0.0048018954242981275,
      0.014182038031199483,
      0.6422059192364573,
      0.003579440481437794,
      0.013427635036165095,
      1.7860115431728798,
      0.001488327552437673,
      0.010977273372955362,
      2.734967469693206,
      0.00034958935316664825,
      0.007704180016887748
    ]
  },
  "scales": {
    "dtype": "float64",
    "shape": [
      3,
      1
    ],
    "values": [
      1.0,
      2.0,
      4.0
    ]
  },
  "time_seconds": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.0,
      0.0078125,
      0.015625,
      0.0234375,
      0.03125,
      0.0390625,
      0.046875,
      0.0546875,
      0.0625,
      0.0703125,
      0.078125,
      0.0859375
    ]
  },
  "wavelet": "morlet"
}

wavelet.scalogram

Access
Registered in the Python Job
Arguments
Typed operands a, b, and c, with an optional typed options struct.
Shape
Two vectors
Units
Explicit sample rate
Result
Numeric and diagnostic fields.
Purpose
Computes the scalogram power with explicit axes.
gxtxt_api_call("SIGNAL_API_v1", "wavelet.scalogram", args)
Fields and Options
  • a

    Purpose
    Coefficients
    Type
    array
    Required
    Yes (1)
    Units
    1
    Shape
    Matrix
    Error
    InvalidOperand
  • b

    Purpose
    Scales
    Type
    array
    Required
    Yes (1)
    Units
    1
    Minimum
    >0
    Shape
    Vector of positive scales
    Error
    InvalidScale
  • c

    Purpose
    Unused protocol operand
    Type
    empty
    Required
    No (0)
    Units
    1
    Shape
    Unused
    Error
    InvalidOperand
  • options.sample_rate

    Purpose
    Sample rate
    Type
    number
    Required
    No (0)
    Default
    1
    Units
    Hz
    Minimum
    >0
    Error
    InvalidSampleRate
Recorded Result · wavelet.scalogram

Download the example script (extract the ZIP first).

Example Operands Preview

[
  {
    "kind": "array",
    "shape": [
      3,
      128
    ],
    "real": [
      0.27315214268398147,
      -0.06929570987213889,
      -0.1190771370575715,
      0.7845308661899912,
      0.05900571444087237,
      -0.01808713901179623,
      1.3301843837654912,
      -0.03650156957521405,
      0.09907546183496747,
      1.6530105381872398
    ],
    "imaginary": [
      0.10820184107394594,
      -4.196960769361384e-06,
      -0.0016350722833607526,
      0.16345408906368572,
      -0.009887676408541076,
      -0.11445737389322304,
      0.12892264486621557,
      0.012488513561808752,
      -0.03407823697234448,
      0.05023574758214946
    ]
  },
  {
    "kind": "array",
    "shape": [
      3,
      1
    ],
    "real": [
      1.0,
      2.0,
      4.0
    ]
  },
  {
    "kind": "empty"
  },
  {
    "kind": "struct",
    "fields": {
      "sample_rate": {
        "kind": "array",
        "shape": [
          1,
          1
        ],
        "real": [
          128.0
        ]
      }
    }
  }
]

Result Preview

{
  "power": {
    "dtype": "float64",
    "shape": [
      3,
      128
    ],
    "values": [
      0.08631973146464163,
      0.0048018954242981275,
      0.014182038031199483,
      0.6422059192364573,
      0.003579440481437794,
      0.013427635036165095,
      1.7860115431728798,
      0.001488327552437673,
      0.010977273372955362,
      2.734967469693206,
      0.00034958935316664825,
      0.007704180016887748
    ]
  },
  "scales": {
    "dtype": "float64",
    "shape": [
      3,
      1
    ],
    "values": [
      1.0,
      2.0,
      4.0
    ]
  },
  "time_seconds": {
    "dtype": "float64",
    "shape": [
      128,
      1
    ],
    "values": [
      0.0,
      0.0078125,
      0.015625,
      0.0234375,
      0.03125,
      0.0390625,
      0.046875,
      0.0546875,
      0.0625,
      0.0703125,
      0.078125,
      0.0859375
    ]
  }
}