ok, looking back at what i wrote it doesnt make much sense - i had just come out of a 6 hour meeting :shock: !! sorry about that. Instead, I will explain my project in full just so that you can get an idea of my intentions:
This is essentially a PIC project for university, using a 16f877. The idea of the final product is something which 'listens' to the ambient volume of the room. I'm using a piezo-electric to do this, and running it through a pre-amp (using an NE5534). This then goes into the 877 on RA1 for the ADC. The next part is where im sort of stuck. Obviously a sound wave is, as it says, a wave. Because i am wanting to sample just the maximum peak of the wave, i am getting problems when the ADC samples the slopes of the wave - instead of getting a constant reading of, say 5V, i am getting 5, 4, 3, 2, 1, 0, 1, 2, 3, 4, 5....(the full wave rectifier mentioned above definitely helps with this, so thank you bmcculla
- it means i dont go into -ve values as well!)).
I would ideally prefer to sample it only when there is a peak, but this isnt possible due to the ever changing wavelengths of ambient sound! Instead of having the sound wave going into the adc, would it be possible to smooth the wave out, so that it gives a flat voltage of what ever the maximum, (or even mean voltage) of the wave being sampled is? I just need to differentiate between different volumes with a PIC.
I hope that is more clear, and if anyone has any suggestions, i would be extremely grateful.
Many thanks in advance.
Ferg
ps.. whats a bleeder juglenaut? i have a vague feeling that capacitors might be the way to go, but im not an electronics wizard - in case you hadnt guessed! :?