DSPRelated.com
Forums

SNR of a Song

Started by Unknown June 17, 2004
Hi, 

could any one tell me how exactly we calculate the SNR (in time
domain) of a song processed in fixed point routine and floating point
routine.

thanks in advance

gold
argon_gold@hotmail.com wrote in message news:<9903481.0406170525.3c987804@posting.google.com>...
> Hi, > > could any one tell me how exactly we calculate the SNR (in time > domain) of a song processed in fixed point routine and floating point > routine. > > thanks in advance > > gold
That depends on whether you like the music being played or not... I think you might want to look into quantization effects in finite word-length systems. Rune
argon_gold@hotmail.com wrote in message news:<9903481.0406170525.3c987804@posting.google.com>...
> Hi, > > could any one tell me how exactly we calculate the SNR (in time > domain) of a song processed in fixed point routine and floating point > routine. > > thanks in advance > > gold
For anything like Eminem or other (C)Rappers then this is like sonar with the signal buried deep in the noise (SNR -30dB or worse). Early Bowie, Gabriel and the like the SNR is more in the range +30 to 36dB Other artistsfit into the range according to your own prejudices ;-) S-V
Gold,

If you have a high-precision reference of the song then you can
subtract it from the quantized version and the remaining samples are
essentially quantization noise.

Otherwise it's pretty tough to isolate noise, especially without an
unambiguous definition of what "noise" is, once it has been combined
with the signal.


On 17 Jun 2004 06:25:48 -0700, argon_gold@hotmail.com wrote:

>Hi, > >could any one tell me how exactly we calculate the SNR (in time >domain) of a song processed in fixed point routine and floating point >routine. > >thanks in advance > >gold
Eric Jacobsen Minister of Algorithms, Intel Corp. My opinions may not be Intel's opinions. http://www.ericjacobsen.org
Eric Jacobsen wrote:

> Gold, > > If you have a high-precision reference of the song then you can > subtract it from the quantized version and the remaining samples are > essentially quantization noise. > > Otherwise it's pretty tough to isolate noise, especially without an > unambiguous definition of what "noise" is, once it has been combined > with the signal.
It seems to me that with care and understanding, it's not hard to add essentially zero noise. The original signal will have quantization noise to start with. If it is, say, 16 bits wide and processed with a 24-bit chain, the added noise won't be measurable. With good dithering when it's chopped back to 16 bits, I doubt that added noise will matter. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Eric Jacobsen" <eric.jacobsen@ieee.org> wrote in message
news:40d31c4f.35456031@news.west.cox.net...
> Gold, > > If you have a high-precision reference of the song then you can > subtract it
Properly or carefully scaled that is.... might even require an iterative process to get the scaling to be optimal (minimum difference energy). Assuming the original has some noise in it or noiselike properties then, assuming that the noises are uncorrelated, subtracting noise from noise is additive. So, you might get a lower SNR estimate than is actually there.... One would have to run some numbers. Fred
"Fred Marshall" <fmarshallx@remove_the_x.acm.org> wrote in message news:<h_CdnTZkPINkGE7dRVn-jw@centurytel.net>...
> "Eric Jacobsen" <eric.jacobsen@ieee.org> wrote in message > news:40d31c4f.35456031@news.west.cox.net... > > Gold, > > > > If you have a high-precision reference of the song then you can > > subtract it > > Properly or carefully scaled that is.... might even require an iterative > process to get the scaling to be optimal (minimum difference energy). > Assuming the original has some noise in it or noiselike properties then, > assuming that the noises are uncorrelated, subtracting noise from noise is > additive. So, you might get a lower SNR estimate than is actually > there.... One would have to run some numbers. > > Fred
Well, the reference SONG has a sampling frequency of 44.1kHz. While I am upsampling this song by a factor of 2, that means changing its sampling frequency to 88.2kHz. I've developed two routines (fixed point 16-bit and floating point) so after processing or upsampling it,I wanna compare the SNR of the song processed by these two routines. As the sampling frequency is different after the processing so I can not simply subtract it from my reference song. I've no SNR Info even for my reference SONG. The formula expressing the SNR of a digital audio system is SNR (dB) = 6.02n + 1.76 + 10 log10 (Fs/2Fmax), where n is the number of bits per sample, Fs the sampling frequency in Hz and Fmax the maximum baseband frequency in Hz. (1) FOR fs = 44.1khz with 16-bit Fmax = 22050 a1 = (1.76 + (6.02*16)+ (10 * log10(44100/(2*22050)))) a1 = 98.0800 dB (2)(upsampling) FOR Fs = 88.2kHz with 16-bit Fmax = 22050 a2 = (1.76 + (6.02*16)+ (10 * log10(88200/(2*22050)))) a2 = 101.0903 dB The above formula tells that if I double the sampling frequency I should have 3db increase in SNR. But how to determine it exactly from a given SONG??
argon_gold@hotmail.com wrote:

   ...

> Well, the reference SONG has a sampling frequency of 44.1kHz. While I > am upsampling this song by a factor of 2, that means changing its > sampling frequency to 88.2kHz. I've developed two routines (fixed > point 16-bit and floating point) so after processing or upsampling > it,I wanna compare the SNR of the song processed by these two > routines. As the sampling frequency is different after the processing > so I can not simply subtract it from my reference song. I've no SNR > Info even for my reference SONG. > > The formula expressing the SNR of a digital audio system is SNR (dB) = > 6.02n + 1.76 + 10 log10 (Fs/2Fmax), where n is the number of bits per > sample, Fs the sampling frequency in Hz and Fmax the maximum baseband > frequency in Hz. > > (1) FOR fs = 44.1khz with 16-bit Fmax = 22050 > a1 = (1.76 + (6.02*16)+ (10 * log10(44100/(2*22050)))) > a1 = 98.0800 dB > > (2)(upsampling) FOR Fs = 88.2kHz with 16-bit Fmax = 22050 > a2 = (1.76 + (6.02*16)+ (10 * log10(88200/(2*22050)))) > a2 = 101.0903 dB > > The above formula tells that if I double the sampling frequency I > should have 3db increase in SNR. But how to determine it exactly from > a given SONG??
I'll lay odds that if you process with 16-bit words and don't dither, the noise will go up. (There's no way it can go down. You can't remove what's already there.) I don't see a way to make a noise measurement on a song, but you can test your system with a tone you generate yourself. A sine should suffice. Generate it at double precision and dither it to samples. Measure the extraneous components of the result. Process it and measure again. Compare. Voila! (Easier said than done.) Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;
"Jerry Avins" <jya@ieee.org> wrote in message
news:40d42e9b$0$3030$61fed72c@news.rcn.com...
> argon_gold@hotmail.com wrote: > > ... > > I'll lay odds that if you process with 16-bit words and don't dither, > the noise will go up. (There's no way it can go down. You can't remove > what's already there.) I don't see a way to make a noise measurement on > a song, but you can test your system with a tone you generate yourself. > A sine should suffice. Generate it at double precision and dither it to > samples. Measure the extraneous components of the result. Process it and > measure again. Compare. Voila! (Easier said than done.) > > Jerry
Gold, Jerry is right. The problem you're having is that you don't have a reference to go by. And, getting such a reference is difficult, subject to judgement in the algorithms used, etc.... perhaps impossible. The formulas you cite are estimates that start from a noiseless case. They are useful in that regard. However, if the original signal includes noise, which it surely will unless it is synthetically generated, then the SNR formulas will only tell you how much noise is added and not how much noise there *is*. Jerry's idea of a pure tone for the purpose of determining the SNR capability of a process is a good one. It's the only way I know under the circumstances that you describe. Then you would be comparing the SNR capability of one process to the SNR capability of another. With this, you could have a pretty good idea of the SNR deterioration in using one process over another. Adding one noise to another if they aren't correlated and if they are of equal amplitude will increase the total noise by 3dB. You might also ponder that the SNR resulting from a process is most likely going to be subject to the signal level at the input. So, you might take this into account by making the pure tone have the same peak level as the "song" - or something like that. Maybe someone has an idea how to set that level better. Fred
Fred Marshall wrote:

   ...

> You might also ponder that the SNR resulting from a process is most likely > going to be subject to the signal level at the input. So, you might take > this into account by making the pure tone have the same peak level as the > "song" - or something like that. Maybe someone has an idea how to set that > level better.
For an analysis of professional quality, I suggest a matrix of nine test tones: three amplitudes -- full scale, low amplitude (say 5 bits plus sign, and something between) -- and two sets of low, middle, and high frequencies, one related to the sampling frequency by small-number fractions, the other not. The results may suggest other test tones. Jerry -- Engineering is the art of making what you want from things you can get. &#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;&#4294967295;