0

For example, I have 2 audios, one is A, and another is B. I want to check whether B appears in A(if part of A is similar to B within some threshold), how many times and what are the exact times B appears. Is there any algorithm? Or some examples have already done the similar thing?

Thanks in advance.

Cuero
  • 1,169
  • 4
  • 21
  • 42

1 Answers1

1

In general terms, you need to perform a cross correlation between the two audio waveforms. If the correlation waveform peaks above a certain threshold value, then you have found a matching pair. This can be achieved in O(n log(n)) time by using techniques based on fast Fourier transforms,

For music content in particular, you can speed things up by using an acoustic fingerprinting technique. The Wikipedia article lists several open-source solutions.

r3mainer
  • 23,981
  • 3
  • 51
  • 88
  • Actually, in my example, A is an audio from broadcast and B is an ad audio. And what I want is to count how many times B appears in A. I don't whether the acoustic fingerprinting techniques, such as Echoprint, works. – Cuero Nov 06 '13 at 02:25
  • They should help to reduce the computational workload. If you're monitoring a radio station, you'll have high-quality audio samples to work from, which will also help. There's an interesting paper about an audio search algorithm here: http://www.ee.columbia.edu/~dpwe/papers/Wang03-shazam.pdf – r3mainer Nov 06 '13 at 12:08
  • Unless this is to run in very controlled conditions (such as: synchronous sources, no lossy compression in the signal path) this will not be robust. Furthermore, the likely application of this presumably searching for M audio fragments in signal A, in which case, the computation load scales with M. This is why feature extraction techniques are likely to be the way to go here. – marko Nov 06 '13 at 12:51
  • What does the feature extraction techniques mean here? Something like acoustic fingerprinting? – Cuero Nov 07 '13 at 05:17
  • The paper I linked to above describes a very efficient feature extraction method based on constellation maps. It's patented, however, so you won't be able to use it commercially without a license. But unless you want to do things on a massive scale (like simultaneously checking hundreds of stations for thousands of different adverts), a simpler and less efficient feature extraction method would probably work just fine. – r3mainer Nov 07 '13 at 11:26