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

36 lines
1.9 KiB
ReStructuredText
Raw Normal View History

2022-06-22 10:46:33 +08:00
mindspore.dataset.audio.BandpassBiquad
======================================
2021-11-22 14:54:00 +08:00
2022-06-22 10:46:33 +08:00
.. py:class:: mindspore.dataset.audio.BandpassBiquad(sample_rate, central_freq, Q=0.707, const_skirt_gain=False)
2021-11-22 14:54:00 +08:00
2022-01-13 11:46:37 +08:00
给音频波形施加双极点巴特沃斯Butterworth带通滤波器。
巴特沃斯滤波器的特点是通频带内的频率响应曲线最大限度平坦,没有纹波,而在阻频带则逐渐下降为零。
巴特沃斯带通滤波器的系统函数为:
.. math::
H(s) = \begin{cases}
\frac{s}{s^2 + \frac{s}{Q} + 1}, &\text{if const_skirt_gain=True}; \cr
\frac{\frac{s}{Q}}{s^2 + \frac{s}{Q} + 1}, &\text{if const_skirt_gain=False}.
\end{cases}
接口实现方式类似于 `SoX库 <http://sox.sourceforge.net/sox.html>`_
.. note:: 待处理音频维度需为(..., time)。
2021-11-22 14:54:00 +08:00
2022-07-08 16:45:20 +08:00
参数:
- **sample_rate** (int) - 采样频率单位Hz不能为零。
- **central_freq** (float) - 中心频率单位Hz
2022-11-02 11:17:18 +08:00
- **Q** (float, 可选) - `品质因子 <https://zh.wikipedia.org/wiki/%E5%93%81%E8%B3%AA%E5%9B%A0%E5%AD%90>`_ ,能够反映带宽与采样频率和中心频率的关系,取值范围为(0, 1]。默认值0.707。
2022-07-08 16:45:20 +08:00
- **const_skirt_gain** (bool, 可选) - 若为True则使用恒定裙边增益峰值增益为Q若为False则使用恒定的0dB峰值增益。默认值False。
异常:
- **TypeError** - 当 `sample_rate` 的类型不为int。
- **ValueError** - 当 `sample_rate` 的数值为0。
- **TypeError** - 当 `central_freq` 的类型不为float。
- **TypeError** - 当 `Q` 的类型不为float。
- **ValueError** - 当 `Q` 取值不在(0, 1]范围内。
- **TypeError** - 当 `const_skirt_gain` 的类型不为bool。
- **RuntimeError** - 当输入音频的shape不为<..., time>。