Log in

View Full Version : An Idea for comparing audio


cid_xvid
10th July 2004, 12:30
Hello, people!

This is my first post at doom9 forums, and my first post in English. So (perhaps), only people like me (Spanish that want to talk in English) can understand me.

Anyway, if you can, I will tell you about my experiment.

I have been playing with avisynth, with two functions, compare and Wavsource (the same results as Directshowsource); with an original wav file and with ogg and mp3 encoded from the original wav ant then decoded again to wav.

I made this script, and I opened it with latest VirtualdubMod.

----------------------------------------------------------

a=WAVSource("D:\PRUEBA\WAV\1.wav")
clip1=Histogram (a,"stereooverlay")
clip1=ConvertToYUY2(clip1)


b=WAVSource("D:\PRUEBA\MP3\97a3.wav")
clip2=Histogram (b,"stereooverlay")
clip2=ConvertToYUY2(clip2)


Compare(clip1,clip2,"","97a3.log")

----------------------------------------------------------

I used "stereooverlay", no "stereo", but I believe it didn’t modified the results.

And those are the results:

For mp3 (Lame versions 3.90.1, 3.93, 3.95, 3.96, 3.97alpha2, 397alpha3).

--alt-preset cbr 128 in 3.90.1 and 3.93

--preset cbr 128 the others.
(According hydrogenaudio, but perhaps I didn’t understand something).

LAME 3.90.1

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0057 0.0223
Mean Deviation: -0.0083 +0.0020 +0.0126
PSNR: 41.9159 49.6475 105.3265
Overall PSNR: 47.9100

LAME 3.93

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0056 0.0214
Mean Deviation: -0.0078 +0.0022 +0.0113
PSNR: 42.0503 49.6861 105.3265
Overall PSNR: 47.9934

LAME 3.95.1

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0044 0.0155
Mean Deviation: -0.0034 +0.0015 +0.0093
PSNR: 43.8467 51.2885 105.3265
Overall PSNR: 49.1984

LAME 3.96

Total frames processed: 2019 <--- ¿¿¿¿???

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0038 0.0151
Mean Deviation: -0.0015 +0.0021 +0.0081
PSNR: 44.0491 52.3919 105.3265
Overall PSNR: 49.7929

LAME 3.97 alpha2

Total frames processed: 2027 <--- ¿¿¿¿???

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0038 0.0151
Mean Deviation: -0.0015 +0.0021 +0.0081
PSNR: 44.0491 52.5242 105.3265
Overall PSNR: 49.8098

LAME 3.97 alpha3

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0039 0.0151
Mean Deviation: -0.0015 +0.0022 +0.0081
PSNR: 44.0491 51.8661 105.3265
Overall PSNR: 49.7264

The results are coherent, no? newer versions give more quality.

NO. Everybody knows that ogg gives better quality than mp3 at same bitrate, but here are the PSNR results:


1.0.1 -q4 (97 kbs)

Total frames processed: 1988 <--- ¿¿¿¿???

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0748 0.4245
Mean Deviation: -0.4116 -0.0700 +0.0007
PSNR: 28.9726 40.0201 105.3265
Overall PSNR: 36.3123

gt3b2 -q4 (97 kbs)

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0748 0.4245
Mean Deviation: -0.4116 -0.0700 +0.0007
PSNR: 28.9726 40.0130 105.3265
Overall PSNR: 36.3112

aotuvb2 -q4 (97 kbs)

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0717 0.4538
Mean Deviation: -0.4444 -0.0668 +0.0008
PSNR: 28.9045 40.1072 105.3265
Overall PSNR: 36.4928

1.0.1 -q6 (134 kbs)

Total frames processed: 1988 <--- ¿¿¿¿???

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0504 0.3101
Mean Deviation: -0.3011 -0.0467 +0.0008
PSNR: 30.3287 41.8349 105.3265
Overall PSNR: 38.0573

gt3b2 -q6 (134 kbs)

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0515 0.3117
Mean Deviation: -0.3029 -0.0479 +0.0008
PSNR: 30.3271 41.7363 105.3265
Overall PSNR: 37.9593

aotuvb2 -q6 (134 kbs)

Total frames processed: 1987

Minimum Average Maximum
Mean Absolute Deviation: 0.0000 0.0497 0.3239
Mean Deviation: -0.3161 -0.0461 +0.0005
PSNR: 30.0039 41.8178 105.3265
Overall PSNR: 38.1171

As you see, psnr values are lower in comparison with mp3 ones. But we have seen the same with Lame. I read in hydrogenaudio forums that quality in ogg vorbis files, in ascending order, is the following:

ogg 1.0.1 < ogg b2 < ogg autvb2

And the results are "almost" coherent with hydrogenaudio forums for this wav file (see gt3b2).

So we can’t use it for compare quality between different audio codecs. But perhaps is a way to find the best settings for a specific codec. I don’t know, this is just an experiment.

There are three things that I believe may exerce influence in the results.

First, the video generated from the wav file. 25 fps are representing all the frames (or its equivalent name for wav) of a second of the wav file.

Second, the duration of decoded wav files is not the same as the original one.

Three, the method used for representing the wav file in the video may not be idoneus for
this use.

I wish this post may interest to you, perhaps someone knows perfectly that I have said something stupid. The only thing I’m trying, is to give an idea for testing audio, this is just an experiment. Perhaps someone can take this for a new filter (representing the wav file in a better way), or something like that.

The file used is my mother singing in a low quality record made 30 - 35 years ago. As my mother is not Loretta Franklin or Nancy Sinatra, and I don’t want to be disinherited (she isn´t a millionaire, anyway), I’m not going to make public this wav file. ;-)

(Shakespeare, don’t get offended by my use of your language, anyway you are dead)

¡nos vemos = see you!

Manao
10th July 2004, 13:26
If a metric was never used to compare audio codec, there is a reason : the quality of a codec isn't related to any kind of mathematical measurement you could make between the source and the result.

During the listening process, a lot of psychoaccoustic phenomenons take place, which can't be taken into a account by a simple metric ( especially PSNR ).

That's why rjamorim is doing a lot of blind tests in order to rank the different codecs.

So don't worry, your results are normal

cid_xvid
10th July 2004, 18:31
In some place (I don´t remember where) I read there were some attempts.

I looked for this theme on the forum before I posted it, but I couldn´t find anything. Now I know why.

Anyway I was just playing, thanks for your reply.