Nice one DVDdoug. I've just been testing that and it's very impressive on the supplied examples. It didn't cope with heavily distorted analogue clipping, but then nothing does.DVDdoug wrote:There is a (non-free) program called SeeDeDlip.
Killing hard clipping
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Re: Killing hard clipping
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Killing hard clipping
I did some testing on 30 seconds of audio, which was the limit.
The first thing was that it took like and instant, which is unnerving. It makes you think they are using some other trick that just makes it look better or something.
The second thing was when I looked at it. It looked as though the clip fixed areas were pushing up against some other threshold. The audio also generally had an appearance of being crushed inward, like reverse clipping (where the waveform has the inner part cut out of it)
When I listened to it, it was clear.
Very little noticable difference, it sounded scratchy, like the bitrate had been lowered or something, and though the waveform looked better, all of the clipping was obviously not compensated for.
I give it 0/1
I though it might do something, but it didn't.
Speaking of all this, I have thought of something interesting regarding a real solution.
When a higher waveform is mixed with a low one, the high waveform tends to clip on the top or bottom until it is pushed out of existence, while the lower one generally also clips. However, the top of said waveform will be mislead a waveform declipper because the low frequency "deforms" the high one. It needs to follow the high and low waveforms separately.

You see the apparent issue here.
Geez, fixing this is a real stack of problems, isn't it?
The first thing was that it took like and instant, which is unnerving. It makes you think they are using some other trick that just makes it look better or something.
The second thing was when I looked at it. It looked as though the clip fixed areas were pushing up against some other threshold. The audio also generally had an appearance of being crushed inward, like reverse clipping (where the waveform has the inner part cut out of it)
When I listened to it, it was clear.
Very little noticable difference, it sounded scratchy, like the bitrate had been lowered or something, and though the waveform looked better, all of the clipping was obviously not compensated for.
I give it 0/1
I though it might do something, but it didn't.
Speaking of all this, I have thought of something interesting regarding a real solution.
When a higher waveform is mixed with a low one, the high waveform tends to clip on the top or bottom until it is pushed out of existence, while the lower one generally also clips. However, the top of said waveform will be mislead a waveform declipper because the low frequency "deforms" the high one. It needs to follow the high and low waveforms separately.

You see the apparent issue here.
Geez, fixing this is a real stack of problems, isn't it?
Re: Killing hard clipping
Yes there is - Avoid clipping in the first place.samspots wrote:There has to be a better way.
A question to mull over - how would you correct a clipped square wave?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
kozikowski
- Forum Staff
- Posts: 68902
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Killing hard clipping
It doesn't always. If you reference the original rich trumpet blast and clip it just the right amount, the rich but powerful musical overtones vanish and are replaced by straight old harsh square wave every third to infinity harmonics -- not necessarily higher than the original. It may sound like that. Ears don't like third harmonics.I'm saying that clipping produces additional harmonics.
There is a developer who makes a really nice volume compressor/manager as a plugin for Audacity. Chris's Compressor. It's pretty amazing how well it works. He designed it to be musical -- to change the volume expression in opera so he could listen in the noisy car. So instead of the left-brain math coming first, he started with a right-brain creative task and worked "backwards."
The only hope of making anything like this work is create software that "knows" melodic progression and harmonious music. Anybody who starts the process -- step one -- with "...the delta rate of change of the remaining Fourier sampled slope...." is already walking dead.
I bet you could go a very long way to appearing to solve the problem by rapidly switching a low pass filter in during the clipped passages. I can see the horrified looks all the way from this time zone, but I bet that would sound better than the math exercises.
Koz
Re: Killing hard clipping
Koz, I feel like I'm not being clear enough.
I have stated a lot of scatterbrained thoughts, and I think it's about time I go it alone.
Can anybody suggest a way I could learn how to make plugins compatible with Audacity?
I'm beginning to feel like this would be a better solo project, because I don't want to slave a programmer into making something based on my wild theories, and I'd rather be right or wrong alone rather than fighting a battle that is very hard to prove either side of.
If I get anything, I will share it with everyone.
I have stated a lot of scatterbrained thoughts, and I think it's about time I go it alone.
Can anybody suggest a way I could learn how to make plugins compatible with Audacity?
I'm beginning to feel like this would be a better solo project, because I don't want to slave a programmer into making something based on my wild theories, and I'd rather be right or wrong alone rather than fighting a battle that is very hard to prove either side of.
If I get anything, I will share it with everyone.
Re: Killing hard clipping
Probably the easiest type of plug-ins to make are "Nyquist plug-ins" http://wiki.audacityteam.org/wiki/Nyqui ... rogramming
(ClipFix is a Nyquist plug-in)
(ClipFix is a Nyquist plug-in)
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Killing hard clipping
I'm looking in to it, it looks very promising to use Nyquist for this.
The tutorials have helped me quite a lot, too.
The tutorials have helped me quite a lot, too.
Re: Killing hard clipping
Well, I like, if not love it.
It's just the the manual assumes that I already know LISP or something.
Any way I can get started with learning this?
It's just the the manual assumes that I already know LISP or something.
Any way I can get started with learning this?
Re: Killing hard clipping
See here: http://www.audacity-forum.de/download/e ... -index.htm
You will also find a lot of code examples in this part of the forum: http://forum.audacityteam.org/viewforum.php?f=39
If you have any questions about Nyquist code you can post in that section.
You will also find a lot of code examples in this part of the forum: http://forum.audacityteam.org/viewforum.php?f=39
If you have any questions about Nyquist code you can post in that section.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Killing hard clipping
I have really been meaning to learn Nyquist...
I am looking over my previous posts, and I was totally unclear. I didn't know what I was talking about, at all.
Here is my method explained using terms that make sense.
The wave shape of the audio will be analyzed and then compared to what it would be if it was straightly-hard clipped (We will figure that part out later), and then corrected to match that.
Each clipped area will be identified as a clip; the clip starts at the first clipped sample, goes through all samples; clipped or not, and ends at the last clipped sample before the wave goes downward past the middle.
The width of a clip at any point will suggest a frequency. Everything above that frequency will be replaced, but only within the clipped area. A Fourier transform will be applied and the new harmonics will be determined by interpolating by them from the non-clipped areas.
Then, at a user specified level, a dynamic algorithm will be applied to the entire mix revive the general sound of the audio before the clipping. The percentage of samples that are clipped in each area will be used to determine how loud to the make the area. This will help the punch of the sound and may reduce clipping-related limiting, but will not be needed in all situations.
How does that hold up?
I am looking over my previous posts, and I was totally unclear. I didn't know what I was talking about, at all.
Here is my method explained using terms that make sense.
The wave shape of the audio will be analyzed and then compared to what it would be if it was straightly-hard clipped (We will figure that part out later), and then corrected to match that.
Each clipped area will be identified as a clip; the clip starts at the first clipped sample, goes through all samples; clipped or not, and ends at the last clipped sample before the wave goes downward past the middle.
The width of a clip at any point will suggest a frequency. Everything above that frequency will be replaced, but only within the clipped area. A Fourier transform will be applied and the new harmonics will be determined by interpolating by them from the non-clipped areas.
Then, at a user specified level, a dynamic algorithm will be applied to the entire mix revive the general sound of the audio before the clipping. The percentage of samples that are clipped in each area will be used to determine how loud to the make the area. This will help the punch of the sound and may reduce clipping-related limiting, but will not be needed in all situations.
How does that hold up?