Distorted Wav file after repair

Help for Audacity on Windows.
Forum rules
ImageThis forum is for Audacity on Windows.
Please state which version of Windows you are using,
and the exact three-section version number of Audacity from "Help 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.
ivantheczar
Posts: 6
Joined: Tue Apr 17, 2012 11:53 pm
Operating System: Please select

Distorted Wav file after repair

Post by ivantheczar » Wed Apr 18, 2012 12:01 am

I have a recording of a concert performance, however the wav file is not saved properly.
After attempt to recover the wave file, it is slightly corrupted. For every 30 seconds, there will be a distorted "click" of 8192 samples length.
Is there any way to fix this, or at least reduce the annoyance?

My best approach is to copy and paste a 8192-sample length after this click and replace it, and repairing the joining points. However there is still a slight stuttering (due to two repeated wave fronts). Is there a good interpolating tool to smooth it out?

A sample of the click is attached. Thanks a lot for any help~
Attachments
distort.wav
(565.2 KiB) Downloaded 90 times

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Distorted Wav file after repair

Post by steve » Thu Apr 19, 2012 12:15 am

ivantheczar wrote:For every 30 seconds, there will be a distorted "click" of 8192 samples length.
At 96 kHz that's around 85 ms which is a bit too long for interpolation methods with rhythmic music.
I think that the solution will be to "patch" the gap with another piece of audio as you have attempted to do, but the "patch" needs to fit a bit better.

Could you post a slightly longer sample of the original un-corrected audio (with the gap). About 1 minute duration would be nice so that I can see a couple of gaps and have a good selection of audio to find a suitable patch.

Due to the upload size limit you will not be able to post 1 minute directly to the forum, but you could use one of the free file sharing sites such as sendspace.com and then post a link.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ivantheczar
Posts: 6
Joined: Tue Apr 17, 2012 11:53 pm
Operating System: Please select

Re: Distorted Wav file after repair

Post by ivantheczar » Thu Apr 19, 2012 2:17 am

I have uploaded a sample with 3 clicks (at 0:09, 0:42, 1:15) and 3 slot of white noises.
http://www.sendspace.com/file/zhc4rw

The white noises are easy to deal with since I can safely remove them without affecting the recording, but the clicks are not.
The white noises and clicks are all 8192(2^13)-sample in length, while every click appears exactly 1048576(=2^20) samples before the white noises.
This mic is responsible for piano and percussion in the orchestra.

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Distorted Wav file after repair

Post by steve » Thu Apr 19, 2012 3:56 am

What's the story here - those glitches are really strange - the ones that are not noise - they are the wrong audio :?
It should be possible to repair, but it's not going to be a quick job.
It's a shame that the recording is also clipped a bit.

I'll get back to you later - possibly tomorrow if I get time.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Distorted Wav file after repair

Post by steve » Thu Apr 19, 2012 7:51 am

Here's the repaired version (Ogg format for an easier download) http://minus.com/mbrFmTXlcy/

The first glitch was the trickiest, there was no suitable material to make a patch, so I cut out the bad bit then use the "Sliding Time Scale / Pitch Shift" effect to stretch the sound that was immediately before the glitch. Initial tempo 0, Final tempo about 42% (don't remember exactly, but enough to fill the gap). The reason for starting at the same tempo was to avoid damaging the attack on the piano note. The sustain is less critical so it stretches better.


For the other two I used material from the same beats of preceding bars, so for the second glitch that was around 41.3 seconds and for the third one around 1 min 9.3 seconds.

To get a good join I applied short cross-fades to the start and end of the "patches".

Do you need any more detail to the description?

So do tell, how did the problem happen? (I'm curious).
And what is the music?
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ivantheczar
Posts: 6
Joined: Tue Apr 17, 2012 11:53 pm
Operating System: Please select

Re: Distorted Wav file after repair

Post by ivantheczar » Thu Apr 19, 2012 7:36 pm

This sounds perfect! But it may be tricky for me as the total recording is about 1 hour long...
I tried the Sliding Time Scale/Pitch Shift effect before, but it seems very hard for me to adjust exactly the length I want.
For the other two, how long the portion did you use from previous beat to cover up the glitch? (Although I don't think it is practical in the rest of the music, since not all of them are hip-hop songs with regular beats...)

I believe the mic didn't save the file properly before it is turned off, so the wave file (as well as the SD card) is corrupted, and couldn't be accessed at all.
I used FileRestore Pro to recover the file, and that's the result...

That portion of the music is from a student arrangement of "All of the Lights" by Kanye West.

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Distorted Wav file after repair

Post by steve » Fri Apr 20, 2012 3:04 am

ivantheczar wrote: But it may be tricky for me as the total recording is about 1 hour long...
I'm not volunteering ;) and I said "it's not going to be a quick job".
ivantheczar wrote:I tried the Sliding Time Scale/Pitch Shift effect before, but it seems very hard for me to adjust exactly the length I want.
Ctrl+D will duplicate the selected audio to a new track. Apply the effect to the duplicate so as to get it close to the right length (slightly over is fine), you can then trim the duplicate (if necessary) to fit.
ivantheczar wrote:For the other two, how long the portion did you use from previous beat to cover up the glitch?
A good place to make an edit is immediately before a strong beat. If the beat is abrupt you can probably get away with doing a straight cut at the start of the beat. If not so abrupt (as in the sample) allow a little extra for a cross-fade. The "patches" started off as a couple of beats (helps with getting the timing alignment right) then trimmed down to one beat + a little extra for the cross-fades (about 0.42 seconds for the last one). There are no hard and fast rules - it's a judgement call plus experience (gained from doing it).
ivantheczar wrote:I believe the mic didn't save the file properly before it is turned off, so the wave file (as well as the SD card) is corrupted, and couldn't be accessed at all.
I used FileRestore Pro to recover the file, and that's the result...
Such a shame, but glad that you recovered so much of it. You probably did not need to record at 96 kHz, 48 or 44.1 will still give excellent results and it's a lot less demanding on the hardware, particularly if using flash memory. I've not used FileRestore Pro but it obviously works - if you don't personally own FileRestore Pro, then a good free data recovery program is "Recuva" from Piriform.com (though obviously I don't know if it would have worked in this case).
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ivantheczar
Posts: 6
Joined: Tue Apr 17, 2012 11:53 pm
Operating System: Please select

Re: Distorted Wav file after repair

Post by ivantheczar » Fri Apr 20, 2012 6:01 am

I think your approach of Sliding Time Scale/Pitch Shift effect works quite well in general, and not difficult to do, I will stick with it. Thanks very much! :D
However I am just a bit confused about why after applying the effect, the endpoint (of the 0% tempo change) doesn't really match, even if I choose zero crossing?

steve
Site Admin
Posts: 80677
Joined: Sat Dec 01, 2007 11:43 am
Operating System: Linux *buntu

Re: Distorted Wav file after repair

Post by steve » Fri Apr 20, 2012 2:50 pm

"Time stretching" is always an approximation. In effect the process requires "synthesizing" the additional audio based on the original audio. It's amazing that it works as well as it does. I suggested applying the effect to a duplicate so that the processed audio can then be tweaked to fit in neatly.
9/10 questions are answered in the FREQUENTLY ASKED QUESTIONS (FAQ)

ivantheczar
Posts: 6
Joined: Tue Apr 17, 2012 11:53 pm
Operating System: Please select

Re: Distorted Wav file after repair

Post by ivantheczar » Sun Apr 22, 2012 6:01 am

One final question, so using ctrl-D, I actually get a new track with that segment I want to time stretch. But I rather want that segment to lie on the same "extra" track, so I won't end up with hundreds of tracks. Is there a quick way of doing it?
(Merging tracks every time seems troublesome, and I lost the "endpoints" as the software decide to join different segments with a long silence.... otherwise I have to be really careful to pick the correct place to paste the segment, which is tiresome.)

Thanks!

Post Reply