Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Typical signal to noise ratio of ADPCM (Read 20492 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Typical signal to noise ratio of ADPCM

So, I have decided to return to this forum (despite my little conflict with greynol) and I have kind of a weird question. I would like to know what is the rough SNR of a 4-bit ADPCM recording (IMA and Microsoft). For those curious why I am asking this, well, I like ripping music and sound effects from old games, and I would like know the technical side as well.

Typical signal to noise ratio of ADPCM

Reply #1
There are various adpcm flavors. Which are you using specifically? A

Typical signal to noise ratio of ADPCM

Reply #2
CompAudio from AFsp can calculate this, IIRC. But this will give you raw SNR, wheras you might be more interested in A-weighted SNR, I'd think.

Typical signal to noise ratio of ADPCM

Reply #3
There are various adpcm flavors. Which are you using specifically? A


The games I am ripping sound files from use IMA or Microsoft ADPCM.

Typical signal to noise ratio of ADPCM

Reply #4
Cool, game soundtrack ripping for the win. I may be able to calculate those parameters for codecs like that, but I guess it really depends on the average error of the encoders used in the first place... which would require that you either have the original encoders handy, or the original uncompressed audio for comparison.

Typical signal to noise ratio of ADPCM

Reply #5
Cool, game soundtrack ripping for the win. I may be able to calculate those parameters for codecs like that, but I guess it really depends on the average error of the encoders used in the first place... which would require that you either have the original encoders handy, or the original uncompressed audio for comparison.


Well I have the soundtrack in both FLAC original (released by the author years after the original game, I also have a mod that includes them in the game as 44 Khz uncompressed WAVs) form and 22 Khz IMA ADPCM form included in the game. The sounds are more important for me through as they cannot really be downloaded from the internet (at least I haven't seen any of them). I will upload some as soon as possible.

Typical signal to noise ratio of ADPCM

Reply #6
Here it is:http://www.hydrogenaudio.org/forums/index.php?showtopic=99152 .

Typical signal to noise ratio of ADPCM

Reply #7
Cool, game soundtrack ripping for the win. I may be able to calculate those parameters for codecs like that, but I guess it really depends on the average error of the encoders used in the first place... which would require that you either have the original encoders handy, or the original uncompressed audio for comparison.


Well, IMA ADPCM and Microsoft ADPCM pretty much has the same encoder always (the one built in Windows).

Typical signal to noise ratio of ADPCM

Reply #8
If you have the lossless and lossy encoded files you can compute the snr by subtraction and comparison of the level of the signal to the error.

Typical signal to noise ratio of ADPCM

Reply #9
I have to admit I don't really know how to do such a thing but I've found something http://www.baudline.com/solutions/codec/index.html .

The curious thing is, why does ADPCM achieve lower SNR than 8-bit PCM according to that website even through ADPCM usually sounds much better? Is it because a sine wave was used? Same for u and A-law, I thought they were supposed to increase SNR (and u-law and A-law files indeed hear much cleaner than linear 8 bit).

Typical signal to noise ratio of ADPCM

Reply #10
I've added the song in 44 Khz MS ADPCM to the sample thread. MS ADPCM has a far lower noise level in my opinion and I provide an ABX test here:

Quote
foo_abx 1.3.4 report
foobar2000 v1.1.16
2013/01/29 22:59:35

File A: C:\Documents and Settings\Administrator.MISO-33497FE14F.000\My Documents\Med Sci 1 msadpcm.wav
File B: C:\Documents and Settings\Administrator.MISO-33497FE14F.000\My Documents\Med Sci 1 dvi.wav

22:59:35 : Test started.
23:00:14 : 01/01  50.0%
23:00:23 : 02/02  25.0%
23:00:34 : 03/03  12.5%
23:00:43 : 04/04  6.3%
23:01:01 : 05/05  3.1%
23:01:23 : 06/06  1.6%
23:01:32 : 07/07  0.8%
23:01:51 : 08/08  0.4%
23:02:06 : 09/09  0.2%
23:02:12 : 10/10  0.1%
23:02:22 : 11/11  0.0%
23:02:31 : 12/12  0.0%
23:02:33 : Test finished.

----------
Total: 12/12 (0.0%)


(For those who wonder why the filenames are different from those in the sample thread, I have renamed them when I uploaded them to the forum, this is how they are named on my harddrive).

 

Typical signal to noise ratio of ADPCM

Reply #11
Well, I used the normalize function of soundforge .
It says that the RMS for file "Eric_Brosius___02___Med_Sci_1___44_Khz_lossless.flac" (i.e 44khz, lossless)  is -19db
Now for the error  , I  compute the difference between the previous file and ADCPM  version, (i.e Eric_Brosius___02___Med_Sci_1___44_Khz_IMA_ADPCM.wav)
using the channel converter function of soundforge.
The normalize function says that the RMS of error  is -38.2 db


So basically you have two number for 44hz version :
signal: -19 db
noise: -38.2 db


but sorry I  don't know the final formula to  compute the snr, especially if you consider that soundforge give negative values for RMS .





Typical signal to noise ratio of ADPCM

Reply #12
MS ADPCM has a far lower noise level in my opinion...

This is not unexpected as it uses a 2nd-order predictor (IMA & OKI ADPCM are 1st order).

Typical signal to noise ratio of ADPCM

Reply #13
Well, I used the normalize function of soundforge .
It says that the RMS for file "Eric_Brosius___02___Med_Sci_1___44_Khz_lossless.flac" (i.e 44khz, lossless)  is -19db
Now for the error  , I  compute the difference between the previous file and ADCPM  version, (i.e Eric_Brosius___02___Med_Sci_1___44_Khz_IMA_ADPCM.wav)
using the channel converter function of soundforge.
The normalize function says that the RMS of error  is -38.2 db


So basically you have two number for 44hz version :
signal: -19 db
noise: -38.2 db


but sorry I  don't know the final formula to  compute the snr, especially if you consider that soundforge give negative values for RMS .


Thank you very much, but what does the first value mean? RMS of what? The second I understand is of noise but the first...
Can you do to the same comparision for the MS ADPCM file please? And perhaps verify it by doing the same with an 8-bit LPCM file? An 8-bit LPCM file should have a SNR of around 48 dB (42 dB with dithering). If the results will be too different something is off.

Typical signal to noise ratio of ADPCM

Reply #14
Thank you very much, but what does the first value mean? RMS of what? The second I understand is of noise but the first...


Well to compute the SNR , you need to compare "loudness" of noise,  to "loudness" of original signal.
So basically I  compute how loud is the original lossless file (i.e RMS of file "Eric_Brosius___02___Med_Sci_1___44_Khz_lossless.flac").


Here are  more measurements:
"Standard RMS":
signal: -19 db
noise IMA ADPCM: -38.2 db
noise Micosoft ADPCM: -38 db


So the IMA is slightly less noisy, but the difference measured is not significant.

But we don't hear all frequencies at same level, and soundforge offers the option to compute RMS
by taking account of "equal loudness curve".

"RMS using equal loudness curve option":
signal: -16.6db
noise IMA ADPCM: -33db
noise Micosoft ADPCM: -32.9

So the difference is even less significant while using "equal loudness contour" option.

And finally, a last experiment, I've computed the average of both ADCPM versions (IMA + Microsoft) ,
and measured the "standard RMS" of the noise level difference (compared to lossless) .
I find -39.6 db, which is better than both ADPCM  version , separately.
So it "might" be interesting to combine two game rips.

Typical signal to noise ratio of ADPCM

Reply #15
Thank you, but what does "signal: -19 db", ratio of signal to what? If the next values compute the RMS of noise.
Can you try doing it with regular 8-bit PCM vs. 16-bit original? The results seem counter-intuitive, MS ADPCM sounds better than IMA (and I provided an ABX test to prove that I indeed hear a difference and that it is the IMA file which sounds noisier to me). The SNR you got corresponds to a 5-7 bit signal which sounds much worse than either of the ADPCM or an 8-bit version.

I understand that in for example mp3, dynamic range and SNR don't really relate and mp3 has a dynamic range of about 144 dB while frequently having a SNR of 20 dB or even lower. However, mp3 masks the noise by clever psychoacoustic methods. ADPCM does not do any psychoacoustic tricks so if the SNR is about 38 dB it should sound as bad as 6-bit PCM but it doesn't. When I'm thinking about it, what is the dynamic range of ADPCM anyways? Will it be 96 dB because of being decoded to 16-bit PCM, but with a low SNR, thus explaining the paradox?

Typical signal to noise ratio of ADPCM

Reply #16
The "dynamic range" of mp3 is actually quite a bit more than that. To understand this, you need to think in terms of a floating point number. Mp3 has, in effect, a fairly small mantissa, so it can only represent any value with limited precision. However, its exponent can range from very large to very small, making the range of values that can be represented quite large.

Typical signal to noise ratio of ADPCM

Reply #17
ADPCM does not do any psychoacoustic tricks so if the SNR is about 38 dB it should sound as bad as 6-bit PCM but it doesn't.
No, it shouldn’t, because it doesn’t output at 6-bit.

Quote
When I'm thinking about it, what is the dynamic range of ADPCM anyways? Will it be 96 dB because of being decoded to 16-bit PCM, but with a low SNR, thus explaining the paradox
Yes.

Typical signal to noise ratio of ADPCM

Reply #18
Thank you, but what does "signal: -19 db", ratio of signal to what? If the next values compute the RMS of noise.

It's the value returned by the normalize function of soundforge.
If you have  -19 db for signal, and -38.2 db for noize, then you can deduce,
that the signal is 19.2 db louder than the noize (38.2-19).
I  guess 0 db, would represent the loudest signal that the normalize function could measure on a file.

Regarding 8 bit , well I  decreased the bit depth of your file "Eric_Brosius___02___Med_Sci_1___44_Khz_lossless.flac"
to 8 bit using the most straightforward algorithm (no noise shaping).
Then again using most straightforward algorithm, I've converted it to 16 bit,
and calculated difference with original file.
RMS of difference  measured , is -96 db, which could be interpreted that there's no meaningful (or no)  difference.

EDIT: I've done the same experience, with a random file, similar result, not sure what to conclude.

EDIT  2: Listened to 8bit version of my random file from speakers, it doesn't sound bad to me.  I  won't do an ABX  test though.

Typical signal to noise ratio of ADPCM

Reply #19
I did an Audacity convert to mono + match both volumes using Amplify + invert one of the track and Mix and render way of subtracting one track from the other. I got a "noise signal", peaking only 11.3 dB below the top. The weird thing is, the quieter parts of the song (not silence, only 9-10 dB below maximum) had "noise" as quiet as -45 dB while the louder parts went up to 11.3 dB. This is not all that is strange, because the "noise" left by the subtraction is actually a recognisable signal of the music, although very noisy (I will post a sample in the uploads section). By contrast, the dithered 8-bit signal is very audibly noisy, but it leaves a normal noise signal at -35.3 dB (which is a bit weird as well as 8-bit sound should have a 48 dB SNR and dithered 42 dB as I used only 1-bits of triangular dither, plus, the original signal is slightly present in the noise as well). The undithered 8-bit signal produces normal random noise at -48.2 dB as expected. Both dithered and undithered 8-bit signal have obvious, strong noise in them, unlike the ADPCM files.

So, how to make sense of this? And why every difference signal except for the non-dithered 8-bit one has recognisable music it it?

Typical signal to noise ratio of ADPCM

Reply #20
Thank you, but what does "signal: -19 db", ratio of signal to what? If the next values compute the RMS of noise.

It's the value returned by the normalize function of soundforge.
If you have  -19 db for signal, and -38.2 db for noize, then you can deduce,
that the signal is 19.2 db louder than the noize (38.2-19).
I  guess 0 db, would represent the loudest signal that the normalize function could measure on a file.

Regarding 8 bit , well I  decreased the bit depth of your file "Eric_Brosius___02___Med_Sci_1___44_Khz_lossless.flac"
to 8 bit using the most straightforward algorithm (no noise shaping).
Then again using most straightforward algorithm, I've converted it to 16 bit,
and calculated difference with original file.
RMS of difference  measured , is -96 db, which could be interpreted that there's no meaningful (or no)  difference.

EDIT: I've done the same experience, with a random file, similar result, not sure what to conclude.


It is not an 8-bit file converted to 16-bit. I've done the same thing as you did and I got a normal noise signal at -48.2 dB as expected with an undithered 8-bit file (and the result was usual 8 bit noisy music), as I said in the post before. The other results of my experiments are very weird through...

Typical signal to noise ratio of ADPCM

Reply #21
EDIT: I've done the same experience, with a random file, similar result, not sure what to conclude.

EDIT  2: Listened to 8bit version of my random file from speakers, it doesn't sound bad to me.  I  won't do an ABX  test though.


Well, neither 4-bit ADPCM or 8-bit PCM are really "bad". 8-bit PCM was used in pretty much all 1980s samplers and 4-bit ADPCM of all flavours was present in pretty much all software with sound or music until about 2005. You can listen to the ADPCM versions too and they will sound even better than 8-bit. It is just that it is... weird, from a technical standpoint. Weird that it is so hard to get a simple SNR value for it. Are there any formulas for ADPCM like there is the famous 6x number of bits = SNR in dB for PCM?

If you want bad, try 1-bit Nintendo DPCM  .

Typical signal to noise ratio of ADPCM

Reply #22
I got a "noise signal", peaking only 11.3 dB below the top.


Measuring RMS is more representative of loudness than peak.

Quote
Well, neither 4-bit ADPCM or 8-bit PCM are really "bad".


I  guess , that higher bit depth is only useful, if you want to reach higher dynamic range.

Typical signal to noise ratio of ADPCM

Reply #23
I did an Audacity convert to mono + match both volumes using Amplify + invert one of the track and Mix and render way of subtracting one track from the other. I got a "noise signal", peaking only 11.3 dB below the top. The weird thing is, the quieter parts of the song (not silence, only 9-10 dB below maximum) had "noise" as quiet as -45 dB while the louder parts went up to 11.3 dB. This is not all that is strange, because the "noise" left by the subtraction is actually a recognisable signal of the music, although very noisy (I will post a sample in the uploads section). By contrast, the dithered 8-bit signal is very audibly noisy, but it leaves a normal noise signal at -35.3 dB (which is a bit weird as well as 8-bit sound should have a 48 dB SNR and dithered 42 dB as I used only 1-bits of triangular dither, plus, the original signal is slightly present in the noise as well). The undithered 8-bit signal produces normal random noise at -48.2 dB as expected. Both dithered and undithered 8-bit signal have obvious, strong noise in them, unlike the ADPCM files.

So, how to make sense of this? And why every difference signal except for the non-dithered 8-bit one has recognisable music it it?


Have you looked at the wikipedia page on ADPCM?  What you're describing is basically the difference between PCM and ADPCM:

Quote
The default signal compression encoding on a DS0 is either ?-law (mu-law) PCM (North America and Japan) or A-law PCM (Europe and most of the rest of the world). These are logarithmic compression systems where a 13 or 14 bit linear PCM sample number is mapped into an 8 bit value.


So it's compression involves taking a 14 bit signal (or some other value depending on the flavor of ADPCM) and spacing the levels on a log scale.  So if the signal is very quiet, the levels are close together, and the error is smaller.  If the signal is larger, the error is larger.  If the error was constant, you'd have regular PCM.

Typical signal to noise ratio of ADPCM

Reply #24
I got a "noise signal", peaking only 11.3 dB below the top.


Measuring RMS is more representative of loudness than peak.

Quote
Well, neither 4-bit ADPCM or 8-bit PCM are really "bad".


I  guess , that higher bit depth is only useful, if you want to reach higher dynamic range.


Well, bit depth of 8-bit PCM or 4-bit ADPCM has quite obvious noise. It is not annoying, but it is also clearly not CD quality. Also, as I learned here, 4-bit ADPCM actually has a 96 dB dynamic range. (because it is mapped to 16 bit). The SNR and dynamic range are the same in undithered PCM, but not in dithered PCM or any flavour of ADPCM. If I understood correctly, this is why you can hear the signal below the noise level on dithered PCM, ADPCM and mp3, kind of like on cassette tapes. The "noise floor" of undithered PCM is more like the event horizon of a black hole - you cannot have a signal under the noise level, it is forever lost.

8-bit PCM, unlike ADPCM, has a lower dynamic range (48 dB), but it is not the same kind of dynamic range reduction as in clipped and overcompressed awful "loudness war" sound. Clipping destroys the most significant bits of the recording (it cuts the dynamic range "from the top", making waveforms have square wave shapes on their peaks), while normal bit rate reduction removes the least significant bits, decreasing dynamic range "from the bottom" (dithering is more complicated through). 8-bit PCM will not dynamically compress the sound at all, but it will distort fadeouts and quiet parts and this is why dithering is used - it reduces the SNR but increases the dynamic range.