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 Dec 7 2002, 12:47
Post #2





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



Hey Pio smile.gif

I never realized you'd posted here, sorry for the long delay in my reply.

I've been beavering away with Cool Edit cutting up the song into the small bad segments and making sure they're all aligned for a program to sort out automatically! I have the first test results for you too!



I've put the exact structure (as best I know it) here - but if you don't want to read it till later, just skip this white portion. Come back select it all with your mouse to read later!


Here is the overall pattern :

[good section][bad section][good section][bad section]......

The good section was ~55 seconds, or ~2'400'000 samples,
and the bad section was ~3 seconds, or ~140'000 samples


Within each bad section, I had this structure :

[broken cluster][good cluster][broken cluster][good cluster].......

A broken cluster spanned 64 samples, starting with a bad sample, then 15 good, then a bad, then 15 good.. until the 64th was the final bad sample.

Then a good cluster lasted 224 samples, leaving the pattern repeating itself every 288 samples.




It wasn't quite this regular though, sometimes bad samples would be missing, at the very beginning and end of the bad group, you'd only have 1 - 3 bad ones, but they would still be spread across 64 samples with spacings of 16 (or 32, 48)..

And also, I believe that every 6th [bad bit] only contained 4 bad samples, spanning 48 in total. So, this meant every 6th repetition only lasted 256, rather than the 288.




I'm not sure if my problem will fit your theory, but I'd like to see if your theory is correct, it could be very useful in diagnosing problems?

I get groups of 5 bad samples, and within each affected cluster there are just under 500 groups, about 2400 broken samples in total. All the clusters are roughly the same size, within 4 groups of eachother.

[just to remind me and you... group = 5 bad, cluster = set of ~500 groups]



So, it's quite a complex pattern. I've tried ripping the cd's on different drives with EAC / CDex, and found the best proof that they were physically wrong is that they play identically on my hi-fi. I am fairly sure the wave's I've ripped are actually what is on the cd, it's not a problem with my drives - unless the same problem could affect a non-PC cd drive?


--------------------
< 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: 16th April 2014 - 09:39