2
$\begingroup$

How can I add noise to a recording to obtain a SNR value provided by the user? I am tryin to test the effects of noise on my algorithm. Is there any function or app for doing that kind of task?

Thank you.

$\endgroup$
2
$\begingroup$

Easiest way is to scale energy of noise. Nevertheless you must understand that for some files it is not that simple. Let's say that you have the recording of crying baby in silence. What is then your point of reference? Are you going to add white noise based on ratio between it's energy and average energy across the whole recording (silence+baby)? Or maybe you should calculate the energy in sliding window and then use only sound of interest as point of reference? That is why you should not add noise based on energy of your whole file.

When it comes to some particular examples, then I suggest you to take a look here for mathematical derivation. If you are looking for functions, then please check out the MATLAB awgn function. Nevertheless if you want something even more sophisticated, then you might want to check the Audio Degradation Toolbox. You can find a dedicated routine for adding various types of noise with a given SNR.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.