# Using wxMaxima to obtain a transfer function from T-twin filter & op amp

I'm trying to get the transfer function from this circuit using wxMaxima

So first using the ideal op amp model I know Vx = Vy and I can know Vy from that voltage divider from Vo

Now I solve this system

From here I'm not pretty sure what should I do next.

I've tried some solutions without success. Like this

Anyone can give me a hint about what to do next? I'm not pretty familiar with Maxima nor op amps but I guess I have the right idea about this.

I think you have to add one more equation $\frac{\text{Vx}-\text{V1}}{R}+\mathcal{C} s (\text{Vx}-\text{V2}) == 0$ and solve for $V0$ as well. Also your first equation needs to have the term $2 \mathcal{C}$ instead of $\mathcal{C}$.

Computations using Mathematica.

sols = Solve[{
(V1 - Vi)/R + (V1 - Vx)/R + (V1 - V0) s 2 \[ScriptCapitalC] == 0,
(V2 - Vi) s \[ScriptCapitalC] + (V2 - Vx) s \[ScriptCapitalC] + V2/(R/2) == 0,
Vx == (RA V0)/(RA + RB),
(Vx - V1)/R + (Vx - V2) s \[ScriptCapitalC] == 0}
,
{V1, V2, Vx, V0}
];

tfm = TransferFunctionModel[V0/Vi /. sols[[1]] // Simplify, s]


Special cases:

1. $RA = 0$, and any value of $RB$

tfm /. RA -> 0

1. $RB = 0$, and any value of $RA$

tfm /. RB -> 0

1. $R = 0$, and any value of $\mathcal{C}$

tfm /. R -> 0

2. $\mathcal{C} = 0$, and any value of $R$

tfm /. \[ScriptCapitalC] -> 0

These are notch filters when $\text{RA}<\text{RB}$.

values = {0.01, 0.1, 1, 10, 100, 1000};
Table[tfm /. {RA -> 1, RB -> 10, R -> f/\[ScriptCapitalC]}, {f, values}];
BodePlot[%, PlotLayout -> "Magnitude", PlotLegends -> values]


They are still notch when $\text{RA}>\text{RB}$.

Table[tfm /. {RA -> 10, RB -> 1, R -> f/\[ScriptCapitalC]}, {f, values}];
BodePlot[%, PlotLayout -> "Magnitude", PlotLegends -> values, PlotRange -> All]


If $\text{RA}=\text{RB}$, it turns out to be "all-pass" filters.

Table[tfm /. {RA -> 1, RB -> 1, R -> f/\[ScriptCapitalC]}, {f, values}];
BodePlot[%, PlotLayout -> "Magnitude", PlotLegends -> values, PlotRange -> All]


• Yes - the four cases 1...4 are easy to derive. However, I still think that for RB=0 the circuit must have a magnitude of zero for one single frequency (real notch).
– LvW
Jul 8, 2015 at 19:12
• Could you explain the reasoning behind that. With $RB=0$ the system appears as a band-pass filter. Jul 8, 2015 at 20:02
• Analyzing the two extreme cases f=0 anf f infinite we see that in both cases the total gain is maximum with (1+RB/RA). Hence, it cannot appear as a bandpass. It is one of the classical notch filter realizations.
– LvW
Jul 9, 2015 at 7:16
• Sure, it's an all-pass system with constant gain $\frac{\text{RB}}{\text{RA}}+1$ for $R C =0$ and $R C \to \infty$. So it should be a notch filter in between? How do you arrive at that conclusion? And the maximum possible gain is $\frac{\text{RB}}{\text{RA}}+1$ for $\textbf{all}$ frequencies and $\textbf{all}$ parameter values? Again, how do you reach that conclusion? Jul 9, 2015 at 14:06
• Yes - the double-T network is a "tricky" circuit because it can assume a different behaviour - if used as a feedback element for amplifiers with different gain values. For gain values lower than "2" it shows a notch characteristic (and thats what I had in mind because this is the classical application of this circuit with unity gain). However - you are right, for a gain of "2" it is an allpass. On the other hand - I am not sure if we should call it "allpass" because it has constant gain AND constant phase (all 3 poles and zeros are identical).
– LvW
Jul 9, 2015 at 15:11

My result looks different (using a symbolic analyzer):

Numerator N(s):

N(s)=2(RA+RB)+sRC*2(RA+RB)+s²R²C²*2(RA+RB)+s³R³C³*2(RA+RB)

Denominator D(s):

D(s)=2RA+sRC(6RA-4RB)+s²R²C²*(6RA-4RB)+2s³R³C³RA

Please note that for the selected dimensioning due to a pole-zero cancellation the transfer function can be simplified to a second order function. For a gain of unity (RA=0 and RB infinite) the numerator must not contain any s-element.

UPDATE 1: After updating his answer, Suba Thomas now arrived at a second-order equation. It seems that his computational machine was able to detect the pole-zero cancellation.

UPDATE 2: Here is the second-order transfer function H(s)=N(s)/D(s) after pole-zero cancellation:

N(s)=1+s²R²C²

D(s)=1+2sRC[2-(1+RB/RA)]+s²R²C².

As can be seen, the notch filter has a transmission zero at wo=1/RC. The pole-Q is dermined by the expression Qp=1/2[2-(1+RB/RA)].

For unity gain (RB=0) the max. pole-Q is Qp=0.5. For a gain of two (RB=RA) we have H(s)=N(s)/D(s)=1. As can beseen, the gain must not be larger than "2", otherwise the s-term in D(s) becomes negative - indicating instability.

UPDATE 3: I have updated my above answer after correction of Suba Thomass answers.

• We cannot reproduce how you got the first N(s) and D(s) and how you did the pole-zero cancellation. The pole-zero cancellation is flat wrong. If it was correct $(2(RA+RB)+sRC*2(RA+RB)+s^2R^2C^2*2(RA+RB)+s^3R^3C^3*2(RA+RB))(1+2sRC[2-(1+RB/RA)]+s^2R^2C^2)-(2RA+sRC(6RA-4RB)+s^2R^2C^2*(6RA-4RB)+2s^3R^3C^3RA)(1+s^2R^2C^2)$ would be zero which it is not! Jul 10, 2015 at 15:27
• Each filter book will confirm the above result (example: Claude Lindquist, Active Network Design).
– LvW
Jul 10, 2015 at 15:39
• Suba T., may I recommend something to you: Use a circuit simulation program and verify that the circuit as shown (for an opamp gain <2) realizes a bandstop filter (notch). From this, you can derive that there must not be any s-term in the numerator of the transfer function. That is basic! You also can show that for gain values >2 the circuit is unstable. Simple proof.
– LvW
Jul 10, 2015 at 15:57
• That doesn't change the fact that your pole-zero cancellation is wrong. Jul 10, 2015 at 16:08
• What means wrong? It is not "my" cancellation. It is a fact that the 3rd-oder Twin-T network (even without any amplifier) for the special dimensioning (2C and R/2) is reducend to a 2nd-order function by pole-zero cancellation. Can be found in any textbook dealing with such 4-pole networks. Can also be proofed by simulation (calculation by hand is rather involved).
– LvW
Jul 10, 2015 at 16:45

I only added a new node to the equation system. And removed another node.

We know

Vx = Vy = Vo * Ra/(Ra+Rb)
K = Ra / (Ra+Rb)


So this was my solution

And thanks for the answers about RA and RB. At lab I saw when K > 1/3 the circuit gets crazy.