apply_preemphasis

ketos.audio.utils.filter.apply_preemphasis(sig, coeff=0.97)[source]

Apply pre-emphasis to signal

Args:
signumpy array

1-d array containing the signal.

coeff: float

The preemphasis coefficient. If set to 0, no preemphasis is applied (the output will be the same as the input).

Returns:
emphasized_signalnumpy array

The filtered signal.

Example:

>>> from ketos.audio.utils.filter import apply_preemphasis
>>> sig = np.array([1,2,3,4,5])
>>> sig_new = apply_preemphasis(sig, coeff=0.95)
>>> print(sig_new)
[1.   1.05 1.1  1.15 1.2 ]