JitterExtractor#

Defined in: voxatlas.features.acoustic.voice_quality.jitter

class voxatlas.features.acoustic.voice_quality.jitter.JitterExtractor[source]#

Bases: BaseExtractor

Extract the acoustic.voice_quality.jitter feature within the VoxAtlas pipeline.

This public extractor defines the reusable API for computing acoustic.voice_quality.jitter from VoxAtlas structured inputs. It consumes None units and produces values aligned to frame units, making the extractor a stable pipeline node that can be cited independently of the surrounding execution machinery.

Algorithm#

The extractor derives relative cycle-to-cycle pitch perturbation from the framewise \(f_0\) contour.

  1. Voiced selection Only adjacent frames with finite, positive \(f_0\) values are compared.

  2. Relative perturbation The implemented statistic is

    \[J_t = \frac{|f_t - f_{t-1}|}{\max(f_{t-1}, \varepsilon)}.\]
  3. Packaging Undefined transitions remain NaN so downstream aggregation can treat them as unvoiced or unsupported frames.

Notes

This extractor declares the upstream dependencies [‘acoustic.pitch.f0’] and is executed only after those features are available in the pipeline feature store.

Examples

>>> import numpy as np
>>> from voxatlas.features.acoustic.voice_quality.jitter import JitterExtractor
>>> from voxatlas.features.feature_input import FeatureInput
>>> from voxatlas.features.feature_output import VectorFeatureOutput
>>> from voxatlas.pipeline.feature_store import FeatureStore
>>> store = FeatureStore()
>>> f0_out = VectorFeatureOutput(
...     feature="acoustic.pitch.f0",
...     unit="frame",
...     time=np.array([0.0, 0.01, 0.02], dtype=np.float32),
...     values=np.array([100.0, 100.0, 100.0], dtype=np.float32),
... )
>>> store.add("acoustic.pitch.f0", f0_out)
>>> feature_input = FeatureInput(audio=None, units=None, context={"feature_store": store})
>>> out = JitterExtractor().compute(feature_input, {})
>>> (np.isnan(out.values[0]), out.values[1:].tolist())
(True, [0.0, 0.0])
name: str = 'acoustic.voice_quality.jitter'#
input_units: str | None = None#
output_units: str | None = 'frame'#
dependencies: list[str] = ['acoustic.pitch.f0']#
default_config: dict = {}#
compute(feature_input, params)[source]#

Compute the extractor output for a single pipeline invocation.

This method is the reusable execution entry point for the extractor. It receives the standard FeatureInput bundle, applies the configured algorithm, and returns feature values aligned to the extractor output units for storage in the pipeline feature store.

Parameters:
  • feature_input (object) – Structured extractor input bundling audio, hierarchical units, and execution context for this feature computation.

  • params (object) – Resolved feature configuration for this invocation. Keys are feature-specific and merged from defaults and pipeline settings.

Returns:

Structured output aligned to the frame unit level when applicable.

Return type:

FeatureOutput

Examples

>>> import numpy as np
>>> from voxatlas.features.acoustic.voice_quality.jitter import JitterExtractor
>>> from voxatlas.features.feature_input import FeatureInput
>>> from voxatlas.features.feature_output import VectorFeatureOutput
>>> from voxatlas.pipeline.feature_store import FeatureStore
>>> store = FeatureStore()
>>> f0_out = VectorFeatureOutput(
...     feature="acoustic.pitch.f0",
...     unit="frame",
...     time=np.array([0.0, 0.01], dtype=np.float32),
...     values=np.array([100.0, 100.0], dtype=np.float32),
... )
>>> store.add("acoustic.pitch.f0", f0_out)
>>> feature_input = FeatureInput(audio=None, units=None, context={"feature_store": store})
>>> result = JitterExtractor().compute(feature_input, {})
>>> result.unit
'frame'