Reply by balaji June 30, 20042004-06-30
If you have a reference vector, then you can even use Perceptual
anlayzers instead of or in addition to finding just SNR.  For audio,
actually the perceptual quality is much more important.  There is
atleast a free tool "EAQUAL" which can be used for this.

Balaji

"Jon Harris" <goldentully@hotmail.com> wrote in message news:<2jopneF12udirU1@uni-berlin.de>...
> How about if you either > 1) up-sampled the reference song to 88.2kHz using a 3rd party high-quality > "reference algorithm" > or > 2) downsampled your 2 versions back to 44.1 using the best quality algorithm you > can find, maybe again a 3rd party "reference algorithm". > > Then, with the reference and processed versions at the same sample rate, > comparison is easier. > > However, stepping back a bit, I agree with the other posters that suggest using > tones to calculate SNR rather than songs. The results will be much more > predictable, understandable, and easier to obtain. That's what the sample rate > conversion chips do for their spec sheets. In fact, reading some of those would > be a good way to get started in deepening your understanding of these issues. > > <argon_gold@hotmail.com> wrote in message > news:9903481.0406190109.6ce75fb2@posting.google.com... > > "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??
Reply by Jon Harris June 21, 20042004-06-21
How about if you either
1) up-sampled the reference song to 88.2kHz using a 3rd party high-quality
"reference algorithm"
or
2) downsampled your 2 versions back to 44.1 using the best quality algorithm you
can find, maybe again a 3rd party "reference algorithm".

Then, with the reference and processed versions at the same sample rate,
comparison is easier.

However, stepping back a bit, I agree with the other posters that suggest using
tones to calculate SNR rather than songs.  The results will be much more
predictable, understandable, and easier to obtain.  That's what the sample rate
conversion chips do for their spec sheets.  In fact, reading some of those would
be a good way to get started in deepening your understanding of these issues.

<argon_gold@hotmail.com> wrote in message
news:9903481.0406190109.6ce75fb2@posting.google.com...
> "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??
Reply by June 21, 20042004-06-21
argon_gold@hotmail.com writes:

> "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.
Hi, That is the formula for the signal-to-quantization noise ratio of a quantizer (i.e., A/D converter) that uses a technique called oversampling. The ratio Fs/(2Fmax) is called the oversampling ratio. However, the signal you're starting out with (the 44.1 kHz signal) has already been quantized. You cannot remove the quantization noise once it's been quantized. So what you're trying to do can't be done. It's based on an incorrect analysis of the signal processing involved. -- Randy Yates Sony Ericsson Mobile Communications Research Triangle Park, NC, USA randy.yates@sonyericsson.com, 919-472-1124
Reply by Jerry Avins June 21, 20042004-06-21
U-CDK_CHARLES\Charles wrote:


> I don't claim exhaustive knowledge, but my recollection is that all > audio recording is done fixed-point, at least in terms of the stored > representation.
I've never seen a floating-point DAC, so it makes sense that you're right. 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;
Reply by Jerry Avins June 21, 20042004-06-21
Jim Thomas wrote:

 > Jerry Avins wrote:
 >
 >> 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.
 >
 >
 >
 > I often call that song "One Kilohertz at Full Scale" and indeed, I 
have it on CD
 >
 > Other artists have made their own versions of it.  It's a very 
popular song for system analysis, but it doesn't have much in the way of 
rhythm.  It fails the listenability test miserably.


I have a few vinyl pressings -- some of them unplayed -- of mono test
tones at various levels and frequencies for checking out phono systems.
They were made at the RCA facility in Indianapolis for use there and at
RCA Labs. I have seen similar suites on reel-to-reel and cassette tape.
Surely there must be CE equivalents.

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;

Reply by U-CDK_CHARLES\Charles June 21, 20042004-06-21
On Mon, 21 Jun 2004 10:06:36 -0400, Jerry Avins <jya@ieee.org> wrote:
> Jim Thomas wrote: > >> Jerry Avins wrote: >> >>> 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. >> >> >> I often call that song "One Kilohertz at Full Scale" and indeed, I have >> it on CD ;-) >> >> Other artists have made their own versions of it. It's a very popular >> song for system analysis, but it doesn't have much in the way of rhythm. >> It fails the listenability test miserably. > > I have a few vinyl pressings -- some of them unplayed -- of mono test > tones at various levels and frequencies for checking out phono systems. > They were made at the RCA facility in Indianapolis for use there and at > RCA Labs. I have seen similar suites on reel-to-reel and cassette tape. > Surely there must be CE equivalents. > > Jerry
Definitely. You can also buy CDs of things like SMPTE time code in various formats. I missed whether his source is CD or not, but you if the OP downloads Audacity, it includes the ability to generate arbitrary sine waves. I don't claim exhaustive knowledge, but my recollection is that all audio recording is done fixed-point, at least in terms of the stored representation.
Reply by Jerry Avins June 21, 20042004-06-21
Jim Thomas wrote:

> Jerry Avins wrote: > >> 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. > > > I often call that song "One Kilohertz at Full Scale" and indeed, I have > it on CD ;-) > > Other artists have made their own versions of it. It's a very popular > song for system analysis, but it doesn't have much in the way of rhythm. > It fails the listenability test miserably.
I have a few vinyl pressings -- some of them unplayed -- of mono test tones at various levels and frequencies for checking out phono systems. They were made at the RCA facility in Indianapolis for use there and at RCA Labs. I have seen similar suites on reel-to-reel and cassette tape. Surely there must be CE equivalents. 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;
Reply by Jim Thomas June 21, 20042004-06-21
Jerry Avins wrote:
> 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.
I often call that song "One Kilohertz at Full Scale" and indeed, I have it on CD ;-) Other artists have made their own versions of it. It's a very popular song for system analysis, but it doesn't have much in the way of rhythm. It fails the listenability test miserably. -- Jim Thomas Principal Applications Engineer Bittware, Inc jthomas@bittware.com http://www.bittware.com (703) 779-7770 To mess up a Linux box, you need to work at it; to mess up your Windows box, you just need to work on it. - Scott Granneman
Reply by Jerry Avins June 19, 20042004-06-19
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;
Reply by Fred Marshall June 19, 20042004-06-19
"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