Skip to content

Commit

Permalink
Fix calculation of SNR value
Browse files Browse the repository at this point in the history
  • Loading branch information
hagenw committed Mar 22, 2022
1 parent 1c3403e commit 34e443e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/tutorials/audio_data_augmentation_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ def get_noise_sample(*, resample=None):
snr_dbs = [20, 10, 3]
noisy_speeches = []
for snr_db in snr_dbs:
snr = math.exp(snr_db / 10)
snr = 10 ** (snr_db / 20)
scale = snr * noise_power / speech_power
noisy_speeches.append((scale * speech + noise) / 2)

Expand Down

0 comments on commit 34e443e

Please sign in to comment.