Help with a simple envelop detector filter. (averaging the signal) - diyAudio
Go Back   Home > Forums > Source & Line > Analog Line Level

Analog Line Level Preamplifiers , Passive Pre-amps, Crossovers, etc.

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 21st February 2013, 05:25 AM   #1
diyAudio Member
 
Join Date: Dec 2011
Default Help with a simple envelop detector filter. (averaging the signal)

Hi guys.
First off I know nothing about audio, and am slowly learning electronics.
This will be my first electronics project that has to do with audio so we'll see how it goes.
I am looking to eventually make some simple lights that fade in and out with music from my computer.
I have found an op-amp circuit which works fine, however i've hit a snag when it came to the envelope detector part of the circuit. I've never heard of an envelope detector before but apparently it's supposed to take a signal and average it out like this: http://upload.wikimedia.org/wikipedi...7/Analytic.svg

So I am trying to get mine to take the audio from my laptop and average out the signal. However when I try it with an led hooked up, the led blinks quite a bit which makes me think that it is not working correctly.

here is the circuit I am using: http://i.imgur.com/7QuQPa3.png (should say "envelope detector" rather than "lowpass filter")


When I play something like a 1khz tone the led's flicker rather than their brightness being constant.

I'm not sure if the envelope detection circuit is built wrong or if the values of the capacitor and resistor are wrong.

If I hook the led up before the signal goes through the envelope detector, it is pretty much the same result. So obviously its not doing what its supposed to.

I would really appreciate any help!!!

thanks in advance,
James
  Reply With Quote
Old 21st February 2013, 06:33 AM   #2
Mooly is offline Mooly  United Kingdom
diyAudio Moderator
 
Mooly's Avatar
 
Join Date: Sep 2007
I haven't a complete circuit for this but it is easy to do (in years gone by I used to do this sort of thing).

Building blocks... you need an opamp to match and give gain (or attenuation) to your signal. In other words a simple x10 amp with volume control. Thats block 1

The output from this now goes to another opamp configured as a rectifier. You can use either a full or half wave configuration. This gives a constantly changing DC level in response to the input. Thats block 2

http://ww1.microchip.com/downloads/e...tes/01353A.pdf

You then add a "peak detector" (in the same pdf) that essentiall just charges a cap up to the max voltage from the rectifier. Adding a resistor across the cap sets up a time constant so that the peak voltage can discharge "between peaks". Thats block 3

You then need something to use that signal. An opamp or comparator can be used to give a "high" output when ever the peak voltage exceeds a certain (preset) level. Thats block 4

Next you need to decide if you want to "stretch" those peak pulses. If you dont then any light or LED will flicker dimly. So for this you need something like a monostable delay that will trigger on the shortest peaks and give a fixed pulse output. Thats block 5

They are all simple basic building blocks.
__________________
-------------------------------------------------------
Installing and using LTspice. From beginner to advanced.
  Reply With Quote
Old 21st February 2013, 06:51 AM   #3
diyAudio Member
 
Join Date: Dec 2011
Quote:
Originally Posted by Mooly View Post
I haven't a complete circuit for this but it is easy to do (in years gone by I used to do this sort of thing).

Building blocks... you need an opamp to match and give gain (or attenuation) to your signal. In other words a simple x10 amp with volume control. Thats block 1

The output from this now goes to another opamp configured as a rectifier. You can use either a full or half wave configuration. This gives a constantly changing DC level in response to the input. Thats block 2

http://ww1.microchip.com/downloads/e...tes/01353A.pdf

You then add a "peak detector" (in the same pdf) that essentiall just charges a cap up to the max voltage from the rectifier. Adding a resistor across the cap sets up a time constant so that the peak voltage can discharge "between peaks". Thats block 3

You then need something to use that signal. An opamp or comparator can be used to give a "high" output when ever the peak voltage exceeds a certain (preset) level. Thats block 4

Next you need to decide if you want to "stretch" those peak pulses. If you dont then any light or LED will flicker dimly. So for this you need something like a monostable delay that will trigger on the shortest peaks and give a fixed pulse output. Thats block 5

They are all simple basic building blocks.
Hi, thanks for the response.
What is a monostable delay?
I also seem to be getting better results when i decrease the capacitance.
  Reply With Quote
Old 21st February 2013, 07:09 AM   #4
Mooly is offline Mooly  United Kingdom
diyAudio Moderator
 
Mooly's Avatar
 
Join Date: Sep 2007
A monstable is a simple logic circuit that once triggered (no matter how briefly), gives an output of fixed duration which can be used to light an LED for example. For example a monostable of 1 second could light an LED for 1 second whether triggered by a 1 microsecond peak or a half second peak.

Look up 555 monostable on google
__________________
-------------------------------------------------------
Installing and using LTspice. From beginner to advanced.
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Best option to attenuate the signal in this simple cct HankMcSpank Solid State 28 7th August 2008 09:20 AM
Reverb Controls-Can You Filter Out Original Signal Entirely? kelticwizard Instruments and Amps 15 7th February 2006 01:58 AM
LC filter combination for 19mhz signal LeakSt20 Parts 5 8th August 2005 02:58 PM
HF filter inductors for signal path cathode_leak Tubes / Valves 3 12th May 2005 09:32 AM


New To Site? Need Help?

All times are GMT. The time now is 12:24 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2