mindspore.dataset.audio.TrebleBiquad

class mindspore.dataset.audio.TrebleBiquad(sample_rate, gain, central_freq=3000, Q=0.707)[source]

Design a treble tone-control effect. Similar to SoX implementation.

Parameters
  • sample_rate (int) – Sampling rate of the waveform, e.g. 44100 (Hz), the value can’t be zero.

  • gain (float) – Desired gain at the boost (or attenuation) in dB.

  • central_freq (float, optional) – Central frequency (in Hz) (default=3000).

  • Q (float, optional) – Quality factor, https://en.wikipedia.org/wiki/Q_factor, range: (0, 1] (default=0.707).

Examples

>>> import numpy as np
>>>
>>> waveform = np.array([[1, 2, 3], [4, 5, 6]], dtype=np.float64)
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.TrebleBiquad(44100, 200.0)]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])