# SNR estimation in segmented speech signals

I was called to estimate the signal-to-noise ratio in a collection of recordings that were manually annotated, meaning that the speech and noise segments are known.

The noise is uncorrelated with the signal and is additive noise: $x(i)=d(i)+n(i)$ ('d' stands for desired). I have no information regarding the sound intensity (no sound meter was employed) neither the voltage-sound-intensity relationship in devices.

I found a formula here that seems to be a possible solution (authors explain the annotated way before diving into the no boundaries problem):

$$\text{SNR}=10 \log_{10}{\left(\frac{P(x)-P(n)}{P(n)}\right)}$$

Where $P(x)$ and $P(n)$ are the power of the contamined signal 'x' and the noise signal 'n' ('n' is basically a copy of 'x' but with zero energy in the speech segments). The mean was subtracted from both signals as requested in the paper.

When I apply the formula in two separate recordings (one clean and the other containing much noise, different signals and different noise) I am getting negative measurements: -6.250953 vs. -7.793706, and a difference of just 1.5 dB between them (I was expecting to see a 20dB diference).

Does it make sense to have negative numbers? How can I interpret the 1.5 dB difference in a meaningful way? Thanks in advance for any light on this!

Below are two copies of the same magnitude spectrum of the example of the clean recording I mentioned earlier (I did not include the noisy one). The formula estimated a SNR of -6.250953 dB. I did not include the oscillogram but it oscillates in the [-1, 1] range:

This is what I am taking as the $x(i)=d(i)+n(i)$ signal: And this is what I am taking as the noise $n(i)$ signal (all energy except the black regions which represent the desired signal): Therefore the formula can be applied very straightforward

• What are these two measurements? $P(x)$ and $P(n)$ in dB? – msm Oct 25 '16 at 6:14
• According to the authors they are the energies of the signals, so $P(s)=\sum^{N}_{i=1}{|s(i)|^2}$. How ever, given that they are placed in a fraction it doesn't matter if I am using the power (I took the definition from here), as the 1/N term is factorizable and can be cancelled out. I don't think that measurements are in dB – JFonseca Oct 25 '16 at 17:14
• I was referring to $-6.250953$ and $-7.793706$. What are these two numbers? – msm Oct 25 '16 at 20:40
• Aha! They are the SNR in dB calculated with the mentioned method for a clean and a noisy recording (up and down respectively as in the image above). I used two periodic harmonic tones, not speech by the way. – JFonseca Oct 25 '16 at 21:06
• Thanks a bunch msm, this is gold. Before accepting your answer could you please review the edits I made in the original question? I am afraid I skipped some details that were important to understand the problem. – JFonseca Oct 26 '16 at 4:55

## 1 Answer

The given equation should be used with caution. Not always we can separate powers of two mixed signals just like that. It will require them to be orthogonal (or independent and at least one of them zero-mean).

In your formula the power of signal $y[n]$ is defined as $$P=\frac{1}{N}\sum_{i=1}^{N}|y[i]|^2$$ where $N$ is the length of $y$. You shouldn't forget the normalizing factor $\frac{1}{N}$.

Just to make it clear, $x$ should be a recording of signal plus noise, and $n$ should be just noise (silence/ no speech). The oscillogram of $n$ should look like the background of oscillogram of $x$ for the formula to make sense.

Regarding the negative values, logarithm of a number less than one is negative. It implies that the numerator is smaller than the denumerator, or the signal power is less than that of noise. A negative SNR can be seen in practice, where the signal is weak in nature. GPS signal can be a good example. But I really think that your noise is polluted with some sort of harmonics that don't appear in $x$, that is why the overall result is less than one and the SNR becomes negative.