语音信号基础--信噪比(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:求向量或范数。

  1. def SNR(x1, x2):
  2. from numpy.linalg import norm
  3. return 20 * np.log10(norm(x1) / norm(x2))
  1. from numpy.linalg import norm
  2. x2 = x2 / norm(x2) * norm(x1) / (10.0 ** (0.05 * snr))
  3. mix = x1 + x2

参考: https://blog.csdn.net/yyhaohaoxuexi/article/details/88350343  (含代码)

 

(0)

相关推荐