mindspore.dataset.audio.PhaseVocoder

class mindspore.dataset.audio.PhaseVocoder(rate, phase_advance)[源代码]

Given a STFT tensor, speed up in time without modifying pitch by a factor of rate.

Parameters
  • rate (float) – Speed-up factor.

  • phase_advance (numpy.ndarray) – Expected phase advance in each bin in shape of (freq, 1).

Examples

>>> import numpy as np
>>>
>>> waveform = np.random.random([2, 44, 10, 2])
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> phase_advance = np.random.random([44, 1])
>>> transforms = [audio.PhaseVocoder(rate=2, phase_advance=phase_advance)]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])