# Calculate the SNR of wav file?

I am doing a project in which i have a "recorded voice". Now i have applied the noise reduction and get the "filtered voice". Now i want to calculate the SNR of recorded voice and filtered voice in matlab. I do not have pure voice for reference (As in all the previous post, pure signal is taken as reference in calculating SNR). I am confused how to do it. Please help !!

## 1 Answer

When you dont have the exact voice as a reference you can only go to estimate/measure the noise. Assuming you are facing white noise, the simplest thing is to look for either time-domain or frequency-domain parts of the signal, where no voice is present. In these parts there is only noise. Hence, if you measure the average signal power in these parts, you get the noise power P(noise). Then, you measure the overall signal power, which is P(voice) + P(noise). Finally, you can have $$SNR=\frac{P(voice)+P(noise)-P(noise)}{P(noise)}$$

• But its difficult to implement this in matlab. I just want to prove that my noise reduction algorithm is working properly that's why I thought SNR is one of the way to prove it. If you could help in matlab code I would be grateful to you. – Sourabh Goel Nov 9 '16 at 9:02
• It is not difficult to proceed with Max's suggestion in Matlab, and agree that this would be the best you could do. There will be pauses between words in the time domain signal, so you could extract these samples to get the best estimate of your noise (the more you can get the better the estimate, assuming your noise is white as Max said and stationary). Ideally if you can make new test signals, either with a minimum noise voice recording and then add your own noise in Matlab, or record with no voice present and record again with the voice on the same hardware. – Dan Boschen Mar 9 '17 at 15:08
• @SourabhGoel Then take a known sample of voice, add noise to it, and then remove it, and see how much noise is left when you subtract the original – endolith May 8 '17 at 13:37