mindspore.dataset.audio.DeemphBiquad

View Source On Gitee
class mindspore.dataset.audio.DeemphBiquad(sample_rate)[source]

Apply Compact Disc (IEC 60908) de-emphasis (a treble attenuation shelving filter) to the audio waveform.

Similar to SoX implementation.

Parameters

sample_rate (int) – Sampling rate of the waveform, must be 44100 or 48000 (Hz).

Raises
  • TypeError – If sample_rate is not of type int.

  • ValueError – If sample_rate is not 44100 or 48000.

  • RuntimeError – If input tensor is not in shape of <…, time>.

Supported Platforms:

CPU

Examples

>>> import numpy as np
>>> import mindspore.dataset as ds
>>> import mindspore.dataset.audio as audio
>>>
>>> waveform = np.array([[2.716064453125e-03, 6.34765625e-03], [9.246826171875e-03, 1.0894775390625e-02]])
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.DeemphBiquad(44100)]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])
Tutorial Examples: