mindspore.dataset.audio.Biquad

class mindspore.dataset.audio.Biquad(b0, b1, b2, a0, a1, a2)[source]

Perform a biquad filter of input audio. Mathematical fomulas refer to: Digital_biquad_filter .

Parameters
  • b0 (float) – Numerator coefficient of current input, x[n].

  • b1 (float) – Numerator coefficient of input one time step ago x[n-1].

  • b2 (float) – Numerator coefficient of input two time steps ago x[n-2].

  • a0 (float) – Denominator coefficient of current output y[n], the value can’t be zero, typically 1.

  • a1 (float) – Denominator coefficient of current output y[n-1].

  • a2 (float) – Denominator coefficient of current output y[n-2].

Examples

>>> import numpy as np
>>>
>>> waveform = np.array([[2.716064453125e-03, 6.34765625e-03], [9.246826171875e-03, 1.0894775390625e-02]])
>>> biquad_op = audio.Biquad(0.01, 0.02, 0.13, 1, 0.12, 0.3)
>>> waveform_filtered = biquad_op(waveform)