Window comparator as envelope generator

Started by earthtonesaudio, June 23, 2010, 09:03:19 AM

Previous topic - Next topic

earthtonesaudio

This is just an interesting thing which I noticed lately.  For a window comparator centered about the signal's "zero" voltage (whether that's 0V or just 1/2 of it's average voltage swing), a window of a given width will produce a larger duty ratio waveform for a larger signal input.

Generally, the steeper the slope of the input signal as it crosses the window, the smaller that pulse will be.

The interesting bit is that this occurs once per half cycle of a sine wave, so in a way it's similar to full-wave rectification.  I think this could be used as a form of envelope detection, if you had some other circuitry that accepts a variable duty cycle pulse train as a "control signal."

The most encouraging aspect is that the analog signal's envelope is converted directly into on/off pulses, allowing the use of many digital techniques.

PRR

> many digital techniques

Still analog. You just replace Voltage with Time (or Time-ratio).

A 10MHz-clocked computer may be able to tick time (or time-ratio) with great precision and fewer fussy voltage-analog circuits. It's certainly useful.
  • SUPPORTER

StephenGiles

Didn't Aphex use a window comparator in their Silence Gate, in order to hold the CV when the input falls below a certain level until it returns to the threshold level again?
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

Lurco

What would happen to a dynamicly played square signal? No envelope detection.

earthtonesaudio

Quote from: Lurco on June 24, 2010, 02:49:36 AM
What would happen to a dynamicly played square signal? No envelope detection.

For this circuit, pulse width is a function of the absolute value of the input signal.  Of course you could integrate that pulse train and get a DC voltage output, but if that's all you wanted a standard envelope detection circuit would be simpler.

It's the same information but represented in a different domain (time instead of voltage, like Paul said).

Quote from: PRR on June 23, 2010, 03:30:26 PM
> many digital techniques

Still analog. You just replace Voltage with Time (or Time-ratio).

What I meant was, an on/off logic level signal can interface more easily with simple logic chips than a continuously variable voltage.

StephenGiles

Quote from: earthtonesaudio on June 24, 2010, 08:37:38 AM
Quote from: Lurco on June 24, 2010, 02:49:36 AM
What would happen to a dynamicly played square signal? No envelope detection.

For this circuit, pulse width is a function of the absolute value of the input signal.  Of course you could integrate that pulse train and get a DC voltage output, but if that's all you wanted a standard envelope detection circuit would be simpler.

It's the same information but represented in a different domain (time instead of voltage, like Paul said).

Quote from: PRR on June 23, 2010, 03:30:26 PM
> many digital techniques

Still analog. You just replace Voltage with Time (or Time-ratio).

What I meant was, an on/off logic level signal can interface more easily with simple logic chips than a continuously variable voltage.

Not if driven by the leading edge I'd wager.
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

PRR

> Didn't Aphex use a window comparator in their Silence Gate, in order to hold the CV

CBS held a patent including this idea. For a tank intercom! But it soon showed up in the AudiMax (or VoluMax?). This would be several years before Aphex was founded.

If I understand earthtonesaudio's idea, he is windowing the raw audio(?). The CV gate worked against CV, after sidechain rectifier et al.
  • SUPPORTER

earthtonesaudio

Quote from: PRR on June 24, 2010, 07:39:08 PM
> Didn't Aphex use a window comparator in their Silence Gate, in order to hold the CV

CBS held a patent including this idea. For a tank intercom! But it soon showed up in the AudiMax (or VoluMax?). This would be several years before Aphex was founded.

If I understand earthtonesaudio's idea, he is windowing the raw audio(?). The CV gate worked against CV, after sidechain rectifier et al.

That's a cool bit of history.  Yes, I'm windowing the raw audio.  I did experiment a bit with lowpass filtering the signal going into the window comparator.

R.G.

I believe this is a consequence of the input signal having sloping sides. A window comparator picks out the time when the signal is above/below the top/bottom respectively thresholds. As noted above, a rectangular wave will not show this behavior, because its sides have infinitesimal slopes, so it's either above/below the top/bottom threshold or not. It will likely not have a variable duty cycle.

Then there's linearity. A triangle fed into a window comparator will produce a linear increase in duty cycle over/under the top/bottom thresholds with increasing size. A rounded-top signal will produce a big change in width at first, corresponding to the flatter top, then less as the side slope increases toward the zero crossing as the signal gets bigger compared to the threshold. And as noted, a rectangle wave will be either no response or always on, excepting glitches in the middle and quirks of the window comparator and the feeding circuitry.

Works best with triangles, which we don't get many of; works nonlinearly with sine waves, which we don't get many of; works poorly if at all with rectangles, and randomly with random signals, which we get a lot of.

Mike Irwin's peak/hold envelope detector is still the best I've seen or heard of. It's just complex.
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

StephenGiles

Quote from: R.G. on June 24, 2010, 11:35:27 PM

Mike Irwin's peak/hold envelope detector is still the best I've seen or heard of. It's just complex.

Do you have a link to that by any chance please?
"I want my meat burned, like St Joan. Bring me pickles and vicious mustards to pierce the tongue like Cardigan's Lancers.".

Lurco

#10
The one towards the end of this thread: http://www.diystompboxes.com/smfforum/index.php?topic=37679.0 ? or the Harry Bissell original one?

R.G.

Sorry - it's Bissell's, not Irwin's. A mind is a terrible thing when it gets wasted.  :icon_lol:
R.G.

In response to the questions in the forum - PCB Layout for Musical Effects is available from The Book Patch. Search "PCB Layout" and it ought to appear.

earthtonesaudio

Quote from: R.G. on June 25, 2010, 01:51:53 PM
Sorry - it's Bissell's, not Irwin's. A mind is a terrible thing when it gets wasted.  :icon_lol:

Or as a friend of mine once said, a waist is a terrible thing to mind.   8)

cpm

Quote from: Lurco on June 25, 2010, 10:07:19 AM
The one towards the end of this thread: http://www.diystompboxes.com/smfforum/index.php?topic=37679.0 ? or the Harry Bissell original one?

nice thread!
bad thing is most of the offsite links are dead