-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
mistake in torchaudio data augmentation tutorial #1930
Comments
@mthrok can you take a look? |
Hi @Moadab-AI Thanks for the issue. I think this has been fixed in torchaudio side pytorch/audio#2285, and the change was ported in tutorial site #1939, which happened in June. Can you confirm that https://pytorch.org/tutorials/beginner/audio_data_augmentation_tutorial.html#adding-background-noise looks okay now? Separately, I just realized that it has not been fixed on the next section; https://pytorch.org/tutorials/beginner/audio_data_augmentation_tutorial.html#simulating-a-phone-recoding |
In pytorch#2285, the SNR calculation was fixed, but there was still one that was not fixed. This commit fixes it. Also following the feedback pytorch/tutorials#1930 (comment), update the variable name.
Addresses: #1930 Ref: pytorch/audio#2595
Summary: In #2285, the SNR calculation was fixed, but there was still one that was not fixed. This commit fixes it. Also following the feedback pytorch/tutorials#1930 (comment), update the variable name. Pull Request resolved: #2595 Reviewed By: carolineechen Differential Revision: D38314672 Pulled By: mthrok fbshipit-source-id: b2015e2709729190d97264aa191651b3af4ba856
Summary: In #2285, the SNR calculation was fixed, but there was still one that was not fixed. This commit fixes it. Also following the feedback pytorch/tutorials#1930 (comment), update the variable name. Pull Request resolved: #2595 Reviewed By: carolineechen Differential Revision: D38314672 Pulled By: mthrok fbshipit-source-id: b2015e2709729190d97264aa191651b3af4ba856
This tutorial was moved. If this is still an issue, please raise in the pytorch/audio repo. |
In the "adding background noise" section of the tutorial file :
https://github.com/pytorch/tutorials/blob/master/beginner_source/audio_data_augmentation_tutorial.py
first of all you are calculating RMS but calling it power:
and then since you're dealing with RMS, the snr_db should be divided by 20 and not 10:
snr = math.exp(snr_db / 10)
also for a "standard" SNr value you'd have to use to log in base 10 as well i suppose.
The text was updated successfully, but these errors were encountered: