Skip to content

Commit

Permalink
Energy was wrongly calculated in get_snr.
Browse files Browse the repository at this point in the history
  • Loading branch information
LukasDrude authored and boeddeker committed Aug 16, 2019
1 parent f705ed4 commit fe5829b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nt/speech_enhancement/noise/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ def get_snr(X, N):
:param N: Signal of noise image.
:return: SNR of time signals or STFT signals in dB.
"""
energy_X = numpy.mean(numpy.abs(X)**2)
energy_N = numpy.mean(numpy.abs(N)**2)
energy_X = numpy.var(X)
energy_N = numpy.var(N)
return 10 * numpy.log10(energy_X / energy_N)


Expand Down

0 comments on commit fe5829b

Please sign in to comment.