HydrogenAudio

Lossy Audio Compression => MP3 => MP3 - Tech => Topic started by: airtas on 2022-03-12 23:48:00

Title: spectral analysis question
Post by: airtas on 2022-03-12 23:48:00
the 128 aac file was a youtube rip.... trying to determine if the 224 vbr is better...I am assuming yes because of the blue above the 16 khz?
Title: Re: spectral analysis question
Post by: DVDdoug on 2022-03-13 00:17:44
The ONLY way to know which one sounds better is by listening.   ;)   You can have a "pretty" spectrum that doesn't sound pretty.

It's  probably easier to make a compression algorithm that makes good looking spectrums than it is to make one that makes good sound.

If you are hear something particular in the sound sometimes the spectrum can help to diagnose the issue.

Quote
because of the blue above the 16 khz?
If you're hearing a loss of high frequencies that might explain it.   But usually when we hear compression artifacts we hear something else.     We don't usually hear any loss above 16kHz because even if you can hear above 16kHz the highest frequencies are weak and masked (drowned-out) by lower frequencies that you can hear.
Title: Re: spectral analysis question
Post by: saratoga on 2022-03-14 15:05:59
They are both low pass filtered at 16 kHz so looking at the spectrum here is especially uninformative.  It just tells you that similar settings were used with both encoders.
Title: Re: spectral analysis question
Post by: shadowking on 2022-03-15 07:22:38
Youtube transcodes to  faac 128. I'd pick the mp3
Title: Re: spectral analysis question
Post by: jaybeee on 2022-03-15 09:23:10
@airtas I don't know if this is the youtube link used (https://youtu.be/E3poeGnXPQU), but I went out on a limb and used it.

The aac (m4a) spectral looks very similar, so hopefully it's the same as you grabbed.

I then grabbed the Opus (webm) file and from a spectral perspective it looks better than the aac and mp3.

So, based just on spectrals, then the Opus is the one to go for. If you can't play it then convert to wav or flac.
Title: Re: spectral analysis question
Post by: airtas on 2022-03-29 18:00:43
They are both low pass filtered at 16 kHz so looking at the spectrum here is especially uninformative.  It just tells you that similar settings were used with both encoders.
  wouldn't the file with blue above the 16khz be better though?
Title: Re: spectral analysis question
Post by: saratoga on 2022-03-30 02:18:54
They are both low pass filtered at 16 kHz so looking at the spectrum here is especially uninformative.  It just tells you that similar settings were used with both encoders.
  wouldn't the file with blue above the 16khz be better though?

I would not assume that without knowing more about the files.  Especially at low bitrates and/or with older formats (e.g. MP3) the opposite may be true.
Title: Re: spectral analysis question
Post by: DVDdoug on 2022-03-30 03:42:27
Quote
wouldn't the file with blue above the 16khz be better though?
It's not that simple.      The spectrum shows ONE ASPECT of the sound.    Sometimes it's a hint or sometimes if you hear something wrong you can confirm it with the spectrum.  But for example, harmonic distortion is added higher-frequency harmonics so a badly-distorted track can show "nice" high frequency content! 

With lossy compression the algorithm HAS to throw-away SOMETHING.    MP3 analyzes the audio and tries to figure-out which sounds are masked (drowned-out) by other sounds then it tries to throw-away sounds you can't hear anyway.   In general it does a very good job and with high quality settings the MP3 can often sound identical to the uncompressed original, in a proper blind listening test. 

If it sounds like the original or not depends on program material and the listener's ability to hear compression artifacts.   Usually, if you do hear a difference (compared to the uncompressed original) it's not the loss of high frequencies you hear.

It turns out that even if you can hear sounds up to 20kHz in a hearing test, your ears aren't as-sensitive at these frequencies, plus higher frequencies in music are usually "weak" and they are masked by other sounds so you (usually) can't hear a difference if these high frequencies are filtered-out.

There are MP3 options for filtering as sort-of a shortcut so the encoder doesn't have to analyze the highest-frequency masking and often you get better results by just throwing away the high frequencies and using the "limited bits" for other stuff you are more-likely to hear.