0

If I am playing audio out of a speaker into a room, and there is a microphone in the room recording all the sounds in the room, can I cancel out the sound produced by the speaker in the recording?

I think that if I fix the mic and speaker's position, It seems to me that I should be able to:

  1. take an impulse response of room through mic and speakers
  2. convolve this impulse response with the audio file that is being played back
  3. invert the phase of the results
  4. add this to the live input of the mic (and account for latency)

just ambient sounds should remain. Is this correct?

If it is correct, how feasible would it be to actually do?

-would moving/rotating the mic or speaker just a hair cause the phases to no longer cancel at all?

-would having people in the space (even if not between mic and speaker) change the acoustics of the space too much?

is there a different/better technique to eliminate the audio being played through the speakers?

0

...can I cancel out the sound produced by the speaker in the recording?

Theoretically, yes. In practice, mostly if you do a really good job, barely if you do a poor job.

You have the right idea with your steps: you model the room, apply the model to the audio going to the speakers, and subtract the modeled audio from the room audio. Theoretically, this completely removes the unwanted audio.

would moving/rotating the mic or speaker just a hair cause the phases to no longer cancel at all? would having people in the space (even if not between mic and speaker) change the acoustics of the space too much?

Neither of these (to a certain degree) will completely break your system for removing the unwanted audio, but changing the position of anything in the system can and will compromise the effectiveness of your model: adding people, moving anything in the room including chairs and tables, etc will all affect the impulse response of the room and therefore the accuracy of the model. To do this properly, you need to be continually adjusting your model of the room (re-generating the impulse response).

For more, see Echo suppression and cancellation; what you are trying to accomplish is typically known as "Acoustic Echo Cancelation" (AEC), and is non-trivial to accomplish in a practical manner for dynamic environments (rooms with non-dead people in them), as it requires continous recomputation of the impulse response of the room, using the audio from the "far end" rather than a typical "ping" or click. According to Wikipedia, modern systems can achieve attenuation of 55 dB with convergence times of 200 ms, which is honestly pretty darn impressive.

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.