does the digital octaver fuzz truly double the frequency?

Started by Top Top, September 05, 2010, 04:21:12 AM

Previous topic - Next topic

Top Top

Yet another from Tim E.'s treasures.




I realize the output is square... but, does it actually produce pulses at twice the frequency of the input? Or is it just narrowing the pulse to get a more mosquito like sound, like the PWM?

I am having a little trouble getting me head around what happens in the logic gates...

Taylor

I'm pretty sure I breadboarded it and it really did work. It's been a while, but from memory it seemed not too different from a green ringer in terms of sound and functionality. Not a true square wave synthy sound like you get from the Harmony Generator's octave up, for example. I barely understand how anything works, but I'll maybe sim this and see if I can get any insight.

Top Top

I think I have the 4070 on hand so I should just try it on my breadboard, but I was brainstorming an idea and wondered if it could somehow work as a building block to get there.

If I understand XOR correctly, it gives you a positive if you have a positive at either of the inputs, but gives 0 if either both or neither.

Confusing, yet perfectly logical  ??? :o :icon_mrgreen:

I wondered how the inputs to the gate could always give you one or the other, but not both on at the same time. In other words, why would the RC network keep both gates from being positive at the same time?

Taylor

Ok, I simmed it super crudely. Go here:

http://www.falstad.com/circuit/index.html

In the applet, go to file>import, and paste this:

Quote$ 0 5.0E-6 10.20027730826997 50 5.0 50
f 528 256 592 256 5 1.5
f 528 352 592 352 4 1.5
w 592 272 592 304 0
w 592 304 592 336 0
w 528 256 528 304 0
w 528 304 528 352 0
f 672 240 672 304 5 1.5
f 672 368 672 304 4 1.5
w 592 368 672 368 0
w 592 240 672 240 0
w 528 304 480 304 0
w 480 304 480 400 0
w 480 400 720 400 0
w 720 400 720 304 0
w 672 240 672 208 0
w 672 208 480 208 0
w 672 368 768 368 0
I 768 208 768 368 0 0.5
w 672 208 768 208 0
w 592 304 624 304 0
w 624 304 656 304 0
w 624 304 624 432 0
w 688 304 720 304 0
x 535 489 589 494 0 20 output
R 336 208 240 208 0 1 40.0 5.0 0.0 0.0 0.5
w 336 208 480 208 0
r 480 208 480 304 0 100000.0
c 480 400 480 480 0 2.0E-9 -1.6842161495104389
g 480 480 480 544 0
O 624 432 624 528 0
o 29 64 0 34 5.0 9.765625E-5 0 -1

It looks a lot like half-wave rectification. That doesn't go too far towards explaining why, though. You have a lowpass filtered version of the signal going to one input, and the regular version to the other. So the lowpassed input crosses zero slightly after the other input does. The XOR gives a high state whenever only one input is high, but not both. So because one lags a little behind the other in crossing zero, there's only that tiny moment where one is high and the other is not, so you get a high state at the output, but as both inputs become high, the output goes back low. That's what it looks like to me anyway.

Incubusguy

#4
This is me just trying to think through the circuit steps so I could well be wrong, but this is how I interpret it:

The first transistor stage is a gain stage to get the guitar signal level up to a voltage range able to trigger the XOR gates.

The truth table for an XOR gate gives a '0' out when both inputs are the same, and gives a '1' out when both inputs are different. One input is tied to ground, so it can be considered to be a permanent '0'.
As the guitar signal level rises above ~0V, the XOR gate would consider both inputs different and switch the output to '1'. As the signal level falls to ~0V, the XOR gate would deem the inputs the same and switch the output to '0'. As Tim mentions in the passage, this has the effect of essentially squaring up the edges of the guitar signal. This will help to provide more reliable triggering of the following XOR gate.

Now, the second XOR gate is where I could be wildly wrong, but this is my best guess:

The RC network separating the two inputs of the second XOR gate means that one input gets the full square wave, whereas the other input receives a rounded square wave (the cut-off frequency is ~796Hz for the low-pass filter arrangement). It will also have the effect of attenuating square waves with a frequency below this. I can't figure out how it achieves the frequency doubling effect, but my guess is that it has something to do with the cut-off frequency separating both inputs.
As Taylor says, the difference in phase between the two inputs probably has a lot to do with it as well; it's making the output switch at twice the frequency of the input(s).

The Fundamental pot allows you to tap off the square wave signal from the first XOR gate's output or, turned the other way, allows you to tap off the square-octave from the second XOR gate, and varying in between allows you to dial in more or less of the octave part.

What follows the second XOR gate is just a standard low-pass filter tone control and antiparallel diodes-to-ground for hard clipping.

By the way, narrowing a pulse will not necessarily automatically increase the frequency. A narrow pulse repeating for the same number of times per second will still produce the same frequency, but will affect the timbre of the sound. Since Tim refers to it as an octave doubler, I imagine his description is accurate and that it actually does produce twice the number of peaks in one second, not narrower pulses.

EDIT: Got ahead of myself and assumed the guitar signal into the first XOR gate had a 2.5V bias, which it obviously doesn't!

R.G. has a little bit on rectification here... http://www.geofex.com/effxfaq/distn101.htm. Perhaps, my assumption is incorrect and the half-wave rectification just gives an octave element but the circuit doesn't give true full-wave rectification.

slacker

The second XOR works like this. When the squared up signal from the first stage goes high, the top input immediately goes high, and the signal also goes through the RC filter to the lower input. This means the lower input doesn't go high immediately, because of the time the capacitor takes to charge up. So whilst the top input is high and the lower one is low, you get a high on the output. Once the capacitor has charged up both inputs will be high and the output goes low, this gives you a short pulse when the input goes high.
The same thing happens when the output of the first stage goes low, the top gate goes low straight away, but the lower gate stays high until the capacitor has discharged, then it goes low. This gives you a short pulse when the input goes low. The circuit is known as an edge detector.
So you get 2 pulses for every one pulse of the input so it doubles the frequency.

I haven't actually built Tim's design but I've used the same idea and it does work, there's some info and soundclips here if anyone's interested http://www.diystompboxes.com/smfforum/index.php?topic=75373.0.

R.G.

All the replies are correct about facets of how it works. The XOR edge detector works great for doubling the pulse repetition rate for digital signals. I first saw it in Markus' giant circuit compendiums back in the 70s. It relies, as noted, on the XOR producing a 1 for the times when its inputs are different, and on the R-C network making them be different at each edge.

Notice I said "pulse repetition rate" and not "frequency". "Frequency" has the suggestion that the pulses are evenly spaced. PRR does not. And that's critical to understanding what this does.

The R-C network acts like a monostable or one shot timer. It keeps the rounded edge different for a fixed time. So when things are all adjusted up, the "1" pulse out of the XOR is almost exactly the same width for every zero crossing. If the input is a square wave, meaning equal high and low times, the zero crossings are all equally spaced, and you get pulses of fixed width that are identically spaced. If the input is rectangular, meaning a duty cycle other than exactly 50%, the pulses happen in pairs, at each edge of the "short" half-cycle. In the frequency domain, you hear (at least!) two frequencies mixed, one being related to the narrow spacing, one related to the wide spacing. Probably others related to the every-other-one spacing. Plus harmonics of these. Plus intermodulation of these in your ear. This is not terribly messier sounding than full wave rectification, but it's more complicated and not musically related, so there's a "clang" quality to it.

And the pulses are fixed width (or nearly so). So as you change the frequency of the input wave, the pulses get closer with higher frequency and further apart with lower frequency, as noted. The timbre quality changes. That's for simple signals which result in one zero crossing per cycle. Guitar signals *may* have one zero crossing per cycle if you play one note at a time and use rolled back tone and the neck pickup. Otherwise, guitar signals tend to be asymmetrical and often have more than one zero crossing per cycle; the zero crossings are what the XOR circuit looks at.

Net: it's an interesting sound, slipping into varying amounts of "octave" and "clang" depending on what signal you feed it. It's a lot of "interesting" for a very small price, and worthwhile for doing on that basis. What it is not is a clean octave up; that's probably OK if that's not what you expected. It's certainly reminiscent of an octave up at certain settings and signals.
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.

Top Top

Thanks to all, that is a lot of good information, and I do understand now what it is doing. What I thought might be interesting was to try a few stages of that multiplication and then to divide it, to see if I could get crude harmony generation, using a 4017 or some other counter...

It sounds like the answer might be "maybe" or yes, but it might not get exactly the type of sound I am thinking of. Still, might be worth a shot.

R.G.

Quote from: Top Top on September 05, 2010, 12:50:43 PM
Thanks to all, that is a lot of good information, and I do understand now what it is doing. What I thought might be interesting was to try a few stages of that multiplication and then to divide it, to see if I could get crude harmony generation, using a 4017 or some other counter...

It sounds like the answer might be "maybe" or yes, but it might not get exactly the type of sound I am thinking of. Still, might be worth a shot.
I think you have the idea. The problem with following this up with another section of the same multiplication is that this thing runs from edges, and it artificially creates one of its own edges.

If you put a 50% duty cycle signal into it, it will indeed put out pulses at each up or down transition, so you can get a pulse train that is double the frequency of the incoming signal - for the right signal. However, the length of the pulses it creates is fixed by the RC time constant on the input of the XOR. That timing does not change with the input signal. If you put in a 1kHz square wave, just for example, you get out a pulse high and low for each edge of the 1kHz square wave, so you get 2KHz pulses. The width of each pulse is set by the R-C. You can tweak that in so that each pulse is 250uS, so you get a nice 50% duty cycle 2kHz output. So far so good.

If you drop the input frequency to 500Hz, the pulses are still 250uS long, so now the output is a 12.5% duty cycle pulse train. That is, it goes up when the input 500Hz goes up, then goes down 250uS later, and stays down for 1750uS. If you run this into another doubler, you get a pulse up, then another pulse up 250uS later, then another pulse 1750uS, then another at 2000uS. The doubled frequency is not 50% duty, so the doubled-doubled one is not particularly any one frequency. This is because the *trailing* edge of the pulses from the first doubling comes from the RC time constant of the first doubler, and not from the input signal at all. It's just not related to the input. So dividing down doubled-doubled signals from this technique does not do what you think it will.

To do what you have in mind, you really need to do a Phase Locked Loop (PLL) to multiply the frequency up in on a frequency basis, not a pulse-per-crossing basis. This can be done with the CD4046 PLL and a divider chip. In fact, the E&MM Harmony Generator is pretty close to a minimal working setup for doing a multipler/harmony divider.

As Albert Einstein said, everything should be as simple as possible - but no simpler.  :icon_eek:
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.

culturejam

I built one last year. It's definitely octavey, but not as much as I had hoped. Here's a sound clip:
http://www.archive.org/details/LogicFuzz-Demo

And here's a pic of the finished unit:





R.G.

Quote from: culturejam on September 05, 2010, 02:12:31 PM
I built one last year. It's definitely octavey, but not as much as I had hoped.
That is a really accurate description!!  :icon_biggrin:
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.

culturejam

Quote from: R.G. on September 05, 2010, 03:32:06 PM
Quote from: culturejam on September 05, 2010, 02:12:31 PM
I built one last year. It's definitely octavey, but not as much as I had hoped.
That is a really accurate description!!  :icon_biggrin:

Haha, thanks!

It's got hella-sustain, though.  :icon_eek:

earthtonesaudio

Running multiple XOR doublers in series, then dividing down with a clock divider chip like a CD4024 is something I have been putting off trying for too long. 

One of the main disadvantages I have seen with the XOR doubler is that at the most "mosquito-like" settings the signal nearly disappears.  This problem would be exacerbated by running more than one stage in series.  However, if you ran this barely-audible pulse train through a flip flop (or several) the output would be a square wave.  It would not correct any glitches from the XOR stage, but it would at least be audible.

caress

Quote from: earthtonesaudio on September 06, 2010, 11:48:19 AM
Running multiple XOR doublers in series, then dividing down with a clock divider chip like a CD4024 is something I have been putting off trying for too long. 

One of the main disadvantages I have seen with the XOR doubler is that at the most "mosquito-like" settings the signal nearly disappears.  This problem would be exacerbated by running more than one stage in series.  However, if you ran this barely-audible pulse train through a flip flop (or several) the output would be a square wave.  It would not correct any glitches from the XOR stage, but it would at least be audible.

i'm going to try this when i get home next week!

Top Top

Thanks for all the info... I was aware of the 4046, but was trying to avoid it  :icon_mrgreen:

Quote from: caress on September 06, 2010, 04:04:57 PM
Quote from: earthtonesaudio on September 06, 2010, 11:48:19 AM
Running multiple XOR doublers in series, then dividing down with a clock divider chip like a CD4024 is something I have been putting off trying for too long. 

One of the main disadvantages I have seen with the XOR doubler is that at the most "mosquito-like" settings the signal nearly disappears.  This problem would be exacerbated by running more than one stage in series.  However, if you ran this barely-audible pulse train through a flip flop (or several) the output would be a square wave.  It would not correct any glitches from the XOR stage, but it would at least be audible.

i'm going to try this when i get home next week!


Even more interesting than a 4024, I think, would be one that will divide in something other than octaves, such as 4017, which can divide by any number 1-10.

If you multiply the input by two and then just divide by 2, you are just back where you started -  no reason to have the multiplication in between.