3
$\begingroup$

I am working on isolating a specific audio click in a factory type setting. After my initial analysis I determined that a 2-pole High Pass Filter set between 500 and 800Hz would work best for me.

The timing can be random on when the clicks occur due to human interaction. The shape of the click is a "spike" shape. I do not have the images with me on this workstation but I can get them next week if it helps. Thus the process is not completely automated as a user is inserting the connectors together however the goal is to limit human error so as little interaction with this implementation as possible is preferred.

There will always be 3 clicks. Click A and Click B are very pronounced but Click C is very quiet and up until now a very expensive camera system was used to capture Click C visually.

Potential Microphone: link

However I was curious as to what DSP hardware would be recommended for analyzing such waveforms in a fast and efficient manner.

Side Note: I am leaning towards IIR due to ease of use and tweaking if that is an incorrect assumption please correct me.

$\endgroup$
10
  • $\begingroup$ Considering a click is a short-duration pulse that contains all frequencies, a filter that picks out specific frequencies for all time doesn't seem like the right approach. What are you trying to identify, specifically, and what other signals are present that you don't want to identify? $\endgroup$
    – endolith
    Commented Aug 21, 2015 at 20:31
  • $\begingroup$ Essentially there is a female and male connector that need to be attached. The task I have been given is to detect it using an audio sensor because right now its using a very expensive camera system. I am restricted to audio so I can't use any other type of sensor. Other signals that could be present? The scary part is it could be someone slamming the table next to them, heavy machinery during certain periods of time. audio speakers, etc.. As its in a factory $\endgroup$
    – Novaura
    Commented Aug 21, 2015 at 21:00
  • 1
    $\begingroup$ If it always makes exactly the same waveform, you could use a matched filter/cross-correlation. You can't put some known signal into the cable while it's being assembled to confirm that it's connected? $\endgroup$
    – endolith
    Commented Aug 21, 2015 at 21:12
  • 1
    $\begingroup$ Elaborate more - you always have 3 clicks? Is this an automatic process? Any knowledge of the shape of the clicks? Is the timing of them depended?... $\endgroup$
    – Moti
    Commented Aug 21, 2015 at 22:03
  • 1
    $\begingroup$ Oh multiple microphones would totally help if the assembly always happens in the same place. Arrange the microphones in 3D around it and have a matched filter for each with the appropriate delays, then sum or multiply the outputs together so it recognizes only clicks with the right distance from the mics. $\endgroup$
    – endolith
    Commented Aug 21, 2015 at 22:36

2 Answers 2

1
$\begingroup$

Probably the easiest (and most accurate) way to do this is the matched filter approach suggested above. Basically, you can record each click independently and use those as matched filters against the microphone signal. If the clicks are always the same, click A will ring up very strong on the A matched filter. Same with B and C.

To implement the matched filter, you can get a development kit with a processor or DSP chip on it. It will take some coding to implement the solution (probably C). In college, I worked on the "TMS320C6713 DSP Starter Kit (DSK)" but you can try Arduino or Beagleboard. Your system will probably not be highly complex. As for the microphone, you can get a relatively simple one that connects to the 3.5mm jack on the development kit. (http://www.amazon.com/Pyle-Pro-PDMIC58-Professional-Handheld-Microphone/dp/B003GEBGA0/ref=sr_1_4?s=electronics&ie=UTF8&qid=1440204270&sr=1-4&keywords=microphone+3.5mm)

A matched filter works by multiplying the incoming signal by the expected stream of data.

Example: If click A lasts 1mS and your sampling rate is 44.1kHz, you would have a 44 sample matched filter (the click may be much shorter). You can store this in the code and point multiply your incoming signal by this matched filter.

MATLAB example code: https://stackoverflow.com/a/19471009/3920284

The maximum value you get when you multiply by your input stream will correspond to the time when your click happened. You can set a threshold like the example does.

One thing that may change over time is your clicks' sound: as the hardware ages, the clicks will sound different since wearing out may occur.

$\endgroup$
1
$\begingroup$

More details on the matched filter approach:

Matched filter is the same thing as cross-correlation. Input A is a template of what you expect the click to sound like, and input B is the live stream of audio. You cross-correlate them, which will produce low-level noise unless there's a match and then it will produce a large spike.

Most efficient way to do cross-correlation is using FFT method. First, pad your template A with silence until it's the same length as a chunk, then take the FFT of your template A and store it. You only need to do this once.

Then read in chunks of live sound data continuously, and process the chunks in an overlapping way (so you don't miss the click if it occurs halfway between chunks). For instance, combine chunks 1 and 2 and process them as a whole, then combine chunks 2 and 3 and process them as a whole, then 3 and 4, etc.

For each (large) chunk you create, compute the FFT, then (complex) multiply it with the FFT of the template A, then inverse transform to get the cross-correlation. If there's a big spike in it, you found the match. If there's not, ignore it.

Multi-channel version:

This will only work if the assembly always happens in the same point in space.

Set up 2 or 3 microphones in a 3D pattern around the area, record the clicks with all the mics at the same time, which might have different delays to them because they are at different distances from the click (though this isn't necessary). Save those waveforms as your templates, making sure to maintain the delay they each have relative to each other. Run the matched filters on the live data as above (one for each channel). When there's a match at that point in space, all 3 matched filters will produce large spikes at the same point in time. Combine the 3 matched filter outputs by adding or multiplying (I don't know which is theoretically better) to get location-specific waveform matching, which will reject similar sounds from other locations and different sounds from the target location. Or if the location is a little sloppy, just look for 3 spikes within a certain amount of time of each other.

$\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.