Skip to main content

Notice

Please note that most of the software linked on this forum is likely to be safe to use. If you are unsure, feel free to ask in the relevant topics, or send a private message to an administrator or moderator. To help curb the problems of false positives, or in the event that you do find actual malware, you can contribute through the article linked here.
Topic: Why am I unable to find the right volume for the signal to subtract? (Read 1624 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Why am I unable to find the right volume for the signal to subtract?

Hello,
I have two sound files here. One is a flute recording, the other is the same flute recording with some background noise added (this noise is changing throughout the sound.)
Unfortunately, the loudness of the flute recordings is not the same in the two sound files. So I thought that if I took one at 100 % amplitude and the other at, let's say, 99 % and subtracted the two, I should only be getting the surrounding noise. But it seems I'm not able to figure out what the ratio of the two amplitudes should indeed be -- i.e. if one is at 100 %, what should be the coefficient for the other?
I have tried almost everything from 98 % to 101 % with something like 0.1 % increments and I don't seem to be able to find a spot where the original recording would be almost inaudible.
Could someone here please examine the two files and tell me if this is indeed impossible?
The folder is here:
https://1drv.ms/u/s!Ap_EgwEX00SDgiOznKS343Oieb37?e=icxmpF
Thank you in advance.

Re: Why am I unable to find the right volume for the signal to subtract?

Reply #1
They would have to be digitally identical* (except for the noise).     The timing, phase, amplitude, and of course frequency content, have to be identical throughout the recordings. 

For example, if you make an exact copy of one of the flute recordings and mix singing with it, you can use subtraction to get the singing only and you can get a perfect result.   (This is rarely useful in the real world because if you have an identical copy without the signing, or noise, you probably already have a clean copy of the singing, or noise.)

If you record the flute part twice (two separate performances) subtraction will sound the same as addition...   Either way, you'll get a mix as-if there were two flute players.

....Technically, you have to be careful of clipping when mixing.


* Analog subtraction works too if the sound is identical.

Re: Why am I unable to find the right volume for the signal to subtract?

Reply #2
They would have to be digitally identical* (except for the noise).     The timing, phase, amplitude, and of course frequency content, have to be identical throughout the recordings. 

For example, if you make an exact copy of one of the flute recordings and mix singing with it, you can use subtraction to get the singing only and you can get a perfect result.   (This is rarely useful in the real world because if you have an identical copy without the signing, or noise, you probably already have a clean copy of the singing, or noise.)
Yes. And that is what I thought. That the two flute recordings were identical, with the only difference that they were not at the same volume and that there was the additional noise in the other file (so that I could get the noise alone if I subtracted the flute part at the right volume). If I'm wrong, then I would need to somehow prove that the two flute recordings are actually different. Of course they may indeed be different in terms of, let's say, some phase shifts, but that's exactly what I'm trying to figure out -- whether they are the same or not (including the phase alignment).

Re: Why am I unable to find the right volume for the signal to subtract?

Reply #3
If they are not subtracting to silence (or just leaving the noise) they aren't identical.   ;)

It would be unusual to have two identical recordings unless you made the recordings yourself and intentionally-carefully mixed-in the other sound/noise without changing anything. else.   

It works "in the lab" but in these cases you usually already have a separate copy of the noise before it was mixed-in so there's no real need for subtraction except as an experiment or demonstration.

You can easily make your own copy of one of these files (or any other file) and subtract to prove to yourself that subtraction "works".   If the files are identical you'll get total silence.

If you change the volume of one copy, subtraction will give you a reduced-volume copy. 

If you slightly time-shift one of the copies (by adding a few milliseconds of silence to the beginning) you'll get comb filtering and difference file that's "louder" than the original.



BTW - The "classic vocal remover trick" works by subtracting left from right.    This can work "perfectly" if the vocals are "perfectly centered" (identical in the left & right).   Unfortunately, it removes everything else in the center too so it's more of a novelty effect and not that useful in serious audio production.     And often there is some remaining reverb which is not identical in both channels.     

Re: Why am I unable to find the right volume for the signal to subtract?

Reply #4
It works "in the lab" but in these cases you usually already have a separate copy of the noise before it was mixed-in so there's no real need for subtraction except as an experiment or demonstration.
Not always. Suppose you have a recording of dry speech and you convolve it with a rising sine sweep (whose instantaneous amplitude and frequency both keep changing in such a way that the overall frequency response is almost flat). Then you convolve your result with the same sine sweep played backwards. Because you shaped the frequency response to be as close to flat as you can make it, the final result is almost the same as the original dry speech recording, but not exactly the same. If you happen to know how loud this resulting signal is, then you can multiply the contents of your original dry speech quantity by the corresponding value, subtrac that from your result, and what you get is just the filtering imperfections  caused by the fact that the two sine sweeps can't be proper inverses of each other.

Re: Why am I unable to find the right volume for the signal to subtract?

Reply #5
Having actually looked at the two files you provided, I can tell you it is extremely unlikely to be an issue of phase shift.

Here is how the left channel of one aligns with the right channel of the other:

Spoiler (click to show/hide)

While it is technically possible that there's still a miniscule phase shift, I find it incredibly unlikely. This level of alignment is indicative of the exact same file just having been digitally processed, not rerecorded.

That also means that subtracting the two waveforms will give you exactly what that digital processing has changed. The reason you're still getting the flute sound in the difference is because the added noise itself contained the flute sound - i.e. something like a reverb.

And this is some incredibly faint reverb. Here's the waveform before and after subtraction at 100%:
Spoiler (click to show/hide)

Re: Why am I unable to find the right volume for the signal to subtract?

Reply #6
That also means that subtracting the two waveforms will give you exactly what that digital processing has changed. The reason you're still getting the flute sound in the difference is because the added noise itself contained the flute sound - i.e. something like a reverb.
Wow, thanks for this. Exactly the kind of comment I was looking for.
As to the processing, let me reveal what went on here. When I talked about convolving the sound with a sine sweep and then convolving the result with the same sine sweep played backwards, that's almost what I did here, but not exactly.
The important added step is that before I did the convolution, I first converted the sine sweep recording from linear PCM to Opus and then from Opus to linear PCM again. So I convolved the flute recording not with the clean sine sweep but with the "decompressed" one and then I convolved my result with the reversed copy of that same "decompressed" sine sweep.