Solid State Guitar Amp Forum | DIY Guitar Amplifiers

Solid State Amplifiers => Preamps and Effects => Topic started by: jokunen on July 16, 2013, 10:22:34 AM

Title: Pre-amp / compressor for bass guitar
Post by: jokunen on July 16, 2013, 10:22:34 AM
I designed and bread boarded a preamp/compressor for bass guitar.

The design goal was to create a battery-operated preamp that is able to drive line level power amp directly from a passive bass.
I feel that properly preamped bass driven into proper amplification has too much dynamic range.
If the speaker's low end response is not sufficient then there is a good amount of "natural compression" but that's not the sound I want. That's why I wanted active compression.

The compressor design is initially inherited from "what compressor" but I reduced the part count a lot and connected the gain reduction before the compression detector.
This makes the compressor more of a limiter. It's easier to adjust that way and never goes to "negative ratio" which I don't like with bass.
Half-wave rectification instead of full-wave (like in what compressor) may introduce some extra asymmetric distortion but I haven't found it objectionable at least yet.

I initially had an option to add gain to the compression loop making it even more of a limiter. Works nice when slapping but sounds too much like typical VCA-compressor with finger style playing.

All the component values on the schematic may not be correct because I drew it from memory.
I have actually used NE5532 and TL082 so far but that OPA happened to be handy in the Eagle library when drawing.

There are two gain stages:
The first is a basic JFET gain stage followed by BJT buffer.
The second is non-inverting buffer driving inverting gain stage on a single opamp chip.
I previously compared the sounds of the JFET stage to an opamp and came to the conclusion the JFET sounds a bit "better".

The compressor part is an independent add-on.
There are controls for ratio (R5) "compression" (R10) and master volume (R15).
I initially had attack, release and pre-gain too but they are not that useful.
R10 is not real threshold as in this design the compression led is always on, so threshold is -infinity.
The R10 adjusts the compression sound in very useful way.
There is no "make up gain" as that would make a positive compression feedback loop.

I currently have just a normal LDR attached to a yellow led installed.
The vactrol is there just for easier drawing again. I may try a vactrol in there but then the R5 needs to be selected accordingly.

Please feel free to contribute and fix my mistakes.
Title: Re: Pre-amp / compressor for bass guitar
Post by: J M Fahey on July 16, 2013, 05:08:03 PM
Very interesting, thanks for posting  :dbtu: :dbtu: :dbtu:
Title: Re: Pre-amp / compressor for bass guitar
Post by: Roly on July 17, 2013, 03:56:49 AM
Hey look Ma!  A FET stage without a trimpot!   :dbtu:

{sorry, just taking the micky out of someone else}

Quote from: jokunenHalf-wave rectification instead of full-wave (like in what compressor) may introduce some extra asymmetric distortion

It looks quite well buffered ahead, and has a long time constant behind, so there is no obvious reason why it should.  The general reason for full wave rectification is so you don't have peak signals on one side escaping control.

Your recovery time constant is quite fast, 0.1uF & 50k = 5mS.  Most compressors have a very long recovery time constant, seconds to even minutes.

I assume that you are going to build this up in something like a belt pack so I'll point you to remote control cases (http://www.jaycar.com.au/productView.asp?ID=HB5610) which I've used to good effect.  They do need to be lined with alfoil however to shield stray noise.
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 17, 2013, 05:06:02 AM
Thanks for the comments.

It's without trimpot only because I first put the JFET to a test circuit and then select R3 based on that.
I aim to have 6V on the drain. So I admit being one of them trimpotters  ;)

C5 gets chaged only from the positive side of the wave so there is always less attenuation for negative sides of the wave. That's the asymmetrical distortion I was speculating on.
Hard transient would be an extreme case.
This is visible in LTSpice simulation but in reality I don't know if it gets smeared in the led or LDR.
Anyway if R13 is set to 0 there is very audible distortion. I don't know if the reason is this.

The value of the release resistor R14 may be off. I need to check.
Anyway it's 50k+1k and 1uF so it's 51ms?

R13 and R14 were originally pots to control attack and release.
R13 controls attack time but also compression level. It's not much different than the "compression" pot when used with bass guitar so I left it at 1k.
R14 controls release time pretty well when R13 is much lower than R14.
For bass guitar use after experimentation I figured that most of the release needs to happen between any 2 played notes. The release time is selected to be high enough to smooth out natural amplitude oscillations from sustained notes and low enough to release between notes.
For any other instrument I would select differently.

Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 17, 2013, 05:18:39 AM
About the enclosure.
Belt pack is a good idea. I was going to make a stompbox. It could be build inside the bass as well but that would be pretty extreme.
It's battery operated just because I hate any extra cable. Especially wall warts.
Still I'm going to build mains powered version too with +-15 rails for the opamps.
Title: Re: Pre-amp / compressor for bass guitar
Post by: Roly on July 18, 2013, 12:59:09 AM
Quote from: jokunenIt's without trimpot only because I first put the JFET to a test circuit and then select R3 based on that.

:cheesy:
1. that is more sensible than putting in a row of trimpots, and
2. you are selecting the right resistor, the Source, not the Drain (like the "Eighteen" preamp from Runoffgroove  ::) ).

Checkin';

Tau = CR

Attack
1uF & 1k

Release
1uF & 50k + 1k

1uF * 51k

1 * 10^-6 * 51 * 10^3 = 0.051 = 51mS

Looking back I see I misread your C as 0.1uF.  Sorry. :-[

Yes, this looks very reasonable for a bass guitar fLOW of about 40Hz.   :dbtu:
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 18, 2013, 04:19:50 AM
No I checked my breadboard and the release resistor was actually 100k, but something between 50 and 100 could actually work better for bass.
The "compression" pot was wired wrong in the schematic. It's supposed to be between output and 4.5V and the wiper going to detector input.
In my actual build I also replaced the ratio pot with 100k as there is too many controls for live use. If it's used a better way to wire it would be to connect the wiper to the LDR and the ends between input and output.

Automatic make-up gain would be nice but I don't really know how to do it. Dual-gang at R10 and another opamp in the end would work but requires calibrating.
Making R9 variable has an interesting effect of increasing gain and compression at the same time but it's not really the same thing.
Would work as a slap-solo booster foot switch but I don't do that many slap solos :)

Title: Re: Pre-amp / compressor for bass guitar
Post by: J M Fahey on July 18, 2013, 11:12:34 AM
QuoteSo I admit being one of them trimpotters  ;)

Actually you belong to the much higher Social Class of them "Matchers" , quite close to Brahma himself.
Title: Re: Pre-amp / compressor for bass guitar
Post by: Kaz Kylheku on July 18, 2013, 09:36:00 PM
I gots me some comments too.

If it were me, I'd try to somehow roll the vactrol into the feedback of an inverting stage, to control gain rather than just attenuation. That could actually eliminate a buffer stage: one amp does everything. And since it is inverting, you preserve phase through the box (as I can see you are diligently doing).

Another musing that occurred to me. You have this rectifier and peak detector circuit, whose output is then buffered and used to drive current into the vactrol.

Perhaps the buffer could be eliminated. If you can reduce the compressor signal path to one inverter with vactrol-controlled gain, as above, and also eliminate the buffer from the rectifier/peak-detector, then you can make this device with just one dual-op amp IC, which is cool engineering. You trim the idle current consumption, save space, etc.

When choosing the capacitor and resistors for the peak detector, just take into account the impedance of the transistor base, rather than making it very high with a buffer; I suspect it can still be made to work fine.

The QN2 circuit could put all the loads on the collector side so that it's a current driver. What you have there now is an emitter-follower: as it stands now, you're driving the LED (the display one and the one in the vactrol) with voltage rather than current, which is basically wrong. If the loads are put to the collector side, you can reduce R12 and put some resistance on the emitter for a little negative feedback to control the gain and improve the impedance of the base.

On an opposite note, if you keep the op-amp buffer in this circuit, it can be configured as an active low-pass filter rather than as just a "dumb" buffer.  Why would you do that? Because thanks to the Miller effect, you can achieve the same frequency roll off as the peak detector has now, but using a much smaller capacitor due to the Miller effect of the cap being in the feedback. Cool engineering, again. Whenever you catch yourself building an RC filter immediately followed by a unity gain buffer, it's useful to consider whether they might not be combined.
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 19, 2013, 05:12:49 AM
Thank you very much for your analysis.

Actually my initial design had the LDR in the feedback loop.
I changed it because I didn't like the sound. Logically it should work the same way when calibrated correctly.
That way there needs to be fixed resistor parallel to the LDR to set the max gain and possibly series resistor to set the ratio.
I felt more "in control" with separate variable gain and fixed gain stages. But yes that idea definitely needs to be explored further.

The stuff that happen after the rectifier...
Again I was careful to separate the transistor from the peak detector to avoid calibration but you are right.
Maybe the correct solution would be a FET so the input impedance would be high.
The led circuit is a sudden flash of genious that does not really work after all.
The leds are one the emitter to set the emitter voltage close to the opamp output when peak detector is idle.
As a concept it's a major component-saver compared to the what compressor.
The problem is that threshold level depends on the battery level; emitter voltage is constant because it's set by the 2 leds. Base voltage at idle is set by the +4.5V.
Fresh battery makes the whole thing choke...
So there must be an adjustable threshold. I'll refine the design and try to omit the buffer.
I'm now thinking about replacing the release resistor with a pot parallel to the capacitor. The wiper would go to the gate of the LED driver FET.

I really like your last idea because of the cool engineering part.
If I keep the IC1A then there is no reason to eliminate IC2B because opamps come in pairs.
On the other hand I could try to make an automatic make-up gain out of it...

Other problem I found in real use due the circuit being battery powered:
Driving line level signal with 9V is quite marginal. When the battery goes low so goes to max clean gain out of IC1B.
With my bass and semi-depleted battery I get distortion when R9 = 33k with NE5532.
I need to have adjustable gain and also try an opamp that goes closer to rails.
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 19, 2013, 05:48:02 PM
Now I solved the previous problems with battery voltage changing.
The new led drive with FET also made IC2B totally redundant so it can be omitted.
I my last idea for threshold adjustment would have made compression ratio to adjust with threshold.
This model should have threshold quite much independent.
The LED driver FET needs to hand picked and matched. The threshold voltage sets the compression ratio.
The integrator circuit can swing from "4.5V" to max opamp positive swing so the best Vth should be that exact voltage difference.
Maybe it would be better to make the ratio adjustable at that end too with a voltage divider and use a FET with lower Vth.
The extra red LED was needed in my case to bring the FET near cutoff with a good battery and threshold set to 0V.
It would have been much easier if I had a P-channel FET.

The gain knob is quite interactive with the compression knob. The idea is to set the gain according to bass output and battery level for clean sound and leave it there.
This thing can drive line level input past 0db on transients but that's just it with NE5532 max swing.

I also noticed my precious first stage JFET bias is totally dependent on battery level. Depleting battery approximates to adjusting drain trimpot. Fresh battery seemed to bring the drain closer to the rail. Meaning less headroom. I didn't expect that to happen.

Now as I have a gain pot I had to try some distortion sounds. To my surprise the distortion was not so horrible as hitting opamp rails would usually sound. There is some interaction with the compressor circuit as it's not just a peak detector but the cap load faster with square wave than sine wave with the same peak voltage.
With adjustable attack and release resistor someone could be able to make a novel distortion box out of it.
Title: Re: Pre-amp / compressor for bass guitar
Post by: Roly on July 19, 2013, 09:43:43 PM
Quote from: jokunenThe LED driver FET needs to hand picked and matched.

Quote from: jokunenThe gain knob is quite interactive with the compression knob.

Nots good.  A good design is device independent, and controls should not interact.  LED's require current control which generally means some form of feedback loop.

Quote from: jokunenfirst stage JFET bias is totally dependent on battery level

Also not good, but one of the reasons that FET's and 9V supplies do not co-exist very well.  Generally speaking FET's are happier on higher supply rails like 24V.

Similarly the NE5532 is a really great amp, but it is not well suited to operation on such low supply voltages.  There is an op-amp, the LM358 dual from memory, which is well suited to low supplies and it gets used in some stomps, but it's specs are obviously not as good.

Sometimes a compromise can be stretched to fit, and other times...   :-\
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 21, 2013, 03:08:27 PM
You are right. This device is not well engineered.
I agree FETs in general are not a good match for battery powered circuits because the usually large Vth eats so big portion of the rails. However J201 should be fine as such if I can get the rails stabilized for that right?

I will re-engineer the led driver circuit. I'm thinking about adding ratio control there and then omitting the "compression" control as it actually has quite limited adjustment range in this configuration.

I now used the device in actual bass playing. It sounds nice and provides quite much the kind of compression I was looking for that is transparent.
The 9V rails is a major problem and I was just about to ditch the whole thing and start again with +-15 rails but the small size and lack of power wire keeps me trying harder.
Currently going from very little compression to very audible compression requires adjusting at least "compression" and "gain" and in most cases fine tuning the threshold too to get the max ratio out of it with max signal level.
Adjustable ratio should make this easier as I could get more compression out of less gain.
It should also eliminate the need of hand-picking the LED driver FET. I'm planning to use 2N7000 this time. That has Vth around -1V so I can drive the LED to full brightness with at around 1/3 of max signal and use the new ratio control to reduce that to suitable level.

Title: Re: Pre-amp / compressor for bass guitar
Post by: Kaz Kylheku on July 22, 2013, 05:20:03 PM
9V is a problem if you're using audio workhorses like the NE5532 which don't go close to the rails.

A problem like that can be overcome by using a charge pump, which can generate a 2V and -V rail from a V rail.

The power consumption of the 5532 is also an issue for batteries.  If you can implement this circuit with two amplifiers instead of four, you can cut the IC-related power use in half. Then if you can use chips that have half the consumption of the 5532, your overall improvement is 4X.

One nice bipolar IC that can replace the 5532 if lowering the current is important is the MC33078. At ordinary temperatures, it consumes about 2 to 2.5 mA per amplifier, so about 4-5 mA per package. Compare that to the typical 8 mA and maximum 16 mA of the NE5532: the MC33078 eats about 3X less.

The MC33078 has good figures, distortion-wise (distortion versus frequency, and such are in the datasheet).  The output stages on the MC33078 are non-complementary and supposedly are free from crossover distortion.

It needs dual rails though: minimum of -5 to +5.  Running it on a 9V supply therefore violates the data sheet, but a charge pump to create -9 to +9 would work.

There are lots of devices out there; and many ideas are possible.

P.S. If you're designing around a JFET, it's also worthwhile to look at a very similar device from the MOSFET world: the depletion-mode MOSFET. This is like a JFET in that it is normally on, and a voltage below the source (for an N-channel device) is required to shut it off. Depletion MOSFETs use the same biasing and can be "dropped in" for JFETs. However, being a MOSFET, the depletion mode MOSFET has an insulated gate: there isn't a diode there, and so unlike a JFET, it has a next to nonexistent (DC) gate leakage current.   The existence of these transistors increases your options if you're designing a JFET type circuit.

Title: Re: Pre-amp / compressor for bass guitar
Post by: Roly on July 23, 2013, 04:02:03 PM
Quote from: Kaz Kylhekua charge pump to create -9 to +9 would work.

As would running two 9V batteries in series.
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on July 28, 2013, 04:56:12 PM
I guess my 5532 was broken because it induced a 100mv offset in the buffer side of the chip and that ate the headroom big time.
Maybe a coupling cap would be a good idea between the stages there.
Another headroom eater was my LDR. It seem to go really high resistance when the led is off so the buffer stage lost it's "4.5V" bias. I fixed that by adding a 1M resistor in parallel with the LDR.
I worked fine with a TL082 and now I put a OPA2134 in there to be on the "hifi" side.
The 2134 also has quite low standby current draw. I guess a good amp for the side chain would be the TL062 because of the low current draw.
The 9V rails are not an issue anymore. It seems to drive line level input into clipping before audible clipping from the preamp.
Of course adding a little compression makes it even easier not to clip.

I changed the LED driver to 2N7000 enhancement mode MOSFET and took out the red led from the source bias circuit. That seems to work better.

The first JFET bias changing with lower battery seems to be only remaining problem but I think I can live with that if the other option is adding voltage regulation for it. That would also waste battery power.
I still need to check the total current draw and maybe adjust some parts if it draws too much.

From usability perspective there are many styles of compression available. One special is saturating the compression led with "too low" threshold so the led is on all the time.
For actual live use there are too many interacting controls and the adjustment range is not optimal.
The threshold goes too low and too high with the MOSFET. That should be an easy fix.
The controls are too interactive. Gain, Threshold and Ratio all control the level of compression in the other 2 are in somewhat normal positions. I'll remove at least one of them when I find which settings are actually good.
It's nice to have all those extreme settings available but it makes practical adjustments more difficult.
It seems like fixing the gain at 25K and threshold at around 4.5V would make a nice straight-forward one-knob compressor but  there are other tempting options too.
Title: Re: Pre-amp / compressor for bass guitar
Post by: jokunen on October 15, 2013, 05:00:30 PM
I now created version 2 of the compressor.
This time I dropped the JFET input as this kind of pedal is used for live rather than recording and the sound difference is marginal.
Instead I upgraded the virtual ground to be able to sink/source some current and the envelope detector to use a full wave rectifier.
The gain reduction is now moved to the feedback loop of the gain op amp although I think it introduces some distortion. Theoretically it should have the same effect as shunting the signal to ground but somehow I feel that in practice it's not...
The LDR LED is not current controlled instead of voltage controlled which was made possible by the enhanced virtual ground.
It's bit more difficult to maximize the attainable gain with 9V rails with this device but I think I can get pretty close to line level.
I also tried using the 7660 voltage doubler but had trouble getting rid of the noise it generated on a tight vero layout. Possibly chokes on the rails would have helped but I didn't have any at hand.