I want to make a Sallen & Key 2nd-Order Butterworth highpass filter with a defined gain. Let's say gain is +6 db.

[![enter image description here](https://i.stack.imgur.com/EuwOs.png)](https://i.stack.imgur.com/EuwOs.png)

Then,

R3 = R4 = 1 kOhm

F = 1000 Hz

C = 100 nF

R2 = 2 \* Q / ( 2 \* 3.14 \* F \* C )

Now, I would assume that Q = 1 / ( 3 - A), where A = 1 + R3 / R4.
But this table here doesn't agree.

[![enter image description here](https://i.stack.imgur.com/nrxGm.png)](https://i.stack.imgur.com/nrxGm.png)

What am i missing?
['https://electronics.stackexchange.com/questions/562193', 'https://electronics.stackexchange.com', 'https://electronics.stackexchange.com/users/262542/']
Here's your diagram with some annotations:

[![enter image description here](https://i.stack.imgur.com/t7JQnl.png)](https://i.stack.imgur.com/t7JQnl.png)

(I'm not promising anything about stability here. This is a high pass filter with gain significantly greater than 1. So this is only an idealized analysis, by the numbers. That's all. Not a practical recipe.)

Using [sympy](https://www.sympy.org/en/index.html):

```
eq1 = Eq( va/(1/s/c) + va/r1 + va/(1/s/c), vo/r1 + vb/(1/s/c) + vi/(1/s/c) )
eq2 = Eq( vb/r2 + vb/(1/s/c), va/(1/s/c) )
eq3 = Eq( vc/r4 + vc/r3, vo/r3 )
eq4 = Eq( vo/r3 + vo/r1, va/r1 + vc/r3 + io )
ans = solve( [eq1, eq2, eq3, eq4, Eq( vb, vc )], [io, va, vb, vc, vo] )
simplify( ans[vo]/vi )

    c**2*r1*r2*s**2*(r3 + r4)/(c**2*r1*r2*r4*s**2 + 2*c*r1*r4*s - c*r2*r3*s + r4)

```

Moving that towards the standard high-pass form leads to the following:

$$\begin{align\*}
\omega\_{\_0}&=\frac1{C\sqrt{R\_1\,R\_2}}\\\\
\zeta&=\sqrt{\frac{R\_1}{R\_2}}-\frac12\frac{R\_3}{R\_4}\sqrt{\frac{R\_2}{R\_1}}\\\\
K&=1+\frac{R\_3}{R\_4}\\\\
\mathcal{H}\left(s\right)&=K\frac{s^2}{s^2+2\zeta\,\omega\_{\_0}s+\omega\_{\_0}^{\:\!2}}
\end{align\*}$$

I'll leave the algebraic details for you to find on your own.

Now, you want to make a Butterworth filter. The 2nd order *normalized* (also known as *analytic*) Butterworth constants are: \$s^2 + \sqrt{2} s + 1\$. (This is where \$\omega\_{\_0}=1\$.) So it follows that \$2\zeta=\sqrt{2}\$ or \$\zeta=\frac12\sqrt{2}\$. So you have this new requirement:

$$\sqrt{\frac{R\_1}{R\_2}}-\frac12\frac{R\_3}{R\_4}\sqrt{\frac{R\_2}{R\_1}}=\frac12\sqrt{2}$$

From here, it is advisable to set \$R\_1=\eta\, R\$ and \$R\_2=\frac{R}{\eta}\$ so that \$\omega\_{\_0}=\frac1{R\,C}\$. This gives you some freedom to adjust these two resistor values. Also, given your desired gain of \$A\_v=K=2\$, it follows that \$\frac{R\_3}{R\_4}=1\$ and that:

$$\begin{align\*}
\eta-\frac12\frac1{\eta}&=\frac12\sqrt{2}\\\\
2\eta-\frac1{\eta}&=\sqrt{2}\\\\
\therefore \eta&=\frac14\left(\sqrt{2}+\sqrt{10}\right)\approx 1.14412281
\end{align\*}$$

From here you can compute \$R\_1\$ and \$R\_2\$, given a desired \$R\$ used in setting \$\omega\_{\_0}\$.

Let's say \$\omega\_{\_0}=6283.18531\$ (\$f\_{\_0}=1\:\text{kHz}\$) and that \$C=100\:\text{nF}\$, per your starting condition. Then it follows that \$R\approx 1.592\:\text{k}\Omega\$ and therefore that \$R\_1\approx 1.821\:\text{k}\Omega\$ and \$R\_2\approx 1.391\:\text{k}\Omega\$.

My apologies for all that precision, here. But I'm retaining it so you can compare with the results from this [recommended site to compute filter component values](http://sim.okawa-denshi.jp/en/OPseikiHikeisan.htm).

Using the E96 series of resistors, the above site says:

```
R1 = 1.82kΩ
R2 = 1.4kΩ
R3 = 10kΩ
R4 = 10kΩ
C1 = 0.1uF
C2 = 0.1uF

```

Which is obviously quite close to what I just computed.

Also, feel free to go there and look at the plot, as well.

Again. This is a high pass filter with a voltage gain you've specified as \$A\_v=2\$! Isolated and by itself, I'm not at all suggesting that you try it with a high performance opamp. But computationally, at least, you can see where the numbers come from. (Or, at least, after you do some algebra.)

P.S. You can also choose to set \$R\_1\$ and \$R\_2\$ to the same value. But if so, and if keeping with the Butterworth response, then you will find that the gain is no longer 2. It will have to be less. Something closer to \$3-\sqrt{2}\approx 1.586\$.
> 
> First, I will present a method that uses [Mathematica](https://www.wolfram.com/mathematica) to solve this problem. When I was studying this stuff I used the method all the time (without using Mathematica of course).
> 
> 
> 

Well, we are trying to analyze the following [opamp-circuit](https://en.wikipedia.org/wiki/Operational_amplifier):

![schematic](https://i.stack.imgur.com/UCuCm.png)

[simulate this circuit](/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fUCuCm.png) – Schematic created using [CircuitLab](https://www.circuitlab.com/)

When we use and apply [KCL](https://en.wikipedia.org/wiki/Kirchhoff%27s_circuit_laws#Kirchhoff%27s_current_law), we can write the following set of equations:

$$
\begin{cases}
\text{I}\_1=\text{I}\_2+\text{I}\_3\\
\\
\text{I}\_1+\text{I}\_3+\text{I}\_4=\text{I}\_2+\text{I}\_5
\end{cases}\tag1
$$

When we use and apply [Ohm's law](https://en.wikipedia.org/wiki/Ohm%27s_law), we can write the following set of equations:

$$
\begin{cases}
\text{I}\_1=\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}\\
\\
\text{I}\_2=\frac{\text{V}\_1-\text{V}\_2}{\text{R}\_2}\\
\\
\text{I}\_3=\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}\\
\\
\text{I}\_2=\frac{\text{V}\_2}{\text{R}\_4}\\
\\
\text{I}\_5=\frac{\text{V}\_3-\text{V}\_4}{\text{R}\_5}\\
\\
\text{I}\_5=\frac{\text{V}\_4}{\text{R}\_6}
\end{cases}\tag2
$$

Substitute \$(2)\$ into \$(1)\$, in order to get:

$$
\begin{cases}
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}=\frac{\text{V}\_1-\text{V}\_2}{\text{R}\_2}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_1-\text{V}\_2}{\text{R}\_2}+\text{I}\_5\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}=\frac{\text{V}\_2}{\text{R}\_4}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_2}{\text{R}\_4}+\text{I}\_5\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_1-\text{V}\_2}{\text{R}\_2}+\frac{\text{V}\_3-\text{V}\_4}{\text{R}\_5}\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_2}{\text{R}\_4}+\frac{\text{V}\_4}{\text{R}\_6}
\end{cases}\tag3
$$

Now, using an [ideal opamp](https://en.wikipedia.org/wiki/Operational_amplifier#Ideal_op_amps), we know that:

$$\text{V}\_x:=\text{V}\_+=\text{V}\_-=\text{V}\_2=\text{V}\_4\tag4$$

So we can rewrite equation \$(3)\$ as follows:

$$
\begin{cases}
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}=\frac{\text{V}\_1-\text{V}\_x}{\text{R}\_2}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_1-\text{V}\_x}{\text{R}\_2}+\text{I}\_5\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}=\frac{\text{V}\_x}{\text{R}\_4}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_x}{\text{R}\_4}+\text{I}\_5\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_1-\text{V}\_x}{\text{R}\_2}+\frac{\text{V}\_3-\text{V}\_x}{\text{R}\_5}\\
\\
\frac{\text{V}\_\text{i}-\text{V}\_1}{\text{R}\_1}+\frac{\text{V}\_1-\text{V}\_3}{\text{R}\_3}+\text{I}\_4=\frac{\text{V}\_x}{\text{R}\_4}+\frac{\text{V}\_x}{\text{R}\_6}
\end{cases}\tag5
$$

Now, we can solve for the transfer function:

$$\mathcal{H}:=\frac{\text{V}\_3}{\text{V}\_\text{i}}=\frac{\text{R}\_3\text{R}\_4\left(\text{R}\_5+\text{R}\_6\right)}{\text{R}\_6\left(\text{R}\_1\left(\text{R}\_2+\text{R}\_3\right)+\text{R}\_3\left(\text{R}\_2+\text{R}\_4\right)\right)-\text{R}\_1\text{R}\_4\text{R}\_5}\tag6$$

Where I used the following Mathematica-code:

```
In[1]:=Clear["Global`*"];
V2 = Vx;
V4 = Vx;
FullSimplify[
 Solve[{I1 == I2 + I3, I1 + I3 + I4 == I2 + I5, I1 == (Vi - V1)/R1, 
   I2 == (V1 - V2)/R2, I3 == (V1 - V3)/R3, I2 == V2/R4, 
   I5 == (V3 - V4)/R5, I5 == V4/R6}, {I1, I2, I3, I4, I5, V1, V3, 
   Vx}]]

Out[1]={{I1 -> ((R4 R5 - (R2 + R3) R6) Vi)/(
   R1 R4 R5 - (R1 (R2 + R3) + R3 (R2 + R4)) R6), 
  I2 -> (R3 R6 Vi)/(-R1 R4 R5 + R1 (R2 + R3) R6 + R3 (R2 + R4) R6), 
  I3 -> ((R4 R5 - R2 R6) Vi)/(
   R1 R4 R5 - (R1 (R2 + R3) + R3 (R2 + R4)) R6), 
  I4 -> ((R3 R4 + 2 R4 R5 - 2 R2 R6) Vi)/(-R1 R4 R5 + 
    R1 (R2 + R3) R6 + R3 (R2 + R4) R6), 
  I5 -> (R3 R4 Vi)/(-R1 R4 R5 + R1 (R2 + R3) R6 + R3 (R2 + R4) R6), 
  V1 -> (R3 (R2 + R4) R6 Vi)/(-R1 R4 R5 + R1 (R2 + R3) R6 + 
    R3 (R2 + R4) R6), 
  V3 -> (R3 R4 (R5 + R6) Vi)/(-R1 R4 R5 + R1 (R2 + R3) R6 + 
    R3 (R2 + R4) R6), 
  Vx -> (R3 R4 R6 Vi)/(-R1 R4 R5 + R1 (R2 + R3) R6 + 
    R3 (R2 + R4) R6)}}

```

My equation was also confirmed using [LTspice](https://en.wikipedia.org/wiki/LTspice).

---

When we want to apply the derivation from above to your circuit we need to use [Laplace transform](https://en.wikipedia.org/wiki/Laplace_transform) (I will use lower case function names for the functions that are in the (complex) s-domain, so \$\text{y}\left(\text{s}\right)\$ is the Laplace transform of the function \$\text{Y}\left(t\right)\$):

* $$\text{R}\_1=\frac{1}{\text{sC}\_1}\tag7$$
* $$\text{R}\_2=\frac{1}{\text{sC}\_2}\tag8$$

So, we can rewrite the transfer function as:

$$\mathscr{H}\left(\text{s}\right)=\frac{\text{R}\_3\text{R}\_4\left(\text{R}\_5+\text{R}\_6\right)}{\text{R}\_6\left(\frac{1}{\text{sC}\_1}\left(\frac{1}{\text{sC}\_2}+\text{R}\_3\right)+\text{R}\_3\left(\frac{1}{\text{sC}\_2}+\text{R}\_4\right)\right)-\frac{1}{\text{sC}\_1}\text{R}\_4\text{R}\_5}\tag9$$

Now, when working with sinusoidal signals we can use \$\text{s}:=\text{j}\omega\$ (where \$\text{j}^2=-1\$ and \$\omega=2\pi\text{f}\$ with \$\text{f}\$ is the frequency of the input signal in Hertz). Now, we know the values for \$\text{C}\_1=\text{C}\_2=100\cdot10^{-9}\space\text{F}\$ and \$\text{R}\_5=\text{R}\_6=1000\space\Omega\$ and we know that at \$\omega=2\pi\cdot1000\space\text{rad/sec}\$ we have \$20\log\_{10}\left(\left|\underline{\mathscr{H}}\left(\text{j}\omega\right)\right|\right)=6\$. So by setting \$\text{R}\_3=\text{R}\_4:=\text{R}\$ we can solve for it and get:

$$\text{R}\approx1587.8\space\Omega\tag{10}$$

Where I used the following code:

```
In[2]:=Clear["Global`*"];
R1 = 1/(s*C1);
R2 = 1/(s*C2);
s = I*\[Omega];
\[Omega] = 2*Pi*1000;
C1 = c;
C2 = c;
c = 100*10^(-9);
R5 = 1000;
R6 = 1000;
R3 = R;
R4 = R;
x = FullSimplify[
   Sqrt[ComplexExpand[
       Re[(R3 R4 (R5 + R6))/(-R1 R4 R5 + R1 (R2 + R3) R6 + 
         R3 (R2 + R4) R6)]]^2 + 
     ComplexExpand[
       Im[(R3 R4 (R5 + R6))/(-R1 R4 R5 + R1 (R2 + R3) R6 + 
         R3 (R2 + R4) R6)]]^2], Assumptions -> R > 0];
FullSimplify[Solve[{20 Log10[x] == 6, R > 0}, R]]

Out[2]={{R -> (1/\[Pi])
   2500 \[Sqrt](2/
       3 (-125 - 80 10^(1/5) - 50 10^(2/5) - 32 10^(3/5) - 
         20 10^(4/5) + Sqrt[
         81125 + 51200 10^(1/5) + 32300 10^(2/5) + 20384 10^(3/5) + 
          12860 10^(4/5)]))}}

In[3]:=N[%2]

Out[3]={{R -> 1587.8}}

```