Skip to content

mistake in torchaudio data augmentation tutorial #1930

Closed
@Moadab-AI

Description

@Moadab-AI

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:

speech_power = speech.norm(p=2)
noise_power = noise.norm(p=2)

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.

Metadata

Metadata

Assignees

Labels

torchaudioIssues relating to torchaudio tutorialstriagedIssues has been triaged

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions