audiblelight.augmentation.Preemphasis

audiblelight.augmentation.Preemphasis#

class audiblelight.augmentation.Preemphasis(sample_rate=44100, coef=None)#

Bases: EventAugmentation

Applies preemphasis to the audio.

Pre-emphasizes an audio signal with a first-order differencing filter, such that

..math::

y[n] = y[n] - text{coef} times y[n-1], text{where coef} in {0, 1}

Parameters:
  • sample_rate (custom_types.Numeric) – the sample rate for the effect to use.

  • coef (int | float | complex | integer | floating | DistributionLike | None) – the coefficient for pre-emphasis, sampled between 0 and 1 when not provided. At coef=0, the signal is unchanged. At coef=1, the result is the first-order difference of the signal.

__init__(sample_rate=44100, coef=None)#
Parameters:
  • sample_rate (int | float | complex | integer | floating | None)

  • coef (int | float | complex | integer | floating | DistributionLike | None)

Methods

__init__([sample_rate, coef])

from_dict(input_dict)

Initialise an augmentation from a dictionary.

process(input_array)

Calls the underlying FX (or a list of FX)

sample_value(override, default_dist)

Samples a value according to the following method:

to_dict()

Returns the parameters used by this augmentation

Attributes

AUGMENTATION_TYPE

MAX_COEF

MIN_COEF

name

Returns the name of this augmentation

MAX_COEF = 1.0#
MIN_COEF = 0.0#