Skip to main content
Topic: Audio editor that normalizes only the clipping parts of 32-bit float recording (Read 443 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Audio editor that normalizes only the clipping parts of 32-bit float recording

I am looking for an audio editor or an Audacity plug-in that normalizes only the clipping parts of 32-bit float recording. I have some 32-bit float waveform files that have sections going above 0db. I have to convert them to 16-bit. Of course, if I don't normalize them, the parts above 0db are cut off and I get a very distorted audio in those parts. I can normalize the audio to 0db peak. That's fine, but I want to do something else. If I playback this 32-bit audio, the audio driver(?) does the following. It plays back all the parts below 0db as loud as they are and when it comes to parts that go above 0db it plays them back at exactly 0db. That's my assupmtion, since there is no audible distortion or clipping. How this playback sounds, is what I want to have, when I convert to 16-bit. If I normalize the audio, its quieter parts are quieter than I want them to be. If I use a compressor effect, it does almost what I want but not quite and it's doing a lot more than I want to.
So, can anyone tell me if some audio editor has such functionality that I want or can anyone help me write an Audacity plug-in that sets all the parts above 0db to exactly 0db and leave the rest of the recording as is?
lame -V 0

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #1
Quote
If I playback this 32-bit audio, the audio driver(?) does the following. It plays back all the parts below 0db as loud as they are and when it comes to parts that go above 0db it plays them back at exactly 0db. That's my assupmtion, since there is no audible distortion or clipping.
Most likely, there is a digital volume control somewhere in the playback chain.    The volume is reduced before conversion to integer, and you have no clipping (or less clipping).    DACs are integer devices and when the driver converts from floating point to 16 or 24-bit integer the data is hard-limited and it will clip if you "try" to go over 0dB,  exactly like converting the file to 16-bit or 24-bit WAV.

Quote
So, can anyone tell me if some audio editor has such functionality that I want or can anyone help me write an Audacity plug-in that sets all the parts above 0db to exactly 0db and leave the rest of the recording as is?
I've done some quick-little experiments and Audacity's limiter set to hard-limit seems to do exactly that.   It has look-ahead so it can limit the peaks without changing/distorting the wave shape.     However, it does have a release-time ("hold" time) so the volume reduction doesn't recover instantly.    (Make sure you are not using an old version of Audacity.    I don't know when it was changed but the limiter wasn't always so advanced.)

Limiting is a special kind of "fast compression" and it can affect the sound character/quality.

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #2
DVDdoug, I have already tried the limiter, but with default settings and the hold time was bothering me. Now I have played around with it some more and these settings seem to do what I want:



Later, at home, I will do an ABX test, because it seems that I can still detect some distrortion, but I am not at a place where I can listen in quiet at the moment.
lame -V 0

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #3
Quote
I can normalize the audio to 0db peak. That's fine, but I want to do something else.
Why though? If the goal is to keep the recording as close to the original as possible, reducing the volume is the lesser of evils, as you can always turn it up later when playing.
Limiting peaks always has potential to introduce audible changes and you'll have to carefully test it. And even if you don't hear the consequences of limiter use, there's a chance that somebody else will.
Keep calm and opusenc --bitrate 128

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #4
magicgoose, I was thinking about this too. You have a good point, which I also considered. However, to me "to keep the recording as close to the original as possible" is how I hear it when I play it. And I hear it as I described. With a particular volume and without distortion or clipping. What normalization does to the parts that go over 0db is great, I just don't like what it does to the parts that are no way near 0db - they become too quiet and some details can't be heard so good anymore. That's why I want to achieve the exact sound as my system's playback. I could, of course, just record my desktop audio, but I want to be able to do it quickly and not in real-time.
I also know that after normalization, if I turn up the volume, I can get to the same level of loudness, but that introduces noise of the amp on really quiet parts. I am seriously thinking about this being the least of all evils and maybe you're right and that's the proper way to go. With a better amp and speakers this should not even be noticeable. It's a fun exercise though, to try to find what exactly happens in my playback chain and try to reproduce it...
lame -V 0

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #5
You can also use a limiter at the playback time and control the loudness with ReplayGain.
Easy to do in foobar2000.

Still it's strange if the amplifier produces so much noise as you describe. Perhaps something isn't working right...
Keep calm and opusenc --bitrate 128

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #6
Thank you for all the suggestions. I think I'll stick with normalizing before converting to 16-bit.
However, if anyone else will have an idea how to reproduce what my playback chain is doing, I'm interested to try. Limiter is the closest but not exactly the same.
lame -V 0

Re: Audio editor that normalizes only the clipping parts of 32-bit float recording

Reply #7
Quote
However, if anyone else will have an idea how to reproduce what my playback chain is doing, I'm interested to try. Limiter is the closest but not exactly the same.
Assuming you aren't running any effects there are 3 possibilities -

1.  The volume is being reduced (digitally) bringing the peaks down below 0dB and preventing clipping.   This is the same as normalizing, except if you normalize and reduce the playback volume you'll get a double volume reduction.

2.  The peaks are being clipped to 0dB.

3.  A combination of the above...   The volume is reduced somewhat so there is less clipping.

 
SimplePortal 1.0.0 RC1 © 2008-2019