mindspore.dataset.audio.RiaaBiquad

class mindspore.dataset.audio.RiaaBiquad(sample_rate)[source]

Apply RIAA vinyl playback equalization.

Similar to SoX implementation.

Parameters

sample_rate (int) – sampling rate of the waveform, e.g. 44100 (Hz), can only be one of 44100, 48000, 88200, 96000.

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

  • ValueError – If sample_rate is not any of [44100, 48000, 88200, 96000].

Supported Platforms:

CPU

Examples

>>> import numpy as np
>>> import mindspore.dataset as ds
>>> import mindspore.dataset.audio as audio
>>>
>>> # Use the transform in dataset pipeline mode
>>> waveform = np.random.random([5, 24])  # 5 samples
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.RiaaBiquad(44100)]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])
>>> for item in numpy_slices_dataset.create_dict_iterator(num_epochs=1, output_numpy=True):
...     print(item["audio"].shape, item["audio"].dtype)
...     break
(24,) float64
>>>
>>> # Use the transform in eager mode
>>> waveform = np.random.random([24])  # 1 sample
>>> output = audio.RiaaBiquad(44100)(waveform)
>>> print(output.shape, output.dtype)
(24,) float64
Tutorial Examples: