DimeFAQ:How to analyze an audio file for lossiness

From DimeWiki

Jump to: navigation, search

The most important clues showing a lossy origin in an audio file are based on the observation:

  • of the frequency curve (FA)
  • of the spectrogram (SA)
  • of the chronogram (editing the WAV file)

These are only clues and unfortunately they can’t give an answer with 100% certainty, but the presence of many of them often let no doubt.

Contents

Frequency curve analysis (FA)

A good guide already exists at audiohub so we only will add some complementary information.

The analysis you can see on this page were made with EAC, which is anyway an obligatory tool for every bootleg collector. Mac users can also use audacity

With EAC:

  • Tools > Process WAV…
  • Select the WAV file to be analysed
  • Put the cursor on the middle of the file
  • Display > Frequency analysis…
  • Preferably, select FFT size = 512 and Window function = Hanning

The typical drop-off in frequency around 16 kHz (or higher, depending on the mp3 encoding bit rate) can generally be seen clearly:

Typical_Lossy_FA

However, the main issue with EAC is that it only runs the analysis from a relatively low number of samples around the cursor. The resulting curves are then stained with noise (which explains their irregular aspect), this noise sometimes being important enough to hide the typical drop-off in frequency for lossy files.

Example :

Another lossy file analysed with EAC :

Other_Lossy_FA

By definition, noise is a random phenomenon so its mean value on a long period is null. Using some more professional tool like Soundforge which allows frequency analysis to be performed from the entire track will give a more accurate result, since not only it has a better statistical signification, but it also gives as a result a much cleaner curve, getting rid of the random noise as shown in the following picture.

Same file analysed with Soundforge, selecting the entire track:

FA_with_soundforge

The drop-off in frequency around 16 kHz, typical of a lossy sourced file, can be seen much more clearly in the view from Soundforge.


With Audacity:

Audacity can give rather good pictures by analysing up to 21.8 seconds of audio:

  • File > Open file...
  • Select the WAV file to be analysed
  • Select a 30 second interval in the middle of the file
  • Analyse > Plot Spectrum
  • Ignore the warning "too much audio was selected...", press "OK"
  • Preferably, select FFT size = 512 and Window function = Hanning


FA_with_audacity

[Top]

#FA

Spectrogram analysis (SA)

We strongly recommend to save spectrogram screenshots in png format, which gives a much better quality result than standard jpeg: SA are often uneasy to interpret, and the lossiness due to jpeg compression will often hide important details.

With EAC:

EAC can also do this analysis, and it does it perfectly well. The picture it gives are even, in our opinion, easier to read than pictures from Soundforge.

  • Tools > Process WAV…
  • Select the WAV file to be analysed
  • Display > Spectral view

Here again, the guide at audiohub is rather good, but it lacks an important piece of information. It only talks about the "haircut" as a visual clue. This one can be seen clearly when the analysis is made on the entire track, as indicated above.

But the Spectrum Analysis needs exactly the opposite of the Frequency Analysis : it gives much significant information when it’s done on a short piece in the middle of a track, zooming a 1.5 to 2 seconds selection:

  • Tools > Process WAV…
  • Select the WAV file to be analysed
  • Display > Spectral view
  • Select a 1.5 to 2 second period in the middle of the track.
  • Click on "Zoom range"

A lossless file will show a good definition picture, the colours slowly cross-fading ones into others:

Lossless_SA

A lossy sourced file will give something like that:

Lossy_SA

Another example:

Other_Lossy_SA

In addition to the haircut (always here), two typical phenomenons can be seen :

  • At the red-blue frontier the picture shows squared blocks, like a brick wall.
  • There are black holes inside the red area.


With Audacity:

Audacity can also do correct spectrum analysis, but there is a trap: by default, audacity displays only frequencies bellow 8 kHz on its spectral view, so it first has to be correctly settled:

  • Edit > Preferences... (or Ctrl-P)
  • Tab "spectrogram"
  • enter "22050" in the field "Maximim Frequency (Hz):"
  • Press OK

Now, you can go ahead:

  • File > Open...
  • Select the WAV file to be analysed
  • Click on the arrow beside the track's name at the left side of the waveform window to have the pop-down menu displayed
  • Choose "Spectrum"
  • Select a 1.5 to 2 second period in the middle of the track.
  • View > Zoom to selection

Here you go:

Lossy_SA_With_Audacity

[Top]

#SA

Chronogram analysis

Unfortunately, EAC isn’t precise enough to do this analysis, it needs a more powerful tool which allows big horizontal and vertical zoomings, such as Soundforge.

Mp3 encoding creates a silent micro-gap followed by a fast fade-in at the beginning of each encoded file. The same way, a fast fade-out followed by a short silent gap can be seen at the end of the file.

With live recordings, the interval between tracks is never made of silence so this default can be seen by zooming the end and the beginning of a WAV file, for exemple with soundforge:

Beginning of a lossless file

Lossless_WAV

Beginning of the same file after it has been encoded to mp3, then decoded back to WAV

Lossy_WAV

With audacity:

Beginning of a lossless file

Lossless_WAV_Audacity

Beginning of the same file after it has been encoded to mp3, then decoded back to WAV

Lossy_WAV_Audacity

Of course, those silent gaps between tracks can’t be seen if the trackless concert was entirely encoded in mp3, then split into individual tracks after being decoded to WAV.

[Top]

#Chronograms

Some links to check

Why most traders dont trade mp3

Audiohub: Frequency Analysis

Audiohub: Spectral Analysis

Gerstyn's MP3 Source Detection Tutorial

Spectral Views of Various Codecs

How to tell if a CDR is MP3-sourced

mp3 vs CD audio quality tests

BIG TEST OF MPEG 1 Layer-3 ENCODERS

Source Analysis - etree wiki

The Trader's Den - Lossy or Lossless forum

auCDtect

EAC

Audacity

[Top]

#Links
Personal tools