1
\$\begingroup\$

I have the following low pass filter:

schematic

simulate this circuit – Schematic created using CircuitLab

When simulating through Circuitlab, I get the following phase response (I think you should be able to get this by simulating the linked circuit, If I embedded it correctly):

enter image description here

This looks consistent with what I directly calculated the phase response to be: \$ \phi = arctan(\frac{-2 \omega RC}{1-\omega ^2 (R C)^2}) \$. The full transfer function is \$ H(\omega) = \frac{1}{1- \omega ^2 (R C)^2 + 2 j \omega R C} \$. (Both resistors and capacitors are the same).

However if I use the bode plot function in MATLAB, I get the following phase response:

enter image description here

I'm given that the second plot is correct but I'm not sure why there's a difference in the simulation result and MATLAB result. Possibly I made some errors in setting up the simulation but I've used component values chosen by the solution to this design question.

I've also tried using calculators like Desmos to directly plot the phase response but it looks different from both the simulation and MATLAB result, but a bit more like the simulation.

Did I make an error in the transfer function, circuit simulation setup, etc?

MATLAB code:

R = 3900;
C = 0.0102*10^(-6);
H = tf([1],[R^2*C^2, 2*R*C, 1]);
bode(H);
\$\endgroup\$
3
  • \$\begingroup\$ Why don't you plot both over the same frequency range for a start. \$\endgroup\$ – Andy aka Jul 16 '20 at 9:21
  • \$\begingroup\$ @Andyaka I updated the plots. The MATLAB version does not include the step at ~180 kHz. \$\endgroup\$ – knzy Jul 16 '20 at 9:36
  • \$\begingroup\$ The step is irrelevant; -180.0000 degrees is +180.0000 degrees. You are being swayed of target by the step - it doesn't actually exist. \$\endgroup\$ – Andy aka Jul 16 '20 at 9:41
2
\$\begingroup\$

Basically two things: -

  • -180 degrees is the same as +180 degrees and you are seeing that step change as something important but it isn't. It's just a continuation of the phase as it passes from -180 degrees to +180 degrees
  • Your circuit simulator uses a real simulated op-amp hence there will be things about it (such as the phase shift extending past -180 degrees) that you won't see in your Matlab simulation (because you are not modelling an imperfect op-amp in Matlab).
\$\endgroup\$
1
  • 1
    \$\begingroup\$ Thank you for the response; I increased the GBW of the simulated op-amp and it looks like the output now matches the ideal transfer function within this frequency range. \$\endgroup\$ – knzy Jul 16 '20 at 9:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.