mindspore.dataset.audio.PhaseVocoder
- class mindspore.dataset.audio.PhaseVocoder(rate, phase_advance)[source]
Given a STFT spectrogram, 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).
- Raises
TypeError – If rate is not of type float.
ValueError – If rate is not a positive number.
TypeError – If phase_advance is not of type
numpy.ndarray
.RuntimeError – If input tensor is not in shape of <…, freq, num_frame, complex=2>.
- Supported Platforms:
CPU
Examples
>>> import numpy as np >>> import mindspore.dataset as ds >>> import mindspore.dataset.audio as audio >>> >>> 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"])
- Tutorial Examples: