medkit.audio.preprocessing#

APIs#

For accessing these APIs, you may use import like this:

from medkit.audio.preprocessing import <api_to_import>

Classes:

Downmixer(output_label[, prevent_clipping, uid])

Downmixing operation converting multichannel audio signals to mono.

PowerNormalizer(output_label[, ...])

Normalization operation setting the RMS power of each audio signal to a target value.

class Downmixer(output_label, prevent_clipping=True, uid=None)[source]#

Downmixing operation converting multichannel audio signals to mono.

Parameters
  • output_label (str) – Label of output downmixed segments.

  • prevent_clipping (bool) – If True, normalize downmixed signals by number of channels to prevent clipping.

  • uid (str) – Identifier of the downmixer.

Methods:

run(segments)

Return a downmixed segment for each segment in segments.

set_prov_tracer(prov_tracer)

Enable provenance tracing.

Attributes:

description

Contains all the operation init parameters.

run(segments)[source]#

Return a downmixed segment for each segment in segments.

Parameters

segments (List[Segment]) – Audio segments to downmix.

Return type

List[Segment]

Returns

List[~medkit.core.audio.Segment] – Downmixed segments, one per segment in segments.

property description: medkit.core.operation_desc.OperationDescription#

Contains all the operation init parameters.

Return type

OperationDescription

set_prov_tracer(prov_tracer)#

Enable provenance tracing.

Parameters

prov_tracer (ProvTracer) – The provenance tracer used to trace the provenance.

class PowerNormalizer(output_label, target_value=1.0, channel_wise=False, uid=None)[source]#

Normalization operation setting the RMS power of each audio signal to a target value.

Parameters
  • output_label (str) – Label of output normalized segments.

  • target_value (float) – Value to set the RMS power of each segment to.

  • channel_wise (bool) – If True, the normalization is performed per-channel, thus modifying the balance of multichannel signals.

  • uid (str) – Identifier of the normalizer.

Methods:

run(segments)

Return a normalized segment for each segment in segments.

set_prov_tracer(prov_tracer)

Enable provenance tracing.

Attributes:

description

Contains all the operation init parameters.

run(segments)[source]#

Return a normalized segment for each segment in segments.

Parameters

segments (List[Segment]) – Audio segments to normalize.

Return type

List[Segment]

Returns

List[~medkit.core.audio.Segment] – Power-normalized segments, one per segment in segments.

property description: medkit.core.operation_desc.OperationDescription#

Contains all the operation init parameters.

Return type

OperationDescription

set_prov_tracer(prov_tracer)#

Enable provenance tracing.

Parameters

prov_tracer (ProvTracer) – The provenance tracer used to trace the provenance.

Subpackages / Submodules#

medkit.audio.preprocessing.downmixer

medkit.audio.preprocessing.power_normalizer

medkit.audio.preprocessing.resampler

This module needs extra-dependencies not installed as core dependencies of medkit.