2
$\begingroup$

I am about to do a lot of a recordings when performing tests. The thing is that there are some parts I would like to extract easily from my recording. Is there a way to play some special sequence of sounds, for example few beeps, and then search the whole recording for those markers?

In the end I want to obtain file with labeled segments similarly to what Audacity is doing. Until now I was using hand claps and searching for energy spikes in the long recorded signal. Since I am performing measurements of room with starter pistol this is not a good idea. Later this will allow me for very quick and easy analysis to search for groups of similar sounds. For example:

start time, end time, location

100, 399, loc1

500, 600, loc2

I tried calculating correlation with some pattern, but when room is reverberant it is not performing very good. I get some false markers from threshold correlation. It is because marker is smeared and not exact.

What would be the best method and type of a signal for that task? Any good and fast techniques such as matched filtering?

Addendum:

saying simple what i want:

  • play the marker sound/pattern at random times

    • record this signal and other signals
  • search for these recorded patterns in very long recording

  • being able to say at which point in time those patterns are for example cross correlation (isn't working well) could give spikes i can search for

  • it should be idiot-proof against noise, tonal/impulsive sounds, reverberation and low playback level

  • it should not be very slow. for example at 10 minutes file 40 seconds is my upper limit

$\endgroup$
  • $\begingroup$ Not really dsp related, but depending on your audio recorder, you might have an option to add cues or markers at selected points while recording. These are metadata, not included in the audio signal itself. $\endgroup$ – audionuma Mar 15 '15 at 13:23
  • 2
    $\begingroup$ @audionuma i edited my question. i think it is very dsp related, if not can you explain why it is not connected with dsp? $\endgroup$ – Black Yasmin Mar 15 '15 at 13:51
  • $\begingroup$ Sorry, I meant my comment was not really dsp related and suggesting an alternative way of marking audio takes. $\endgroup$ – audionuma Mar 15 '15 at 14:55
  • $\begingroup$ It is DSP related IMO. $\endgroup$ – Celdor Mar 16 '15 at 11:39
3
$\begingroup$

You can use DTMF tones which are very easily decodable with resonator banks. Brief explanation at http://en.m.wikipedia.org/wiki/Dual-tone_multi-frequency_signaling

If you are in a reverberant room then something like a mobile phone will not put too much energy in it and consequently the recording will not be affected too much by the reverberation. Also, DTMFs are relatively high pitch and would stand out from the background.

There are 16 combinations in a typical keypad but then you can alter symbols (e.g. 1213), possibly in a recording, to build more complex phrases or markers. Altering the symbols quicker than the time constant of the room will reduce the effect of reverberation.

If you are using the starter gun to obtain impulse responses from the room, you can play a sequence in the beginning and just after the end of the recording to roughly identify a particular response but I wouldn't recommend relying on the markers for absolute syncing. You can add a mic close to the gun to obtain the pulse start and end and use the room mics to estimate the dynamics of the room (attack, decay and others)

Hope this helps

Updated part of this answer:

The general idea remains the same, tag a point in time by playing a sound and detect its presence later. The question now is, which sounds and how to detect them. Here is an example using DTMF codes.

1) Get a DTMF generator (for example, a DTMF android app such as this one, https://play.google.com/store/apps/details?id=hu.soska.dtmf&hl=en )

2) In a "clean" (non-reverberant) room, record a sequence of sounds, for example "1928". This is the "tag". Please make sure that each number is keyed in for at least 1 second.

3) In the room under measurement, start your recording. When you want to tag a point, have the "1928" sound reproduced and recorded along with the main recording.

4) Build a filter bank of 8 filters at the DTMF frequencies. The resonators are dead simple filters, here is some example code to get your coefficients: http://lifeorange.com/MATLAB/MATLAB_FD.htm

5) Open the file, run the recording through the filters. Their output will vary depending on the power of the tone in the signal. During the reproduction of DTMF tones, the output of the filters will be increasing. Apply a very simple rule: To maintain a "correct match" you would have to see pairs of filters (representing numbers) going "high" and staying high for at least 1 second. Look for this rule in the outputs of your filters. You now have the matches.

Why single tones and resonators? Because they are very easy and fast to decode.

Alternatives?

Record a Pseudorandom generator signal at step 4 and use cross correlation for step 5. Cross correlation though will be much slower because it would have to run repeatedly in a "sliding window" fashion (please see http://en.wikipedia.org/wiki/Overlap%E2%80%93add_method).

An alternative for step 5 could be multimon (please see http://manpages.ubuntu.com/manpages/gutsy/man1/multimon.1.html ), but that would not give you the offset.

These are all approximate solutions though, they will not give you a dead accurate point in time that your "event" occurs, only a rough approximation (which also depends from the length of your recording).

Hope this helps.

$\endgroup$
  • $\begingroup$ Would be my recommendation too. Tonal feature signals like DTMF are also the only ones that will be robust in strongly reverberant environments. $\endgroup$ – Jazzmaniac Mar 16 '15 at 11:15
  • $\begingroup$ Why do they use dual-tone multi frequency signal? Why not to use one pure sine tone or out of curiosity triple-tone multi frequency? $\endgroup$ – Celdor Mar 16 '15 at 13:44
  • $\begingroup$ i tried different beeps sounds but it is not good robust when i am playing back a tonal sounds. very important question you didnot answered is HOW TO DO IT $\endgroup$ – Black Yasmin Mar 17 '15 at 15:28
  • $\begingroup$ Thank you for your comment, can I please ask that you amend the original question with more information about what it is exactly that you are trying to do? I can then answer, possibly even with specific equipment or suggestions for software. I feel that there are a few points I have to reverse engineer from your question. $\endgroup$ – A_A Mar 17 '15 at 16:05
  • $\begingroup$ @A_A i added more explanation $\endgroup$ – Black Yasmin Mar 17 '15 at 20:12
0
$\begingroup$

Engineers found a number of signals which have spiky autocorrelation function and use them in a technique called "pulse compression". Chirp signal is one of them, and it's easy to generate. You can make it long enough to be reliably detected by correlation (it doesn't have to be loud if it's long enough).

Of course, reverberation will add some smearing. You may do a matched filter for reverberated signal by generating a "pilot" marker in the beginning of the record and then correlating it with the rest.

$\endgroup$
  • $\begingroup$ hoe matched filter is better than autocorrelation? what is the pulse compression? what kind of chirp should i use ? is it robust at noisy enviroment? $\endgroup$ – Black Yasmin Mar 22 '15 at 22:45
  • $\begingroup$ Matched filter and correlation are basically the same thing. Matched filter has same impulse characteristic as transmitted signal, but in reversed order. In this case filtering yields the same result as correlation. Pulse compression is use of signal that can be long, but if you use matched filter/correlation, it gives you a short spike with good time localization. $\endgroup$ – Yuri Nenakhov Mar 23 '15 at 11:35
  • $\begingroup$ ...pulse compression is usage of signal that can be long and thus transmits higher energy, but with matched filtering/correlation results in a short spike with good time localization. Longer chirp gives you more reliable detection (assuming amplitude is constant). Frequency range of a chirp will depend on characteristics of your mic and signal transmitter (wider is better). Determine them in practice. $\endgroup$ – Yuri Nenakhov Mar 23 '15 at 11:53
  • $\begingroup$ Small correction — actually, matched filter is not a "reversed transmitted signal" but rather "reversed signal to be detected". So you use "pilot" marker signal in the beginning of the record, extract it and then use as an impulse characteristic of a matched filter (if you reverse its order) or do a correlation of it with the rest of a record. $\endgroup$ – Yuri Nenakhov Mar 23 '15 at 12:07

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.