PraatIntensityEnvelope#
Defined in: voxatlas.features.acoustic.envelope.praat_intensity
- class voxatlas.features.acoustic.envelope.praat_intensity.PraatIntensityEnvelope[source]#
Bases:
BaseExtractorExtract the
acoustic.envelope.praat_intensityfeature within the VoxAtlas pipeline.Computes a smoothed, frame-aligned intensity-like contour intended to serve as a lightweight proxy for Praat-style intensity tracking.
Algorithm#
The implementation mirrors the code path.
RMS amplitude The waveform is framed and converted to RMS values \(r_t\).
Smoothing The RMS contour is smoothed with a moving-average window of length
smoothingframes.
Notes
This extractor does not attempt to reproduce Praat’s full intensity computation (e.g., frequency weighting and dB scaling). It provides a consistent, frame-aligned contour suitable for downstream transforms.
- name#
Registry key for this extractor (
"acoustic.envelope.praat_intensity").- Type:
str
- input_units#
Required input unit level.
Nonemeans this extractor operates directly on waveform audio.- Type:
str | None
- output_units#
Output alignment unit (
"frame").- Type:
str | None
- dependencies#
Upstream features required before execution. Empty for this extractor.
- Type:
list[str]
- default_config#
Default runtime parameters:
frame_length=0.025,frame_step=0.01,peak_threshold=0.1,smoothing=5.- Type:
dict
References
Boersma, P. (2001). Praat, a system for doing phonetics by computer. *Glot International, 5*(9/10), 341–345.
Examples
>>> import numpy as np >>> from voxatlas.audio.audio import Audio >>> from voxatlas.features.acoustic.envelope.praat_intensity import PraatIntensityEnvelope >>> from voxatlas.features.feature_input import FeatureInput >>> audio = Audio(waveform=np.zeros(1600, dtype=np.float32), sample_rate=16000) >>> feature_input = FeatureInput(audio=audio, units=None, context={}) >>> params = PraatIntensityEnvelope.default_config.copy() >>> out = PraatIntensityEnvelope().compute(feature_input, params) >>> out.unit 'frame'
- name: str = 'acoustic.envelope.praat_intensity'#
- input_units: str | None = None#
- output_units: str | None = 'frame'#
- dependencies: list[str] = []#
- default_config: dict = {'frame_length': 0.025, 'frame_step': 0.01, 'peak_threshold': 0.1, 'smoothing': 5}#
- 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
FeatureInputbundle, 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
frameunit level when applicable.- Return type:
FeatureOutput
Examples
>>> import numpy as np >>> from voxatlas.audio.audio import Audio >>> from voxatlas.features.acoustic.envelope.praat_intensity import PraatIntensityEnvelope >>> from voxatlas.features.feature_input import FeatureInput >>> audio = Audio(waveform=np.zeros(1600, dtype=np.float32), sample_rate=16000) >>> feature_input = FeatureInput(audio=audio, units=None, context={}) >>> params = PraatIntensityEnvelope.default_config.copy() >>> result = PraatIntensityEnvelope().compute(feature_input, params) >>> result.values.shape[0] > 0 True