# bass boost shelving filter equations



## morsel

Calling all hardcore math/ee geeks! What are the true equations for gain and 3dB points of a bass boost shelving filter, as described below? The Audio EQ Cookbook may provide some clues, but math is not my forté.

 The bass boost circuit is a 6dB/octave low pass shelving filter. Bass response increases from the cutoff frequency down to the shelving frequency and levels off below the shelving frequency. Increasing R4 decreases the cutoff frequency and increases amp gain. Increasing Rbb decreases the shelving frequency and increases bass boost gain. Increasing Cbb decreases both cutoff and shelving frequencies. The graph shows Rbb = (46.6k, 30k, 18.3k, 10k, 4.1k, 0 Ohms).

 Ao = overall gain for any conditions (should match the MicroCap graph)
 Av = gain with no bass boost; Rbb = 0 Ohms
 Abb = gain of bass boost; Xcbb >> Rbb; does not include Av
 fs = shelving frequency; 3dB below Abb
 fc = corner frequency; 3dB above Av

 Ao = ?
 Av = 1+R4/R3
 Abb = 1+Rbb/(R3+R4)
 fs ≅ 1/(2πRbbCbb)
 fc ≅ 1/(2π((R3+R4)-(R3+R4)^2/Rbb+.707(R3+R4)((R3+R4)/Rbb)^1.532)Cbb)

 The equations are approximations derived from numerical analysis of MicroCap AC modeling graphs and lose accuracy as bass boost gain drops towards 6dB. Below 6dB they are useless as fc and fs overlap.

 What are the true equations for Ao, fs, fc?


----------



## morsel

One of my motivations (besides intellectual curiosity) is to put the real equations into this JavaScript bass boost calculator instead of using approximate equations:


```
<html> <head> <title>Bass Boost Calculator</title> </head> <body> <h1>Bass Boost Calculator</h1> <form name="bbc" onsubmit="return calculate()"> R<sub>3</sub> = <input id="R3" size="2" value="1">k&Omega;, R<sub>4</sub> = <input id="R4" size="2" value="10">k&Omega;, R<sub>bb</sub> = <input id="Rbb" size="2" value="33">k&Omega;, C<sub>bb</sub> = <input id="Cbb" size="2" value=".22">&micro;F <input type="submit" value="Calculate"> </form> <div id="output"><font color="red">JavaScript is required.</font></div> <script type="text/javascript"><!-- function format(n) {return n.toFixed(1)-0} function calculate() {with(Math){ R3 = form.R3.value*1000 R4 = form.R4.value*1000 Rbb = form.Rbb.value*1000 Cbb = form.Cbb.value/1000000 R34 = R3+R4 if (Rbb < R34) // Abb must be at least 2 (6dB) { Rbb = R34 form.Rbb.value = R34/1000 } Av = 1+R4/R3 Abb = 1+Rbb/R34 fs = 1/(2*PI*Rbb*Cbb) fc = 1/(2*PI*(R34-R34*R34/Rbb+.707*R34*pow(R34/Rbb,1.532))*Cbb) div.innerHTML = "A<sub>v<\/sub> = "+format(Av)+ " ("+format(20*log(Av)/LN10)+"dB), "+ "A<sub>bb<\/sub> = "+format(Abb)+ " ("+format(20*log(Abb)/LN10)+"dB), "+ "&fnof;<sub>s<\/sub> = "+format(fs)+"Hz, "+ "&fnof;<sub>c<\/sub> = "+format(fc)+"Hz" return false // force failure of form submission }} form = document.bbc div = document.getElementById("output") calculate() // --></script> </body> </html>
```


----------



## morsel

Any advice would be appreciated. There seems to be a dearth of available information on this subject. I don't care how scary the equation is, since computers will do the grunt work.


----------



## drewd

Ao is (Rbb||Cbb + R4)/R3 +1. It's frequency dependent, so you get:

 Ao = ([Rbb/(j*2pi*f*Cbb)/{Rbb+1/(j*2pi*f*Cbb)}+R4]/R3)+1

 j = sqrt(-1) and f=frequency. Sorry about the creative parentheses - I needed to be sure that they were in the right spots!

 Your equation for fs is right on. I don't remember how to calculate the corner frequency and all of my signal analysis texts are at work 
	

	
	
		
		

		
		
	


	




 -Drew


----------



## morsel

Hi Drew, thanks for your reply. I tried what you suggested about a month ago and plotted it, but the graph is a regular low pass filter, no shelving. I think there should be multiple exponentiated terms.

 This is how I reduced the equation:

 Ao = (Rbb||Cbb+R4)/R3+1
 Ao = ((Rbb/(2πfCbb)/(Rbb+1/(2πfCbb))+R4)/R3)+1
 Ao = 1+(Rbb/(2πfCbbRbb+1)+R4)/R3

 Tossing j is legitimate in this case, right?


----------



## stadams

I scribbled some work down and finally got around to posting this. One equation is in the s-domain for which I have yet to do the inverse Laplace. The other uses simple capacitive reactance in conjunction with the other components to provide a response equation. Both equations take into account the voltage division that takes place at the v+ terminal of the filter due to R1 and R2. Oh, these equations are both solutions for "Ao."

 Somebody check and see if these work. If I get a chance, and my algebra skills are up to it, I'll try to solve the s-domain equation later tonight.

 EDIT: I corrected the "simple" f-domain equation and removed the s-domain equation seeing that it is really not needed.

 Later,


----------



## morsel

Hi Todd,

 I used the voltage divider R1 & R2 to counteract the output gain of 2, so the MicroCap graph would have a unity baseline. We don't really want to include them in the equations, so pretend they don't exist. Do you have any references to s-domain math? It's been over 20 years since I slept through it in college.


----------



## jamont

Quote:


  Originally Posted by *stadams* 
_I scribbled some work down and finally got around to posting this. One equation is in the s-domain for which I have yet to do the inverse Laplace._

 

The Laplace inverse is not too hard, if I have understood your expression correctly. It can be put in the form

 f(s) = a + b/(s+c)

 for which f(t) = a*Delta(t) + b*exp(-c*t)

 where Delta is the Dirac delta function (an impulse function).

 I'm not sure how much this helps morsel...


----------



## aos

I wouldn't think that you need to use Laplace transformation for this since you're analysing a steady state periodic signal - instead of a general, aperiodic signal. you should be able to use normal complex number analysis.


----------



## stadams

Quote:


  Originally Posted by *aos* 
_I wouldn't think that you need to use Laplace transformation for this since you're analysing a steady state periodic signal - instead of a general, aperiodic signal. you should be able to use normal complex number analysis._

 

Yeah, I just got carried away. I started thinking about transfer functions, and the first thing that came to my mind was Laplace. I removed the s-domain equation from the post, and I think that the last equation that I posted is correct, at least it is giving me the same type of response that morsel posted from Microcap. Just a reminder, the frequency is in rad/sec.

 Later,


----------



## morsel

Thanks everyone, and especially Todd, for looking at this. I will try out your equation when I get back from dinner. Would you care to explain how you came up with it? 
	

	
	
		
		

		
		
	


	




 I'm interested in learning how this works.


----------



## morsel

Quote:


  Originally Posted by *stadams*
_ I think that the last equation that I posted is correct, at least it is giving me the same type of response that morsel posted from Microcap._

 

  I am unable to reproduce your results. Here is your equation:






 This is how I entered it, 2 different ways:

 ((2πf) + (2πfR4/R3) + (1/(R3Cbb)) + (R4/(R3RbbCbb)) + (1/(RbbCbb))) / (2πf + (1/(RbbCbb)))

 (1 + (R4/R3) + (1/(2πfR3Cbb)) + (R4/(2πfR3RbbCbb)) + (1/(2πfRbbCbb))) / (1 + (1/(2πfRbbCbb)))

 This results in a curve that goes up as frequency drops, but does not level out, i.e. there is no shelving. Am I doing something wrong?


----------



## stadams

Are you looking at the results on an x-axis log scale?


----------



## stadams

If you wish, I can send you the Excel worksheet with which I checked the equation response. Just let me know where.

 Later, and good night,


----------



## morsel

Quote:


 Are you looking at the results on an x-axis log scale? 
 

Yes, just like the bass boost MicroCap graph. In any case, the gain should level out below fs, which it is not doing. Sure, send me the Excel worksheet, I can be emailed via my profile.


----------



## drewd

Quote:


  Originally Posted by *morsel* 
_Hi Drew, thanks for your reply. I tried what you suggested about a month ago and plotted it, but the graph is a regular low pass filter, no shelving. I think there should be multiple exponentiated terms._

 

Try looking at the equation under two conditions - as f approaches zero and as f approaches infinity.

  Quote:


  Originally Posted by *morsel* 
_
 This is how I reduced the equation:

 Ao = (Rbb||Cbb+R4)/R3+1
 Ao = ((Rbb/(2πfCbb)/(Rbb+1/(2πfCbb))+R4)/R3)+1
 Ao = 1+(Rbb/(2πfCbbRbb+1)+R4)/R3

 Tossing j is legitimate in this case, right?_

 

It reduces just like that. By looking at the equation's behavior as it approaches the two frequency extremes, you should be able to see that it's correctly modeling the way that the circuit works. You don't have to toss j because it is integral to the capacitor's function - and at the frequency extremes, you get this:

 Ao = (Rbb+R4)/R3+1 as f approaches zero.

 and

 Ao=R4/R3+1 as f approaches infinity.

 Instead of zero and infinity, just think low and high frequencies. So for low frequencies, Rbb is in play, effectively increasing the gain of the system. At high frequencies, Rbb is out of the circuit, so the gain approaches the normal gain without the bass boost.

 Now, tossing j, you should be able to observe the shelving function of the circuit in terms of gain, assuming that you are using a log scale plot.

 Let me throw in this caveat that it's been a few years since I did any signal analysis by hand and that was in college, where everything was nice and predictable.

 -Drew


----------



## aos

What you do is like drewd wrote, a normal feedback equation where you replace impedances with what's in your schematics. Impedance of a capacitor is 1/jwC, for a steady state periodic signal. You get a complex number equation. Then, to calculate gain variation with frequency, which is what Morsel wants, you would calculate modulo of that expression. If you want phase, you calculate phase.

 I got the transfer function as

 A + jwB
 -------
 1 + jwC

 where

 A = 1 + R4/R3 + Rbb/R3

 B = Cbb * Rbb * (R3+R4)/R3

 C = Cbb^2 * Rbb^2

 Which would yield modulo of 

 sqrt( ( (1 + R4/R3)^2 + Rbb^2/R3^2 + 2*Rbb/R3(1+R4/R3) + 4*pi^2/f^2 * Cbb^2 * Rbb^2 * (1 + R4^2/R3^2 + 2*R4/R3) ) / (1 + 4*pi^2/f^2 * Cbb^2 * Rbb^2) )


----------



## morsel

Aos, I don't understand how you arrived at your result, nor your usage of the word "modulo" in this context, but I plotted your suitably complex equation and it didn't work, perhaps due to some parenthetical ambiguity. I have tried what Drew suggested in various ways but it has not worked.

 Drew, I'm using the same component values that generated the bass boost graph, so I should see shelving if an equation is correct. Perhaps Mathematica is not doing what I think it should be doing. I will look at this again in the morning.


----------



## SnoopyRocks

Since no one has given Morsel all that she has asked for, this seems like a good time for me to stop lurking and lend a hand. This would have been up sooner but there sure is a long wait between registering and being permitted to post.

 Everything is in the attached file. The pole and zero frequencies should be good enough for fs and fc. I could derive more precise equations but I don't think that it's worth the effort. 






BassBoost_TF.pdf


----------



## stadams

Quote:


  Originally Posted by *SnoopyRocks* 
_Everything is in the attached file. The pole and zero frequencies should be good enough for fs and fc. I could derive more precise equations but I don't think that it's worth the effort. 

BassBoost_TF.pdf_

 

 Have you checked the permissions on this file? I do not have access to it (403).

 Taking _j_ into account, and after manipulating my equation, I agree with Snoop's derivations.

 Nice work. Snoopy Rocks!

 Later,


----------



## aos

(duplicate)


----------



## aos

Yeah, that pretty much maches the equation I wrote above, but you did it in a much more readable way, plus you explicitly calculated the pole and zero.

 Modulo is the same thing as magnitude, and for a complex number 
 a + jb it's sqrt ( a^2 + b^2 ). Since my and SnoopyRocks formula are identical in the beginning it should work - it's possible I made a mistake somewhere trying to unwind all the squares in the expression. You can probably just write it in original form since you're using a program to calculate it.

 By the way, pole is any root of the denominator while zero is any root of the nominator. A "root" is a value of the variable where the polynomial evaluates to zero. Typically a transfer function for passive circuits (R,L,C) is a fraction of two polynomials. You can write a polynomial in the form

 a0 + a1*x + a2*x^2 + ... + an*x^n

 or in the form

 (x-x0) * (x - x1) * ... (x - xn)

 where roots are values x0, x1... xn. Calculating roots manually for higher order polynomials can be tricky although there are methods that you can use - it's just that they will be very time consuming. That means that precise manual analysis when there's more than 3 L or C in the circuit is hard and in practice is rarely done. Engineers would just go through the formula and eliminate most of the terms by realizing that some values are much larger or smaller than the others and therefore some terms can be ignored. That's how they get simple equations. However this filter is simple enough to allow manual manipulation.

 Oh yes, why calculate poles and zeros? Because it's then very simple to draw Bode diagrams of magnitude and phase. You simply have flat line at A0 (DC gain), then whenever you encounter a pole you slope the line by 20dB / decade and every time you run into a zero you slope it up by the same amount. Bode diagrams are approximations but they're very close to the real thing


----------



## SnoopyRocks

fixed. 
	

	
	
		
		

		
		
	


	




  Quote:


  Originally Posted by *stadams* 
_Have you checked the permissions on this file? I do not have access to it (403).

 Taking j into account, and after manipulating my equation, I agree with Snoop's derivations.

 Nice work. Snoopy Rocks!

 Later,_


----------



## morsel

Snoopy, you do indeed rock. I will study and experiment with your equations today. Aos, thanks for your comments as well. Mathematica, here I come.


----------



## morsel

It is not leveling at fs, and the transition is abrupt.

 [Head-Fi lost attachment]


----------



## stadams

Is the analysis step value set for 10? It looks as if the software does not have enough points between 1 and 10. Try increasing the number of analysis points by a factor of 10.

 Later,


----------



## morsel

Holy hacksaws, Batman! This problem has been torturing me for *years*. Mathematica v5 defaults to only 25 plot points. Of course this means I have to go back and retry all the rejected equations.
 I grovel before you in thanks.


----------



## SnoopyRocks

It's nice to see that you got it to work. You probably don't need to go back and check all the equations - there are minor mistakes to be found. Speaking of which, I made one too. omega_z=Abb*omega_p (no minus sign ... it's in the left half plane). The documents have been updated.

  Quote:


  Originally Posted by *morsel* 
_Holy hacksaws, Batman! this problem has been torturing me for *years*. Mathematica defaults to only 25 plot points. Of course this means I have to go back and retry all the rejected equations.
 I grovel before you in thanks._


----------



## morsel

Ao was only a means to an end. The really useful things to know are fs, fc, and Abb. I want to see if some of the previous equations I discarded, including some that were not posted here, work with fewer terms.

 Can you suggest any websites or books that explain how to derive equations like yours? Back in a bit, going for lunch.


----------



## aos

Well, in this case it's easy since you already have the formula for the gain of the amplifier - the ratio of two resistors + 1. Now, in this case that works for general impedances, not just resistors, so if you simply write the impedances you've got on your schematics, you get the formula immediately, in the first step. Calculating magnitude and phase is nothing but mathematics. So there was really nothing to derive here, just to write down and perhaps simplify.

 If you're asking where do impedances of inductors and capacitors come from, and why is the complex calculus used for steady state periodic signals, that's basic EE network theory, it should be covered in any introductory EE book, if you want to see how it's derived. But the formulas for impedance are easy to remember, Zl = jwL for inductor and Zc=1/jwC for capacitor where w = angular frequency, i.e. 2 * pi / f, and j is imaginary number one. Incidentally mathematicians use i, and EE's use j, because i is usually used to denote current intensity.


----------



## SnoopyRocks

Since I'm not sure what your background is Morsel, I won't reccomend a particular book. Try searching for "circuit analysis" on Amazon books. You'll see lots of choices. Irwin's "Basic Engineering Circuit Analysis" is commonly used in EE programs. It is not a cliff notes type thing though. This type of book will have all the basic analysis tools covered. Perhaps someone who doesn't take this stuff for granted would have a better recomendation. Don't expect an easy read.


----------



## SnoopyRocks

typo: w=2*pi*f (not 2*pi/f)

  Quote:


  Originally Posted by *aos* 
_Well, in this case it's easy since you already have the formula for the gain of the amplifier - the ratio of two resistors + 1. Now, in this case that works for general impedances, not just resistors, so if you simply write the impedances you've got on your schematics, you get the formula immediately, in the first step. Calculating magnitude and phase is nothing but mathematics. So there was really nothing to derive here, just to write down and perhaps simplify.

 If you're asking where do impedances of inductors and capacitors come from, and why is the complex calculus used for steady state periodic signals, that's basic EE network theory, it should be covered in any introductory EE book, if you want to see how it's derived. But the formulas for impedance are easy to remember, Zl = jwL for inductor and Zc=1/jwC for capacitor where w = angular frequency, i.e. 2 * pi / f, and j is imaginary number one. Incidentally mathematicians use i, and EE's use j, because i is usually used to denote current intensity._


----------



## morsel

Aos, I remember the basics like Xc=1/2πfC (otherwise I would have thrown in the towel long ago instead of designing headphone amps), it's the equations Snoopy came up with that I would like to understand in more detail. Disgraceful though it may seem given my appalling lack of wherewithal, I actually have a BS in electronic engineering, it's just that I never used it. 
	

	
	
		
		

		
			





 Snoopy, "Basic Engineering Circuit Analysis" by Irwin is going for $120. Tangent recommended "Circuits and Filters Handbook" by Wai-Kai Chen, but it costs about $150 and none of the local libraries have it. My original circuit analysis book exploded 20 years ago and I never replaced it. (I'm on a tight budget.)

 Now that Mathematica is behaving, everything will probably fall into place. More later after all is reexamined, verified to be in harmony with MicroCap, and optimized. Thanks again, guys!


----------



## aos

Quote:


 typo: w=2*pi*f (not 2*pi/f) 
 

D'oh, you're right. That's why the formula I had above (the long and complicated looking one) didn't work. It should be identical otherwise.


----------



## SnoopyRocks

Morsel, Irwin's book is just an example. Any of them should be fine. Try half.com for cheap version. This type of book is often sold right after the class ends, usually in as new condition. Older editions are just good as the new ones but usually come much cheaper because demand plumets when the newer editions replace them on required textbook lists.

half.com circuit analysis books 

 Since you do have the background I presume that all you need is a refresher and reference. This stuff hasn't changed in decades. I'd be happy to help if you want further assistance, especially since you are doing this for the benefit of the community.


----------



## SnoopyRocks

Yes, that was the error in your earlier equation. Hint: follow the units.

  Quote:


  Originally Posted by *aos* 
_D'oh, you're right. That's why the formula I had above (the long and complicated looking one) didn't work. It should be identical otherwise._


----------



## morsel

SnoopyRocks, I massaged your equation a bit to emulate the MicroCap graph, which shows Abb. Looking good. 
	

	
	
		
		

		
		
	


	




 Now to check fc and fs.

 [Head-Fi lost attachment]


----------



## aos

Quote:


 Yes, that was the error in your earlier equation. Hint: follow the units. 
 

Yep, definitely the way to go, especially in physics. What threw me off actually is that at university we used T - period - much more often than the frequency, and f = 1/T, w = 2*pi/T. So I just have a habit of seeing 2 * pi divided by *something*. f was just in the way 
	

	
	
		
		

		
		
	


	




.


----------



## morsel

I came up with a new equation for fc based upon Abb which closely matches the Microcap graph. The numerical analysis I did years ago that we still use today provides an equation for an equivalent resistance Rc which is used to calculate fc. The Zero equation Snoopy provided is not as accurate.

 I tried using similar methods to solve for fs, but it did not work out as cleanly. Time to leave for my quarterly Bay Area Carnivorous Plant Society meeting, more later.






Snoopy Zero
Numerical analysis of equivalent resistance Rc
Solve[Abb=3dB]


----------



## SnoopyRocks

Since you persist 
	

	
	
		
		

		
		
	


	




, I derived exact equations for fc and fs. They will give imaginary values for Abb<3dB. 






  Quote:


  Originally Posted by *morsel* 
_I came up with a new equation for fc based upon Abb which closely matches the Microcap graph. The numerical analysis I did years ago that we still use today provides an equation for an equivalent resistance Rc which is used to calculate fc. The Zero equation Snoopy provided is not as accurate.

 I tried using similar methods to solve for fs, but it did not work out as cleanly. Time to leave for my quarterly Bay Area Carnivorous Plant Society meeting, more later._


----------



## SnoopyRocks

Validation in Matlab:

 Code: BassBoost.m 

 Some Plots:


----------



## SnoopyRocks

Everything in one pdf file

BassBoost_ALL.pdf


----------



## morsel

SnoopyRocks, you are a gentleman and a scholar. I massaged your 3db equations and noted that your Adc is what I call Abb, which is relative to unity gain, not Av. Since I was planning to use Abb .vs. unity rather than Ao .vs. Av, I merely substituted 1 for Av, and it worked. The new fc equation plots identically to Solve[Abb=3dB]. The new fs equation works, too. Thanks again! 
	

	
	
		
		

		
		
	


	






Zero
New fc
Numerical analysis of equivalent resistance Rc
New fs
Pole


----------



## morsel

A bit more massaging to put all these equations in similar form, and added fo to represent the 1/2 gain point where Abb < 6dB.






Zero
fc
fo
fs
Pole


----------



## morsel

Improved JavaScript uses the new equations:


```
<html> <head>   <title>Bass Boost Calculator</title> </head> <body> <h1>Bass Boost Calculator</h1> <form name="bbc" onsubmit="return calculate()"> R<sub>3</sub> = <input id="R3" size="2" value="1">k&Omega;, R<sub>4</sub> = <input id="R4" size="2" value="10">k&Omega;, R<sub>bb</sub> = <input id="Rbb" size="2" value="33">k&Omega;, C<sub>bb</sub> = <input id="Cbb" size="2" value=".22">&micro;F <input type="submit" value="Calculate"> </form> <div id="output"><font color="red">JavaScript is required.</font></div> <script type="text/javascript"><!-- function format(n) {return Math.round(n*10)/10} // toFixed method not supported by Safari or IE on Mac OS X function calculate() {with(Math){ R3 = form.R3.value*1000 R4 = form.R4.value*1000 Rbb = form.Rbb.value*1000 Cbb = form.Cbb.value/1000000 Av = R4/R3+1 Abb = Rbb/(R3+R4)+1 TwoPiRC = 2*PI*Rbb*Cbb fs = Abb/(TwoPiRC*sqrt(Abb*Abb-2)) fc = sqrt(Abb*Abb-2)/TwoPiRC fo = sqrt(Abb)/TwoPiRC div.innerHTML =   "A<sub>v<\/sub> = " + format(Av) +   " (" + format(20*log(Av)/LN10) + "dB), " +   "A<sub>bb<\/sub> = " + format(Abb) +   " (" + format(20*log(Abb)/LN10) + "dB), " if (Abb > 2)   div.innerHTML +=   "&fnof;<sub>s<\/sub> = " + format(fs) + "Hz, " +   "&fnof;<sub>c<\/sub> = " + format(fc) + "Hz" else   div.innerHTML +=   "&fnof;<sub>o<\/sub> = " + format(fo) + "Hz" return false // force failure of form submission }} form = document.bbc div = document.getElementById("output") calculate() // --></script> </body> </html>
```


----------



## SnoopyRocks

You caught a typo. I neglected to remove R4 from the denominator when I cut and pasted the equations. The correct equation is on the first page of the pdf. You seem to have it all working regardless. 
	

	
	
		
		

		
			





 I updated my files with the correction. 

  Quote:


  Originally Posted by *morsel* 
_SnoopyRocks, you are a gentleman and a scholar. I massaged your 3db equations and noted that your Adc is what I call Abb, which is relative to unity gain, not Av. Since I was planning to use Abb .vs. unity rather than Ao .vs. Av, I merely substituted 1 for Av, and it worked. The new fc equation plots identically to Solve[Abb=3dB]. The new fs equation works, too. Thanks again! 
	

	
	
		
		

		
		
	


	


_

 

Is Mountain View near Sunnyvale? I drove though there on Monday while I was visiting the bay area this week.


----------



## morsel

Apparently I got confused with the 2 different versions of Adc and thought after looking at your 3dB frequencies page that your Adc was my Abb. In any case, it seemed simpler to reference Abb to 1.

 Mountain View is next to Sunnyvale. Please send me an email via the link on my profile page. I'd like to talk with you offline about the merits of Matlab .vs. Mathematica, filters, math, and whatnot.


----------



## SnoopyRocks

email sent

  Quote:


  Originally Posted by *morsel* 
_Apparently I got confused with the 2 different versions of Adc and thought after looking at your 3dB frequencies page that your Adc was my Abb. In any case, it seemed simpler to reference Abb to 1.

 Mountain View is next to Sunnyvale. Please send me an email via the link on my profile page. I'd like to talk with you offline about the merits of Matlab .vs. Mathematica, filters, math, and whatnot. 
	

	
	
		
		

		
		
	


	


_


----------



## Frenchman

Someone really should sticky this.


----------



## morsel

I am not a fan of stickies, as they eat up space on the first forum page that should be available to current threads. More than 1 or 2 stickies is a clutter. I would rather see a single sticky with important info and links to threads of note. If there is interest, I could be talked into summarizing this thread with a single document of the valid equations we came up with.


----------



## Frenchman

Why not throw it into the big list/faq section then? If somethings refered to often enough to be stickied, or is simply important enough that we don't want to lose it to the depths of the forum, then why not stick it someplace where it's still easily accessable but also out of the way. Of course, I'm refering to all the current stickies as well.


----------



## Syzygies

Quote:


  Originally Posted by *morsel* 
_A bit more massaging to put all these equations in similar form, and added fo to represent the 1/2 gain point where Abb < 6dB._

 

Would it be possible for someone who has this working to upload the actual _Mathematica_ file? They use a nifty text format which ports well between machines. I could type this reading the gifs, and if I do, I'll post my file, but it would save time if someone already has the file handy.

 (The calculators don't tell enough of the story...)

 Thanks


----------



## SnoopyRocks

An old thread finds new life...

 Here is a version of the bass boost mathematica notebook. 

BassBoost.nb

 I take it that you don't have/like matlab Syzygies. Everything is it the code I posted. Knock yourself out.


----------



## morsel

bassboost.nb is the Mathematica file I created during the process of deriving the equations we use for bass boost calculations from the equations SnoopyRocks posted. It generated the graphs I posted in this thread. Thanks for your scholarly assistance, SnoopyRocks, without which we would still be using the old numerical analysis model.

 Maybe some day I'll learn out how to use Mathematica properly and clean up the notebook a bit. With that in mind, the link above points to my copy, but don't hold your breath about a new version showing up anytime soon.


----------



## SnoopyRocks

Morsel you don't need to clean anything up. It works just fine after all. I prefer the fo term you added to characterize the filter for low boost levels. It makes more sense than the 3dB frequencies, which are after all just a mathematically convenient way to characterize things. 

 You have all the equations posted on your BB calculator. AMB's plots the frequency response. People seem to like the default values that you're recommending for the filter. What more is there to ask? The design is a success. 
	

	
	
		
		

		
		
	


	




 I suggest also listing the DC gain with the bass boost on since it, not Av, amplifies the DC offset. 

 I could understand if people might be interested in seeing the phase, group delay, step response, etc also. I presume Syzygies is interested in the code to take a look at something along these lines. At this point though, I imagine many DIYers would probably find the extra information more perplexing than enlightening.

 Just to clarify: the mathematica file that I posted was originally morsel's work. After playing with it for a bit, I decided to go back to matlab because the typeset GUI scared me.


----------



## Syzygies

Quote:


  Originally Posted by *SnoopyRocks* 
_I take it that you don't have/like matlab Syzygies. Everything is it the code I posted. Knock yourself out. 
	

	
	
		
		

		
		
	


	


_

 

 Quote:


  Originally Posted by *SnoopyRocks* 
_I could understand if people might be interested in seeing the phase, group delay, step response, etc also. I presume Syzygies is interested in the code to take a look at something along these lines._

 

Thanks, Snoopy and Morsel. No, I just wanted to stare at locally-generated curves to match the default recs using my choice for R4, to see how changing the cap works, the usual. None of my actual amps have needed debugging, but for some reason I couldn't sort out why my recently reinstalled, fully loaded Mac was running the rest of the planet's Javascript in every browser, but balking at DIY audio Javascript. I'd give up this hobby before I sat in front of Windows as my main machine, it's so corporate and such a poor interpretation of this GUI OS thing that the programmer in me finds it painful.

 I get _Mathematica_ for free at my University; I was actually the host once when Steve Wolfram came to give a talk announcing a new version. I used to prefer _Maple_, but I don't have any experience with _Matlab_, which never made any inroads here.

 The _Mathematica_ package I crave is _Analog Insydes 2.1_, but it's $900 academic. _Spice_ is an amazing accomplishment from, what, 30 years ago? I'm learning it, but I find the interface antiquated.

 If _Matlab_ or _Maple_ had a decent analog electronics add-in I could afford, I'm there.


----------



## tangent

Quote:


 Spice is an amazing accomplishment from, what, 30 years ago? I'm learning it, but I find the interface antiquated. 
 

Several of the commercial GUI SPICE packages have free demo versions available. These are usually only limited in terms of the number of components it includes and how many parts you can add to the design; neither of these limits will be a problem for simulating such a simple circuit. With SPICE, you get all those other curves SnoopyRocks mentioned in his previous post. 

 Unfortunately, I don't know if any of these SPICE demos run on OS X. The most popular are MicroCap and PSpice on Windows, for what that's worth.


----------



## SnoopyRocks

Quote:


  Originally Posted by *Syzygies* 
_The Mathematica package I crave is Analog Insydes 2.1, but it's $900 academic. Spice is an amazing accomplishment from, what, 30 years ago? I'm learning it, but I find the interface antiquated.

 If Matlab or Maple had a decent analog electronics add-in I could afford, I'm there._

 

Which version of spice are you using? Just curious. I use spectre. There is much more to spice than the interface. A nice GUI on top of spice does help though.

 Analog Insydes looks like a neat toy which doesn't really cost that much (about 1/10th) compared to a Cadence (professional 'spice' for IC design) licencse set. In the end, it's still a symbolic solver though. I have always found the sybolic solvers only useful for very simple tedious stuff. For anything else, you have to trick them into giving you what you actually want and you'd have been better off just doing it yourself. Good luck with your designs if you trust the software to think (what Analog Insydes calls simplifications) for you. I'd be shocked if it didn't crash on anything more than a couple of transistors.


----------



## morsel

I found out why Mac users have problems with the bass boost calculator. The Apple Safari and IE browsers do not support the Number.toFixed() Javascript method. My recommendation for Mac users is to use a real browser like Firefox, Camino, or Mozilla that fully supports Javascript. I might get around to changing the Javascript at some point to format numbers with reduced precision manually.


----------



## Syzygies

Thanks! I was going nuts trying to figure out how this was something I'd done, though I truly do select _every_ installation option for both basic OS and for development.

 I want Safari to be a credible browser, so I will use the Apple feedback mechanisms to document this issue with them.

 IE I can live without. By coincidence these were the two I tried, before moving to a Windows box. I was going to try the rest of my browsers, but these two failing made me believe it was something in my Java installation.


----------



## Syzygies

I just tested all three bass boost calculators (Amb, Morsel, Tangent) on five Mac OS X browsers (Safari, IE, OmniWeb, Foxfire, Mozilla).

 The number.tofixed(2) issue wipes out Amb and Morsel on Safari, IE, Omniweb. All other combinations work.

Here's a possible fix? (I haven't tried it, but it looks reasonable.)


----------



## tangent

Quote:


 The Apple Safari and IE browsers do not support the Number.toFixed() Javascript method 
 

Yes. That's because IE is still v5 for Mac, and because Safari (KHTML) attends to ECMAScript, which is roughly equivalent to Javascript 1.4. The method you're using was introduced in 1.5.

 Why not use Math.round() the way I've done in my calculator? That method goes back to JS 1.0. No sense ignoring a significant chunk of your user base when a reasonable workaround exists. (Probably 5%, by looking at my web stats.)


----------



## amb

Thanks for the hint syzygies and tangent, I've changed my site to use Math.round() now.


----------



## GeekGirl

How critical is group delay? I just downloaded and ran tangent's Micro-cap simulation, plot attached. I'm not sure where the audible perception threshold is, i.e. how many mS can I get away with?

 Micro-Cap evaluation version 8.1.1.0 is reporting an error on start-up using tangent's file download from his web site: http://tangentsoft.net/audio/ppa/amp...tml#bass-boost . 
 Extra or unknown data: Static Grids = False.
 Sounds like a version problem. No big deal, just thought I'd mention it. Runs fine as-is.

 Update: Most of the delay is below 20 Hz, so it's probably not that important.


----------

