Sound Processing with PIC

Discussion in 'The Projects Forum' started by lasania, Jan 5, 2013.

  1. lasania

    Thread Starter New Member

    Jan 5, 2013
    4
    0
    Hey guys,

    I'm currently doing a project to get a sound from a mechanical watch (with a contact mic) to calculate the bpm and lag/lead per day. I've done it with a pc writing a code in Matlab.

    I need general suggestions. Can it be done with a PIC 16f877a? I don't need much accuracy.

    What I have in mind is this, contact mic>filter>amp>pic adc>computation. All I need to do is really just measure peak to peak time so that I can approximate beat error. Any ideas? It would really help me.
     
  2. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,394
    1,606
    I'd toss the ADC and just amplify the analog signal till it becomes a digital one. A little simpler to implement on the PIC side and just as accurate.

    Short term it may jitter some but long term it will have the same accuracy as the watch.
     
  3. Dodgydave

    Distinguished Member

    Jun 22, 2012
    4,999
    745
    I would amplify the signal with an op amp, convert it into a square wave and count the time between pulses, you don't need an adc.
     
  4. lasania

    Thread Starter New Member

    Jan 5, 2013
    4
    0
    Currently I've changed to arduino. I'm using it with a oscilloscope on my comp to see online analog input. Mic gets the heart beat, but it is unable to get watch ticking with opamp.

    I've then tried to use a pocket amplifier (marshall brand), just getting the voltage output from its speaker out. But can't get the ticking signal, only noise.
     
  5. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    Does it sense watch ticking when taken off the wrist?

    Is it a piezo element, electret, or dynamic microphone?
     
  6. lasania

    Thread Starter New Member

    Jan 5, 2013
    4
    0
    It's a piezo mic. Watch is off the wrist, piezo is clamped onto the watch's back.
     
  7. thatoneguy

    AAC Fanatic!

    Feb 19, 2009
    6,357
    718
    If it is on a bench, what "heartbeat" is the element picking up?

    You may need to play with mounting schemes, such as upside down and right side up so one side of piezo element is fixed, and the other end is connected to watch?

    Fixing one or the other in place will reduce avenues of noise.
     
  8. lasania

    Thread Starter New Member

    Jan 5, 2013
    4
    0
    We fixed it by salvaging and using Marshall amplifier's amplifying circuit. Just connected our piezo mic to that circuit and matched the output impedance by adding high resistances to Arduino's analog input. Now we can see the distinctive signal. Although it's noisy, little computation will make it better.
     
Loading...