mindspore.dataset.audio.transforms.BandpassBiquad
- class mindspore.dataset.audio.transforms.BandpassBiquad(sample_rate, central_freq, Q=0.707, const_skirt_gain=False)[source]
Design two-pole band-pass filter. Similar to SoX implementation.
- Parameters
sample_rate (int) – Sampling rate of the waveform, e.g. 44100 (Hz), the value can’t be zero.
central_freq (float) – Central frequency (in Hz).
Q (float, optional) – Quality factor, https://en.wikipedia.org/wiki/Q_factor, range: (0,1] (default=0.707).
const_skirt_gain (bool, optional) – If True, uses a constant skirt gain (peak gain = Q). If False, uses a constant 0dB peak gain (default=False).
Examples
>>> import numpy as np >>> >>> 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.BandpassBiquad(44100, 200.0)] >>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])