# sample and calculate average voltage?

Discussion in 'The Projects Forum' started by Frosty555, Jul 22, 2008.

1. ### Frosty555 Thread Starter New Member

Jul 22, 2008
1
0
This is my first post, hopefully I'm not doing anything wrong

I'm trying to think of a way to "sample" a certain amount of an input waveform and calculate it's average volume. E.g. basically calculate the average amplitude of some sample of a waveform. So if I put a sine wave with an amplitude of 2v in, I'd get a flat 2v DC out. Or perhaps not exactly 2v, but something that would scale with the sine wave's amplitude. E.g. 2Sin(t) in, 1.5v out, 4Sin(t) in, 3.0v out, etc.

The reason i'm trying to do it is I'm trying to create a device that can auto-regulate the volume of an audio source (e.g. television, dvd player, music etc.). I was thinking... 555 timer creates a square wave that will step up or step down the volume of a digitally controlled potentiometer. A comparator controls whether or not that 555 timer's pulse reaches the DCP. The comparator compares the average volume of the input with some kind of predefined reference point.

But that's all unrelated brainstorming... really I'm just trying to get the average amplitude of some kind of input waveform that is not uniform.

Maybe it's similar to the type of circuit that would convert AC into DC. Invert all the negative voltage, and use a capacitor to smooth out the waveform into an approximately average voltage? It sounds like something that ought to be fairly easy to do, but maybe it's not. Maybe there's an IC chip or component I can buy that will do it instead?

Do you guys have any suggestions?

2. ### SgtWookie Expert

Jul 17, 2007
22,201
1,807
You're looking for an AGC (Automatic Gain Control) circuit.

There are plenty of AGC circuits out there. Google is your buddy here

When you figure out how to automatically mute the sound on TV commercials, you'll make a lot of money - but you won't be able to advertise it