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: Faith in spectral analysis (Read 8299 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Faith in spectral analysis

Hi,

I have a question about spectral analysis - I've had a search through the forums but can't really find a thread that properly answers my question.

I have an audio file (FLAC format).  I think it's lossless, but someone else claims it's a decompressed MP3.  TO support his claim, he's done a spectral analysis in Goldwave and you can clearly see that the frequencies above 16khz are greatly reduced.

To support *my* claim, I did a spectral analysis in the hideously named AnalFreq.  What I saw was that, while the frequencies above 16khz were low, there was still something there. 

I've tried coverting the file in question to 320kbps CBR MP3 and LAME v0 and analysed both of those.  Each one does not show *any* frequencies above 16khz.

So my question is this: if the file was in fact formerly an MP3, would I be able to see anything above 16khz?  If so, why can I no longer see these after encoding to MP3 myself?  Could this happen if it had been encoded using something other than LAME?

The song is an old disco song so it could conceivably have some noise reduction or something on it - could this be causing the reduction in frequencies?

ABX tests aren't really relevant for this, he intends to play the file on a club soundsystem that is far superior to anything I have access too.

Thanks in advance,
Alex

Faith in spectral analysis

Reply #1
Depending on the settings, mp3 encoding may or may not filter out frequencies above 16 kHz. It is also possible that while signals above 16 kHz are not completely removed, they could be greatly attenuated, due to the psy model ignoring what would not be audible anyway. So, either you or your friend could be right.

Encoding to 320 CBR or -V0 should not give a lowpass anywhere near 16 kHz, but again, the psy model will tend to eliminate anything that is not audible, therefore those frequencies may disappear during encoding.

If you could provide a 30 second clip then the experts here could take a look and possibly settle the issue.

Faith in spectral analysis

Reply #2
There is no point in the psymodel attenuating anything. An MP3 encoder will not do this. An MP3 encoder will add distortion or remove the frequencies.

LAME has a mode where it flicks encoding above 16kHz on and off contiously depending on what the psymodel says. This could look like attenuating depending on the program being used for analysis, particularly if it has a low temporal resolution.

Faith in spectral analysis

Reply #3
It's quite interesting encoding the "Computerlove/Computerliebe" track from Kraftwerk's "Computer World/Computerwelt" album. If you encode that track with LAME MP3 320 CBR, it will cut everything above 16kHz. This proves that not all 16kHz lowpass is low-quality file. It had just determined that that was the best for that song.



Faith in spectral analysis

Reply #6
LAME has a mode where it flicks encoding above 16kHz on and off contiously depending on what the psymodel says. This could look like attenuating depending on the program being used for analysis, particularly if it has a low temporal resolution.


After taking a look at the sample, I am now sure the above is exactly what happened

The source is a LAME MP3.

Faith in spectral analysis

Reply #7
So does that mean that when I converted it to a 320kbps MP3 using LAME, I was just finally cutting off the frequencies about 16khz? 

I don't get it though, other songs I converted to 320 or v0 don't look like the WAV sample there - I'd have assumed it was at least encoded with something other than LAME.

Maybe it's just the analysis program I'm using.  Oh well.  Thanks for the clear answers.


Faith in spectral analysis

Reply #9
I have to check the sample but a 16 kHz limit is tipical for FM radio broadcasts also.

Faith in spectral analysis

Reply #10
I have to check the sample but a 16 kHz limit is tipical for FM radio broadcasts also.
That is no surprise as there are usually playing MP3 files from their servers. I can't say, if it's also a characteristic of the FM signal.

Faith in spectral analysis

Reply #11
I have to check the sample but a 16 kHz limit is tipical for FM radio broadcasts also.

In fact, the cutoff frequency for FM broadcasts is 15 kHz.


Faith in spectral analysis

Reply #13
 So, I have checked out the samples and here is what I think.
The question "Is this a lossless" implies the sound in question has been obtained from a source with more information about the sound. Not knowing the source I would assume it was a CD track.
Next plot shows three spectra: a CD rip spectrum and both: "is-this-lossless" sound spectra from .wav and .mp3 files.



Both "is-this" spectra differ from my CD rip in the range 20 Hz 12 kHz because they are different tunes but the essential differences are in the high frequency range (crossed out) which are shown on the next plot.



The most essential difference is the spectrum band width.
But let me state my understanding first.
I consider the line at the level -101.1  a "Noise floor" for the 16 bits sound because it is the level of a white noise introduced by the 16 bit quantizer. So, I prefer to think about the sound signal which components are above this level and at least above -90 dB level.
Then, using -90 dB level, the band width of the "is-this" sound is 14 kHz when determined by the low level channel or no more than 14.9 kHz when taken from the higher level channel. Compared to the 20.5 kHz of the CD rip there is a big loss.

The transition range and the stop band range contain additional information that could help identifying the source of the "is-this" sound.
First of all it is obvious it is not an mp3 or other sound encoder.
To show this here is a plot with two mp3 (Lame 3.98 beta 6) encoded sounds from the same CD rip I used. They have as parameters: -q0 -mj and -V5 (transition range:15,826-16,380), -V6 (transition range: 15,115-15,648).



The mp3 transition range is smaller and spectra have steeper slope and the stop band level is lower. It is tipical for high order digital filters.

What about the next plot?



The spectra here I received using a low pass filter with a transition range of 2000 Hz and stop band attenuation of -60dB and three different cut off frequencies.
This analogy tells me the source of the is-this-lossles.wav more likely was an FM radio broadcast. So, I think it is not an mp3 source.
And the frequensy components above 16 kHz are much smaller then the quantization noise. So, simply noise.

Faith in spectral analysis

Reply #14
Quote
This analogy tells me the source of the is-this-lossles.wav more likely was an FM radio broadcast. So, I think it is not an mp3 source.

A lot of graphs, too bad it's not the right conclusion.

Are you familiar with a spectrogram?


Faith in spectral analysis

Reply #15
 Again I do not share this point.
The spectrogram gives you an impression on the spectum over the time.
A spectrum is a result of a transform of a function which generates the sound.
So, I am not interested in the sound. I am interested in the filter which has changed the function.
And this is seen in the transition range and in the stop band range of the spectrum. The rest of the spectrum is not of importance at all for obvious reason - you cannot tell enything about the original, and hance about the filter, looking at its filtered spectrum.
But  the transition range and in the stop band range show a lower order and higher stop band level than the filters an mp3 encoder like Lame 3.98 beta 6 has.

Faith in spectral analysis

Reply #16
The tell-tale sign of an MP3 in the spectrograms is not just the 16khz cutoff, but the occassional full-bandwidth lines from >1.0 peaks from the mp3 encoding/decoding process (even when these peaks weren't present in the original)

Faith in spectral analysis

Reply #17
If the file were from an FM broadcast, there would be very little energy from 15-16kHz and above and should appear somewhat uniformly.  This sample clearly has concentrated energy in that area as indicated by the vertical lines.  Further, the sample did not run out of headroom in those areas.

The holes in the spectrum are another indication that the file had undergone a lossy compression process at some point in time.  This does not rule out the possibility that the lossy file was broadcast, but the energy above 16kHz does.

Faith in spectral analysis

Reply #18
A stereo FM broadcast looks nothing like that - there's always the pilot tone at 19kHz, and rubbish either side of it. No tuners filter this out completely, and even high-ish bitrate mp3 tries to preserve it.

As mentioned, the holes in the spectrum imply psychoacoustic coding. Those lines above 16kHz imply some clipping or distortion on decoding. Real content up there would look different.

Cheers,
David.


Again I do not share this point.
The spectrogram gives you an impression on the spectrum over the time.
A spectrum is a result of a transform of a function which generates the sound.
So, I am not interested in the sound. I am interested in the filter which has changed the function.
...and you need a spectrogram to prove that this filter is static! Here, it isn't.

Since psychoacoustic codecs typically use a static filter, plus psychoacoustics which dynamically lower the upper frequency limit, you might guess the filter by looking at a moment when the dynamic limit appears to be absent. The "high point" on the spectrogram, if you like. Analyse that moment, you and will have some hint as to the shape of the filter (plus the content, of course!). Analyse the whole file, and you have something quite meaningless.

Cheers,
David.

Faith in spectral analysis

Reply #19
 Thank you.
The explanations helped me see what I did not understand.