Second-order two-stage RC low-pass filter

Thread Starter

Sup H

Joined Aug 6, 2025
26
Hi again,

That formula is not correct, sorry.
Here is the formula in pure text:
w=(sqrt(sqrt(C2^4*R2^4+4*C2^4*R1*R2^3+(6*C2^4+4*C1*C2^3+6*C1^2*C2^2)*R1^2*R2^2+(4*C2^4+8*C1*C2^3+4*C1^2*C2^2)*R1^3*R2+(C2^4+4*C1*C2^3+6*C1^2*C2^2+4*C1^3*C2+C1^4)*R1^4)-C2^2*R2^2-2*C2^2*R1*R2+(-C2^2-2*C1*C2-C1^2)*R1^2))/(sqrt(2)*C1*C2*R1*R2)

and in Latex:
\[ w = \frac{ \sqrt{ \sqrt{ C_2^4 R_2^4 + 4 C_2^4 R_1 R_2^3 + (6 C_2^4 + 4 C_1 C_2^3 + 6 C_1^2 C_2^2) R_1^2 R_2^2 + (4 C_2^4 + 8 C_1 C_2^3 + 4 C_1^2 C_2^2) R_1^3 R_2 + (C_2^4 + 4 C_1 C_2^3 + 6 C_1^2 C_2^2 + 4 C_1^3 C_2 + C_1^4) R_1^4 - C_2^2 R_2^2 - 2 C_2^2 R_1 R_2 + (-C_2^2 - 2 C_1 C_2 - C_1^2) R_1^2 } } }{ \sqrt{2} \, C_1 C_2 R_1 R_2 } \]

and if R2=R1 then:
\[w=\frac{\sqrt{\sqrt{16\,{C2}^{4}+16\,C1\,{C2}^{3}+16\,{C1}^{2}\,{C2}^{2}+4\,{C1}^{3}\,C2+{C1}^{4}}-4\,{C2}^{2}-2\,C1\,C2-{C1}^{2}}}{\sqrt{2}\,C1\,C2\,R1}\]

and in pure text:
w=sqrt(sqrt(16*C2^4+16*C1*C2^3+16*C1^2*C2^2+4*C1^3*C2+C1^4)-4*C2^2-2*C1*C2-C1^2)/(sqrt(2)*C1*C2*R1)

Either of these agrees with Eric's plot.
Thank you, Can you provide me a reference for the calculation provided by you ?
 

MrAl

Joined Jun 17, 2014
13,708
This gets even simpler if we introduce a ratio B such that C2=C1*B, and that's not hard to do:
w=sqrt(sqrt(16*B^4+16*B^3+16*B^2+4*B+1)-4*B^2-2*B-1)/(sqrt(2)*B*C1*R1)

\[w=\frac{\sqrt{\sqrt{16\,{B}^{4}+16\,{B}^{3}+16\,{B}^{2}+4\,B+1}-4\,{B}^{2}-2\,B-1}}{\sqrt{2}\,B\,C1\,R1}\]
 

Thread Starter

Sup H

Joined Aug 6, 2025
26
This gets even simpler if we introduce a ratio B such that C2=C1*B, and that's not hard to do:
w=sqrt(sqrt(16*B^4+16*B^3+16*B^2+4*B+1)-4*B^2-2*B-1)/(sqrt(2)*B*C1*R1)

\[w=\frac{\sqrt{\sqrt{16\,{B}^{4}+16\,{B}^{3}+16\,{B}^{2}+4\,B+1}-4\,{B}^{2}-2\,B-1}}{\sqrt{2}\,B\,C1\,R1}\]
This gets even simpler if we introduce a ratio B such that C2=C1*B, and that's not hard to do:
w=sqrt(sqrt(16*B^4+16*B^3+16*B^2+4*B+1)-4*B^2-2*B-1)/(sqrt(2)*B*C1*R1)

\[w=\frac{\sqrt{\sqrt{16\,{B}^{4}+16\,{B}^{3}+16\,{B}^{2}+4\,B+1}-4\,{B}^{2}-2\,B-1}}{\sqrt{2}\,B\,C1\,R1}\]
can you provide me reference for the calculations ?
 

MrAl

Joined Jun 17, 2014
13,708
Thank you, Can you provide me a reference for the calculation provided by you ?
Hi again,

Yes, it's Nodal Analysis combined with solving directly for 'w' which you can then divide by 2*pi to get the frequency 'f'.

You can also just use impedance calculations working from right to left, then back from right to left, but you need math software so it does not get too complicated by hand.

Once you have the transfer function it will have this form:
Vout/Vin=H(s)
and then substitute s=j*w, that gives you H(jw), then take the norm of that (complex absolute value) which gives you the amplitude A(w), then set w=0 and solve for A0, then, then solve for w with A(w)=A0/sqrt(2). It's not too hard to do if you use math software. We can do a simpler example so you can see how this works.

For a single RC we end up with (RC=R*C):
H(s)=1/(s*RC+1)
set s=jw:
H(jw)=1/(j*w*RC+1)
calculate the norm:
A(w)=1/sqrt(w^2*R^2*C^2+1)
set w=0 solve for A(0):
A(0)=1
now solve A(w)=A(0)/sqrt(2) for w:
1/sqrt(w^2*R^2*C^2+1)=1/sqrt(2)
we get two results:
w=-1/RC
and
w=1/RC
Since we don't want a negative frequency, we choose w=1/RC and that is w=1/(R*C) and then divide by 2*pi to get 'f' the frequency.
 

MrAl

Joined Jun 17, 2014
13,708
can you define the ratio B. ?
Hi,

Yes but see the previous post too with more details.

Since we defined C2=B*C1, then solve that for B we get:
B=C2/C1

Try it with the formula with B and see what you get.

Oh BTW, for a decent approximation we can also use the very simple formula:
w=0.3742/(C*R)
if we make C equal to the geometric mean of C1 and C2:
gm=sqrt(C1*C2)
It's probably best when C2 and C1 are not that different, but are different.
 
Last edited:

sparky 1

Joined Nov 3, 2018
1,218
I asked Ai for a spice simulation of a single order RC filter having -3dB at 20mHz.
here is the output:

* RC low-pass, fc ≈ 0.02 Hz (20 mHz)
* R*C ≈ 7.96 s -> R=1e6 Ω, C=7.96e-6 F
Vin in 0 AC 1
R1 in out 1e6
C1 out 0 7.96e-6
*.ac decade 10 1m 10
* Fine resolution around fc:
.ac dec 20 1m 1
*.plot ac mag(v(out)) phase(v(out))
.end

then I followed up asking to run this in LTspice and Mathcad which gave the same results:

⚡ LTspice Setup
Here’s a ready‑to‑run netlist for a low‑pass RC filter:

spice
* RC low-pass filter, fc ≈ 20 mHz
Vin in 0 AC 1
R1 in out 1e6
C1 out 0 7.96u
.ac dec 20 1m 1
.plot ac mag(v(out)) phase(v(out))
.end

  • R1 = 1 MΩ
  • C1 = 7.96 µF (≈ 8.2 µF standard value)
  • Sweep: 1 mHz → 1 Hz (covers the cutoff region)
In LTspice, run an AC Analysis. At 20 mHz, you should see:

  • Gain ≈ −3.01 dB
  • Phase ≈ −45°

Mathcad Verification
In Mathcad (or Prime), define the transfer function and evaluate:

mathcad
fc := 0.02 // Hz
R := 1e6 // Ohm
C := 7.96e-6 // F
tau := R*C

H(f) := 1/sqrt(1 + (f/fc)^2)

f := 0.02 // Hz
Gain_dB := 20*log10(H(f))
Phase_deg := -atan(f/fc) * 180/pi

Expected results:

  • Gain_dB ≈ -3.01
  • Phase_deg ≈ -45
You can also plot:

mathcad
fvec := logspace(-3, 0, 200) // 1 mHz to 1 Hz
Gain(f) := 20*log10(1/sqrt(1+(f/fc)^2))
Phase(f) := -atan(f/fc)*180/pi

This gives you the Bode magnitude and phase plots directly in Mathcad.


✅ Cross‑check
  • LTspice: Run .ac sweep → confirm −3 dB at 20 mHz.
  • Mathcad: Plug in same R, C → confirm analytical −3 dB at 20 mHz.
Both should line up exactly, since the RC filter is analytically simple.


Would you like me to also give you a step‑by‑step LTspice GUI workflow (schematic drawing, probe setup, plotting) so you don’t have to rely on netlists alone?

This is a little faster than I am used to however I followed up with:


explain why the workflow differences might cause slightly diffent result?

Great question — this is exactly the kind of subtlety that trips people up when they compare analytical math (Mathcad) with numerical simulation (LTspice). Both are “right,” but the workflows differ in ways that can shift results by a fraction of a dB or a few millihertz. Here are the main reasons:

⚙ 1. Ideal math vs. numerical engine
  • Mathcad evaluates the transfer function symbolically or with high‑precision floating point. It assumes ideal components with no parasitics.
  • LTspice uses a numerical solver with finite step sizes and tolerances. Even with ideal R and C, the solver discretizes the frequency sweep, so the exact −3.01 dB point may fall between two sampled frequencies.

⚙ 2. Frequency sweep resolution
  • In LTspice, .ac dec 20 1m 1 means 20 points per decade. That’s relatively coarse around 20 mHz. If the cutoff lies between sampled points, the plotted curve interpolates, which can look slightly shifted.
  • In Mathcad, you can evaluate at exactly 0.020 Hz. If you increase LTspice resolution (e.g. .ac dec 200 1m 1), the results converge much closer.

⚙ 3. Component tolerances and rounding
  • In Mathcad, you can plug in an exact C=7.9577 μFC = 7.9577\ \mu\text{F}.
  • In LTspice, you might enter 7.96u, which is rounded. That tiny difference in RC time constant shifts the cutoff slightly.
  • Real capacitors have ±5–20% tolerance, so in practice the cutoff will wander far more than the math suggests.

⚙ 4. Initial conditions and leakage models
  • LTspice capacitors can include ESR, leakage, and initial conditions if you enable them. Even if you don’t, the simulator may include default parasitics (like GMIN conductance to ground).
  • Mathcad ignores all of that unless you explicitly model it.

⚙ 5. Phase unwrapping and interpolation
  • Mathcad gives you the exact arctangent phase at a frequency.
  • LTspice plots phase across a sweep and may unwrap differently depending on the range, which can make the −45° point look slightly offset.

✅ How to reconcile
  • Use higher sweep resolution in LTspice.
  • Enter more precise component values.
  • Compare at the exact frequency (e.g. probe at 20 mHz, not just the nearest sweep point).
  • Remember that in real hardware, tolerances swamp these tiny differences anyway.


What is the take away for an EE in evaluating Ltspice using both regular and precision mode when the results are not perfect?
A good engineer designs with the ideal in mind, but always checks against the real‑world spread to ensure the circuit still performs within spec.
An improvement in accuracy of second order using different mathematical method does not reflect on Ltspice software but on the user's ability.
Mathcad can check a hand calculation to some degree but the real improvement is in using a more accurate mathematical method.
 
Last edited:

MrAl

Joined Jun 17, 2014
13,708
(see attachement)
That does not look correct. Where did you get that from?
In fact, we need at least this:
w=0.374*1/(R*Ceq)

so even the first form in that image can not be right.

When I said use the values to calculate the 'w' for this problem, I meant use the formulas you were given:
w=0.374/(R*Ceq)
which is an approximation, where again Ceq=sqrt(C1*C2) which is the geometric mean of C1 and C2, valid up to about C2>=0.75*C1 when C2<C1.
 

Attachments

MrAl

Joined Jun 17, 2014
13,708
I asked Ai for a spice simulation of a single order RC filter having -3dB at 20mHz.
here is the output:

* RC low-pass, fc ≈ 0.02 Hz (20 mHz)
* R*C ≈ 7.96 s -> R=1e6 Ω, C=7.96e-6 F
Vin in 0 AC 1
R1 in out 1e6
C1 out 0 7.96e-6
*.ac decade 10 1m 10
* Fine resolution around fc:
.ac dec 20 1m 1
*.plot ac mag(v(out)) phase(v(out))
.end

then I followed up asking to run this in LTspice and Mathcad which gave the same results:

⚡ LTspice Setup
Here’s a ready‑to‑run netlist for a low‑pass RC filter:

spice
* RC low-pass filter, fc ≈ 20 mHz
Vin in 0 AC 1
R1 in out 1e6
C1 out 0 7.96u
.ac dec 20 1m 1
.plot ac mag(v(out)) phase(v(out))
.end

  • R1 = 1 MΩ
  • C1 = 7.96 µF (≈ 8.2 µF standard value)
  • Sweep: 1 mHz → 1 Hz (covers the cutoff region)
In LTspice, run an AC Analysis. At 20 mHz, you should see:

  • Gain ≈ −3.01 dB
  • Phase ≈ −45°

Mathcad Verification
In Mathcad (or Prime), define the transfer function and evaluate:

mathcad
fc := 0.02 // Hz
R := 1e6 // Ohm
C := 7.96e-6 // F
tau := R*C

H(f) := 1/sqrt(1 + (f/fc)^2)

f := 0.02 // Hz
Gain_dB := 20*log10(H(f))
Phase_deg := -atan(f/fc) * 180/pi

Expected results:

  • Gain_dB ≈ -3.01
  • Phase_deg ≈ -45
You can also plot:

mathcad
fvec := logspace(-3, 0, 200) // 1 mHz to 1 Hz
Gain(f) := 20*log10(1/sqrt(1+(f/fc)^2))
Phase(f) := -atan(f/fc)*180/pi

This gives you the Bode magnitude and phase plots directly in Mathcad.


✅ Cross‑check
  • LTspice: Run .ac sweep → confirm −3 dB at 20 mHz.
  • Mathcad: Plug in same R, C → confirm analytical −3 dB at 20 mHz.
Both should line up exactly, since the RC filter is analytically simple.


Would you like me to also give you a step‑by‑step LTspice GUI workflow (schematic drawing, probe setup, plotting) so you don’t have to rely on netlists alone?

This is a little faster than I am used to however I followed up with:


explain why the workflow differences might cause slightly diffent result?

Great question — this is exactly the kind of subtlety that trips people up when they compare analytical math (Mathcad) with numerical simulation (LTspice). Both are “right,” but the workflows differ in ways that can shift results by a fraction of a dB or a few millihertz. Here are the main reasons:

⚙ 1. Ideal math vs. numerical engine
  • Mathcad evaluates the transfer function symbolically or with high‑precision floating point. It assumes ideal components with no parasitics.
  • LTspice uses a numerical solver with finite step sizes and tolerances. Even with ideal R and C, the solver discretizes the frequency sweep, so the exact −3.01 dB point may fall between two sampled frequencies.

⚙ 2. Frequency sweep resolution
  • In LTspice, .ac dec 20 1m 1 means 20 points per decade. That’s relatively coarse around 20 mHz. If the cutoff lies between sampled points, the plotted curve interpolates, which can look slightly shifted.
  • In Mathcad, you can evaluate at exactly 0.020 Hz. If you increase LTspice resolution (e.g. .ac dec 200 1m 1), the results converge much closer.

⚙ 3. Component tolerances and rounding
  • In Mathcad, you can plug in an exact C=7.9577 μFC = 7.9577\ \mu\text{F}.
  • In LTspice, you might enter 7.96u, which is rounded. That tiny difference in RC time constant shifts the cutoff slightly.
  • Real capacitors have ±5–20% tolerance, so in practice the cutoff will wander far more than the math suggests.

⚙ 4. Initial conditions and leakage models
  • LTspice capacitors can include ESR, leakage, and initial conditions if you enable them. Even if you don’t, the simulator may include default parasitics (like GMIN conductance to ground).
  • Mathcad ignores all of that unless you explicitly model it.

⚙ 5. Phase unwrapping and interpolation
  • Mathcad gives you the exact arctangent phase at a frequency.
  • LTspice plots phase across a sweep and may unwrap differently depending on the range, which can make the −45° point look slightly offset.

✅ How to reconcile
  • Use higher sweep resolution in LTspice.
  • Enter more precise component values.
  • Compare at the exact frequency (e.g. probe at 20 mHz, not just the nearest sweep point).
  • Remember that in real hardware, tolerances swamp these tiny differences anyway.


What is the take away for an EE in evaluating Ltspice using both regular and precision mode when the results are not perfect?
A good engineer designs with the ideal in mind, but always checks against the real‑world spread to ensure the circuit still performs within spec.
An improvement in accuracy of second order using different mathematical method does not reflect on Ltspice software but on the user's ability.
Mathcad can check a hand calculation to some degree but the real improvement is in using a more accurate mathematical method.
That calculate looks good.
 

Thread Starter

Sup H

Joined Aug 6, 2025
26
That does not look correct. Where did you get that from?
In fact, we need at least this:
w=0.374*1/(R*Ceq)

so even the first form in that image can not be right.

When I said use the values to calculate the 'w' for this problem, I meant use the formulas you were given:
w=0.374/(R*Ceq)
which is an approximation, where again Ceq=sqrt(C1*C2) which is the geometric mean of C1 and C2, valid up to about C2>=0.75*C1 when C2<C1.
https://www.mathforengineers.com/filters/low-pass-filter-transfer-function.html go through this link
 

LvW

Joined Jun 13, 2013
2,030
  • LTspice uses a numerical solver with finite step sizes and tolerances. Even with ideal R and C, the solver discretizes the frequency sweep, so the exact −3.01 dB point may fall between two sampled frequencies.

2. Frequency sweep resolution
  • In LTspice, .ac dec 20 1m 1 means 20 points per decade. That’s relatively coarse around 20 mHz. If the cutoff lies between sampled points, the plotted curve interpolates, which can look slightly shifted.

What is the take away for an EE in evaluating Ltspice using both regular and precision mode when the results are not perfect?
What do you mean with "perfect"? (ideal or realistic or...?)
Why do you think that LTSpice can compute only 20 points per decade`? Why didn`t you try a better resolution?
 

Thread Starter

Sup H

Joined Aug 6, 2025
26
Can anybody help me with the time constant formula for second order RC cascaded Low pass filter with two different value resistro and capacitor ?
 

LvW

Joined Jun 13, 2013
2,030
Can anybody help me with the time constant formula for second order RC cascaded Low pass filter with two different value resistro and capacitor ?
If I've counted correctly, this thread contains nearly 50 responses to your original question - and now you're asking if anyone can help you?
Or do you have a new problem?
 

MrAl

Joined Jun 17, 2014
13,708
Can anybody help me with the time constant formula for second order RC cascaded Low pass filter with two different value resistro and capacitor ?
An overdamped second order system would have a step response:
Vs=1/(s*(s+a)*(s+b))

you can solve for a and b from:
a=wn*(df+sqrt(df^2-1))
b=wn*(df-sqrt(df^2-1))
where wn is the natural frequency and df is the damping factor.

You can use partial fractions to convert:
Vs=1/(s*(s+a)*(s+b))
into:
Vs=A1/s+B1/(s+2)+C1/(s+5)
where
A1 will be 1, and solve for B1 and C1, then:
A=-B1 and B=-C1 for the time response:

The time response will be of the form:
Vt=1-A*e^(-a*t)-B*e^(-b*t)

The time constants assuming you want these would be 1/a and 1/b.

That looks right but we can go over an example if you like.

If you wanted to match the voltage at the time when it reaches 0.632, then you would set Vt=0.632 and go from there. That would give you one time constant, but I am not sure if that is what you are looking for either.
 
Top