mindspore/docs/api/api_python/dataset_audio/mindspore.dataset.audio.Spe...

31 lines
1.8 KiB
ReStructuredText
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

mindspore.dataset.audio.SpectralCentroid
========================================
.. py:class:: mindspore.dataset.audio.SpectralCentroid(sample_rate, n_fft=400, win_length=None, hop_length=None, pad=0, window=WindowType.HANN)
计算每个通道沿时间轴的频谱中心。
参数:
- **sample_rate** (int) - 音频信号的采样率例如44100 (Hz)。
- **n_fft** (int, 可选) - FFT的大小将创建 `n_fft // 2 + 1` 个频段。默认值400。
- **win_length** (int, 可选) - 窗口大小。默认值None将使用 `n_fft`
- **hop_length** (int, 可选) - STFT窗口之间的跳跃长度。默认值None将使用 `win_length // 2`
- **pad** (int, 可选) - 信号两端的填充长度。默认值0。
- **window** (WindowType, 可选) - 作用于每一帧的窗口函数可为WindowType.BARTLETT、WindowType.BLACKMAN、
WindowType.HAMMING、WindowType.HANN或WindowType.KAISER。默认值WindowType.HANN。
异常:
- **TypeError** - 当 `sample_rate` 的类型不为int。
- **ValueError** - 当 `sample_rate` 为负数。
- **TypeError** - 当 `n_fft` 的类型不为int。
- **ValueError** - 当 `n_fft` 不为正数。
- **TypeError** - 当 `win_length` 的类型不为int。
- **ValueError** - 当 `win_length` 不为正数。
- **ValueError** - 当 `win_length` 大于 `n_fft`
- **TypeError** - 当 `hop_length` 的类型不为int。
- **ValueError** - 当 `hop_length` 不为正数。
- **TypeError** - 当 `pad` 的类型不为int。
- **ValueError** - 当 `pad` 为负数。
- **TypeError** - 当 `window` 的类型不为 :class:`mindspore.dataset.audio.WindowType`
- **RuntimeError** - 当输入音频的shape不为<..., time>。