Shop OBEX P1 Docs P2 Docs Learn Events
log the data, date/time of when it reaches a certain dB range — Parallax Forums

log the data, date/time of when it reaches a certain dB range

globalglobal Posts: 6
edited 2006-11-15 02:32 in BASIC Stamp
question
First of all, let me tell you what I"m trying to do. I'm taking audio samples through a microphone into an A/d converter· (ltc1298) and I'm trying to log the data, date/time of when it reaches a·certain dB range.· I've done the math and·need to know when it goes over say·335 mV or 274· a/d value.· ··I guess what I need is to take many samples and store in eeprom the voltage level and the date and time after its been over a certain voltage for say 15 seconds.· Since the signal is sinusoidal, i think i need to do some sort of loop to only take peak voltages because I dont need all of the samples to be stored.··Ex. if the a/d reads a max peak that goes over·300 for more than 10 sec, average them out and store the value and date/ time.· I'm· not really sure how to go about doing this.· I have the a/d code working but its taking so many samples that I dont know how to go about storing only some of them.· can anyone help. i know it sounds confusing!!

Post Edited By Moderator (Chris Savage (Parallax)) : 11/15/2006 2:47:15 AM GMT

Comments

  • FranklinFranklin Posts: 4,747
    edited 2006-11-15 02:24
    I'd try using an RC circuit on the analog side to get a sum or average (not sure what to call it) of the sound level before sending it to the A/D. Unless you can match the frequency exactly or sample multiple times a cycle you will always go below your threshold every cycle.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    - Stephen
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2006-11-15 02:32
    Why not run the audio into a comparator (possible as a· Peak Detector) and when the level crosses the threshold then the output will toggle.· The Stamp would monitor the comparator's output (IF Comp_Out = 1 THEN Log_Data.)
Sign In or Register to comment.