nemo_curator.stages.audio.filtering.band_filter_module.features

View as Markdown

Module Contents

Classes

NameDescription
AudioFeatureExtractorAudio feature extractor for band energy classification.

Data

_HIGH_FREQ_CUTOFF

_MIN_LOUDNESS_THRESHOLD

API

class nemo_curator.stages.audio.filtering.band_filter_module.features.AudioFeatureExtractor()

Audio feature extractor for band energy classification.

BAND_DEFINITIONS
dict[str, tuple[int, int]]
nemo_curator.stages.audio.filtering.band_filter_module.features.AudioFeatureExtractor.calculate_band_energy(
y: numpy.ndarray,
sr: int
) -> dict[str, float]
staticmethod

Calculate energy in different frequency bands with LUFS normalization.

Parameters:

y
np.ndarray

Audio time series

sr
int

Sampling rate

Returns: dict[str, float]

Dictionary with energy levels for each frequency band

nemo_curator.stages.audio.filtering.band_filter_module.features.AudioFeatureExtractor.extract_band_features_from_waveform(
waveform: numpy.ndarray,
sr: int
) -> dict[str, float]
staticmethod

Extract band energy features from a waveform tensor/array.

Parameters:

waveform
np.ndarray

Audio waveform tensor/array

sr
int

Sample rate of the waveform

Returns: dict[str, float]

Dictionary of band energy feature names and values

nemo_curator.stages.audio.filtering.band_filter_module.features.AudioFeatureExtractor.features_dict_to_vector(
features_dict: dict[str, float]
) -> tuple[numpy.ndarray, list[str]]
staticmethod

Convert a dictionary of features to a feature vector.

Parameters:

features_dict
dict[str, float]

Dictionary of feature name-value pairs

Returns: tuple[np.ndarray, list[str]]

Tuple of (feature_vector, feature_names)

nemo_curator.stages.audio.filtering.band_filter_module.features.AudioFeatureExtractor.get_empty_feature_dict() -> dict[str, float]
staticmethod

Create an empty feature dictionary with all band energy keys set to 0.0.

Returns: dict[str, float]

Dictionary with all band energy feature keys initialized to 0.0

nemo_curator.stages.audio.filtering.band_filter_module.features._HIGH_FREQ_CUTOFF = 10000
nemo_curator.stages.audio.filtering.band_filter_module.features._MIN_LOUDNESS_THRESHOLD = -100.0