Low frequency audio level detector using PIC ADC?


Results 1 to 40 of 69

Threaded View

  1. #1
    Join Date
    Mar 2009
    Posts
    653

    Default Low frequency audio level detector using PIC ADC?

    I'm very tight on board space, so I'm looking at how I can win back some board real estate..

    My circuit needs to detect the signal level of an incoming audio stream - at the moment, I use the well trodden path....full wave rectifiying then smooting into a PIC ADC.

    But since I have a lot of unused pins on my PIC...and it's not being pushed hard, then why not use some of its latent power to detect signal level? If nothing else, this will help me educate myself about sampling.

    The maximuum audio frequency is about 1.5khz...the lowest is about 50Hz, the signal is quite sinusoidal, so to my questions.....

    1. To try and catch peak (or close to it), what would be a good sampling frequency? (if it helps, I'm using a PIC16f1828 ...max internal oscillator of 40Mhz) - I'm thinking 10khz?

    2. Is this methodology correct....

    setup a time to interrupt at a rate of 10khz
    in the interrupt routine take an ADC sample into a variable, compare it to the last if it's bigger keep it, if it's smaller ignore it.
    run a bit of maths to convert peak voltage to RMS (ie multipy by .0707 using some FP workaround)
    Have another timer setup to reset the ADC sample variable every 20ms (ie 50hz the lowest frequency)

    Anything I'm missing - or any comments?
    Last edited by HankMcSpank; - 16th February 2011 at 09:33.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts