medkit.audio.preprocessing.power_normalizer#
Classes#
Normalization operation setting the RMS power of each audio signal to a target value. |
Module Contents#
- class medkit.audio.preprocessing.power_normalizer.PowerNormalizer(output_label: str, target_value: float = 1.0, channel_wise: bool = False, uid: str | None = None)#
Bases:
medkit.core.audio.PreprocessingOperation
Normalization operation setting the RMS power of each audio signal to a target value.
- Parameters:
- output_labelstr
Label of output normalized segments.
- target_valuefloat, default=1.0
Value to set the RMS power of each segment to.
- channel_wisebool, default=False
If True, the normalization is performed per-channel, thus modifying the balance of multichannel signals.
- uidstr, optional
Identifier of the normalizer.
- init_args#
- output_label#
- channel_wise#
- target_value#
- run(segments: list[medkit.core.audio.Segment]) list[medkit.core.audio.Segment] #
Return a normalized segment for each segment in segments.
- Parameters:
- segmentslist of Segment
Audio segments to normalize.
- Returns:
- list of Segment
Power-normalized segments, one per segment in segments.
- _normalize_segment(segment: medkit.core.audio.Segment) medkit.core.audio.Segment #