1
$\begingroup$

I hope I can find some help here.

I have started working on a little project concerning voice recordings. What I would like to is: given two audio files in RAW format (or WAV, as long as I can convert them to arrays of bytes), I would like to overlap them, that it get the RAW signal that is roughly equivalent to playing them at the same time.

Being the complete newbie that I am at signal processing, the first thing I've tried, as soon as I was able to turn my files into arrays, was to average them arithmetically ((x+y)/2) and geometrically (sqrt(x*y)). Clearly both approaces return a shriek from hell. Now I was looking into convolutions, but I don't think it is the way to go. Last I thought I could go with FFT, sum themin the transform space and then convert back, but I'm not quite sure. So here goes:

How can I overlap two RAW audio signals? That is, given two audio signals that sound good by themselves, how can I produce a new audio signal that sounds as if the former were being played at the same time?

Hope it is possible to do it using RAW audio, but other suggestions are appreciated. Thanks

$\endgroup$
  • $\begingroup$ Why the downvote? Is it the wrong community? Should I ask on stack overflow? The question is clear, I did some research too but could not find anything $\endgroup$ – gionni Jul 3 '17 at 8:15
  • $\begingroup$ adding the signals in time domain(sample by sample addition) while ensuring they don't add up to saturate will give you the desired effect. $\endgroup$ – arpit jain Jul 3 '17 at 8:39
  • $\begingroup$ You mean I can add the signal element by element (i.e. just a+b) and scale them so that they stay in a reasonable range? Isn't that like doing a arithmetic mean? I'll look up saturation. Thanks for the suggestion $\endgroup$ – gionni Jul 3 '17 at 8:55
  • $\begingroup$ yup, it is adding and normalizing(like arithmetic mean). in question it is mentioned that taking mean is not giving desired results, this puzzles me. if i understand the desired effect properly then, adding element by element in time domain and normalizing it should do. $\endgroup$ – arpit jain Jul 3 '17 at 9:44
  • $\begingroup$ Tryied again, adding in time works, I was doing a wrong thing with the normalization... Thank you for the help! $\endgroup$ – gionni Jul 3 '17 at 9:49
2
$\begingroup$

Adding the signals in time domain(sample by sample addition) while ensuring they don't add up to saturate will give you the desired effect. operation is adding and normalizing(like arithmetic mean). in question it is mentioned that taking mean is not giving desired results, this puzzles me. if i understand the desired effect properly then, adding element by element in time domain and normalizing it should do.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.