mindspore.dataset.audio.Magphase

class mindspore.dataset.audio.Magphase(power=1.0)[源代码]

Separate a complex-valued spectrogram with shape (…, 2) into its magnitude and phase.

Parameters

power (float) – Power of the norm, which must be non-negative (default=1.0).

Examples

>>> import numpy as np
>>>
>>> waveform = np.random.random([2, 4, 2])
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.Magphase()]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])