IPB

Welcome Guest ( Log In | Register )

Editing A Wave With A Program..., How would I do it?
Mac
post Nov 4 2002, 20:43
Post #1





Group: Members
Posts: 650
Joined: 28-July 02
From: B'ham UK
Member No.: 2828



I have some wave files from a set of cd's that I'm trying to fix. They have what I'd call "digital screw-up" on them (these are purchased cd's, yet have artifacts like a bad cd-r)..

It appears that groups of 5 samples in the right channel are offset by varying amounts, in patches throughout the tracks. It sounds incredibly annoying, and I have tried lots of different ways to fix them, filtering, click removal, interlacing other sections of the song over them. They definately improve the sound quality, but naturally, I want what they *originally* sounded like!

What I dawned on recently though was that the affected samples, and their offsets seem to follow a pattern. You get regularly spaced groups of 5, with regular spacing between each bad sample. And the amount it is offset by, from what I can tell so far, it appears to be by the difference between it's actual value and the value before it.. which would be hard to work out mathematically, because how are you meant to know what it "should" be?

Anyway, the best way I thought to fix this problem would be to get a friend to write a program that manipulated the samples in mathematical form. I can do maths, so could probably find a reasonable way of correcting the samples, then he could write a program that performed the algorithm on the correct samples in a wave.

My question is, could this be done by converting a wave file into a file that contains the sample values as integers? Or is this what a wave file is, meaning it could be acted on directly by a program that could search through the values and alter certain ones?

Thanks! smile.gif

(i can post samples for any kind person who wants to help figure out how to fix them!)


edit:
Ok, I've looked at the files some more, and noticed something quite obvious. The problem samples all take the same value as their preceding sample. I found that taking the difference between the corresponding left channel's sample and it's preceeding sample was a good approxomation (it moved the bad samples in the right direction and close to the right amount), and that would be why.

Is there a way of predicting how the samples should be changed to follow their natrual curve (as would be hinted at by the preceeding and following samples?) It would need to be specifically for when one sample is of unknown value, but the others are correct.. I'm not sure if standard click-restoration in Cool-Ed can deal with this.. just single bad samples, rather than a click in a vinyl which spans dozens of samples...

This post has been edited by Mac: Nov 4 2002, 21:08


--------------------
< w o g o n e . c o m / l o l >
Go to the top of the page
+Quote Post
 
Start new topic
Replies
Mac
post Nov 5 2002, 18:51
Post #2





Group: Members
Posts: 650
Joined: 28-July 02
From: B'ham UK
Member No.: 2828



Aaah.. that's a good idea! I have access to matlab on the computers at university.. I was going to ask my maths lecturer about it, and the prediction algorithms I saw on the Monkeys Audio site.. it seems like they could be made to find a good approximation to the missing value.

I ripped the cd's with Audiocatalyst years ago and the problem was there. I took those cd's back and said hey, they're damaged. Then more recently I bought them again, ripping them with CDex, again I found the problem, in the same portions of the same tracks!

I ripped them with EAC as well, but not using deglitch. Instead I tried the standalone deglitch program which claims to be more accurate. It works on some passages, generally the quieter ones, but when there are drums inolved (as there are in most parts) it only picks up about half the bad samples, and gets some wrong too (as in, corrects left channel samples when it shouldn't), so I'm guessing I need to do it myself as I know exactly which samples are messed up and which ones aren't.

Question is, how best to do it?

I don't have a clue how to use matlab yet, but could problably collar one of the computer technicians to get some help! And then it's a case of finding the best predictor?

If you had 4 samples, x1, x2 x3 & x4 (x4 being the unkown one)

something like x4 = (2 * X3) - X2 or, x4 = (3 * X3) - (3 *X2) + X1 ?


If I found the best one of these to use (or a way to decide the best one of many predictors to use), would it help running it forewards as well as backwards? I know the samples that follow on from the broken sample, so it could predict backwards from those too..

And I have intact left channel information (most of the time).. the way I was editing the files was by taking the difference between the two channels, this leaves a waveform with much lower amplitude, so it was easier to find and remove the peaks. Could this 'difference' waveform be used at all? Or is it in effect just the same information presented in a different way?

Thanks btw! :o)


--------------------
< w o g o n e . c o m / l o l >
Go to the top of the page
+Quote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



RSS Lo-Fi Version Time is now: 30th August 2014 - 20:43