• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Audacity Import Clipping

RayDunzl

Grand Contributor
Central Scrutinizer
Joined
Mar 9, 2016
Messages
13,247
Likes
17,162
Location
Riverview FL
Occasionally, I have downloaded some audio from YouTube.

I grab the MP4 and drag it into Audacity to strip out the audio.

It decodes and I see clipping, and go "Oh well..."

upload_2016-7-1_15-34-52.png


For some reason I decided to apply the Amplify tool this time:

upload_2016-7-1_15-36-41.png


It (by default in this case) picked a small amount of attenuation. Huh? I say to myself.

I zoom way in on some of the clips, and find samples that exceed "full scale", the biggest by about 14% (not shown)

upload_2016-7-1_15-57-4.png


So I apply the suggested attenuation to the whole piece...

And the "clipped" peaks are restored. (Sorry about the scale change, makes it look smushed, but it isn't)

upload_2016-7-1_16-3-30.png


What's going on here?

If I burn a disc (yes, I still do that) without the attenuation, it gets clipped, sounds doubly awful.

With this new insight, I can burn the disc, and it only sounds singly awful.

What's with the over-scale yet restorable sample-hiding here?
 

Attachments

  • upload_2016-7-1_15-45-57.png
    upload_2016-7-1_15-45-57.png
    25 KB · Views: 166
  • upload_2016-7-1_15-53-4.png
    upload_2016-7-1_15-53-4.png
    21.8 KB · Views: 171
Last edited:

Don Hills

Addicted to Fun and Learning
Joined
Mar 1, 2016
Messages
708
Likes
464
Location
Wellington, New Zealand
If I recall correctly(*), AAC data is stored in 32 bit float format. Audacity (by default) works internally in 32 bit float format. The import decoder may be decoding direct to 32 bit float instead of reducing to 16 bit then converting to 32 bit.

I don't know how the original audio came to contain samples exceeding the 16 bit limit.

(*) Memory is the second thing to go with age. I forget what the first one was.
 

fas42

Major Contributor
Joined
Mar 21, 2016
Messages
2,818
Likes
191
Location
Australia
I've noted that behaviour myself many times, I presumed it was the nature of the compression slicing the waveform into different frequency bands - when decompressed and added, at times, from the mathematics, the waveform will exceed full scale. Since the audio has not lost the information, a simple attenuation will bring the overall below clipping - it's not "guessed at reconstruction", but a byproduct of how the audio data is compressed and stored.
 
Top Bottom