1
\$\begingroup\$

So I'm pretty well-versed in the software world, and my buddy and I decided to tackle a hack idea to get into hardware hacking but we're trying to figure out whether our implementation will actually be feasible the way we're thinking about it.

The basic gist is this:

Some audio is playing through a car's speaker system. We have direct access to that digital audio stream. We also will be capturing the ambient sound, which is a mix of the audio song, any white noise, and conversation between the passengers in the cabin. We would like to take the latter (ambient) signal and subtract out the song's signal as much as possible to detect (roughly) whether or not a conversation is happening past a certain volume threshold (the resulting output for this measure can be 0 or 1 or analog).

Our proposed solution is to feed both signals into a differential amplifier and then capture the output and make meaning of it. We're not entirely sure whether this is the correct rabbit hole to jump down. We do know that this is possible via software with Least Mean Squares Filtering (or Finite Impulse Response filtering - although it doesn't bode too well in real time), but, again, we would like to try to get this done through hardware for the fun of it.

An issue we were thinking about is that the audio signals may be out-of-phase, but, since we're both noobs, we're not entirely sure how much of an issue this is in practicality.

Please excuse my ignorance if this is a dumb question. I tried looking for a similar question in the group but couldn't find anything that I perceived as close.

\$\endgroup\$

3 Answers 3

3
\$\begingroup\$

What you're doing is known as "echo cancelling" (also here) and it's a common problem in the implementation of speakerphones. The gist of the problem is that the version of the music that you're getting from the microphone has been heavily modified (relative to the "clean" version you're getting directly from the radio) by the reverberation of the space it's playing in. A direct subtraction of the two signals will not achieve anything useful.

Instead, an adaptive FIR filter is used to build up an electronic copy or model of the acoustic reverberation, and the output of this filter can then be subtracted from the microphone signal to get a useful amount of cancellation.

The real trick is the algorithm that's used to "train" the filter, which needs to use heuristics to decide what's reverberation and what's actual background noise or conversation. These algorithms are far from trivial.

\$\endgroup\$
3
  • \$\begingroup\$ Ahhh ok that actually explains it pretty clearly. \$\endgroup\$
    – Vinay
    Commented Jan 8, 2015 at 9:52
  • \$\begingroup\$ Actually, it doesn't. The reverberation time in a space as small as a car, with a whole lot of sound-absorbing fabric and padding (not to mention people) is insignificant. Echoes are not a problem. \$\endgroup\$ Commented Jan 8, 2015 at 23:33
  • \$\begingroup\$ @WhatRoughBeast: Even though the reverberation time is very short, the frequency response of the through-the-air signal is very different from the direct electronic signal, and the adaptive filter is what compensates for this. Structurally, it's the same problem as echo cancellation (but not noise cancellation), but the details are different. \$\endgroup\$
    – Dave Tweed
    Commented Jan 9, 2015 at 3:31
0
\$\begingroup\$

Essentially, you're talking about the principle behind noise-cancelling headphones. For a quick discussion, see http://www.forbes.com/sites/geoffreymorrison/2014/02/21/are-noise-cancelling-headphones-worth-it/

In your case, you want to do the subtraction electronically rather than by reemitting the ambient noise with reversed polarity, but the principle is the same. However, you're actually dealing with a more difficult version, since you're dealing with a harder-to-control noise source. You can (more or less) deal with radio noise, although you need to model the acoustics of the car to determine what the music will sound like at the microphone, and that can get tricky. What you can't do easily is determine wind and road noise, which can be very significant depending on speed and road surface conditions. Headphones have the advantage that they can sense ambient noise more-or-less independently of what's going on in the headphones, but your situation doesn't have that luxury.

So, your idea can work (sort of) but don't expect too much.

\$\endgroup\$
0
\$\begingroup\$

How about two mics? One right near a speaker and the other up where people are talking. Balance the gains when there is no talking and then look at the difference. Of course if it's stereo this won't work.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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