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 0cd2509 commit c47fef5
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 @@ -334,7 +334,7 @@ def get_noise_sample(*, resample=None):
noise_power = noise.norm(p=2)

for snr_db in [20, 10, 3]:
snr = math.exp(snr_db / 10)
snr = 10 ** (snr_db / 20)
scale = snr * noise_power / speech_power
noisy_speech = (scale * speech + noise) / 2

Expand Down

0 comments on commit c47fef5

Please sign in to comment.