From c47fef5c59daaf4d8160f3e3adef1d5595319f78 Mon Sep 17 00:00:00 2001 From: Hagen Wierstorf Date: Tue, 22 Mar 2022 13:54:51 +0100 Subject: [PATCH] Fix calculation of SNR value --- examples/tutorials/audio_data_augmentation_tutorial.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/tutorials/audio_data_augmentation_tutorial.py b/examples/tutorials/audio_data_augmentation_tutorial.py index d191b079595..f11a2471a16 100644 --- a/examples/tutorials/audio_data_augmentation_tutorial.py +++ b/examples/tutorials/audio_data_augmentation_tutorial.py @@ -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