Advice on how to recognize a sound?

Discussion in 'Electronics Resources' started by jpanhalt, Jul 25, 2009.

  1. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    I want to recognize a specific sound on a background of other sounds. For example, most of us can easily distinguish a knock on the door or a doorbell from a telephone ring. However, someone who is hearing impaired might not find that distinction so simple. I am not concerned with something like speech recognition per se, which seems much more complex.

    I have downloaded a freeware program called SoundRuler. In looking at the spectrum analysis, it appears that one might identify a sound by monitoring certain frequency windows, say with filters, and defining the sound of interest as the occurrence of two or more events with a certain time and/or intensity relationship.

    My Internet searches have not revealed much in a practical sense, except for speech recognition. I assume that is either because the approach just mentioned has been tried and won't work or is such old technology that it is not even indexed on-line.

    Does anyone know whether the approach is feasible? If it has been done, can you provide any references I could follow up on? BTW, I do not have access to MatLab.

    John
     
  2. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I think the approach is feasable, to the extent that if you can detect the sound clearly with a microphone you can use a PIC or other micro to spectrum analyse it.

    Microchip have fast fourier transform appnotes on their website for their dsPIC chips and there are a couple of multi band spectrum analyser projects on the net that people have made using just low-end micros and some clever programming.

    I know from looking at the spctrum analyser on my music setup it would be very easy to tell the difference between say a kick drum and a singer or guitar. Telling th esinger and guitar apart would be a lot harder. Suppose it depends on just what you wanted to achieve?
     
  3. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Yes you could set up a 'signature analysis' in the frequency domain for you particular sound.
    More information would be helpful.

    Is it a knock on the door, for instance?
    Is it a single isolated sound or is it repeated?

    There are some sound spectral analyser programs around, some have free versions, but the output can be very complex.

    I did some exhaust sound analysis recently for someone and found the phonic gadget
    'phonic personal assistant' much better for the job. This handy gadget has a real time audio spectrum analyser and a memory so you can save measurements for later download to a pc. There are 2 single channel versions PAA2 and PAA3

    http://www.phonic.com/index.php?target=products&product_id=30360
     
  4. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    Matlab makes it much easier. If you can't get a student version, or borrow access somehow, try to track down one of the free clone versions of Matlab. These are not as good, but some of them have the basic functions needed.

    I would recommend doing detailed analysis of the sounds you are interested, in Matlab (or Matlab clone), then figure out a very reliable way to distinguish the sounds with minimal calculations. This will make implementation easier in a cheaper microprocessor.
     
  5. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    I would like to thank everyone for their input. I resisted responding earlier for fear it might inhibit brainstorming. Now that the sun has passes a few more meridians, let me respond:

    @studiot
    This is the beginning of another hobby project. My Summers are full of house repairs and such, but in the Fall, our football season starts. That is usually a time for sitting back, eating popcorn, having a few beers and watching the Cleveland Browns get pushed around. The problem with modern microwave popcorn is timing. Not enough, and there are too many unpopped kernels; too much, and it is burned. My plan is to develop an automatic popcorn timer.

    While it is attractive to consider counting the actual number of pops, I suspect other measures may be less complicated to do and perhaps even better at determining the endpoint. Deciphering the sound pattern to determine the number of pops during a period when rapid popping occurs is probably well above my level of understanding. However, detecting isolated single or perhaps double pops seems more doable. Most of us determine when the popping is done either by smell of burnt popcorn (not part of this project) or by the change in popping frequency that occurs at the end. This project will try to make detection of that endpoint a little more objective and automated. NB: I have not ruled out a chemical detector for the first burnt kernel, probably by detection of a specific pyrolysis product. That is just not part of the project as it stands.

    @steveb
    MatLab is probably a great way to go, and if I really tried, I could probably get access to it for this project. I am afraid that would become a project within a project. So, I am looking for a more empirical/analog way to solve the problem. Does anyone know of a site that provides calculation of component values for Sallen-Key notch filters?

    @ The RB
    FFT may end up in the final project. Right now, I am looking for a simple (at my level of understanding) analog approach for proof of concept.

    @All
    I anticipate going through a lot more popcorn this Fall than I could possibly eat. Fortunately, birds and squirrels like popcorn treats during the Winter.

    Best regards, John
     
  6. CDRIVE

    Senior Member

    Jul 1, 2008
    2,223
    99
    John, please tell me that you're retired! If not.. please don't respond because my head will explode. :rolleyes:
     
  7. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    Yes, of course I am retired. I don't do this for money.

    John
     
  8. steveb

    Senior Member

    Jul 3, 2008
    2,433
    469
    Hey, if it works, infomercials may be in your future! :p
     
  9. flat5

    Active Member

    Nov 13, 2008
    403
    17
    What pops in my little mind is
    after the fast pops stop (interval detector) or a preset time
    monitor the slower popping until the interval gets too long.
    Probably want to use a bandpass filter and sensitivity control.
     
  10. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    I would sense the rapid temperature rise that will occur once the majority of them pop. It's a tried and proven system with many types of automatic cookers.
     
  11. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    Not sure where or how one would put the probe or point an IR detector in the microwave scenario. Sniffing pyrolysis products from starch (and other components) in the corn is a surrogate measure of temperature and is an option I would like to keep on the back burner for now.

    John
     
  12. Dave

    Retired Moderator

    Nov 17, 2003
    6,960
    144
    John,

    I'm with the suggestions made here about doing this in Matlab - a DSP approach will be both simpler and will more than likely give better results. Obviously Matlab is costly, but the free clones are more than adequate for this sort of application: http://forum.allaboutcircuits.com/blog.php?b=65

    Note, they are often made with Matlab compatibility in mind so you should be able to use user files from the Matlab Exchange for the requisite SP and filters with minimal effort for the port.

    The complexity of a changing environment might mean you need to look at adaptive filtering which would be nigh on impossible in the analog world.

    Dave
     
  13. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    Thanks Dave for the advice and link. I will take a look at those clones. Studiot sent me a freebie yesterday (Spectrogram). It looks pretty good and intuitive. Another freebie, SoundRuler and its related programs also seems to be simple to use, but I will follow studiot's recommendation and learn to use Spectrogram.

    I agree on the DSP, but will probably try some analog methods first just to see what happens. My ulterior motive is to expand my programming abilities in assembly and not the sound analysis per se or easier popcorn. So, I definitely see DSP in my future, if the preliminary work is at all encouraging.

    John
     
  14. darenw5

    Active Member

    Feb 2, 2008
    45
    0
    An alternative to Matlab is IDL. The official one is very expensive itself, but you can get a free clone sufficient for exploratory signal processing and plotting, called Fawlty Language. See http://freshmeat.net/projects/fl and http://fl.net23.net/ for more.
     
  15. ChrisHelvey

    Active Member

    May 22, 2004
    45
    1
    I would think that a "pop" has a much higher amplitude than the surroundings, which would be more constant. so, maybe filtering by amplitude instead of frequency would be more appropriate. You can "count" the "pops" against time. That's a fun project. :)
     
  16. ChrisHelvey

    Active Member

    May 22, 2004
    45
    1
    How about using a comparator in a PIC where one little microphone hears the pop, via an op-amp, could be detected on the comparator and generate an interrupt in the PIC. Count the interrupts. A really good algorithm could make perfect popcorn! Whoever thought math was boring never ate perfect POPCORN! :)

    Chris
     
  17. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    Yes, in my first run on the spectrum analyzer, the pops were quite obvious. Still lots of work, though, before it is ready for TV. :D

    John
     
  18. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Sorry I didn't see that you were going to use a microwave. I thought you were making a specialised automatic popcorn popper.
     
  19. studiot

    AAC Fanatic!

    Nov 9, 2007
    5,005
    513
    Microwaves have exhauset vents in the outer cabinet.

    If you open this, there will be a corresponding path from the oven cavity.
    This is a good place to record both sound and smells.

    It's just tough if yours is a built in model.

    Glad you got Spectrogram working, shame they stopped doing it.
     
  20. jpanhalt

    Thread Starter AAC Fanatic!

    Jan 18, 2008
    5,677
    900
    Update: Having great fun. I can detect the pops fairly reliably using simple analog filtering. Used sound analysis to determine filter cutoffs.

    I've looked at TI and Microchip for DSP solutions. I don't think I can even solder anything TI makes, and its evaluation packages seem to start at $400 + software licenses. The Microchip ds30F2XXX series looks more attractive. At least the chips are available with leads that can be soldered. Microchip has a demo of a door latch with motor noise. Sounds just like my popcorn, and the .wav file after adaptive filtering is really impressive.

    QUESTIONS:

    Does anyone have experience with the dsPICDEM 2 Development Board?

    What else is needed to get started? Microchip provides and/or sells assembly routines for filtering. It is a bit confusing to tell what is needed and what is available free. For example, it appears there is an evaluation/single unit version available for $5 or free (?), but it is not clear whether it is time limited or limited in any other way. Anyone have advice on that software?

    John
     
Loading...