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/']
> 
> 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}}

```
From "A handbook of Active Filters", by D.E. Johnson, et al., reference VCVS high-pass filter. This uses tables of coefficients for the various types of filters (butterworth, cheby, elliptic, ...). Warning, C is a coefficient, C1 are the capacitor values.

For 2nd order butterworth coefficients:

```
B = sqrt(2)
C = 1.0

```

Equations:

```
R2 = 4 * C / {[B + sqrt(B^2 + 8 * C * (K + 1)] * w * C1}
R1 = C / {w^2 * C1^2 * R2}
R4 = K * R2 / {K - 1}
R3 = K * R2

```

where:

```
K = gain
w = 2*π*f
C1 = capacitors (arbitrary value, same value for both)

```

R4 & R3 equations are given to optimize DC offset. You can make them any reasonable value if you don't care about DC offset.

Choosing C1 = 100nF:

```
R2 = 1391.77 -> nearest 1% value = 1.40k
R1 = 1821.85 -> nearest 1% value = 1.82k
R3 = R4 = 2783.54 -> nearest 1% value = 2.87k

```

Spice simulation shows this to be very close to what you want. Watch out for your choice of dielectric for C1. Either use plastic or COG dielectrics. If using COG (NPO) dielectric, you may want to make C1 = 10nF. X7R, and other class 2 ceramic dielectrics, will introduce distortion, have a strong temperature dependence, and change value over time.