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

27 lines
1.9 KiB
ReStructuredText
Raw 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.GriffinLim
==================================
.. py:class:: mindspore.dataset.audio.GriffinLim(n_fft=400, n_iter=32, win_length=None, hop_length=None, window_type=WindowType.HANN, power=2.0, momentum=0.99, length=None, rand_init=True)
使用Griffin-Lim算法从线性幅度频谱图中计算信号波形。
有关Griffin-Lim算法更多的描述详见论文 `A fast Griffin-Lim algorithm <https://doi.org/10.1109/WASPAA.2013.6701851>`_
`Signal estimation from modified short-time Fourier transform <https://doi.org/10.1109/ICASSP.1983.1172092>`_
参数:
- **n_fft** (int, 可选) - FFT的长度。默认值400。
- **n_iter** (int, 可选) - 相位恢复的迭代次数。默认值32。
- **win_length** (int, 可选) - GriffinLim的窗口大小。默认值None将设置为 `n_fft` 的值。
- **hop_length** (int, 可选) - STFT窗口之间的跳数长度。默认值None将设置为 `win_length//2`
- **window_type** (WindowType, 可选) - GriffinLim的窗口类型可以是WindowType.BARTLETT
WindowType.BLACKMANWindowType.HAMMINGWindowType.HANN或WindowType.KAISER。
默认值WindowType.HANN目前macOS上不支持kaiser窗口。
- **power** (float, 可选) - 幅度谱图的指数。默认值2.0。
- **momentum** (float, 可选) - 快速Griffin-Lim的动量。默认值0.99。
- **length** (int, 可选) - 预期输出波形的长度。默认值None将设置为stft矩阵的最后一个维度的值。
- **rand_init** (bool, 可选) - 随机相位初始化或全零相位初始化标志。默认值True。
异常:
- **RuntimeError** - 当 `n_fft` 指定的FFT长度不小于 `length` 指定的输出波形长度。
- **RuntimeError** - 当 `win_length` 指定的窗口长度不小于 `n_fft` 指定的FFT长度。