Telling whether a wav file is sourced from an mp3?

GoldWave general discussions and community help
Post Reply
eburggraaf
Posts: 3
Joined: Sun May 14, 2006 11:28 am

Telling whether a wav file is sourced from an mp3?

Post by eburggraaf »

Hi friends, I need to be able to annalize wave files and see whether they are sourced from mp3's. I have a program that will take a 22050 hz mono or one chanel of a 44100 hz stereo wave file, and plot the spectrum of freequencies on a graph with DB on the y axis and samples on the X axis. If the maximum number of samples per DB in a 22050 hz file is between 11025 and 16000 samples, then the wave file was sourced from an mp3 orother lossy compression format.
Where it all falls down is that I am totally blind and can't see the graph. So I'm wondering if gold wave has a tool that will annalize, and return the actual sampling rate as a number? Failing that, can I set up the expression evaluater to return a true if the sampling rate is say over 19000 hz, and a false if it falls below that threshold?

Thanks,

Erik
jdeligiannis
Posts: 34
Joined: Sat Mar 05, 2005 1:50 am

Post by jdeligiannis »

There is a very simple process to know if your WAV file used to be an MP3 file.


If you have an official retail CD, do the following:

1. Extract a song in WAV format;
2. Extract the same song in MP3 format at 64kbps

As you know, low quality MP3s, which are pretty much any MP3s encoded lower than 192kbps, will have a very distinct form of distortion. You know what the sound of a low quality MP3 is. The human ear, mine anyway, will have a very hard time hearing the difference between an MP3 encoded at 192 or higher and a WAV.

Note that from here, it would be wise to use a headset.

Take the WAV file into Goldwave and select a portion of it. Go to Effects > Stereo > Reduce Vocals and select the preset to Simple Cancellation. Listen to the outcome, which should be mono. There will be a very clean and clear sound, even though many of the instruments will not be heard.

Now take the MP3 and do the same. There will be a very distinct disgusting sound to it. That is the sound that MP3 inflicts on music. In this case, the outcome of the MP3 will be brutal because it was encoded so very low. If you encode higher, the same sound will be there, but not as powerful. Try the process again with a 192 and/or 320, and you will still get a similar noise in the file, but it won't be as intense.

If someone sends you a WAV and it has that sound after you do that process, then that WAV used to be an MP3.

This process is not exclusive to Goldwave. It is a very simple procedure, and it goes as follows:

1. Invert the right channel;
2. Copy the inverted right channel;
3. Mix the copied sound into the left channel;
4. Copy the outcome of the left channel;
5. Silence the right channel;
6. Mix the copied sound into the right channel.

You now did the same exact thing a Simple Cancellation will do, except it took longer. The sound will now be mono. This process cancels all sounds that are identical in both channels (mono sounds).

-John
piano nick
Posts: 423
Joined: Wed Jun 16, 2004 8:33 pm

Post by piano nick »

John:

Very interesting reply - I learned something from that.

He might also have a look at the file with TOOL/CONTROL/SPECTOGRAM. It seemst that mp3's have virtually nothing above 16 kHz.

I'm looking at one right now that was ripped from a CD with Goldwave, and converted to 128 kbps mp3 (for use in a ordinary vehicle audio system where 16 kHz plus is pretty much useless), and there is nothing above 14.0 kHz. The spectogram is virtually flat at 14 kHz, with nothing above that.

Haven't tried 192 conversion - I should. Thanks for the tip.

You might find this site interesting - it compares various audio codecs used for compression.

http://www.extremetech.com/article2/0,1 ... 783,00.asp

PN
eburggraaf
Posts: 3
Joined: Sun May 14, 2006 11:28 am

Post by eburggraaf »

Thanks John, This is an exciting prospect and I tried it right away. I looked at a three versions of a song: Wave ripped from CD, 64 kbps mp3 and 192 kbps mp3, both stereo sources. I found I could hear the noise in both the mp3's and tell the difference no problem between the wav and the 192 kbps mp3.

So I applied this to a file ripped from a piece of audience recorded live music which I received in a mail trade. The original has the definite ring of mp3 somewhere in the liniage, but many things could account for that including minidisc or dubious shn compression. But I found I couldn't tell the difference between the original source and the cansilled version. Does that mean I have a pure copy or that it doesn't work if you have a muddy copy to begin with. Or does it mean I've been listening to too much music too loud?

Thanks,

Erik
jdeligiannis wrote:There is a very simple process to know if your WAV file used to be an MP3 file.


If you have an official retail CD, do the following:

1. Extract a song in WAV format;
2. Extract the same song in MP3 format at 64kbps

As you know, low quality MP3s, which are pretty much any MP3s encoded lower than 192kbps, will have a very distinct form of distortion. You know what the sound of a low quality MP3 is. The human ear, mine anyway, will have a very hard time hearing the difference between an MP3 encoded at 192 or higher and a WAV.

Note that from here, it would be wise to use a headset.

Take the WAV file into Goldwave and select a portion of it. Go to Effects > Stereo > Reduce Vocals and select the preset to Simple Cancellation. Listen to the outcome, which should be mono. There will be a very clean and clear sound, even though many of the instruments will not be heard.

Now take the MP3 and do the same. There will be a very distinct disgusting sound to it. That is the sound that MP3 inflicts on music. In this case, the outcome of the MP3 will be brutal because it was encoded so very low. If you encode higher, the same sound will be there, but not as powerful. Try the process again with a 192 and/or 320, and you will still get a similar noise in the file, but it won't be as intense.

If someone sends you a WAV and it has that sound after you do that process, then that WAV used to be an MP3.

This process is not exclusive to Goldwave. It is a very simple procedure, and it goes as follows:

1. Invert the right channel;
2. Copy the inverted right channel;
3. Mix the copied sound into the left channel;
4. Copy the outcome of the left channel;
5. Silence the right channel;
6. Mix the copied sound into the right channel.

You now did the same exact thing a Simple Cancellation will do, except it took longer. The sound will now be mono. This process cancels all sounds that are identical in both channels (mono sounds).

-John
eburggraaf
Posts: 3
Joined: Sun May 14, 2006 11:28 am

Post by eburggraaf »

piano nick wrote:John:

He might also have a look at the file with TOOL/CONTROL/SPECTOGRAM. It seemst that mp3's have virtually nothing above 16 kHz.
Thanks PN. Will this generate a number for me? Such as an edit box that says "the average sampling rate of this file is 14000 hz"? I have a spectrometer here, but it only generates a graph which I can't read being totally blind.
You might find this site interesting - it compares various audio codecs used for compression.

http://www.extremetech.com/article2/0,1 ... 783,00.asp
I'm happy with mp3 for most of my compression needs. It plays in more players, so if I buy something new I don't have to worry about compadibility. It gets good battery life. It takes up too much space, but space is getting cheeper by the hour. All in all, I'm happy with mp3, but I'm also a purist, and when I don't want mp3, I really don't want mp3.
PN
:)
piano nick
Posts: 423
Joined: Wed Jun 16, 2004 8:33 pm

Post by piano nick »

Didn't mean to imply that you should use anything else but mp3's. I use them all the time.

The point is that mp3's have to drop something to make the file one tenth the size of a wave file. Among other things, the process drops anything above 16 kHz.

If you look at the spectogram (and read the article I referenced) you will see that there is no sound above about 16 kHz on an mp3, whereas on a song pulled from a CD, there is quite a bit of music above that frequency.

Final point - not many males older than 20 or so can really get much out of anything above 16 kHz. This is going to start an argument as sure as can be, but I've had a hearing test, and mp3's are just fine for me.


PN
Blandine Catastrophe
Posts: 253
Joined: Sun Jul 24, 2005 3:25 pm

Post by Blandine Catastrophe »

Something who betrays often mp3 origins, specially if the mp3 was joint stereo, is a kind of "passed-through-a-jacuzzi" sounding if you listen in earphones with the cancel vocals preset of the "mix channel". This kind of degradation affects particularly the choirs and the cymbals.
Gloup? :-°
piano nick
Posts: 423
Joined: Wed Jun 16, 2004 8:33 pm

Post by piano nick »

One more observation:

Ripped a song from a CD, and used the Goldwave Spectogram. The higest frequency I observed on the WAVE file is a touch over 22.0 khz. Nyquist's Theorem states that the maximum frequency attainable is one half of 44.1 kHz = 22.05 kHz. So this result seems reasonable.

I then converted the WAV file to a 128 kbps mp3 file. The highest observable frequency was 14.0 kHz.

Then converted the WAV file to a 320 kbps mp3. This time the highest observable frequency was 21.1 kHz.

It seems that the "standard" conversion to a 128 kbps mp3 file isn't nearly as good as a 320 kbps conversion.

That all being said, it is possible that one can very likely tell a wave file that has been converted from an mp3 original because the highest frequency that will be observed in the Goldwave Spectrogram will be 14 kHz, or perhaps 16 kHz as noted in the article I referenced.

Blandine's comments also seem useful, so if it really matters, one could utilize all three methods to "test" for a wave file that was converted from an mp3 (Jdeligiannis, Blandine and the method I outlined).

Comments and rebuttals are quite welcome - otherwise how will we learn?


PN
Post Reply