most elegant ways to make diode clipping frequency dependent?

Started by KarenColumbo, October 07, 2017, 12:55:38 AM

Previous topic - Next topic

KarenColumbo

After some mishaps with jfet distortion (the genius "Spitfire" worked out fine, though) I decided to leave this particular learning curve where it is and swap my attention to opamps w/ diode pairs.

I read through a lot of schematics, some "classic" like TS & family, some not so easy to digest (Triple Wreck & Co.), some completely hermetic (OpenHaus distortion).

The "usual" way to make this clipping frequency dependent seems to be this:



The R/C bit in the feedback path is ambivalent, since R1 almost always sets the gain factor (asuming an R0 at the +In of the opamp). But R2/C2 does exactly that, forming a high pass so low frequencies get clipped least (as electrosmah put it). Am I right so far?

There are questions:

1. I circled a second R/C pair (upper right, numbered "1") in the pic: Would this be the way to introduce a 2nd order HP filter? Can I make this active (with another opamp)? How?
2. Circle number "2" is my wild guess how to filter the clipped frequencies in the hard clipping path. Does this make sense? it looks iffy, at best, to my unknowing eyes. How would YOU do the thing like that at the opamp in this part of the circuit?
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

Fancy Lime

Welcome to the vast field of "TS-style" clipping. Lots of fun to be had here!

I think a 2nd order low pass embedded in the negative feedback clipping stage would have to look something like this:



Be aware though that the maximum available Q-factor is limited because the Q-factor is (among other things) a function of the impedance ratio between the two RC-low passes. And that depends on the values of the resistors, which also control the gain. So it's a bit messy to design. I think you would be better of to just precede a normal 1st order TS-stage with a passive RC high pass. Much easier to handle, design wise.

Also, in my experience higher order filters in or before the clipping stage(s) tend to sound quite peculiar. They have their uses (especially low passes for wave form shaping) but quite quickly kill the "natural tone" that this type of clipping stage is so well liked for by many.

I can highly recommend including a bass control into the clipping stage. This allows enormous flexibility between warm fuzzy and tube-screamer-like sparkly tones, very nice. A cap in series with the diodes is makes a good an simple bass boost. MOSFETS wired as clipping diodes is great for very soft clipping, if done correctly (beware there are many schematics floating around the interwebs that connect the MOSFETS precisely the wrong way around in which case they act like normal Si diodes). See the Onkotherium for an implementation example of these things:
http://www.diystompboxes.com/smfforum/index.php?topic=118391.msg1101956#msg1101956

Have fun with this,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!


amz-fx

Quote from: KarenColumbo on October 07, 2017, 12:55:38 AM
The R/C bit in the feedback path is ambivalent, since R1 almost always sets the gain factor (asuming an R0 at the +In of the opamp). But R2/C2 does exactly that, forming a high pass so low frequencies get clipped least (as electrosmah put it). Am I right so far?

True, but low frequencies are much stronger than highs in a guitar signal. The high pass keeps the processed signal from being too muddy and bass-heavy, so it will cut better through the mix of a band. It's mostly for frequency shaping and tone control.

The second R/C pair will filter the clipped signal but you don't need the series resistor. This looks Rat-like so note that in the Rat, there is a lowpass filter following the clipper diodes. The Rat's tone control varies the cutoff frequency of the filter by changing the resistance going into the filter capacitor, so the R of the R/C changes.

Best regards, Jack

R.G.

You might profit from some basics.

> Clippers create new frequencies higher than the original signal. This is simplest to see with the sine wave as an input to a clipper. If you clip a pure sine wave, you get out only the original sine wave, plus integer multiples of the original sine's frequency. If you clip it symmetrically, you get only odd multiples: 3x, 5x, 7x and so on to much higher frequencies. If you clip it asymmetrically, you get all multiples in some amounts: 2x, 3x, 4x, 5x, 6x, 7x...

> The "harder" the clipping, the more amounts of higher frequency multiples are output. Softer clipping might produce 2x and 3x (second and third harmonics for a sine) and very little else. Tubes do this naturally until they're driven very hard.

> For non-pure-sine wave signals, each sine wave component making up the signal at that instant is not only clipped, but the cross products are produced. That is, for a signal containing 1000Hz and 300Hz, the output will have 1000, and its multiples, 300 and its multiples, but also multiples of 1000+300= 1300Hz and 1000-300=700Hz. These cross products are referred to as intermodulation distortion. In general, they sound quite discordant. But, just like okra, some people like them.

I promise, a point it coming.    :) 

For any real-world clipping circuit, the harder you drive it, the "harder" the clipping is; that is, the more higher order clipping products and the more intermodulation distortion and cross products. Except for the difference products in intermod, these are all trebly. So the harder you drive a clipper, the more trebly and harsh sounds come out.

Also, the more frequencies in the mix fed to a single clipping stage, the more intermodulation products you get, so the more native harshness is likely.

Controlling what you get out of a clipper depends on (1) how complex the mix of frequencies you send in might be, (2) how hard the clipper is driven and (3) any post-filtering of the signal after the clipper has worked.

The tube screamer family of distortions uses all three of these. They filter how much goes into the clipping opamp, how the opamp's effective gain varies with frequency and hence how hard the clipper is driven with frequency as well as doing some post filtering. This is very simple, and produces a good result, so could be called elegant.

Other distortions do various versions of this. Some have active or passive filters before the clipping stage to get better control of what goes into the clipper. This can be a few RC stages, or something as complicated as a gyrator-capacitor resonator. Or many capacitor-gyrators. I know one pedal that uses five or six of these. This can also be done in the feedback path of the opamp, producing a variation in gain and hence signal level with frequency and different clipping.

At some point, you have to trade simplicity for control. This is what the Quadrafuzz does. It does a four-band frequency splitting operation, distorts each band separately, then adds them back together. The distortion is kept to a small band of frequencies and produces much less intermodulation.

And now we're finally coming back to your question: how do you clip different frequencies in a frequency variable manner more elegantly? There is a fundamental tradeoff on how much control you have on the frequency response of an overall input filter - opamp - clipper - output filter setup. You add parts to make the input and gain filtering more complicated, then use output filtering to tone down the treble products on the output. It is very hard to do better than a -6db/octave filter on an opamp input or output without also going to some form of separate active filtering.

I'll translate that a bit: You can't do a sharper, more cleanly defined filtering on opamp input, feedback, and output filtering with single R stages. The sharpness of the filtering is poor, and different frequencies will overlap, making the results of one filter affect the results of the other sections. This is not to say it can't sound good, only that there comes a point of diminishing returns. You have two use more and more components to achieve less and less additional filtering effectiveness.

The big decision to be made is are you limiting yourself to a single opamp or two? Can you use six or seven? If you can, the Quadrafuzz is a good place to start. Do you insist on building it into your footpedal? If no, a stereo graphic equalizer gives you incredible control of both an input to a clipping stage and the filtering on the output once it's been clipped.  If the decision is to use only one or two opamps, you are deciding to so things that can be done with the frequency response of one opamp, and those are well described in the sections of any good opamp book on frequency response and active filtering.

Sorry - this is one of those apparently simple questions that gets complex once you probe under the surface.

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.

Fancy Lime

R.G. puts the finger on a critical point there: How much control do you need/want and how complicated is too complicated? To me this is the one thing I struggle most with when designing anything. My impulse is always to implement too many controls. I usually start with just giving in t that urge and then fiddling with values and re-designs to figure out which controls can be sacrificed. To me the goal is always to have as few controls as possible and make them intuitive, while trying to get as much musically useful tonal variability as is sensible for one device. Striking that balance right is what the art of good design is about (among other things).

For any fuzz/overdrive/distortion type of effect, the magic is to a large extent in the frequency shaping before, between and after the drive stages. R.G.s tip of using a stereo equalizer to have maximum control is nice in the studio or if you have a guitar tech hauling your stuff onto arena stages but not super practical for the "working musician". But its great for testing and figuring out what the default setting of the pedal you build should be and what frequencies need to be variable where. Or you can build a 12-band graphic fuzz from op amps or Muff-like clipping stages. Although I would consider this more of a "because I can" project, than one guided by practical value.

Some general (and subjective) tendencies that may help to get started:
- More bass into the clipping stage makes the sound more fuzz-like, less bass on the input makes it more overdrivy/distortiony. I would place any bass cut controls after clipping in a fuzz but before clipping in an overdrive or distortion.
- Mid cut before clipping makes for very fat but less aggressive (less "obviously distorted") tones that retain dynamics in the mids. Can get mushy if too much mids are cut. I like variable T notch filters centered at 1000Hz for this (with bass).
- High boost is best placed before clipping stages, high cut at the very end of the circuit. This gives the best noise performance and also makes for (imho) more useful tone controls.
- Limit your frequency range coming into and going out of the circuit. Anything below 20Hz and above 20kHz has no business in the audio path. Low frequencies can cause thumping noises from switching and the like, supersonic frequencies invite Radio Yerevan to play through your high gain distortion (which can be fun but its best to be able to shut it off when its unwanted). I usually limit the range to 20Hz-10kHz on the input and about 7kHz on the output. Anything above that will not make it through a guitar speaker anyway and only contributes to noise if the thing is plugged into a DI box. Matter of taste, though, acoustic guitar pre-amps may want higher frequencies but we are talking distortion here, right?

Have fun with this,
Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

amptramp

One more thing to consider about the Tube Screamer is that it is based on a non-inverting stage.  Even if the feedback has been driven hard enough to make the diodes look like a short circuit, there is a gain of unity from input to output so it will sound different from antiparallel diodes from the output of the stage to ground.  When they look like a short circuit, the output is zero.

Mark Hammer

There's always this approach, that uses a 6-band before AND after the clipping stage/s.

Fancy Lime

Huh, did not know the G-Drive. Pretty nifty way of labeling the setting suggestions, gotta remember that. One of those things that I never thought of myself but seems so obvious when seeing it for the first time. Hallmark of genius human-machine interface design. Seems useful for anything with many knobs and interactive or somewhat unintuitive controls.

Andy
My dry, sweaty foot had become the source of one of the most disturbing cases of chemical-based crime within my home country.

A cider a day keeps the lobster away, bucko!

KarenColumbo

Wow, thank you guys!

And youknow exactly what I want to achieve. I don't want to simply copy an existing pedal. I want to tinker around with a maximum of control to get to how it sounds in my head. If this takes 10 opamps it doesn't matter to me. As long as I achieve the goals I'm setting. Btw at least 50% of the fun is what I learn on the way.

When I have an approximation of what I'd like, I'll try and deconstruct all those extra controls and fancy filters and maybe "condense" them into somethin simpler that needs less peripheral stuff. Which - regarding filters - could be possible if I finally have a certain frequency band I'd like to attenuate/boost. What was once a trilogy of pots could very well become a high/low/bandpass with a fixed range. Etc.

I love those suggestions and starting points - exactly what I needed to set me up with some kind of plan instead of having three or five schematics in front of me and frankensteining some circuit that's not gonna work in 9 out of 10 cases :)
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

blackieNYC

I have a simple two-band that I love. A BMP filter splits the signal, followed by a pot (variable resistor) and diodes to ground.  Triple wreck and quadrafuzz are tempting.
  • SUPPORTER
http://29hourmusicpeople.bandcamp.com/
Tapflo filter, Gator, Magnus Modulus +,Meathead, 4049er,Great Destroyer,Scrambler+, para EQ, Azabache, two-loop mix/blend, Slow Gear, Phase Royal, Escobedo PWM, Uglyface, Jawari,Corruptor,Tri-Vibe,Battery Warmers

EBK

Quote from: Mark Hammer on October 07, 2017, 09:00:44 PM
There's always this approach, that uses a 6-band before AND after the clipping stage/s.

I cant help but wonder if I had designed and built that if I'd immediately have a "what the hell was I thinking?" reaction.   :icon_lol:
  • SUPPORTER
Technical difficulties.  Please stand by.

KarenColumbo

#12
Quote from: EBK on October 08, 2017, 12:34:18 PM
Quote from: Mark Hammer on October 07, 2017, 09:00:44 PM
There's always this approach, that uses a 6-band before AND after the clipping stage/s.

I cant help but wonder if I had designed and built that if I'd immediately have a "what the hell was I thinking?" reaction.   :icon_lol:

That thing is exactly where my thoughts would've lead me to. Then I'd have built it and it'd had exactly 1 configuration that's usable.
I tried the BMP tone control with it's variations and went wild with it. Still - for me there's still a part missing - I think it's the midrange that's nagging me, those "vocals" from "aah" to "oh" that somehow are boosted even if you're not doing pinch harmonics. Must be 1 1/2 octaves up from the low E, I guess. I'd like those to be so thick the tone "tips over" almost by itself.

I'd like to try a frankenstein a combination of the enhanced BMP and an active baxandall like there: http://sound.whsites.net/dwopa2.htm. And then pull up those midranges with another filter. Or should I boost the mids before the bass/treble filter? Hm. Or between gain stages? Well ...

By the way: Do jfet distortions actually like an opamp at the end of the signal chain?
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

KarenColumbo

I guess I'm not the first (and won't be the last) one that's endlessly fascinated by the way the guitar signal gets passed along from gain stage to gain stage, be it low (the excellent "Spitfire") or high complexity, getting shaped by filters after each stage. If I look at it intuitively it feels like cooking a soup: the signal gets repeatetly cooked up 'til it boils, then the foam that's been forming gets skimmed off (and with it the "junk"), while the broth itself (or the soup - Fry and Laurie couldn't consent on this in their excellent comedy series) stays enriched by the essences that form through the boiling process.

Of course this is no serious way of looking at material and scientific facts.
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

vortex

Quote from: Mark Hammer on October 07, 2017, 09:00:44 PM
There's always this approach, that uses a 6-band before AND after the clipping stage/s.


The G Drive looks impressive but I found it to sound remarkably average despite the pre/post eq.


KarenColumbo

Guess it depends on what's going on between the eq stages. If you crunch and compress and ultra-high-gain the hell out of it it probably djents a bit
  • SUPPORTER
I see something of myself in everyone / Just at this moment of the world / As snow gathers like bolts of lace / Waltzing on a ballroom girl" - Joni Mitchell - "Hejira"

Djentronio

https://imgur.com/a/QpIj5

I've been toying with the very idea the way a morbidly obese cat might toy with a mouse.

The point is generating two signals to process from the single, run one through a notch filter (or a bandpass designed to have a band of 1-10hz wide in this pictured case?), use an amplification stage to boost the signal until it clips, and then mix it back in.

R3 should be a cap. Lucky the outputs are out of phase before Q2 so after they'll be in phase and no cancel happens.

if you want, you put clipping diodes after the filter (or before?), and Q2 brings the signal level back up.

Maybe the mixer should be some sort of IC that can compare the levels and make them both equal before mixing together.

From what I gather, if you had a wide range of Audio Frequencies at 0.5v and you boosted 1khz until clipping occurred, all of the frequencies are going to clip, not just the 1khz. Because the 1khz is 'opening the gate' so to speak by making the overall voltage higher when the frequencies are in phase. Or something.

I think I might experiment with this. I'd need to run a wide band of AFs through a clipping stack with all frequencies lower than 0.5v except, maybe 2khz, and then run it through a low pass filter and obliterate all freqs above 1khz and see if I still hear a distorted sound.

But its not cars on a 1000 lane highway where each one can be independently manipulated, to my understanding. If 1khz is high enough voltage to clip, everything will clip because the diode is conducting that that exact moment.


R.G.

The idea of generating a 1Hz wide active filter, or even a 10Hz wide filter is seductive, but as a practical matter, it is remarkably hard to do with analog filters. It's theoretically possible, of course, but the practical aspects of doing it with real parts that have tolerances and not ideal parts with zero variation make it nearly impossible. The Q's necessary are quite large, and the gain and precision demands on the components are equally large.
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.

Djentronio

How about a notch filter? if the stop bands overlap, it should make pretty slim peak, and then invert and amplify the result.

R.G.

Quote from: Djentronio on October 08, 2017, 05:41:32 PM
How about a notch filter? if the stop bands overlap, it should make pretty slim peak, and then invert and amplify the result.
The math is the same. The problem is that "pretty slim" is a relative term, and you immediately have to start calculating the filter functions, Q, damping coefficients, part values, tolerances, etc, to actually implement what you want to happen.

One the next few questions to come up in some earlier filter discussions like this one is "what about cancellation?" The Twin T filter is an RC phase-shift cancellation notch filter. In theory, if the components are perfectly matched (there's that tolerance thing again) it can have infinitely deep notch depth. Accordingly, when used as a feedback network for an opamp, it gives the opamp its open loop gain at the cancellation frequency and thus gives very high, thin peaks.

... but how thin? The dissipation in the filter components needs some help. There are schemes for driving the "ground" terminal of the Twin T" to get much higher Qs (which is the same as narrow peaks/notches) and these can give you much better Q than the passive Twin T, which is about 0.5. 

Another place to look for very high Q filters, very selective filters, is in oscillators. Oscillators are circuits which have a frequency selective feedback network and some gain. The frequency selection of the feedback path lets the amplifier drive itself into oacillation at one and only one frequency. however, even in oscillators, the feedback filter is not perfectly isolating of a single frequency. Sine oscillators jitter and wander as the components heat up and age.

If you're going to dig into this more - and I highly recommend that you do! - get yourself a copy of The Active Filter Cookbook and do some reading.
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.