Newbie Question: Interpolating Two Audio Files

Audio software developers forum.
Forum rules
If you require help using Audacity, please post on the forum board relevant to your operating system:
Windows
Mac OS X
GNU/Linux and Unix-like
Post Reply
101Force
Posts: 2
Joined: Thu Jan 03, 2013 6:04 am
Operating System: Please select

Newbie Question: Interpolating Two Audio Files

Post by 101Force » Thu Jan 03, 2013 6:15 am

Hello,

I'd like inquire about interpolating between two audio files. Originally I thought I was looking for a vocoder, but having looked in to the process I believe that is incorrect, and I'm actually looking for some sort of interpolation or similar mathematical function.

Specifically, I have two audio files... and I'd like to interpolate between them to create a third audio file... but I'd like the effect to be variable. That is to say, for example, at a setting of zero the output is 100% audio file A, and at a setting of 100 (the maximum setting) the output is 100% audio file B, and at a setting of 50% the output is a balanced interpolation between the two audio files. Being able to sweep, or output multiple files, at other settings (such as 25 for 75% audio file A and 25% audio file B being interpolated) would be ideal as well. I'm not looking to pan between the two audio files, but rather create an interpolation between (I believe) the spectra.

Is there a readily available effect that does this, and if not (as I suspect) what would be a good mathematical function to investigate to achieve this?

I realize this is mostly a music orientated forum, but my question pertains to an audio effect that will be utilized for a film's special effect. My apologies if this isn't a good place to ask about this, but if not, I would appreciate some advice on where I may ask about this sort of effect/mathematical function.

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: Newbie Question: Interpolating Two Audio Files

Post by Robert J. H. » Thu Jan 03, 2013 4:04 pm

That's a little weird. What do you mean exactly with interpolating?
The simplest form of interpolation is mixing two tracks together. With a sweep from 0 to 1 (100%) you're getting a crossfade.
This happens all in the time domain i.e. sample a[t] * %[t] + sample b[t] * (100 - %[t]).
The domain that holds the spectral information is in contrast called frequency domain. There are some interesting connections:
- Multiplication in time domain = addition in frequency domain.
This means, if you add two spectra, it is the same as multiplying one signal with the other.
- convolution in time domain = multiplication in frequency domain.
Convolution is time consuming, thus the fast fourier transform is used to bring the time domain into the frequency domain, where two spectra simply can be multiplied.
The basic interpolation method is two average two values. C = (A + B) / 2. Now it is the question, if this can be achieved for the frequency domain while still in the time domain (or you'll have to learn all the stuff about fft and ifft).
The addition is no problem because A + B (FD) = A * B (TD). Then there is the division by two. We can convert it two a multiplication by 0.5.
I am not sure how the second argument of the convolution should look like. if we can simply take 0.5 or if the signal must have the same length as the product of A + B. In any case, I don't know if the result will be meaningful.
Have you any example of the effect that you can attach?
Or can you describe how the result should be?
For example, if you "interpolate" one sine tone of 440 Hz with another of 263 Hz, which spectrum should result?

kozikowski
Forum Staff
Posts: 69374
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Newbie Question: Interpolating Two Audio Files

Post by kozikowski » Thu Jan 03, 2013 9:50 pm

Is there a sample somewhere on-line of about what you want it to sound like?

"Like that noise that Robby makes in "Forbidden Planet'."

Koz

Robert J. H.
Posts: 3633
Joined: Thu May 31, 2012 8:33 am
Operating System: Windows 10

Re: Newbie Question: Interpolating Two Audio Files

Post by Robert J. H. » Thu Jan 03, 2013 10:06 pm

If you're refering to the movie from the fifties, I surmize that was accidently made by the glue that stuck to the tapes...:D

kozikowski
Forum Staff
Posts: 69374
Joined: Thu Aug 02, 2007 5:57 pm
Operating System: macOS 10.13 High Sierra

Re: Newbie Question: Interpolating Two Audio Files

Post by kozikowski » Thu Jan 03, 2013 10:52 pm

Or more likely the film. Those postings are the cue for whimsey.

If we can get an idea of the goal rather than a fuzzy description of the process, we may do better.

Koz

Trebor
Posts: 9954
Joined: Sat Dec 27, 2008 5:22 pm
Operating System: Windows 8 or 8.1

Re: Newbie Question: Interpolating Two Audio Files

Post by Trebor » Fri Jan 04, 2013 8:36 am

Chimera's are possible using talkbox (like vocoder) ... http://forum.audacityteam.org/viewtopic ... 70#p202170

or envelope follower ... http://www.freesound.org/browse/tags/chimera

Post Reply