Simple EQ using the BA3812L chip

Started by tca, October 12, 2012, 04:49:57 AM

Previous topic - Next topic

tca

Hi, I'm planning on building a simple 5 band EQ  using the BA3812L chip but changing the frequencies to more suitable values. The frequencies that I'll be using are the ones from Mesa Boogie DC-5 amp. Here is the schematic:



What are your thoughts on this chip? Is it noisy? Alternatives?

Suggestions/comments.

Thanks.

P.S.

I've searched the forum but nothing useful found.
"The future is here, it's just not evenly distributed yet." -- William Gibson

Mark Hammer

Any potential noise (hiss in particular) is addressed by that 1000pf cap linking pins 12 and 14.  As shown, it provides rolloff starting around 23.4khz.  If hiss does become an issue, you can always increase the value of that cap to lower the rolloff point.  It's not a perfect solution, but good enough for rock and roll.

Note as well that noise becomes an issue the more gain is inserted.  To that end, EQ curves are most quietly attained by using cut rather than boost.

tca

Quote from: Mark Hammer on October 12, 2012, 09:40:00 AM
Any potential noise (hiss in particular) is addressed by that 1000pf cap linking pins 12 and 14.  As shown, it provides rolloff starting around 23.4khz.  If hiss does become an issue, you can always increase the value of that cap to lower the rolloff point.  It's not a perfect solution, but good enough for rock and roll.

Thanks for the advice, I will take that in to account when testing the schematic.

Cheers.
"The future is here, it's just not evenly distributed yet." -- William Gibson

Morocotopo

Tca, I have one of those chips I bought some time ago. It´s waiting in the parts bin to be converted into an EQ pedal. Might use your schem if it´s OK. Have you given any thought to the type of pots you will use? Common circular ones, or you will take on the challenge of making slots in your enclosure to use linear pots?
Morocotopo

tca

#4
Hi,
 I'm thinking on using circular pots for the first run on this EQ.

The schematic is correct, it was taken directly from the datasheet. The values of the capacitors for each band were also calculated from the data of the datasheet.
C0=1./(2*pi*R0*Q*f);
C=Q./(2*pi*R1*f);

where
R0=1.2e3;
R1=66e3;


All you have to do is to fit the capacitor values to the standards values. For completeness here is the GNU/Octave - Matlab code to get all the capacitors values for a set of given frequencies:

#1;
# Calculations for a simple EQ: BA3812L
# All resistors in Ohm and capacitors in F
# 2012 (c) Tiago Charters de Azevedo
# Verbatim copying and redistribution of this code
# are permitted provided this notice is preserved.

R0=1.2e3;
R1=68e3;
f=[80 240 750 2200 6600];
Q=1;
C0=1./(2*pi*R0*Q*f);
C=Q./(2*pi*R1*f);

disp("Q=1")
disp("        Freq      C0 (uF)    C (uF)")
disp([f' floor(C0'*10^12)/10^6 floor(C'*10^12)/10^6])
"The future is here, it's just not evenly distributed yet." -- William Gibson

Morocotopo

#5
Tca, I meant if it´s OK with you, not if the schem is correct!

;D

Thanks for posting that code, will be useful to other forum members. But, what is GNU/octave - Matlab? Some software, I assume...
Wouldn´t it be nice to have a gain stage at the end (or at the beginning), so as to be able to compensate for the volume loss/increase according to the EQ curve used? Just thinking aloud.

Good luck with the build!

EDIT: By the way, wich Q are you going to use? .7 or 1? I really don´t know wich one would suit a guitar EQ better.
Morocotopo

tca

#6
You can do whatever you want with the schematic, see the license terms. Altgought I don't think that changing a  few capacitors values from a datasheet circuit would infringe "any law" ::)  But I would like to see your run on the EQ and learn something on the way!

Probably I'll add a buffer and a 100k vol pot at the end. About the value of Q, I've read some where here at the forum that this range .7<Q<1 is fine for a guitar Q.

About the software: http://www.gnu.org/software/octave/
GNU Octave is a high-level interpreted language, primarily intended for numerical computations. The Octave language is quite similar to Matlab so that most programs are easily portable.

Cheers.
"The future is here, it's just not evenly distributed yet." -- William Gibson

tca

#7
I've done some thinking about the choice for the value of the Q factor.
For the EQ frequencies 80, 240, 750, 2200 and 6600, roughly a factor of 3 for consecutive frequencies, and a Q factor of order 1 one gets a 1.5 band width in octaves, so because of the ratio of the EQ frequencies one can, with this Q=1, control the full interval of frequencies between 40Hz to 10kHz.

I think I'm getting it right?!

P.S.

Just updated the sch image and corrected the value of R1. Updated the first standard values for the capacitors (may change that without notice).
"The future is here, it's just not evenly distributed yet." -- William Gibson

R.G.

The BA3812 looks the same in concept if not particulars to the KA2223, with an opamp to do the cut/add feedback and single transistor followers to do the inductor-faking gyrators. You don't necessarily need the specific chip, as you can do the same thing with a dual opamp chip and individual transistors. The individual transistors approach is flexible in that you can add more channels as you like, one at a time. But the single chip approach does get all the semiconductors down on the board in one clot.

See http://geofex.com/Article_Folders/EQs/paramet.htm at geofex. Also:





National Semiconductor had a great article on graphic EQs, the Q of the filters, and how to do a constant-Q version of the graphic EQ (which the resonator-style EQ as used in the BA3812, KA2223, and opamp versions does not) in their Audio Handbook from the mid-70s. I think it's on line now, and a search might turn it up. Rane also has a discussion of graphic-EQ filter Qs and their ideas on why constant Q is better.  I've always thought the resonator style sounded fine.

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.

tca

#9
Quote from: R.G. on October 15, 2012, 09:36:26 AM
You don't necessarily need the specific chip, as you can do the same thing with a dual opamp chip and individual transistors. The individual transistors approach is flexible in that you can add more channels as you like, one at a time. But the single chip approach does get all the semiconductors down on the board in one clot.

See http://geofex.com/Article_Folders/EQs/paramet.htm at geofex.

National Semiconductor had a great article on graphic EQs, the Q of the filters, and how to do a constant-Q version of the graphic EQ (which the resonator-style EQ as used in the BA3812, KA2223, and opamp versions does not) in their Audio Handbook from the mid-70s. I think it's on line now, and a search might turn it up. Rane also has a discussion of graphic-EQ filter Qs and their ideas on why constant Q is better.  I've always thought the resonator style sounded fine.

R.G. thanks for your thoughts. I've already read your article about EQs and I do understand the flexibility of using transistors but I really wanted a much simpler and less part number version of an EQ. I also wanted an EQ that is freely available (as in free speech, not as free beer ;) ), i. e., the schematic and the PCB, and I could not find one (only schematics). This is why I've started to work on this project and learned a lot on the way.

Thanks for the other refs, I have to look for them.

Cheers.

P.S.
Here is my work in progress PCB:

"The future is here, it's just not evenly distributed yet." -- William Gibson

composition4


tca

#11
Quote from: composition4 on October 15, 2012, 11:14:03 AM
Just to save some people searching for the constant q designs if they are interested:
http://www.rane.com/pdf/constanq.pdf

Thanks for that last ref.

QuoteThere is only one rule: The amplitude function must be entirely separate from the bandpass filter function.

Cheers.

P.S.
Mesa Boogie DC-5 uses 5 inductors.
"The future is here, it's just not evenly distributed yet." -- William Gibson

PRR

> National Semiconductor had a great ... Audio Handbook from the mid-70s. I think it's on line now

I don't believe it is. I think for various reasons the Copyright is still enforced. (I did find one hit on a book-pirate site but it had been removed "for copyright".)

National's official word-- http://www.national.com/kbase/category/Audio.html (down bottom).

I think this is what you mean:

Audio Handbook, National Semiconductor 
http://www.amazon.com/Audio-Handbook-Dennis-ed-Bohn/dp/B000NIMP0W

Re-printed by Audio Amateur/audioXpress:
http://www.amazon.com/National-Semiconductor-Audio-Radio-Handbook/dp/1882580354

A very similar work is:

Audio IC Op-Amp Applications, Walter G. Jung
http://www.amazon.com/Audio-Op-Amp-Applications-Walter-Jung/dp/0672224526

A specific (and free) article on gyros and many-band EQ is:
http://www.ti.com/lit/an/slyt134/slyt134.pdf

Rane has some in-depth white-papers on EQ.
  • SUPPORTER

Morocotopo

This thread gets more interesting with each response.

A couple things:

- The conflictive part of making an EQ pedal is the holes in the box of course. Well, at least for me. Has anyone came up with a solution to this? Bench drill template? Another plate prefabricated, on top of the box? Other ideas?
- Since EQ adds gain, I always feared that at some point you will make the opamps or whatever clip on 9V power. So, how about powering it with a voltage doubler to get more headroom? Or is it really not necessary?
Morocotopo

R.G.

Quote from: Morocotopo on October 16, 2012, 09:20:52 AM
- The conflictive part of making an EQ pedal is the holes in the box of course. Well, at least for me. Has anyone came up with a solution to this? Bench drill template? Another plate prefabricated, on top of the box? Other ideas?
Excellent point! The practicalities of cutting slots for linear sliders is probably the toughest part of all of this.

I have come up with several possibilities. The simplest is to not do it: at one time, and possibly still, you could get a used hifi stereo graphic equalizer for a price of between free and maybe $20. This is a clumsy solution to putting it on a pedalboard, but a wonderfully cheap and effective idea for actually getting the function.

If one really, really has to cut the slots, one way is to drill a line of holes, then manually enlarge the holes into a slot by some means. One way do this is to:
(1) have the use of a drill press with a proper sized drill bit and a small end mill that will cut sideways and use this to finish cutting between the already drilled holes (such bits are sometimes included in sets of surplus carbide PCB drills)
(2) clamp a guide of some kind, like a wooden plank to the table to guide your box
(3) carefully, carefully, carefully mark the extents of the slots
(4) place the box where the drill is over one of the proper places to drill
(5) clamp the guide down so that sliding the box moves it under the drill so that all places you can drill are on the line you're trying to cut
(6) drill a series of holes, one at each end of the line to be cut, and many along the line
(7) change the drill bit for the end mill 
(8 ) finish by careful smoothing of the slot with a needle file.
(9) Repeat for each slot.

Quote- Since EQ adds gain, I always feared that at some point you will make the opamps or whatever clip on 9V power. So, how about powering it with a voltage doubler to get more headroom? Or is it really not necessary?
It is always either necessary or not necessary depending on the size of the signals fed to it. The Boss GE7 seems to have been OK-ish on 9V. But active EQs typically have 12-15db of boost at maximum, maybe gains of 4-5X. So a signal bigger than 0.9 - 1V peak would likely clip on a single 9V supply. If your pedalboard has pedals which produce 4.5V peaks (or larger; this is where the scheme of using 12V or 18V supplies for clipping pedals and boosters is going) then you'll get clipping. In that case, you have to make a bigger power supply to make more available volts for the EQ to swing. Fortunately, opamp style EQs can simply be fed more volts if needed. I don't know the specs on a BA3812 or KA2223.
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.

tca

From the datasheet: the BA3812 can use power source voltages from 3.5V to 16V, with a typical 8V (I should say 9V). Quiescent current 5mA and typical gain +-12dB. But what does a maximum output voltage 2.1V mean? And input/output gain of -.5dB?

Cheers.
"The future is here, it's just not evenly distributed yet." -- William Gibson

R.G.

Quote from: tca on October 16, 2012, 11:21:13 AM
But what does a maximum output voltage 2.1V mean?
Go look at figure 8. The distortion in the output waveform increases rapidly away from 0.15V. They don't say volts RMS or volts peak, unfortunately, so it's not much help.

I think what it means is that the output becomes rapidly more distorted if the output gets too big. (Well, or too small, but that's another story.) That fits with clipping at some point near 2.1V. Notice from "Electrical Characteristics" that the maximum output voltage may be as low as 1.5V - RMS, peak, peak to peak, or something.

Have I mentioned that there's a special hell waiting for writers of incomplete and vague datasheets?

What may be going on is that they may be saying that the minimum "maximum output voltage" might be only 1.5V (RMS/average/peak/p-p/etc) at 3.85V, and get bigger with bigger power supplies. But they don't tell us that.

It's about here that I get disgusted with all-packaged chips. At least with a well specified opamp you know where you run out of volts. A good rail to rail opamp in this circuit would do +/-4.4V peak from a 9V supply, with fanishing distortion right up to clipping. But then you already know my biases.

QuoteAnd input/output gain of -.5dB?
Gain in db = 20 * (log10(Vout/Vin)). So a "gain" of -0.5db is a "gain" of 0.944, just less than unity. Note that it may have a gain when all controls are flat of between -2.5db and +1.5db. That's somewhere between 0.75 and 1.19.
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.

tca

Hi R.G., thanks for your pedagogical explanation.

Quote from: R.G. on October 16, 2012, 03:57:02 PM
Note that it may have a gain when all controls are flat of between -2.5db and +1.5db. That's somewhere between 0.75 and 1.19.

That was the answer that I could not find. Thanks.

Cheers.
"The future is here, it's just not evenly distributed yet." -- William Gibson

PRR

> Since EQ adds gain, I always feared that at some point you will make the opamps or whatever clip on 9V power.

You don't boost what you already have a lot of.

You boost what you are short on.

Male singer gives 0.1V above 800Hz but 0.05V below 800Hz, sounds like a girl. The female singer objects. Bump the guy's mike 6db at 100 250 620, now his bottom is similar to his treble. Altogether this may make him stronger than the soprano, so take the volume down a few dB.

Same with guitar. If dead strings don't ring-scream well, weak past 2KHz, bring up 3KHz until the ring is right.

(Yes, yes, sometimes we DO over-boost for "effect". This is of course a balancing act between emphasis and ugliness.)

Another thing. You don't (except for "effect") boost so much the _next_ stage overloads. Unless near-overload is wanted for artistic emphasis, you don't really want to come close to overload. You can always turn-up later in the signal chain. Since any guitar amp can be LOUD with 0.1V input, and many guitar-amp inputs overload above 1V, there's little need for even a Volt out of the EQ.

1V rms signal can be handled with a 2.8V supply on a perfect amplifier. 9V seems ample margin.

Higher supply voltages may make sense if a process has a high hiss voltage. Amplify signal until the signal-to-hiss ratio is adequate, then pad-down to suit the next stage.

> If your pedalboard has pedals which produce 4.5V peaks

Then guitar amp inputs either overload grossly, or must be desensitized far below "naked guitar" signal levels for no good reason.

> The Boss GE7 seems to have been OK-ish

I note it has an interesting variation of level boost-cut. R31 R28 C20 and R33 R36 C27 boost treble going in and cut it going out. In the process the bulk (>2KHz) of the hiss induced by a many-band EQ is reduced. Of course the pre-de-emphasis should be matched to the source spectrum.

> what does a maximum output voltage 2.1V mean?

Assuming 8V supply, maximum clean sine is 2.8V rms. Allowing a volt of drop in each output device suggests clipping just above 2.1V rms.

> distorted if the output gets too big. (Well, or too small....

Probably not distortion. The curve runs through 0.1% (1 in 1000) near 10mV, headed for 100% at 10uV. 10uV is a reasonable hiss voltage, right near the specced 5uV typ 20uV max. So they were still using broadband THD techniques, which count random hiss as harmonic distortion. In fact the low-level THD is essentially zero, and masked (more-or-less) by random hiss.

0.03% THD at 1V out is valid and very low for musical-instrument work.

THD at 9V is going to be ~~~1% at 2.4V and ~~10% at 3V. 10% opamp clipping is significant flavor. However 3V is really more than any guitar amp needs.

> fanishing distortion right up to clipping

0.03% THD 7dB down from clipping is pretty near 'fanished'. Some audiophiles will object.

> input/output gain of -0.5dB?

Bogus number. The "all center" gain is the ratio of the two 6.8K resistors (you supply those), minus the non-infinity gain of the output opamp, times the gain of the input buffer. The two internal parts may "only" get to 0.97 of true unity gain, hence the -0.5dB typical overall gain. If the "6.8K" are 10% off opposite ways, that's another 2dB either way, -2.5dB to +1.5dB. Odds are it will be so close to unity that it doesn't matter; anyway you just gonna diddle the sliders mostly + until every band is louder than every other band.

> a special hell waiting for writers of incomplete and vague datasheets?

It's crowded. I too am mildly annoyed at Rohm for this scanty sheet. However their typical market (boomboxes, cassette auto-sound) would be fine with this data; if not, Rohm had decent support engineers who could provide more data for qualified (mass-market) customers.
  • SUPPORTER

tubegeek

Quote from: R.G. on October 16, 2012, 09:49:28 AM
The practicalities of cutting slots for linear sliders is probably the toughest part of all of this....
If one really, really has to cut the slots, one way is to drill a line of holes, then manually enlarge the holes into a slot by some means. One way do this is to:
(1) have the use of a drill press with a proper sized drill bit and a small end mill that will cut sideways and use this to finish cutting between the already drilled holes (such bits are sometimes included in sets of surplus carbide PCB drills)
(2) clamp a guide of some kind, like a wooden plank to the table to guide your box
(3) carefully, carefully, carefully mark the extents of the slots
(4) place the box where the drill is over one of the proper places to drill
(5) clamp the guide down so that sliding the box moves it under the drill so that all places you can drill are on the line you're trying to cut
(6) drill a series of holes, one at each end of the line to be cut, and many along the line
(7) change the drill bit for the end mill 
(8 ) finish by careful smoothing of the slot with a needle file.
(9) Repeat for each slot.

Quote from: R.G.
Have I mentioned that there's a special hell waiting for writers of incomplete and vague datasheets?

And the slot-cutting process described would be exactly what goes on in that special hell, with the addition of Step 10: the discovery that somehow, the linear fader's projecting slider is slightly too wide for the slot you made (or you made your slots too close together to fit more than one fader into the faceplate) and you have to start all over again. (Next, the whole process would then repeat over and over forever, if we were to be all Greek-mythological about this.)
"The first four times, we figured it was an isolated incident." - Angry Pete

"(Chassis is not a magic garbage dump.)" - PRR