support_feature_extraction.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:laughter 作者: ganesh-srinivas 项目源码 文件源码
def _hz_to_mel(frequencies, htk=False):
    frequencies = np.atleast_1d(frequencies)

    if htk:
        return 2595.0 * np.log10(1.0 + frequencies / 700.0)

    # Fill in the linear part
    f_min = 0.0
    f_sp = 200.0 / 3

    mels = (frequencies - f_min) / f_sp

    # Fill in the log-scale part

    min_log_hz = 1000.0                         # beginning of log region (Hz)
    min_log_mel = (min_log_hz - f_min) / f_sp   # same (Mels)
    logstep = np.log(6.4) / 27.0                # step size for log region

    log_t = (frequencies >= min_log_hz)
    mels[log_t] = min_log_mel + np.log(frequencies[log_t]/min_log_hz) / logstep

    return mels
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号