Peak Detector For Audio Frequencies.

Discussion in 'General Electronics Chat' started by erezMASTER, Jul 12, 2014.

  1. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    Hello dear community,
    I was wondering for a long time about a precision Peak Detector with low error rate, that will work from 0Hz up to 20kHz.
    All this is for an Audio Project that I'm planning.

    I was thinking about using the structure provided in the pic,
    Here are a few questions.

    1) I managed to conclude that I may have an Oscillation problem with the Capacitor - Is that true, and how? (the cap has no where to discharge)

    2) In general will this Peak Detector suffice when the sole input will be an Audio Signal after Pre-Amplification?

    3) If you have a better structures or suggestions, please share them!

    Thanks a bunch,
    I realy dont take your comments as granted.
    Sincerely,
    Erez.
     
  2. JasonL

    Active Member

    Jul 1, 2011
    47
    0
    For the capacitor to discharge, you can add a resistor in parallel to the capacitor. The rate for discharge depends on your RC value.
     
  3. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    All the peak detectors I've seen have had a discharge path for the cap; i.e. it's usual to have a 'leaky peak detector'. You don't really want to detect one peak which occurred over several hours of measurement do you?
     
  4. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    I know what you mean.
    I will make an immediate discharge method via a separate circuit once I'll be sure the current detection method using this circuit has no mistakes.

    I left the discharge issue to the end because the discharge time must vary for each frequency domain -
    Low freqs - Vey low discharge time, in order to read the Output reliably.
    High freqs - Fast discharge time, in order not to miss the next Peak.
    (Those facts should not worry you, that's just the needs of the project)
     
  5. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    I'm not in the least worried by them :).
     
  6. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    Any more comments?
    I need the circuit to have very fast detection time, does this one can provide such demand?
     
  7. MrChips

    Moderator

    Oct 2, 2009
    12,453
    3,371
    You need to describe what you plan to do with the output of the peak detect.
    What is your quantitative specification of "very fast detection time"?
    You can reduce the value of the storage capacitor to suit your needs.

    There are two ways to discharge the capacitor:

    1) a resistor in parallel with the capacitor
    2) a reset switch consisting of a FET or analog switch across the capacitor.
     
  8. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    I intend to insert the Peak reading into an A\D Converter and process the outcome with an micro-controller.
    Main project target is a Spectrum Analyzer.
     
  9. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,293
    1,262
    You maybe don't have an oscillation problem, but you might have some others. Even though you are running at audio frequencies you still need a fairly fast op amp and one that can drive some current so it can charge the cap on a cycle by cycle basis like you are looking for.
     
  10. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    I'm sorry but using a spectrum analyzer with a peak detect circuit does not compute. :rolleyes: The output of peak detector is basically DC so it doesn't have a spectrum. What are you trying to measure?
     
  11. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    I agree with Crutschow. If the audio input signal is a mix of frequencies how will you know which frequency is responsible for the detected peak?
     
  12. MrChips

    Moderator

    Oct 2, 2009
    12,453
    3,371
    If you want to create a spectrum analyzer using a microcontroller (MCU), there is a straight forward way of doing this.

    Sample the audio waveform at the required rate and perform the FFT (Fast Fourier Transform).

    If you are looking at a 16-channel frequency display, this is very doable on a MCU.
     
  13. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    I will process each DC level for each Frequency.
    One at a time, 1st freq DC peak then 2nd freq DC peak etc...

    Taking note that sampling only 16 channels wont take to much time so there wont be delay on the spectrum.
     
  14. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,813
    1,105
    That raises another question: how will you isolate each frequency so that you can measure one at a time?
     
  15. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    Simple -
    Each frequency band (divided parts of 0Hz~20kHz) has its own
    Active Band Pass Filter,
    and I'm willing to do about 16 of those.

    I intend to do it using the Analog way, not the FFT.
     
  16. ronv

    AAC Fanatic!

    Nov 12, 2008
    3,293
    1,262
    Drive the capacitor output into a FET input buffer. Then you should be able to make the cap smaller.
     
  17. MrChips

    Moderator

    Oct 2, 2009
    12,453
    3,371
  18. crutschow

    Expert

    Mar 14, 2008
    13,056
    3,245
    Instead of a peak detector, you may want to consider using a precision rectifier and filter the output to measure the signal average value. That may be an easier circuit to build.
     
  19. erezMASTER

    Thread Starter New Member

    Jan 11, 2012
    25
    0
    Thanks, you're really helping me.
    Any more thoughts?
     
Loading...