Help - Search - Members - Calendar
Full Version: Spectrum Analysis - Interesting Results
Hydrogenaudio Forums > Hydrogenaudio Forum > Scientific Discussion
Zemo
I got bored, so logically I generated a 19Hz - 22kHz sine sweep, encoded it to APS, APX, and API, decompressed it back to WAV, and ran some spectrum analysis on the samples....I got some interesting results! I know how to interpret the low-mid frequncy noise, but what about that pattern at 4kHz? (that pattern continues all the way up through about 15kHz). And the huge amounts of noise at the cutoff point?

WAV ANALYSIS
user posted image
user posted image
user posted image

API ANALYSIS
user posted image
user posted image
user posted image

APX ANALYSIS
user posted image
user posted image
user posted image

APS ANALYSIS
user posted image


Interpretations/explainations?
Zemo
user posted image
user posted image
askoff
yup. Nice pictures. smile.gif
Atlantis
rolleyes.gif
Zemo
Hmmm...hoping for a LITTLE more explaination than that.....for instance, why is there that crazy looking diamond criss-cross pattern with APS and APX? and why the heck is there SO MUCH noise at the end of each frequency range?
Jebus
those are kinda neat looking.

I have no idea what i'm seeing though... any codec engineers have any insight?

And before someone goes off on a rant about the evils of spectrum analysis, lets just look at this from a point of interest and nothing more, okay? I don't think the original poster actually intends this as damning evidence against the presets or anything.
ff123
What you're seeing may depend on how your sweep actually works. If it steps in frequency rather than doing a smooth ramp, you may be introducing impulses that the codec has to handle. For example:

http://ff123.net/clicking.html

ff123
indybrett
Did you compare the spectrum analysis of the mp3 to the spectrum analysis of the original wave file?

More importantly, can you hear the pattern and/or noise?
HansHeijden
The frequency sweep was probably (almost) full scale amplitude. The lowpass filter in Lame has a slight gain boost just before the cutoff frequency.

So it's just plain clipping.
Zemo
Right, this is entirely from a curiosity standpoint, nothing more!

QUOTE
Did you compare the spectrum analysis of the mp3 to the spectrum analysis of the original wave file?


The spectrum analysis of the original wave is there too.

QUOTE
So it's just plain clipping.


Cool. I'll generate some 50% amplitute sine sweeps and do the same thing....let's see what happens!
Pio2001
The explanations must not be searched into the psychoacoustic model. Distorded sines always look like this. For example, look at the Udial sample :

http://perso.numericable.fr/laguill2/pictures/udial.png

Now, let's resample it with a poor algorithm :

http://perso.numericable.fr/laguill2/pictures/udialalias.jpg

Or let's clip it :

http://perso.numericable.fr/laguill2/pictures/udialclip.jpg

Or look at this pure lossless sweep, generated with a very poor program (old SoundForge 4.5 ) :

http://perso.numericable.fr/laguill2/pictures/aliases.jpg

(yes, this is ONE sweep ! In green. )

We should first understand how copies of the original are created. Upper copies are just harmonic distortion. For example in your 4 kHz sweep, we can see the harmonics 3 (12 kHz) and 5 (20 kHz), that come from a distortion of the peaks (if distortion only affect peaks, then only odd harmonics will appear).

Reversed copies are called aliases. The first alias is the symmetric above the nyquist frequency (22050 Hz). For a 4 kHz sine, it would be 40100 Hz. This is a wave that, if it was sampled without any digital filter, would lead to the same digital file.
For example consider a 22050 Hz sine. It has only two sampled values : up, down, up, down, etc
Now consider a 66200 Hz sine. If me measured its value 44100 Times per second, we would get the same thing : up, down, up, down etc. We would just skip some peaks in between. That's why any audio signal is lowpassed before being digitalized. To avoid recording some garbage if the sampler would be fast enough to measure the instant value of very high frequency noise. That's why this lowpass filter is also called anti-alias.

Now, looking at the clipped version of udial, we can see that there are copies of the sweep, but below the original instead of above. This should not be harmonic distorion, since harmonic distortion appears above the fundamental frequency, not below. But their frequency oscillation is bigger than the fundamental one. They are in fact aliases of the upper harmonics of the fundamental tone !
The "udial" tone oscillates around 20 kHz. When we clip it, it generates odd harmonics, remember ? Thus 60 kHz, 100 kHz, 140 kHz etc frequencies should appear. They are above the maximum frequency of a 44100 Hz file, but since the volume process does not apply an antialias filter (it should), the aliases of these ultrasonic distortions appear in the resulting file as audible frequencies.
Here, they are aliases of aliases of etc... because the aliasing process also occurs at integer multiples of the nyquist frequency : the graph is symmetric above 22050 Hz, but also above 44100, 66150 etc.

Thus, in the same way, when a sweep seems to bounce on the top of the graph, its mathematical expression actually crosses it, and goes on above 22050 Hz, and what we see coming down is the alias of it.

I don't know exactly the origin of the starry patterns at the end of the sweeps, but I think that it must be related to the relative phase of the sweep and the sample rate, because the sweep generator starts the generation by a zero crossing, and all the additional frequencies gather there.
Zemo
These frequency spectrums were with a 50% amplitude sine sweet....you were right, it was just clipping (and yes, I could hear it). Clipping sure looks pretty!


API 50%

user posted image
user posted image

APX 50%

user posted image
user posted image

APS 50%

user posted image
user posted image
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2008 Invision Power Services, Inc.