用 pesq 给 soundfile 读取的录音数据打分

音频文件来源 NOIZEUS: Noisy speech corpus - Univ. Texas-Dallas

很多python库都能计算pesq分数,如pypesq跟pesq两个库,这里讲的的是pesq的库

import soundfile as sf
from pesq import pesq

# 读取音频文件
audio_clean, src = sf.read('./audio/NOIZEUS/clean/sp01.wav')
audio_0dB, sr0 = sf.read('./audio/NOIZEUS/bable/0dB/sp01_babble_sn0.wav')
audio_5dB, sr5 = sf.read('./audio/NOIZEUS/bable/5dB/sp01_babble_sn5.wav')
audio_10dB, sr10 = sf.read('./audio/NOIZEUS/bable/10dB/sp01_babble_sn10.wav')
audio_15dB, sr15 = sf.read('./audio/NOIZEUS/bable/15dB/sp01_babble_sn15.wav')

score_c_c = pesq(fs = src, ref = audio_clean, deg = audio_clean, mode = 'nb')

score_c_15 = pesq(fs = src, ref = audio_clean, deg = audio_15dB, mode = 'nb')

score_c_10 = pesq(fs = src, ref = audio_clean, deg = audio_10dB, mode = 'nb')

score_c_5 = pesq(fs = src, ref = audio_clean, deg = audio_5dB, mode = 'nb')

score_c_0 = pesq(fs = src, ref = audio_clean, deg = audio_0dB, mode = 'nb')

score_0_0 = pesq(fs = src, ref = audio_0dB, deg = audio_0dB, mode = 'nb')

输出结果如下 

用 pesq 给 soundfile 读取的录音数据打分_第1张图片

你可能感兴趣的:(pesq,python)