PDA

View Full Version : is it possible to subtract a waveform from another one?

Nineko
02-13-2006, 10:15 PM
I mean... you all know that you can mix two sounds together, but is it possible to do the opposite? for example, if I have a song with vocals and the instrumental version of the same song, would it be possible to do something like [song w/vocals] - [song w/o vocals] = [vocals]? I think it should be possible, according to physic laws, I just need to find a software able to do this.
what should I use? I tried to write a code by myself that takes the bytes in the raw PCM data and works on them but (of course) it didn't work.

zircon
02-13-2006, 10:22 PM
Yep. Think about it this way. A simple sine wave, played in time (or in "phase") with another sine wave, will double the amplitude. Now what happens if you start the second sine wave exactly at the halfway point of the first one? The positive amplitude sections of the first will coincide with the negative amplitude sections of the second, and vice versa. Result is "phase cancellation" - no sound!

So yes, if you have vocals, and instrumental w/ vocals, and they're based on the EXACT same recordings, you invert the phase of the vocal recording, play that inverted recording at the same time over the full track, you will get only the instrumental.

Nineko
02-13-2006, 10:41 PM
man, you are a genius.
with all my engineering exams and stuff, I never thought about inverting the second waveform and then mixing them together. now that you tell me this it's so simple.

thank you very much. :D

Yoozer
02-14-2006, 05:56 AM
I did this with a track, and it's not 100% - but you can get close. It's very important that you have both versions on CD (uncompressed) as opposed to mp3, because mp3 ruins the sound.

If the track has a short silence before it starts, just putting one inverted wave on top of the other is not going to work either - the recording might've been off just enough to ruin things.

The wave editor I use (Sound Forge) allows you to "snap" to a point on the waveform. If you zoom in to the highest level you'll see a series of dots.

The trick is to find a sudden recognizable peak in the songs and use that point as a kind of guide.

Also, if both tracks are on 16 bit and both tracks are mastered - convert them to 24 bit first. You'll have more headroom and less chances clipping that way. Then, after putting 'm on top of eachother like zircon described, dither back to 16 bit again.

seanv
02-14-2006, 06:22 AM
With Adobe Audition I'm pretty sure it's possible. As zircon said, it's usually rather simple.
If you have a song with a sample that's played twice in a song, and is exactly alike except for some additions, you can subtract both of those samples and get the additions left over.

Nineko
02-14-2006, 04:18 PM
I did this with a track, and it's not 100% - but you can get close. It's very important that you have both versions on CD (uncompressed) as opposed to mp3, because mp3 ruins the sound.

If the track has a short silence before it starts, just putting one inverted wave on top of the other is not going to work either - the recording might've been off just enough to ruin things.

The wave editor I use (Sound Forge) allows you to "snap" to a point on the waveform. If you zoom in to the highest level you'll see a series of dots.

The trick is to find a sudden recognizable peak in the songs and use that point as a kind of guide.

Also, if both tracks are on 16 bit and both tracks are mastered - convert them to 24 bit first. You'll have more headroom and less chances clipping that way. Then, after putting 'm on top of eachother like zircon described, dither back to 16 bit again.yeah, I know about the mp3 compression. I was talking about two tracks I have on a uncompressed audio cd.
and yes, I'm not new on audio editings with full zoom factor, I just need to try this new thing.