语音信号基础--信噪比(SNR)
我的博客: https://blog.csdn.net/qq_34638161/article/details/89711441
信噪比就是信号的平均功率和噪声的平均功率之比:S/N。用分贝(dB)作为度量单位:信噪比 = 10 * log10(S/N) (dB)
信噪比(SNR):20lg10(norm(x1)/norm(x2))
norm:求向量或范数。
def SNR(x1, x2):
from numpy.linalg import norm
return 20 * np.log10(norm(x1) / norm(x2))
from numpy.linalg import norm
x2 = x2 / norm(x2) * norm(x1) / (10.0 ** (0.05 * snr))
mix = x1 + x2
参考: https://blog.csdn.net/yyhaohaoxuexi/article/details/88350343 (含代码)
赞 (0)