mindspore.dataset.audio.Angle

View Source On Gitee
class mindspore.dataset.audio.Angle[source]

Calculate the angle of complex number sequence.

Note

The shape of the audio waveform to be processed needs to be <…, complex=2>. The first dimension represents the real part while the second represents the imaginary.

Raises

RuntimeError – If input tensor is not in shape of <…, complex=2>.

Supported Platforms:

CPU

Examples

>>> import numpy as np
>>> import mindspore.dataset as ds
>>> import mindspore.dataset.audio as audio
>>>
>>> waveform = np.array([[1.43, 5.434], [23.54, 89.38]])
>>> numpy_slices_dataset = ds.NumpySlicesDataset(data=waveform, column_names=["audio"])
>>> transforms = [audio.Angle()]
>>> numpy_slices_dataset = numpy_slices_dataset.map(operations=transforms, input_columns=["audio"])
Tutorial Examples: