Let’s talk about Clipping

Started by acehobojoe, November 01, 2014, 01:15:39 AM

Previous topic - Next topic

acehobojoe


Hello all. I hope you are having a lovely halloween

I have been studying and studying and baffling my mind trying to learn circuits to create my own overdrive pedal from the ground up.

It wasn't necessarily from the ground up as I started by looking at various circuits that already existed, but I just started with a transistor boost and wanted to get simple clipping. I think I achieved this first by looping the source to the drain, or it could have been the other way around, but it was just a simple circuit, so then I decided to try my hand at an op amp, because word on the street is, they can achieve more gain. 

I read, or at least attempted to read R.G.'s Anatomy of a tubescreamer and a the one he has about clipping, and ways to achieve it. These were both incredible articles, but I still found myself lost. I knew R.G. was talking about impedance level when he referred to Z, but I still didn't know exactly what he was referring to on certain things. I will get back to a few things with R.G.'s articles soon. First, I'll show you the circuit I am attempting to modify.

This: http://www.jer00n.nl/2010/07/28/clean-boost-for-guitar-or-bass/ is the op amp booster circuit, I am using a tl072, because that's what I had lying around, but I may switch to the Jrc one that is in ts808s, because those are at my house somewhere off campus. Anyway. You can see that it is just a simple buffer/boost, but My question has been, why is it boosting? I understand .. .yes, if I monkey the values of R1 and R2, there becomes more gain.. but why? Then I started looking up, why op amps work.. still learning that.. but here is the applicable problem to my circuit :
Problem:
I stick the diodes at the end of this circuit, only to find that the clipping occurring is "blary" as described in one of the transistor biasing pages, and then when I push the op amp too hard with a 1m R2 or so, it starts distorting, so there is no distinguishable clipping from the diodes. I have tried the diodes clipped to ground off of the signal, as many overdrives do (that was blary), I have tried the ts9 arrangement of looping to the negative side of the op amp, that was not enough overdrive to produce anything, and I may have tried a few other things, but none of them seem to give me a lucky break.. which brings us back to Geofex and the lovely pages.

Look at This: http://www.geofex.com/article_folders/tstech/tsxtech2.gif 
It is the all important clipping section or the ts9, I I understand the basic premise of the pot, and the fact that the capacitors are acting as filters in a way, but I do not understand the 4.5v connected to the 10k, why is this? it is some sort of bias I believe... I still don't understand what that even means..

So any way, in summary,
1. I wonder why my diodes don't produce smooth clipping instead of blarry clipping,
2. I don't understand the 4.5v 10k resistor in the ts9 circuit
3. I still must learn about op amps

I am slowly learning guys, I just need a little guidance. You don't have to answer every single question I asked. I know that would be difficult. Perhaps you could just say "here, read this" or you should watch this video, that would be great. and if R.G. chimes in, I would be super glad.

It's almost like I'm in a class called tubescreamers 101, when I didn't take the prerequisites.

acehobojoe

and if you are wondering, my diodes are the Ge 1n34a and a 1n4001 alternated for the heck of it.

MaxPower

Just look up non-inverting op amp circuits and you'll get plenty of sites and info including the equations to figure out how to set the amount of gain you want from an op amp and so on. You may as well look up inverting op amp circuits while you're at it. Here's one:

http://www.electronics-tutorials.ws/opamp/opamp_3.html

If you want a textbook that will walk you through diodes, capacitors, transistors, op amps, etc. I would recommend Electronic Principles by Malvino. It's a great place to get started. You can find it under $10 at Amazon (any edition will do). If you want to get  in depth with transistors I recommend Transistor Circuit Approximations (also by Malvino). The math required (for both books) is algebra at worst, so it's not difficult. But you can find all of that info online if you prefer, you just have to dig around.
What lies behind us and what lies before us are tiny matters, compared to what lies within us - Emerson

duck_arse

Quote from: acehobojoe on November 01, 2014, 01:15:39 AM
Perhaps you could just say "here, read this" or you should watch this video, that would be great. and if R.G. chimes in, I would be super glad.

go over to amz, read everything in the lab notebook section, especially on warp, saturation, impedance, buffers and clipping. plenty there.
You hold the small basket while I strain the gnat.

acehobojoe

Ok thank you, I will see if I can find that book at the library or order it, and I'll look through the AMZ website too.

anotherjim

Maybe some books don't explain the 4.5volt thing.

Most opamp primers will take you straight to the "traditional" circuits which were mainly interested in analogue computational jobs. Because these deal with positive and negative values, the power supply is "dual" or "balanced". The Positive power supply is some DC voltage above ground and the Negative supply is the same voltage below ground. Ground represents a value of Zero. You can easily imagine that you can have a circuit to perform maths where input voltages represent numeric values and the polarity (positive or negative) represents the sign of the values, then adding, multiplying, squaring etc., can all be achieved with the fundamental opamp circuits you'll find in data books.

Most stompbox circuits don't have or need the complexity and expense of a dual supply and have a single 9volt one, but you still need some way of representing zero. Audio signals are AC, they swing between some positive voltage and some negative voltage. If we make the ground of this single power supply the ground of the opamp circuit, then how can the signal go negative? There's no negative power supply so it can't and won't.
The answer is to make a special ground connection that represents zero at HALF of the voltage of the power supply. This of course is 4.5volts and most often created with a simple voltage divider made of 2 equal resistors. This half voltage is often referred to as the Bias or Reference voltage. If you see Vref on a schematic, that is the reference voltage. You may also see this written as VCC/2.

As to putting clipping diodes across the output of an opamp booster, you would need some resistance (say 1k) in series before the diodes otherwise it is overloading the amplifiers output when the diodes conduct. Also, if there is no coupling capacitor on the amps output before the diodes, both diodes must ground to Vref and not the supply 0volts, or the one with it's anode facing the amplifier will always be turned on  and the one facing opposite will never act.

In general, all the dual supply opamps circuits you'll find in the books, can be made to work with a single supply when the ground shown is replaced with the divided voltage.

acehobojoe

ok, jim, thank you... mind=blown

Let's see here, so if I have ground represented in my regular op amp circuit as 4.5v, what does that mean for the audio signal, will it be affected?

anotherjim

For the input jack, the output jack and the DC power jack - those Grounds and 0v power  and the metal case must be "chassis ground". This ground must not be tied to Vref (4.5v) or it will just short out to the 0volt of the power supply.

Before entering the opamp circuit, the signal must pass through a capacitor - this lets our AC signal through but blocks any DC in either direction. The capacitor doing this job might be called an "AC coupling capacitor", but can equally be referred to as a "DC blocking capacitor".
Failure to fit the input capacitor will cause the guitars pickups and volume control to short circuit Vref to ground.

After the capacitor, the signal will assume the DC level "bias" of 4.5v from the Vref circuit. At least one of the opamps inputs must be connected to Vref.  usually the Non-inverting (+) one.

Note that any other opamps that follow the first do not always need to have a coupling capacitor. The output of the preceding amp will have a bias at the same 4.5volts so can be "DC coupled".

Upon leaving the op-amp circuits, the 4.5 volt bias needs to be removed by a further coupling capacitor.



Spot the circuit elements in the RAT distortion above.
See R2 and R3 are the 4.5v Vref divider.
R4 couples Vref to the amps + input and also sets the input impedance of the circuit.
C3 AC couples the signal to the + input.
C9 Blocks the amp Vref  from the output to the clipping diodes so the diodes can connect to 0volt chassis ground.
R8 limits the output current drawn by the clipping diodes.


PRR

Re-read anotherjim's essays 3 or 4 more times.

The back-story.....

Guitar strings and speaker cones, "sound in general", goes back-and-forth Both Ways. Look close at strings and cones. No-sound, they sit in a certain position, "center". With sound, they go left and right (or up and down or forward and backward... "both ways").

Simple electronic devices (transistors, tubes) only go ONE way. Electrons flow cathode to plate, never plate to cathode, ONE way.

Complex amplifiers can be powered with two batteries and swing both positive and negative.

However one-battery systems are much more practical. Cheaper and maybe simpler.

The standard trick to get both-ways audio through a one-way electronic device is to "bias" it about "halfway" between the battery terminals. Then audio can swing both ways from the middle.

Halfway on a 9V battery is 4.5 Volts.

In 12V car-audio we bias to 6V, 300V vacuum-tubes are biased to 100V-200V, etc.

Few amplifiers live alone. We usually plug one to another. Each will have its own bias preference. So the convention is to have NO bias on the input or output jacks. Fortunately audio excludes DC, so a simple capacitor will charge to the average voltage on one end, toward zero at the other end, and "block DC".
  • SUPPORTER

acehobojoe

Thank you for that. I am going to draw out my schematic and try to apply those principles the best I can. I'll probably get some things wrong, but it's worth a shot. my circuit is pretty simple, so it will be easy to implement.

acehobojoe



this is the schematic now, I'm going to try to implement the various resistors and capacitors you mentioned.

R.G.

You have some good advice here. Study it.

Let me add just a bit of something related but completely different. It will not make sense to you right now, but keep it in the back of your head, and one day it will if you keep at this.

If you have not listened to a pure sine wave, do it sometime. It's a bland, almost insipid tone. A softly-blown flute is only slightly more complex than a sine wave. The sine wave is the most fundamental waveform. A gentleman named Fourier figured out that *all* other repeating waveforms can be made up out of sums and differences of sine waves; and on top of that, sums and differences of multiplies of ONE sine wave at the lowest frequency in the waveform.

Musicians already knew that. Musicians call these sums and differences "overtones" or harmonics. Musicians' ears and indeed everyone's ears do an automatic, real-time analysis of the incoming sound into different frequencies and harmonics as we listen. Take a look here for the simplest internet sendup of this effect I could find quickly. http://clas.mq.edu.au/speech/acoustics/waveforms/adding_waveforms.html

What comes next is the part you're interested in. If you take the simplest waveform, a sine, and do something to it to make it "impure" by clipping one or both sides, then what you hear when you listen to that is the overtones that Fourier's math describes. Distortion in general, including clipping in all forms, causes harmonics to APPEAR. It creates them by warping the simpler incoming signal.

So clipping is actually the process of MAKING overtones appear that were not there before. The smoother and less sharp-edged the waveforms are, the lower the harmonics are and the less harsh the clipping sounds to our ears. The sharper the corners on the resulting clipped waveform, the harsher it sounds to the human ear.

You can do smooth-sounding distortion two ways. One is to use a distortion/clipping process that naturally doesn't make for sharp corners or discontinuities in the resulting waveforms. The other is to do whatever nasty-sounding process you like, then filter out the resulting sharp edges by low pass filtering somehow. A tremendous amount of "clipping research" amounts to dinking around with those two.
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.

acehobojoe

Thank you, RG. I will be monkeying around all the rest of the weekend with this to  figure out my own taste in clipping. I remembered what you said in one article about the importance of the EQ pre and post. I think I want to try a lower tone eq pre, with a higher more present eq post. We'll see where it goes. I'll let you know how it goes if I get it right. Thank you for all the help.

Mark Hammer

One of the most important things you can know about a guitar signal is that it is not constant, and does not function like an oscillator.  It starts out at a much higher amplitude that it has only a few moments later, post-pick/pluck.  Not only does the overall amplitude decline, but it also starts out with more harmonic content than it has a few small moments later.  Finally, even though it declines in amplitude over time, the properties of the string are such that even in that declining period, there will be tiny "micro-peaks" interpsersed among the rest of the signal.

This is important because what you get when you attempt to clip, no matter what means you use to do it, will depend on how close the signal is to any absolute clipping threshold.  And there's the rub: the clipping action depends on an absolute threshold being crossed, and the content and level of the guitar signal itself keeps changing.  Consequently the tone you achieve is a function of how much of the signal - fundamental and overtones alike - remains above that absolute threshold, and for how long.

All the otherr electronic theory ultimately needs to be viewed through that lens.

acehobojoe

Interesting, and so you must form your circuit around that, with tone caps and such. Then I guess you gotta make sure the op amp output is strong, but just right so that it isn't above the thresh hold by so much. 

Mark Hammer

I'm not sure that's the particular inference I would draw, but I suppose that one possible conclusion a person might reach.

Keep in mind that guitars and pickups and strings vary in the manner that they decay.  If the initial string attack is bright, and the decay is quick, then it may be that only the first brief portion of the picked note is above threshold, such that it starts iut dirty, but cleans up very soon after.  If the string hangs in there for a while, and the pickup's sensitivity helps, then the signal may remain above, or in the neighbourhood of the threshold for a lengthy period.

This is also why clean boosters tend to do what they do when placed ahead of a clipping circuit: they keep the signal well above the threshold for a longer period of time.

But the other thing, perhaps somewhat buried in my earlier post, is that, as the string/note decays, there will be very brief micro-peaks, where the signal will be above threshold, interspersed between longer periods where it is below.  In compressors, noise gates, and envelope-controlled filters, this will result in "envelope ripple", perceived as a kind of gurgly sound to the output.  IN distortion pedals, this instability in the amplitude will produce a sort of unpleasantly ragged distortion, since it comes in a discontinuous fashion.  Those discontinuities are actually still there in much of the early part of a note's lifespan, but since the whole thing is well above clipping threshold at that point, you don't notice it.  Once the overall amplitude starts to peter out, and the signal is hovering around the clipping threshold, or juuuuuusssst below it, THAT's when you notice the unstable guitar signal.

karbomusic

QuoteIN distortion pedals, this instability in the amplitude will produce a sort of unpleasantly ragged distortion, since it comes in a discontinuous fashion.

+1

IMHO it's not very difficult to make a great sounding overdrive or distortion but it can be very difficult to make it great sounding during the entire decay. That being said, it isn't a bad idea to spend a lot of time listening and tweaking while the decaying note is riding that fine line as it makes the transition from dirty to clean. This can be easy to miss when cranking pedals and saying Yay!.. this sounds phenomenal" but not so much when someone begins making music through it. I also think amp SIMs have a particularly hard time with this as well.

From different page of the clipping subject... If the OP has some type of scope + FFT analyzer (even if for only academic purposes) I think it is a good experience to tweak and work with clipping through one. Watching which harmonics drop out or appear with different clipping including anything that modifies the waveform. The harmonics are the distortion, get to know them; there's more to be had than just rolling the high ones off. It's another interesting room to enter and have a look around.

acehobojoe

Quote from: karbomusic on November 02, 2014, 11:16:00 PM
Watching which harmonics drop out or appear with different clipping including anything that modifies the waveform. The harmonics are the distortion, get to know them; there's more to be had than just rolling the high ones off. It's another interesting room to enter and have a look around.

That sounds like a great room to venture into, I do this a lot on my DAW with various spectrum analyzers, I think I could hook up a sine wave to it and watch it's characteristics..
yes, and yes to the clipping at different sub peaks. I know what you mean with the ragged sound, it's not pleasant. you have to really mess around the circuit to have it sound good at all times, not just when playing constant. That could be one reason why the ts9 has it's mid notch boost deal, because the low frequencies seem to be a bit more warbly or resonant.

amptramp

Use an active clamp as shown in National Semiconductor App Note 31:

http://www.ti.com/ww/en/bobpease/assets/AN-31.pdf

Go to page 17 at the lower left and if you use a more modern amp with better slew rate than an LM101, you can get rid of C1 and D2.  A TL07X would do nicely.  The clamp voltage is set by the voltage on the non-inverting input and you can add series resistance at the input as with Rin in the schematic.  This replaces one diode.  You need another clamp with the diode reversed in the other one and the opposite polarity of clamp voltage at the non-inverting input.

Why go through all this monkey motion to replace a diode?  Because the voltage at which the diode starts to conduct is set by the clamp voltage so you have a diode that is infinitely adjustable for voltage and resistance is set by Rin.  The design has no variation with temperature beyond op amp input offset voltage so if you are playing a gig in Phoenix and you have to play in Nome the next day, you do not have to worry about anything sounding different at temperature extremes, which get even more extreme if you just pulled your equipment out of a van.  Part of design engineering is to make sure you have the same behaviour of the device regardless of temperature extremes.  Elsewhere in this forum, we have the Spark Gap overdrive which uses a 6AL5 as the diode section of a Tube Screamer.  A 6AL5 has a forward resistance of about 1000 ohms, so in a design that I have built with active clamps, I have used a 2500 ohm pot in series with each clamp to provide a range from the softest clipping to clipping with an impedance equal to the output resistance of the op amp, which is less than an ohm at audio frequencies.  You can set the Rin and clipping levels independently in my design so if you prefer asymmetrical clipping or symmetrical clipping, either can be done.

The active clamps are set up line to ground as in a DOD250 so you can also add waveshaping and frequency response control by putting a capacitor in series with the junction of the two Rin resistors.  This allows you to avoid hard clipping at low frequencies which make it sound muddy and you can also add inductance since you don't need clipping of high frequencies - that just creates higher harmonics.  You could build the ultimate stompbox this way and one advantage is you don't need a lot of gain ahead of the clamps as long as you can achieve enough gain after to get back to unity gain.  The diode action works down into the millivolts, so the problem of a high gain stage preceding the clipping stage is unnecessary - you just need enough gain to stay out of the noise.

acehobojoe

hey, thanks man.. I think I will switch to that op amp for the final design, looks much more efficient. So this clamp circuit ensures that the diodes will conduct at a lower impedance, correct? and, I guess the tl07x will work for it! time to start testing.