Trouble calculating transfer function of 3rd order RC lowpass filter

I am working on simulations of a 3rd order RC filter.

Cascaded first order RC lowpass X3 with: R = 100 ohms, C = 3.3 nF.

When I perform the calculations for the transfer function I get a result that is different from the theoretical which is just 3 cascaded 1st order RC filters.

Circuit:

Calculated:

When I simulate the circuit in LTspice and plot both the above equations in Matlab, the simulation matches the Cascaded formula.

Versus:

Am I deriving the transfer function incorrectly here or is it some other issue?

Full Calculations:

• @Andy aka, that's what I was thinking, but why does the LTspice simulation still match that (Cascaded) transfer function? I can provide the Matlab code too but it's simple and I'm fairly confident of no errors there. Mar 15, 2023 at 13:32
• Your last step seems incorrect $$3 + 2\ c\ r\ s -(1+c\ r\ s) (2+c\ r\ s)^2 = -c^3 r^3 s^3-5 c^2 r^2 s^2-6\ c\ r\ s-1$$ Looks like you flipped the minus to a plus. Mar 15, 2023 at 14:17
• @SubaThomas That will do it. Figures it was a simple algebraic error in the end... On the last line too. Ran the expansion in Matlab and got the same as you. Bode Plot looks good now, thank you. Mar 15, 2023 at 14:29

Applying brute-force analysis to this type of circuit makes the exercise difficult, especially when it comes to tracking an error. I have used the fast analytical circuits techniques or FACTs to determine the transfer function (TF) of this circuit:

Then I compare the reference TF obtained using brute-force algebra versus the TF obtained with the FACTs: they are rigorously similar. Then, when you have components of similar values for $$\C\$$ and $$\C\$$, the transfer function simplifies:

In your attempt, you have wrongly cascaded the stages without accounting for the output impedance of the driving network. This is what I described in my brute-force approach by including two Thévenin generators. Then, you could have seen in the equation you came up with that for $$\s\$$ = 0, you do not find a magnitude of 1 as you should: open the caps in dc and the gain is 1.

The FACTs lead you to the answer by inspecting simple sketches - no algebra in this example - and that is the safest way to go in my opinion. Check out my seminar on the subject.

• I don't know about your techniques, but what you're using is precisely known as the extended time constant method, formally known as Middlebrook's theorem.
– edmz
Mar 23, 2023 at 22:44
• The extra-element theorem or EET forged by Dr. Middlebrook is part of the FACTs. It has been generalized by a CalTech student many tears ago and lead to the technique I used in this example. This paper from Ali Hajimiri is an interesting read on the subject. Mar 24, 2023 at 6:22

Well, we have the following circuit:

simulate this circuit – Schematic created using CircuitLab

When we use and apply KCL, we can write the following set of equations:

\begin{cases} \begin{alignat*}{1} \text{I}_1&=\text{I}_2+\text{I}_3\\ \\ \text{I}_3&=\text{I}_4+\text{I}_5\\ \\ 0&=\text{I}_0+\text{I}_4+\text{I}_5\\ \\ \text{I}_2&=\text{I}_0+\text{I}_1 \end{alignat*} \end{cases}\tag1

When we use and apply Ohm's law, we can write the following set of equations:

\begin{cases} \begin{alignat*}{1} \text{I}_1&=\frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}\\ \\ \text{I}_2&=\frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}\\ \\ \text{I}_3&=\frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}\\ \\ \text{I}_4&=\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}\\ \\ \text{I}_5&=\frac{\displaystyle\text{V}_2-\text{V}_3}{\displaystyle\text{R}_5}\\ \\ \text{I}_5&=\frac{\displaystyle\text{V}_3-0}{\displaystyle\text{R}_6} \end{alignat*} \end{cases}\tag2

Now, we can use $$\(2)\$$ to rewrite $$\(1)\$$:

\begin{cases} \begin{alignat*}{1} \frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}&=\frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}+\frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}\\ \\ \frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}&=\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}+\frac{\displaystyle\text{V}_2-\text{V}_3}{\displaystyle\text{R}_5}\\ \\ 0&=\text{I}_0+\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}+\frac{\displaystyle\text{V}_2-\text{V}_3}{\displaystyle\text{R}_5}\\ \\ \frac{\displaystyle\text{V}_1-0}{\displaystyle\text{R}_2}&=\text{I}_0+\frac{\displaystyle\text{V}_\text{i}-\text{V}_1}{\displaystyle\text{R}_1}\\ \\ \frac{\displaystyle\text{V}_1-\text{V}_2}{\displaystyle\text{R}_3}&=\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}+\frac{\displaystyle\text{V}_3-0}{\displaystyle\text{R}_6}\\ \\ 0&=\text{I}_0+\frac{\displaystyle\text{V}_2-0}{\displaystyle\text{R}_4}+\frac{\displaystyle\text{V}_3-0}{\displaystyle\text{R}_6}\\ \\ \end{alignat*} \end{cases}\tag3

Now, when using Mathematica in order to solve this system of equations I found (I am assuming that $$\\text{R}_\text{a}:=\text{R}_1=\text{R}_3=\text{R}_5\$$ and $$\\text{R}_\text{b}=\text{R}_2=\text{R}_4=\text{R}_6\$$):

$$\mathscr{H}:=\frac{\displaystyle\text{v}_3}{\displaystyle\text{v}_\text{i}}=\frac{\displaystyle\text{R}_\text{b}^3}{\displaystyle\text{R}_\text{a}^3+\text{R}_\text{b}\left(\text{R}_\text{b}^2+\text{R}_\text{a}\left(5\text{R}_\text{a}+6\text{R}_\text{b}\right)\right)}\tag4$$

Applying this to your circuit we need to substitute $$\\displaystyle\text{R}_\text{b}=\frac{1}{\text{sC}}\$$, so we get:

$$$$\begin{split} \mathscr{H}\left(\text{s}\right)&=\frac{\displaystyle\text{V}_3\left(\text{s}\right)}{\displaystyle\text{V}_\text{i}\left(\text{s}\right)}\\ \\ &=\frac{\displaystyle\left(\frac{1}{\text{sC}}\right)^3}{\displaystyle\text{R}_\text{a}^3+\frac{1}{\text{sC}}\cdot\left(\left(\frac{1}{\text{sC}}\right)^2+\text{R}_\text{a}\left(5\text{R}_\text{a}+6\cdot\frac{1}{\text{sC}}\right)\right)}\\ \\ &=\frac{\displaystyle\text{sC}\cdot\left(\frac{1}{\text{sC}}\right)^3}{\displaystyle\text{sC}\cdot\text{R}_\text{a}^3+\frac{\text{sC}}{\text{sC}}\cdot\left(\left(\frac{1}{\text{sC}}\right)^2+\text{R}_\text{a}\left(5\text{R}_\text{a}+6\cdot\frac{1}{\text{sC}}\right)\right)}\\ \\ &=\frac{\displaystyle\left(\frac{1}{\text{sC}}\right)^2}{\displaystyle\text{sCR}_\text{a}^3+\left(\frac{1}{\text{sC}}\right)^2+\text{R}_\text{a}\left(5\text{R}_\text{a}+6\cdot\frac{1}{\text{sC}}\right)}\\ \\ &=\frac{\displaystyle\text{sC}\cdot\left(\frac{1}{\text{sC}}\right)^2}{\displaystyle\text{sC}\cdot\text{sCR}_\text{a}^3+\text{sC}\cdot\left(\frac{1}{\text{sC}}\right)^2+\text{R}_\text{a}\left(\text{sC}\cdot5\text{R}_\text{a}+6\cdot\frac{\text{sC}}{\text{sC}}\right)}\\ \\ &=\frac{\displaystyle\frac{1}{\text{sC}}}{\displaystyle\left(\text{sC}\right)^2\text{R}_\text{a}^3+\frac{1}{\text{sC}}+\text{R}_\text{a}\left(5\text{sCR}_\text{a}+6\right)}\\ \\ &=\frac{\displaystyle\frac{\text{sC}}{\text{sC}}}{\displaystyle\text{sC}\cdot\left(\text{sC}\right)^2\text{R}_\text{a}^3+\frac{\text{sC}}{\text{sC}}+\text{sC}\cdot\text{R}_\text{a}\left(5\text{sCR}_\text{a}+6\right)}\\ \\ &=\frac{\displaystyle1}{\displaystyle\left(\text{sC}\right)^3\text{R}_\text{a}^3+1+\text{sCR}_\text{a}\left(5\text{sCR}_\text{a}+6\right)}\\ \\ &=\frac{\displaystyle1}{\displaystyle\text{s}^3\text{C}^3\text{R}_\text{a}^3+5\text{sCR}_\text{a}\text{sCR}_\text{a}+6\text{sCR}_\text{a}+1}\\ \\ &=\frac{\displaystyle1}{\displaystyle\text{s}^3\text{C}^3\text{R}_\text{a}^3+5\text{sCR}_\text{a}\text{sCR}_\text{a}+6\text{sCR}_\text{a}+1}\\ \\ &=\frac{\displaystyle1}{\displaystyle\text{s}^3\left(\text{C}\text{R}_\text{a}\right)^3+5\text{s}^2\left(\text{CR}_\text{a}\right)^2+6\text{sCR}_\text{a}+1} \end{split}\tag6$$$$

So, when working out the bode plot we need to take a look at:

$$$$\begin{split} \left|\space\underline{\mathscr{H}}\left(\text{j}\omega\right)\right|=&\left|\frac{\displaystyle1}{\displaystyle\left(\text{j}\omega\right)^3\left(\text{C}\text{R}_\text{a}\right)^3+5\left(\text{j}\omega\right)^2\left(\text{CR}_\text{a}\right)^2+6\text{j}\omega\text{CR}_\text{a}+1}\right|\\ \\ &=\frac{\displaystyle\left|1\right|}{\displaystyle\left|\left(\text{j}\omega\right)^3\left(\text{C}\text{R}_\text{a}\right)^3+5\left(\text{j}\omega\right)^2\left(\text{CR}_\text{a}\right)^2+6\text{j}\omega\text{CR}_\text{a}+1\right|}\\ \\ &=\frac{\displaystyle1}{\displaystyle\left|1-\text{j}\omega^3\left(\text{C}\text{R}_\text{a}\right)^3-5\omega^2\left(\text{CR}_\text{a}\right)^2+6\text{j}\omega\text{CR}_\text{a}\right|}\\ \\ &=\frac{\displaystyle1}{\displaystyle\left|1-\left(\omega\text{C}\text{R}_\text{a}\right)^3\text{j}-5\left(\omega\text{CR}_\text{a}\right)^2+6\omega\text{CR}_\text{a}\text{j}\right|}\\ \\ &=\frac{\displaystyle1}{\displaystyle\left|1-5\left(\omega\text{CR}_\text{a}\right)^2+\left(6\omega\text{CR}_\text{a}-\left(\omega\text{C}\text{R}_\text{a}\right)^3\right)\text{j}\right|}\\ \\ &=\frac{\displaystyle1}{\displaystyle\left|1-5\left(\omega\text{CR}_\text{a}\right)^2+\omega\text{CR}_\text{a}\left(6-\left(\omega\text{C}\text{R}_\text{a}\right)^2\right)\text{j}\right|}\\ \\ &=\frac{\displaystyle1}{\displaystyle\sqrt{\left(1-5\left(\omega\text{CR}_\text{a}\right)^2\right)^2+\left(\omega\text{CR}_\text{a}\left(6-\left(\omega\text{C}\text{R}_\text{a}\right)^2\right)\right)^2}} \end{split}\tag7$$$$

And, let's set $$\\displaystyle\alpha:=1-5\left(\omega\text{CR}_\text{a}\right)^2\$$ and $$\\displaystyle\beta:=\omega\text{CR}_\text{a}\left(6-\left(\omega\text{C}\text{R}_\text{a}\right)^2\right)\$$, for the argument we get:

$$$$\begin{split} \arg\left(\space\underline{\mathscr{H}}\left(\text{j}\omega\right)\right)&=\arg\left(\frac{\displaystyle1}{\displaystyle\left(\text{j}\omega\right)^3\left(\text{C}\text{R}_\text{a}\right)^3+5\left(\text{j}\omega\right)^2\left(\text{CR}_\text{a}\right)^2+6\text{j}\omega\text{CR}_\text{a}+1}\right)\\ \\ &=\arg\left(1\right)-\arg\left(\left(\text{j}\omega\right)^3\left(\text{C}\text{R}_\text{a}\right)^3+5\left(\text{j}\omega\right)^2\left(\text{CR}_\text{a}\right)^2+6\text{j}\omega\text{CR}_\text{a}+1\right)\\ \\ &=0-\arg\left(1-5\left(\omega\text{CR}_\text{a}\right)^2+\omega\text{CR}_\text{a}\left(6-\left(\omega\text{C}\text{R}_\text{a}\right)^2\right)\text{j}\right)\\ \\ &=-\displaystyle\begin{cases} \displaystyle0&\space\text{if}\space\displaystyle\alpha=0\space\wedge\space\beta=0\\ \\ \displaystyle\frac{\pi}{2}&\space\text{if}\space\displaystyle\alpha=0\space\wedge\space\beta>0\\ \\ \displaystyle\pi&\space\text{if}\space\displaystyle\alpha<0\space\wedge\space\beta=0\\ \\ \displaystyle\frac{3\pi}{2}&\space\text{if}\space\displaystyle\alpha=0\space\wedge\space\beta<0\\ \\ \displaystyle\arctan\left(\frac{\beta}{\alpha}\right)&\space\text{if}\space\displaystyle\alpha>0\space\wedge\space\beta>0\\ \\ \displaystyle\frac{\pi}{2}+\arctan\left(\frac{\left|\alpha\right|}{\beta}\right)&\space\text{if}\space\displaystyle\alpha<0\space\wedge\space\beta>0\\ \\ \displaystyle\pi+\arctan\left(\frac{\left|\beta\right|}{\left|\alpha\right|}\right)&\space\text{if}\space\displaystyle\alpha<0\space\wedge\space\beta<0\\ \\ \displaystyle\frac{3\pi}{2}+\arctan\left(\frac{\alpha}{\left|\beta\right|}\right)&\space\text{if}\space\displaystyle\alpha>0\space\wedge\space\beta<0 \end{cases} \end{split}\tag8$$$$

Used Mathematica code:

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

Out[1]={{I0 -> -((Rb (Ra + 2 Rb) Vi)/(Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3)),
I1 -> ((Ra + Rb) (Ra + 3 Rb) Vi)/(
Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
I2 -> ((Ra^2 + 3 Ra Rb + Rb^2) Vi)/(
Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
I3 -> (Rb (Ra + 2 Rb) Vi)/(Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
I4 -> (Rb (Ra + Rb) Vi)/(Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
I5 -> (Rb^2 Vi)/(Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
V1 -> (Rb (Ra^2 + 3 Ra Rb + Rb^2) Vi)/(
Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
V2 -> (Rb^2 (Ra + Rb) Vi)/(Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3),
V3 -> (Rb^3 Vi)/(Ra^3 + 5 Ra^2 Rb + 6 Ra Rb^2 + Rb^3)}}
`