Deleting Clipped Audio
Forum rules
This forum is for Audacity on macOS 10.4 and later.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Please state which version of macOS you are using,
and the exact three-section version number of Audacity from "Audacity menu > About Audacity".
Audacity 1.2.x and 1.3.x are obsolete and no longer supported. If you still have those versions, please upgrade at https://www.audacityteam.org/download/.
The old forums for those versions are now closed, but you can still read the archives of the 1.2.x and 1.3.x forums.
Deleting Clipped Audio
I've seen many posts asking how to repair audio which has been clipped during recording. The general answer is: for mild cases use "Effect-->Clip Fix...", but for severe cases IT CANT BE DONE. Well, since I'm an AmeriCAN rather than an AmeriCANT, I don't accept that.
For simple speech, THERE IS A WAY to repair even severely clipped audio which produces an acceptable result. The problem is that the process is very time consuming. That's where you brilliant Audacity experts come in: if you can teach us how to automate this process you will help a lot of folks.
By using View-->"Show Clipping" you all clipped regions are highlighted in red. What I have found is that if I go in and delete all those highlighted data points individually (TIME CONSUMING!) the result is acceptable sounding. So can someone tell me how do that quickly? Yes, in the worst cases this will produce a glitch, but it's better than hearing the speaker try to interpret a clip.
It seems to me this should be easy for a coder since the program obviously knows where all those highlighted data points are. It would be best if this could be done in only selected regions since not all clips produces distorted sound.
I've found that if the data is filtered using Effect-->Equalization as in screen shot 1: the result is that all the awful sounding glitches show up as distinct spikes. As shown in screen shot 2: If I then go through and delete just those spikes the result is a pretty acceptable. It is REALLY time consuming to do it manually. So once again, my question is how could I delete all those quickly? (By the way, when you zoom in on those spikes, it looks as shown in screen shot 3, where the 2 tracks show a "before" and "after" applying the equalization of screen shot 1.) So in each case my main question is: How can I use audacity to quickly delete all data points that exceed a defined threshold? If I could somehow export the data to Excel (64-bit) and reimport it to Audacity I would immediately know how to solve the problem, but no one seems to have solved that issue either.
Thanks for your help!
For simple speech, THERE IS A WAY to repair even severely clipped audio which produces an acceptable result. The problem is that the process is very time consuming. That's where you brilliant Audacity experts come in: if you can teach us how to automate this process you will help a lot of folks.
By using View-->"Show Clipping" you all clipped regions are highlighted in red. What I have found is that if I go in and delete all those highlighted data points individually (TIME CONSUMING!) the result is acceptable sounding. So can someone tell me how do that quickly? Yes, in the worst cases this will produce a glitch, but it's better than hearing the speaker try to interpret a clip.
It seems to me this should be easy for a coder since the program obviously knows where all those highlighted data points are. It would be best if this could be done in only selected regions since not all clips produces distorted sound.
I've found that if the data is filtered using Effect-->Equalization as in screen shot 1: the result is that all the awful sounding glitches show up as distinct spikes. As shown in screen shot 2: If I then go through and delete just those spikes the result is a pretty acceptable. It is REALLY time consuming to do it manually. So once again, my question is how could I delete all those quickly? (By the way, when you zoom in on those spikes, it looks as shown in screen shot 3, where the 2 tracks show a "before" and "after" applying the equalization of screen shot 1.) So in each case my main question is: How can I use audacity to quickly delete all data points that exceed a defined threshold? If I could somehow export the data to Excel (64-bit) and reimport it to Audacity I would immediately know how to solve the problem, but no one seems to have solved that issue either.
Thanks for your help!
Re: Deleting Clipped Audio
I have an idea of how this might be done almost automatically.
Do you have an audio sample that I could try out the idea with?
Do you have an audio sample that I could try out the idea with?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
kozikowski
- Forum Staff
- Posts: 69374
- Joined: Thu Aug 02, 2007 5:57 pm
- Operating System: macOS 10.13 High Sierra
Re: Deleting Clipped Audio
So you essentially want the data that writes the red bars in the display that tells us where the clipping is.
Yes, in the case of moderate voice clipping that would probably work OK, however the two most experienced clipping events are plugging a powerful line-level stereo signal into the Mic-In of a laptop, and wanting to fix a camcorder rock concert recording.
The Mic-In problem produces very serious clipping and distortion 6dB down from Audacity overload. No red bars and no outward indication of damage. The rock concert recording is almost always 100% distortion and clipping garbage -- and it's all continuous music.
Straight, simple vocal clipping is a very distant third, but it does occur. This would be a good tool to have.
Koz
Yes, in the case of moderate voice clipping that would probably work OK, however the two most experienced clipping events are plugging a powerful line-level stereo signal into the Mic-In of a laptop, and wanting to fix a camcorder rock concert recording.
The Mic-In problem produces very serious clipping and distortion 6dB down from Audacity overload. No red bars and no outward indication of damage. The rock concert recording is almost always 100% distortion and clipping garbage -- and it's all continuous music.
Straight, simple vocal clipping is a very distant third, but it does occur. This would be a good tool to have.
Koz
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Deleting Clipped Audio
Just to add to Steve's and Koz's points...
If it's your recording, it would be far better to turn the input down to a more reasonable level (or ensure you plug into the correct input or record with an appropriate device. I assume image 2 is after deamplifying, and it looks very flat-topped. How exactly are you making these recordings?
It would be much better to go with a plug-in or some kind of filter processing on the whole track. I don't think it's ideal to EQ, delete, then apply the inverse EQ to get back to something like the original EQ.
Can you compile Audacity? There a couple of patches that have never been properly tested that apply Effect > Repair to sections detected by Analyze > Find Clipping. I don't know if either patch still builds but I've been meaning to see if they do. Repair would be better than delete, but at present Repair only works on extremely small selections of up to 128 samples at a time. It may depend how clipped the recordings were in the first place.
Here is how to attach your audio sample http://forum.audacityteam.org/viewtopic ... 49&t=64936 .
Gale
If it's your recording, it would be far better to turn the input down to a more reasonable level (or ensure you plug into the correct input or record with an appropriate device. I assume image 2 is after deamplifying, and it looks very flat-topped. How exactly are you making these recordings?
It would be much better to go with a plug-in or some kind of filter processing on the whole track. I don't think it's ideal to EQ, delete, then apply the inverse EQ to get back to something like the original EQ.
Can you compile Audacity? There a couple of patches that have never been properly tested that apply Effect > Repair to sections detected by Analyze > Find Clipping. I don't know if either patch still builds but I've been meaning to see if they do. Repair would be better than delete, but at present Repair only works on extremely small selections of up to 128 samples at a time. It may depend how clipped the recordings were in the first place.
Here is how to attach your audio sample http://forum.audacityteam.org/viewtopic ... 49&t=64936 .
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Deleting Clipped Audio
I've attached a small mp3 portion of the audio to this post for steve and others who've requested it.
In response to Gale: yes, you are surely right that the BEST way is to record the audio without clipping in the first place. But as I mentioned, I've found many posts online from folks in a similar situation to mine: The recording cannot be made again because the event is over and if we want to share it with others we are stuck with this recording. Based on my manual deleting, I KNOW that a much better product can be made by deleting the largest spikes -- but as I said, that process must be automated to be practical. I also agree that using EQ to magnify the portions to delete (the spikes seen in screenshot 3) is not 'ideal'. But I want to emphasize that for simple speech it's not necessary to have 'ideal' sound -- but it is necessary to remove glitches that hurt your ears, and that's all I'm after as the person who wants to 'repair' this audio.
In response to Koz: I guess you could say that I request 2 things in my post: (1) Being able to "select" all the data points which are highlighted when one chooses View-->Show Clipping. Once selected, you could then press "delete" and they'd be gone. (2) To be able to set a horizontal threshold above/below which data points would be selected -- thus the spikes of screen shot 3 (which is where all the unpleasant glitches occur) could then be removed by pressing "delete". I can do both (1) & (2) manually, but it just takes forever.
Thanks for all the great help, and so quick!!
In response to Koz: I guess you could say that I request 2 things in my post: (1) Being able to "select" all the data points which are highlighted when one chooses View-->Show Clipping. Once selected, you could then press "delete" and they'd be gone. (2) To be able to set a horizontal threshold above/below which data points would be selected -- thus the spikes of screen shot 3 (which is where all the unpleasant glitches occur) could then be removed by pressing "delete". I can do both (1) & (2) manually, but it just takes forever.
Thanks for all the great help, and so quick!!
This is from the original recording
The "test.mp3" file I uploaded had already been altered with Audacity (I've been trying a LOT of things so I got confused). To this post, I've now attached the same portion of audio from the raw, original recording:
You'll note that it's pretty severely clipped.
Also, here are my answers to Gale's other questions: I did not make this recording, but rather am in the position of "fixing" it. However, the same thing has happened when I have been responsible for doing recordings, and in that case Audacity was used to make the recording and the input was set too high, giving a similar result. I have never compiled Audacity but I suppose I could if really necessary -- my coding experience is mostly with Excel VBA, but I've used other languages.
Thanks again
Also, here are my answers to Gale's other questions: I did not make this recording, but rather am in the position of "fixing" it. However, the same thing has happened when I have been responsible for doing recordings, and in that case Audacity was used to make the recording and the input was set too high, giving a similar result. I have never compiled Audacity but I suppose I could if really necessary -- my coding experience is mostly with Excel VBA, but I've used other languages.
Thanks again
Re: Deleting Clipped Audio
You're going to have trouble with that.tlm wrote: I've attached a small mp3 portion of the audio to this post for steve and others who've requested it.
The problem is that it has been recorded with bad electronics that have allowed clipped audio to "overflow" between positive and negative numbers.
If you look at the highlighted section, the sample values have overflowed from positive values to negative.
Here's what happens if I make them positive again:
and now you can see that it has the typical "flat top" from clipping,
Which if properly repaired should look like this:
So what is it that you want automating?
Could you post a "repaired" example (even if only a small section is repaired such as "this morning")
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
Re: Deleting Clipped Audio
What format is the original recording?
One of the problems that I am seeing is that the distortion has been further mashed by MP3 encoding.
Could you send a short clip in WAV or FLAC format?
One of the problems that I am seeing is that the distortion has been further mashed by MP3 encoding.
Could you send a short clip in WAV or FLAC format?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)
-
Gale Andrews
- Quality Assurance
- Posts: 41761
- Joined: Fri Jul 27, 2007 12:02 am
- Operating System: Windows 10
Re: Deleting Clipped Audio
Did you ever finish that version of Clip Fix that compensated for inverted polarity?steve wrote:Here's what happens if I make them positive again
Gale
________________________________________FOR INSTANT HELP: (Click on Link below)
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
* * * * * Tips * * * * * Tutorials * * * * * Quick Start Guide * * * * * Audacity Manual
Re: Deleting Clipped Audio
In response to Steve, I've attached a "repaired" version of the testRaw.mp3 file:
I admit that it's far from ideal, but at least the loudest screeching sounds are gone. After deleting the small sections, the discontinuities result in clicks -- so I applied the repair tool to those -- but even without the repair tool, the clicks are still much better than the screeching (especially with headphones!). Here is the procedure I followed to repair it:
Select All, Effect --> Amplify --> -4, Effect --> Equalization --> use profile shown in screen shot 1 above, Effect --> Amplify --> 7.2,
Select 0.796 - 0.855, delete
2.395 - 2.445
3.282 -3.361
5.325 - 5.451
5.522 - 5.579
10.022 - 10.126
11.438 - 11.522
I then took a little more off of the 10s spike, 10.015-10.022, amplified the result using Effect --> amplify 6, and then went in to repair 0.002 second segments at each discontinuity, and finally amplified once more using Effect --> amplify 0.6
I could imagine the process being automated by finding each spike that exceeds a threshold, defining a delete width, and then applying repair to the result.
As requested, I've also uploaded a .WAV version of the file: Thanks again for the help.
Select All, Effect --> Amplify --> -4, Effect --> Equalization --> use profile shown in screen shot 1 above, Effect --> Amplify --> 7.2,
Select 0.796 - 0.855, delete
2.395 - 2.445
3.282 -3.361
5.325 - 5.451
5.522 - 5.579
10.022 - 10.126
11.438 - 11.522
I then took a little more off of the 10s spike, 10.015-10.022, amplified the result using Effect --> amplify 6, and then went in to repair 0.002 second segments at each discontinuity, and finally amplified once more using Effect --> amplify 0.6
I could imagine the process being automated by finding each spike that exceeds a threshold, defining a delete width, and then applying repair to the result.
As requested, I've also uploaded a .WAV version of the file: Thanks again for the help.