Signals, Convolution, Events, and Quality
Generate waveforms and reproducible noise, compare convolution and correlation, and measure events and signal quality.
Basic Checks
The linear convolution of [1, 2, 3] with [1, 1] is [1, 3, 5, 3]. For circular convolution, specify the period length if you want the result to wrap at a different length from the default. To measure a delay, use a reference signal and repeat the check with the signals reversed. To estimate pulse timing, record at least two rising edges and one falling edge. In noisy data, verify the threshold, direction, and hysteresis.
Operation Reference
Jump to an Operation
convolution.linearconvolution.circularconvolution.deconvolvecorrelation.autocorrelation.crosscorrelation.delayquality.basicquality.snrquality.harmonicsevents.crossingsevents.periodevents.delaytime_metric.steptime_metric.slewtime_metric.pulsegenerate.sinegenerate.multi_tonegenerate.chirpgenerate.squaregenerate.pulsegenerate.impulsegenerate.white_noisegenerate.colored_noisegenerate.amgenerate.fmquality.spectrum
convolution.linear
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors
- Units
- Product of the input and kernel units
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes the linear convolution.
gxtxt_api_call("SIGNAL_API_v1", "convolution.linear", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Kernel
- Type
array- Required
- Yes (1)
- Units
- Kernel unit
- Shape
- Vector
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
Recorded Result · convolution.linear:projection
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
2,
1
],
"real": [
1,
2
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
1
]
},
{
"kind": "empty"
},
{
"kind": "struct",
"fields": {
"result_fields": {
"kind": "text",
"value": "value_real"
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
2,
1
],
"values": [
1.0,
2.0
]
}
}convolution.circular
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors
- Units
- Product of the input and kernel units
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes the circular convolution.
gxtxt_api_call("SIGNAL_API_v1", "convolution.circular", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Kernel
- Type
array- Required
- Yes (1)
- Units
- Kernel unit
- Shape
- Vector
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.length- Purpose
- Circular length
- Type
- integer
- Required
- No (0)
- Default
max(numel(a),numel(b))- Units
- 1
- Minimum
1- Error
InvalidLength
Recorded Result · convolution.circular
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
3,
1
],
"real": [
1,
2,
3
]
},
{
"kind": "array",
"shape": [
2,
1
],
"real": [
1,
1
]
},
{
"kind": "empty"
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
3,
1
],
"values": [
4.0,
3.0,
5.0
]
},
"value_imaginary": {
"dtype": "float64",
"shape": [
3,
1
],
"values": [
0.0,
0.0,
0.0
]
},
"output_length": 3.0
}convolution.deconvolve
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors
- Units
- Product of the input and kernel units
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes the deconvolution.
gxtxt_api_call("SIGNAL_API_v1", "convolution.deconvolve", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Kernel
- Type
array- Required
- Yes (1)
- Units
- Kernel unit
- Shape
- Vector
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.relative_floor- Purpose
- Relative spectral floor
- Type
- number
- Required
- No (0)
- Default
1e-10- Units
- 1
- Minimum
0- Error
InvalidTolerance
options.regularization- Purpose
- Regularization
- Type
- number
- Required
- No (0)
- Default
0- Units
- 1
- Minimum
0- Error
InvalidTolerance
Recorded Result · convolution.deconvolve
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
4,
1
],
"real": [
1,
3,
5,
3
]
},
{
"kind": "array",
"shape": [
2,
1
],
"real": [
1,
1
]
},
{
"kind": "empty"
},
{
"kind": "struct",
"fields": {
"regularization": {
"kind": "array",
"shape": [
1,
1
],
"real": [
1e-05
]
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
3,
1
],
"values": [
0.9999999999499998,
2.00000000005,
2.99999999975
]
},
"value_imaginary": {
"dtype": "float64",
"shape": [
3,
1
],
"values": [
0.0,
0.0,
0.0
]
},
"output_length": 3.0
}correlation.auto
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors
- Units
- Lags in samples or seconds
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes the autocorrelation.
gxtxt_api_call("SIGNAL_API_v1", "correlation.auto", args)Fields and Options
a- Purpose
- First signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Second signal (empty selects auto-correlation)
- Type
array- Required
- No (0)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.normalization- Purpose
- Normalization
- Type
- choice
- Required
- No (0)
- Default
none- Units
- 1
- Choices
none;biased;unbiased;coefficient- Error
InvalidPolicy
options.sample_rate- Purpose
- Sample rate
- Type
- number
- Required
- No (0)
- Units
- Hz
- Minimum
>0- Error
InvalidSampleRate
Recorded Result · correlation.auto
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"
},
{
"kind": "struct",
"fields": {
"sample_rate": {
"kind": "array",
"shape": [
1,
1
],
"real": [
128.0
]
},
"normalization": {
"kind": "text",
"value": "coefficient"
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
255,
1
],
"values": [
0.0,
-0.003180170473721321,
-0.011322322435689139,
-0.02403007493697578,
-0.0388655511752762,
-0.052244225202870836,
-0.06059552034443428,
-0.06126237623762372,
-0.0528708738015336,
-0.035268990290513634,
-0.00937139191593099,
0.022792451174599694
]
},
"value_imaginary": {
"dtype": "float64",
"shape": [
255,
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
]
},
"lags": {
"dtype": "float64",
"shape": [
255,
1
],
"values": [
-127.0,
-126.0,
-125.0,
-124.0,
-123.0,
-122.0,
-121.0,
-120.0,
-119.0,
-118.0,
-117.0,
-116.0
]
},
"delay_samples": 0.0,
"delay_seconds": 0.0,
"n": 128.0,
"n_x": 128.0,
"n_y": 128.0,
"lag_count": 255.0,
"sample_rate": 128.0,
"peak_magnitude": 0.9999999999999994,
"peak_value_real": 0.9999999999999994,
"peak_value_imaginary": 0.0,
"peak_resolved": true,
"input_kind": "real",
"normalization": "coefficient",
"method": "uncentered_conjugate_sequence_correlation",
"peak_policy": "first_maximum_absolute_in_ascending_lag"
}correlation.cross
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors
- Units
- Lags in samples or seconds
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes the cross-correlation.
gxtxt_api_call("SIGNAL_API_v1", "correlation.cross", args)Fields and Options
a- Purpose
- First signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Second signal (empty selects auto-correlation)
- Type
array- Required
- No (0)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.normalization- Purpose
- Normalization
- Type
- choice
- Required
- No (0)
- Default
none- Units
- 1
- Choices
none;biased;unbiased;coefficient- Error
InvalidPolicy
options.sample_rate- Purpose
- Sample rate
- Type
- number
- Required
- No (0)
- Units
- Hz
- Minimum
>0- Error
InvalidSampleRate
Recorded Result · correlation.cross
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": [
128,
1
],
"real": [
-1.790262379133897,
-1.4527922061357845,
-0.8161093988707413,
0.0,
0.8161093988707402,
1.4527922061357854,
1.7902623791338947,
1.8,
1.5357039379067376,
1.0927922061357858
]
},
{
"kind": "empty"
},
{
"kind": "struct",
"fields": {
"sample_rate": {
"kind": "array",
"shape": [
1,
1
],
"real": [
128.0
]
},
"normalization": {
"kind": "text",
"value": "coefficient"
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
255,
1
],
"values": [
0.0,
-0.0070141415607014885,
-0.018470428759534793,
-0.03029776017221712,
-0.038366336633663324,
-0.03963421249471219,
-0.03265700950539546,
-0.017525073297776073,
0.004427556663669189,
0.030800725540413968,
0.05810363479717681,
0.08175025722977448
]
},
"value_imaginary": {
"dtype": "float64",
"shape": [
255,
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
]
},
"lags": {
"dtype": "float64",
"shape": [
255,
1
],
"values": [
-127.0,
-126.0,
-125.0,
-124.0,
-123.0,
-122.0,
-121.0,
-120.0,
-119.0,
-118.0,
-117.0,
-116.0
]
},
"delay_samples": -3.0,
"delay_seconds": -0.0234375,
"n": 128.0,
"n_x": 128.0,
"n_y": 128.0,
"lag_count": 255.0,
"sample_rate": 128.0,
"peak_magnitude": 0.971438779969994,
"peak_value_real": 0.971438779969994,
"peak_value_imaginary": 0.0,
"peak_resolved": true,
"input_kind": "real",
"normalization": "coefficient",
"method": "uncentered_conjugate_sequence_correlation",
"peak_policy": "first_maximum_absolute_in_ascending_lag"
}correlation.delay
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors
- Units
- Lags in samples or seconds
- Result
- Numeric and diagnostic fields.
- Purpose
- Estimates the delay by correlation.
gxtxt_api_call("SIGNAL_API_v1", "correlation.delay", args)Fields and Options
a- Purpose
- First signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Second signal (empty selects auto-correlation)
- Type
array- Required
- No (0)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.normalization- Purpose
- Normalization
- Type
- choice
- Required
- No (0)
- Default
none- Units
- 1
- Choices
none;biased;unbiased;coefficient- Error
InvalidPolicy
options.sample_rate- Purpose
- Sample rate
- Type
- number
- Required
- No (0)
- Units
- Hz
- Minimum
>0- Error
InvalidSampleRate
Recorded Result · correlation.delay
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": [
128,
1
],
"real": [
-1.790262379133897,
-1.4527922061357845,
-0.8161093988707413,
0.0,
0.8161093988707402,
1.4527922061357854,
1.7902623791338947,
1.8,
1.5357039379067376,
1.0927922061357858
]
},
{
"kind": "empty"
},
{
"kind": "struct",
"fields": {
"sample_rate": {
"kind": "array",
"shape": [
1,
1
],
"real": [
128.0
]
},
"normalization": {
"kind": "text",
"value": "coefficient"
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
255,
1
],
"values": [
0.0,
-0.0070141415607014885,
-0.018470428759534793,
-0.03029776017221712,
-0.038366336633663324,
-0.03963421249471219,
-0.03265700950539546,
-0.017525073297776073,
0.004427556663669189,
0.030800725540413968,
0.05810363479717681,
0.08175025722977448
]
},
"value_imaginary": {
"dtype": "float64",
"shape": [
255,
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
]
},
"lags": {
"dtype": "float64",
"shape": [
255,
1
],
"values": [
-127.0,
-126.0,
-125.0,
-124.0,
-123.0,
-122.0,
-121.0,
-120.0,
-119.0,
-118.0,
-117.0,
-116.0
]
},
"delay_samples": -3.0,
"delay_seconds": -0.0234375,
"n": 128.0,
"n_x": 128.0,
"n_y": 128.0,
"lag_count": 255.0,
"sample_rate": 128.0,
"peak_magnitude": 0.971438779969994,
"peak_value_real": 0.971438779969994,
"peak_value_imaginary": 0.0,
"peak_resolved": true,
"input_kind": "real",
"normalization": "coefficient",
"method": "uncentered_conjugate_sequence_correlation",
"peak_policy": "first_maximum_absolute_in_ascending_lag"
}quality.basic
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors and a positive scalar
- Units
- Signal unit, dB, and bits
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes basic signal-quality metrics.
gxtxt_api_call("SIGNAL_API_v1", "quality.basic", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidSampleRate
Recorded Result · quality.basic
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
{
"n": 128.0,
"rms": 0.7106335201775948,
"peak": 1.0,
"peak_to_peak": 2.0,
"crest_factor": 1.4071950894605836,
"dc_real": 5.074066167232161e-17,
"dc_imaginary": 0.0,
"input_kind": "real",
"method": "descriptive_complex_magnitude"
}quality.snr
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors and a positive scalar
- Units
- Signal unit, dB, and bits
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes the signal-to-noise ratio.
gxtxt_api_call("SIGNAL_API_v1", "quality.snr", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Noise (empty selects mean-subtracted SNR)
- Type
array- Required
- No (0)
- Units
- Signal unit
- Shape
- Same length as a
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidSampleRate
Recorded Result · quality.snr
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": [
128,
1
],
"real": [
0.0,
0.04533941104837446,
0.08071067811865475,
0.09945902106299415,
0.1,
0.0853168854392632,
0.060710678118654764,
0.03119727542464351,
9.797174393178827e-18,
-0.031197275424643497
]
},
{
"kind": "empty"
}
]Result Preview
{
"n": 128.0,
"snr_db": 19.999999999999993,
"signal_energy": 64.64000000000001,
"noise_energy": 0.6464000000000005,
"signal_zero": false,
"noise_zero": false,
"method": "ratio_of_supplied_complex_magnitude_energies"
}quality.harmonics
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors and a positive scalar
- Units
- Signal unit, dB, and bits
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes harmonic metrics.
gxtxt_api_call("SIGNAL_API_v1", "quality.harmonics", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
c- Purpose
- Sample rate
- Type
- number
- Required
- Yes (1)
- Units
- Hz
- Minimum
>0- Error
InvalidSampleRate
options.fundamental_hz- Purpose
- Fundamental frequency
- Type
- number
- Required
- No (0)
- Units
- Hz
- Minimum
>0- Shape
- FFT bin coherent with the tone frequency
- Error
NoncoherentSampling
Recorded Result · quality.harmonics
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": "array",
"shape": [
1,
1
],
"real": [
128.0
]
},
{
"kind": "struct",
"fields": {
"fundamental_hz": {
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
}
}
}
]Result Preview
{
"n": 128.0,
"sample_rate": 128.0,
"fundamental_hz": 8.0,
"fundamental_bin": 8.0,
"harmonic_orders": {
"dtype": "float64",
"shape": [
7,
1
],
"values": [
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0
]
},
"method": "coherent_positive_fft_bins",
"normalization": "raw_positive_fft_squared",
"fundamental_power": 4096.0,
"dc_power": 5.040978703296321e-29,
"harmonic_powers": {
"dtype": "float64",
"shape": [
7,
1
],
"values": [
40.95999999999973,
3.738115339998805e-30,
6.91773038107749e-28,
1.623974022746975e-28,
5.602991237240054e-29,
2.878205578790401e-30,
2.96192311623379e-35
]
},
"noise_power": 0.0,
"noise_floor_power_per_bin": 7.497313137387964e-29,
"noise_floor_db_relative": -317.3745429773262,
"distortion_power": 40.95999999999973,
"thd": 0.09999999999999967,
"thd_db": -20.00000000000003,
"thd_plus_n": 0.09999999999999967,
"snr_db": Infinity,
"sinad_db": 20.00000000000003,
"sfdr_db": 20.00000000000003,
"enob_bits": 3.0299003322259184
}Negative Test or Attempt Result · quality.harmonics
Download the example script (extract the ZIP first).
Result Preview
"GXTXT:Signal:InvalidFrequency: fundamental_hz must lie below Nyquist"
events.crossings
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing vector and real vectors
- Units
- Seconds
- Result
- Numeric and diagnostic fields.
- Purpose
- Finds threshold crossings.
gxtxt_api_call("SIGNAL_API_v1", "events.crossings", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector
- Error
InvalidGrid
b- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Matching real vector
- Error
InvalidGrid
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.threshold- Purpose
- Threshold
- Type
- number
- Required
- No (0)
- Default
0- Units
- Signal unit
- Error
InvalidArguments
options.direction- Purpose
- Crossing direction
- Type
- choice
- Required
- No (0)
- Default
rising- Units
- 1
- Choices
rising;falling;both- Error
InvalidPolicy
options.hysteresis- Purpose
- Hysteresis
- Type
- number
- Required
- No (0)
- Default
0- Units
- Signal unit
- Minimum
0- Error
InvalidThreshold
Recorded Result · events.crossings
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"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": "struct",
"fields": {
"threshold": {
"kind": "array",
"shape": [
1,
1
],
"real": [
0.0
]
},
"direction": {
"kind": "text",
"value": "rising"
},
"hysteresis": {
"kind": "array",
"shape": [
1,
1
],
"real": [
0.01
]
}
}
}
]Result Preview
{
"time": {
"dtype": "float64",
"shape": [
7,
1
],
"values": [
0.1250861557287507,
0.2500861557287507,
0.3750861557287507,
0.5000861557287507,
0.6250861557287507,
0.7500861557287507,
0.8750861557287507
]
},
"count": 7.0
}events.period
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing vector and real vectors
- Units
- Seconds
- Result
- Numeric and diagnostic fields.
- Purpose
- Estimates the period from events.
gxtxt_api_call("SIGNAL_API_v1", "events.period", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector
- Error
InvalidGrid
b- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Matching real vector
- Error
InvalidGrid
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.threshold- Purpose
- Threshold
- Type
- number
- Required
- No (0)
- Default
0- Units
- Signal unit
- Error
InvalidArguments
options.direction- Purpose
- Crossing direction
- Type
- choice
- Required
- No (0)
- Default
rising- Units
- 1
- Choices
rising;falling;both- Error
InvalidPolicy
options.hysteresis- Purpose
- Hysteresis
- Type
- number
- Required
- No (0)
- Default
0- Units
- Signal unit
- Minimum
0- Error
InvalidThreshold
Recorded Result · events.period
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"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": "struct",
"fields": {
"threshold": {
"kind": "array",
"shape": [
1,
1
],
"real": [
0.0
]
},
"direction": {
"kind": "text",
"value": "rising"
},
"hysteresis": {
"kind": "array",
"shape": [
1,
1
],
"real": [
0.01
]
}
}
}
]Result Preview
{
"n": 6.0,
"crossing_count": 7.0,
"period_count": 6.0,
"method": "arithmetic_intercrossing_intervals",
"period": 0.125,
"frequency_hz": 8.0,
"crossing_times": {
"dtype": "float64",
"shape": [
7,
1
],
"values": [
0.1250861557287507,
0.2500861557287507,
0.3750861557287507,
0.5000861557287507,
0.6250861557287507,
0.7500861557287507,
0.8750861557287507
]
}
}events.delay
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing vector and real vectors
- Units
- Seconds
- Result
- Numeric and diagnostic fields.
- Purpose
- Measures the delay between events.
gxtxt_api_call("SIGNAL_API_v1", "events.delay", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector
- Error
InvalidGrid
b- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Matching real vector
- Error
InvalidGrid
c- Purpose
- Second signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Same length as the time axis
- Error
InvalidOperand
options.threshold- Purpose
- Threshold
- Type
- number
- Required
- No (0)
- Default
0- Units
- Signal unit
- Error
InvalidArguments
options.direction- Purpose
- Crossing direction
- Type
- choice
- Required
- No (0)
- Default
rising- Units
- 1
- Choices
rising;falling;both- Error
InvalidPolicy
options.hysteresis- Purpose
- Hysteresis
- Type
- number
- Required
- No (0)
- Default
0- Units
- Signal unit
- Minimum
0- Error
InvalidThreshold
Recorded Result · events.delay
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"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": [
128,
1
],
"real": [
-1.790262379133897,
-1.4527922061357845,
-0.8161093988707413,
0.0,
0.8161093988707402,
1.4527922061357854,
1.7902623791338947,
1.8,
1.5357039379067376,
1.0927922061357858
]
},
{
"kind": "struct",
"fields": {
"threshold": {
"kind": "array",
"shape": [
1,
1
],
"real": [
0.0
]
},
"direction": {
"kind": "text",
"value": "rising"
},
"hysteresis": {
"kind": "array",
"shape": [
1,
1
],
"real": [
0.01
]
}
}
}
]Result Preview
{
"delay_seconds": -0.10160079143500031
}time_metric.step
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing vector and real vector
- Units
- Seconds and signal unit per second
- Result
- Numeric and diagnostic fields.
- Purpose
- Measures the time characteristics of the step response.
gxtxt_api_call("SIGNAL_API_v1", "time_metric.step", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Matching real vector
- Error
InvalidGrid
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.baseline- Purpose
- Baseline
- Type
- number
- Required
- No (0)
- Default
b(1)- Units
- Signal unit
- Error
InvalidArguments
options.final- Purpose
- Final value
- Type
- number
- Required
- No (0)
- Default
b(end)- Units
- Signal unit
- Error
InvalidArguments
options.lower_fraction- Purpose
- Lower crossing fraction
- Type
- number
- Required
- No (0)
- Default
.1- Units
- 1
- Minimum
0- Maximum
1- Error
InvalidThreshold
options.upper_fraction- Purpose
- Upper crossing fraction
- Type
- number
- Required
- No (0)
- Default
.9- Units
- 1
- Minimum
0- Maximum
1- Shape
- Greater than lower_fraction
- Error
InvalidThreshold
options.settling_fraction- Purpose
- Settling fraction
- Type
- number
- Required
- No (0)
- Default
.02- Units
- 1
- Minimum
>0- Error
InvalidThreshold
Recorded Result · time_metric.step
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.06058693718652419,
0.11750309741540454,
0.17097088181959963,
0.22119921692859512,
0.2683843710533582,
0.31271072120902776,
0.35435147357210794,
0.3934693402873666,
0.430217175269077
]
},
{
"kind": "empty"
}
]Result Preview
{
"rise_time_seconds": 0.2742447329752323,
"lower_crossing_seconds": 0.013217565434770043,
"upper_crossing_seconds": 0.2874622984100023,
"settling_time_seconds": 0.4921875,
"overshoot_fraction": 0.0,
"peak_time_seconds": 0.9921875,
"steady_state_value": 0.9996429018914238,
"undershoot_fraction": -0.0
}time_metric.slew
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing vector and real vector
- Units
- Seconds and signal unit per second
- Result
- Numeric and diagnostic fields.
- Purpose
- Measures the slew rate.
gxtxt_api_call("SIGNAL_API_v1", "time_metric.slew", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Matching real vector
- Error
InvalidGrid
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
Recorded Result · time_metric.slew
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.06058693718652419,
0.11750309741540454,
0.17097088181959963,
0.22119921692859512,
0.2683843710533582,
0.31271072120902776,
0.35435147357210794,
0.3934693402873666,
0.430217175269077
]
},
{
"kind": "empty"
}
]Result Preview
{
"maximum_slew_per_second": 7.755127959875097,
"minimum_slew_per_second": 0.002947948709532966
}time_metric.pulse
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing vector and real vector
- Units
- Seconds and signal unit per second
- Result
- Numeric and diagnostic fields.
- Purpose
- Measures the time characteristics of the pulse.
gxtxt_api_call("SIGNAL_API_v1", "time_metric.pulse", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Matching real vector
- Error
InvalidGrid
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
options.threshold- Purpose
- Threshold
- Type
- number
- Required
- No (0)
- Default
(max(b)+min(b))/2- Units
- Signal unit
- Error
InvalidArguments
Recorded Result · time_metric.pulse
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0
]
},
{
"kind": "empty"
}
]Result Preview
{
"n": 4.0,
"crossing_count": 5.0,
"period_count": 4.0,
"method": "complete_pulse_intervals",
"width_count": 4.0,
"period_seconds": 0.19921875,
"frequency_hz": 5.019607843137255,
"pulse_width_seconds": 0.091796875,
"duty_cycle": 0.46078431372549017,
"jitter_std_seconds": 0.004510548978043951
}Negative Test or Attempt Result · time_metric.pulse
Download the example script (extract the ZIP first).
Result Preview
"GXTXT:Signal:InsufficientEvents: pulse metrics require repeated rising and falling crossings"
generate.sine
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates a deterministic sine wave on the supplied time axis.
gxtxt_api_call("SIGNAL_API_v1", "generate.sine", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
Recorded Result · generate.sine
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
},
{
"kind": "empty"
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
0.0,
0.3826834323650898,
0.7071067811865475,
0.9238795325112867,
1.0,
0.9238795325112867,
0.7071067811865476,
0.3826834323650899,
1.2246467991473532e-16,
-0.38268343236508967,
-0.7071067811865475,
-0.9238795325112865
]
},
"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
]
},
"time": {
"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
]
}
}generate.multi_tone
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates a deterministic multitone waveform.
gxtxt_api_call("SIGNAL_API_v1", "generate.multi_tone", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.amplitudes- Purpose
- Tone amplitudes
- Type
array- Required
- No (0)
- Default
ones(numel(b),1)- Units
- Signal unit
- Shape
- Same length as b
- Error
DimensionMismatch
Recorded Result · generate.multi_tone
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
2,
1
],
"real": [
8,
16
]
},
{
"kind": "empty"
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
0.0,
1.0897902135516373,
1.7071067811865475,
1.6309863136978344,
1.0000000000000002,
0.21677275132473928,
-0.2928932188134524,
-0.3244233488214578,
-1.2246467991473532e-16,
0.3244233488214577,
0.29289321881345254,
-0.21677275132473817
]
},
"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
]
},
"time": {
"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
]
}
}generate.chirp
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates a chirp with linearly varying frequency.
gxtxt_api_call("SIGNAL_API_v1", "generate.chirp", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Final frequency
- Type
- number
- Required
- Yes (1)
- Units
- Hz
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
Recorded Result · generate.chirp
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
20.0
]
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
0.0,
0.38482496029734437,
0.7136356382015007,
0.9316650167886132,
0.9993116726964553,
0.900152725633147,
0.6456780906568124,
0.27545570818317583,
-0.14787736976946872,
-0.548479975009406,
-0.8506955460484044,
-0.9937245683858658
]
},
"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
]
},
"time": {
"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
]
}
}generate.square
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates a square wave with adjustable duty cycle.
gxtxt_api_call("SIGNAL_API_v1", "generate.square", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.duty- Purpose
- Duty fraction
- Type
- number
- Required
- No (0)
- Default
.5- Units
- 1
- Minimum
>0- Maximum
<1- Error
InvalidDuty
Recorded Result · generate.square
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
},
{
"kind": "empty"
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
-1.0,
-1.0,
-1.0,
-1.0
]
},
"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
]
},
"time": {
"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
]
}
}generate.pulse
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates a pulse signal with adjustable duty cycle.
gxtxt_api_call("SIGNAL_API_v1", "generate.pulse", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.duty- Purpose
- Duty fraction
- Type
- number
- Required
- No (0)
- Default
.5- Units
- 1
- Minimum
>0- Maximum
<1- Error
InvalidDuty
Recorded Result · generate.pulse
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
},
{
"kind": "empty"
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
0.0,
0.0,
0.0,
0.0
]
},
"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
]
},
"time": {
"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
]
}
}generate.impulse
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates a discrete impulse at the specified index.
gxtxt_api_call("SIGNAL_API_v1", "generate.impulse", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.index- Purpose
- Impulse index
- Type
- integer
- Required
- No (0)
- Default
1- Units
- 1
- Minimum
1- Shape
- At most numel(a)
- Error
InvalidIndex
Recorded Result · generate.impulse
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "empty"
},
{
"kind": "empty"
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
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": [
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
]
},
"time": {
"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
]
}
}generate.white_noise
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates white Gaussian noise with an explicit seed.
gxtxt_api_call("SIGNAL_API_v1", "generate.white_noise", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.seed- Purpose
- Random seed
- Type
- integer
- Required
- Yes (1)
- Units
- 1
- Minimum
0- Error
SeedRequired
Recorded Result · generate.white_noise
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "empty"
},
{
"kind": "empty"
},
{
"kind": "struct",
"fields": {
"seed": {
"kind": "array",
"shape": [
1,
1
],
"real": [
613
]
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
-0.1297983654819169,
-0.14371019472947513,
-1.332667708957102,
1.6801156482455213,
-1.0963446600469144,
-0.5788560544724631,
0.29395300167536303,
0.7858319661295884,
1.322440741239405,
0.07603174226496008,
2.1684329935282767,
-0.7094495334216208
]
},
"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
]
},
"time": {
"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
]
}
}Negative Test or Attempt Result · generate.white_noise:missing-seed
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "empty"
},
{
"kind": "empty"
}
]Result Preview
"GXTXT:Signal:SeedRequired: Random seed is required"
generate.colored_noise
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates colored noise with a power-law spectrum and an explicit seed.
gxtxt_api_call("SIGNAL_API_v1", "generate.colored_noise", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
c- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.seed- Purpose
- Random seed
- Type
- integer
- Required
- Yes (1)
- Units
- 1
- Minimum
0- Error
SeedRequired
options.spectral_exponent- Purpose
- Spectral exponent
- Type
- number
- Required
- No (0)
- Default
1- Units
- 1
- Error
InvalidArguments
Recorded Result · generate.colored_noise
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "empty"
},
{
"kind": "empty"
},
{
"kind": "struct",
"fields": {
"seed": {
"kind": "array",
"shape": [
1,
1
],
"real": [
613
]
}
}
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
0.360066447714454,
0.1690273904398521,
-0.3374921680903721,
1.3320467151724438,
-0.10957213949227827,
0.18136382678404758,
0.9859352103596921,
1.597507297078357,
2.015930779478399,
1.5084209679281038,
2.5308505250502122,
1.030538992367843
]
},
"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
]
},
"time": {
"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
]
}
}generate.am
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates an example amplitude-modulated waveform.
gxtxt_api_call("SIGNAL_API_v1", "generate.am", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Carrier frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Modulation frequency
- Type
- number
- Required
- Yes (1)
- Units
- Hz
- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.depth- Purpose
- Modulation depth
- Type
- number
- Required
- No (0)
- Default
.5- Units
- 1
- Error
InvalidArguments
Recorded Result · generate.am
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
2.0
]
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
0.0,
0.4014382002110532,
0.7760816260072833,
1.057973568469808,
1.1913417161825448,
1.141636430934361,
0.9035305207833231,
0.5040693320916427,
1.6576248272650997e-16,
-0.5305925791385628,
-1.001075681791387,
-1.331274035220247
]
},
"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
]
},
"time": {
"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
]
}
}generate.fm
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Increasing time vector, scalars, or frequency vector
- Units
- Units declared by the caller
- Result
- Numeric and diagnostic fields.
- Purpose
- Generates an example frequency-modulated waveform.
gxtxt_api_call("SIGNAL_API_v1", "generate.fm", args)Fields and Options
a- Purpose
- Time
- Type
array- Required
- Yes (1)
- Units
- s
- Shape
- Increasing real vector with at least two samples
- Error
InvalidGrid
b- Purpose
- Carrier frequency
- Type
array- Required
- Yes (1)
- Units
- Hz
- Shape
- Vector for multi_tone, scalar otherwise
- Error
InvalidOperand
c- Purpose
- Modulation frequency
- Type
- number
- Required
- Yes (1)
- Units
- Hz
- Minimum
>0- Error
InvalidFrequency
options.amplitude- Purpose
- Amplitude
- Type
- number
- Required
- No (0)
- Default
1- Units
- Signal unit
- Error
InvalidArguments
options.phase_rad- Purpose
- Phase
- Type
- number
- Required
- No (0)
- Default
0- Units
- rad
- Error
InvalidArguments
options.frequency_deviation- Purpose
- Frequency deviation
- Type
- number
- Required
- No (0)
- Default
1- Units
- Hz
- Error
InvalidArguments
Recorded Result · generate.fm
Download the example script (extract the ZIP first).
Example Operands Preview
[
{
"kind": "array",
"shape": [
128,
1
],
"real": [
0.0,
0.0078125,
0.015625,
0.0234375,
0.03125,
0.0390625,
0.046875,
0.0546875,
0.0625,
0.0703125
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
},
{
"kind": "array",
"shape": [
1,
1
],
"real": [
2.0
]
}
]Result Preview
{
"value_real": {
"dtype": "float64",
"shape": [
128,
1
],
"values": [
-0.479425538604203,
-0.1047010376143296,
0.29074513472481367,
0.6439324153811344,
0.8951896567236625,
0.9988356373997486,
0.9324490279890207,
0.7027135286834914,
0.34623359378053586,
-0.07543072496157634,
-0.4860926579369859,
-0.8089706041998321
]
},
"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
]
},
"time": {
"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
]
}
}quality.spectrum
- Access
- Registered in the Python Job
- Arguments
- Typed operands a, b, and c, with an optional typed options struct.
- Shape
- Vectors and a positive scalar
- Units
- Signal unit, dB, and bits
- Result
- Numeric and diagnostic fields.
- Purpose
- Computes SNR, SINAD, THD, THD+N, SFDR, and ENOB with sampling coherent with the FFT bins.
gxtxt_api_call("SIGNAL_API_v1", "quality.spectrum", args)Fields and Options
a- Purpose
- Signal
- Type
array- Required
- Yes (1)
- Units
- Signal unit
- Shape
- Vector
- Error
InvalidOperand
b- Purpose
- Unused protocol operand
- Type
empty- Required
- No (0)
- Units
- 1
- Shape
- Unused
- Error
InvalidOperand
c- Purpose
- Sample rate
- Type
- number
- Required
- Yes (1)
- Units
- Hz
- Minimum
>0- Error
InvalidSampleRate
options.fundamental_hz- Purpose
- Fundamental frequency
- Type
- number
- Required
- No (0)
- Units
- Hz
- Minimum
>0- Shape
- FFT bin coherent with the tone frequency
- Error
NoncoherentSampling
Recorded Result · quality.spectrum
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": "array",
"shape": [
1,
1
],
"real": [
128.0
]
},
{
"kind": "struct",
"fields": {
"fundamental_hz": {
"kind": "array",
"shape": [
1,
1
],
"real": [
8.0
]
}
}
}
]Result Preview
{
"n": 128.0,
"sample_rate": 128.0,
"fundamental_hz": 8.0,
"fundamental_bin": 8.0,
"harmonic_orders": {
"dtype": "float64",
"shape": [
7,
1
],
"values": [
2.0,
3.0,
4.0,
5.0,
6.0,
7.0,
8.0
]
},
"method": "coherent_positive_fft_bins",
"normalization": "raw_positive_fft_squared",
"fundamental_power": 4096.0,
"dc_power": 5.040978703296321e-29,
"harmonic_powers": {
"dtype": "float64",
"shape": [
7,
1
],
"values": [
40.95999999999973,
3.738115339998805e-30,
6.91773038107749e-28,
1.623974022746975e-28,
5.602991237240054e-29,
2.878205578790401e-30,
2.96192311623379e-35
]
},
"noise_power": 0.0,
"noise_floor_power_per_bin": 7.497313137387964e-29,
"noise_floor_db_relative": -317.3745429773262,
"distortion_power": 40.95999999999973,
"thd": 0.09999999999999967,
"thd_db": -20.00000000000003,
"thd_plus_n": 0.09999999999999967,
"snr_db": Infinity,
"sinad_db": 20.00000000000003,
"sfdr_db": 20.00000000000003,
"enob_bits": 3.0299003322259184
}Negative Test or Attempt Result · quality.spectrum
Download the example script (extract the ZIP first).
Result Preview
"GXTXT:Signal:InvalidFrequency: fundamental_hz must lie below Nyquist"