Detect envelope from PWM signal?

Started by earthtonesaudio, July 13, 2009, 02:56:06 PM

Previous topic - Next topic

earthtonesaudio

I have a project (still in the idea stage) in which I'd like to detect the envelope of a signal after it's been pulse-width modulated.  Of course it would be easy for half-wave (diode, resistor, cap), but I'd rather do full-wave rectification.

Essentially for zero input (50% duty cycle) I'd want the low control voltage, and as the duty cycle moves away from 50% (in either direction) I want the control voltage to rise.  I feel like there should be a way of doing this with just a few simple logic gates...

earthtonesaudio

I think I figured out how to do this:
Start with interleaved PWM signals, then XOR each one with a corresponding square-wave derived from a "zero signal" voltage.  Then OR those two outputs, and the result would be a duty cycle that increases whenever the audio signal's absolute value increases.
...That's a lot of work for a rather small gain in performance, so I think for now I'll stick with the quick & dirty half-wave envelope detector.

earthtonesaudio

Another idea:



The PWM section is not ideal, because the frequency varies along with the duty cycle.  However this quirk can be exploited by converting the signal to a variable frequency square wave, and then feeding a frequency-to-voltage converter.  The F-V puts out a small signal with zero signal input to the buffer, but when the signal swings above OR below the quiescent point, the F-V puts out a larger signal, so you get full-wave rectification.  The F-V is over-simplified and probably incorrect but I'm just trying to convey the general idea.

Jaicen_solo

Awesome! but ermm, what's it for..?  ???

Cliff Schecht


earthtonesaudio

Quote from: Cliff Schecht on August 21, 2009, 10:47:03 PM
That's super duper secret!!
Quote from: Jaicen_solo on August 21, 2009, 09:34:49 PM
Awesome! but ermm, what's it for..?  ???

Cliff is right, because... even I don't know yet!

This latest incarnation started as an attempt at another Crash Sync/Uglyface type of noisemaker, using a CMOS chip with multiple Schmitt trigger gates (4093 or 40106)... then I got a bit carried away with the possibility of putting envelope control over ...something.  Couple that with my dislike of optocouplers and a pie-in-the-sky notion of doing as much as possible in the quasi-digital/switching domain (to save power compared to biasing things for linear operation).


Interestingly enough, I kept getting rather clean audio out and I have no idea why, so it's been tabled for now.