What causes this 360 phase shift at ~20khz?

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
In this simple common emitter stage there's an intentional pole at 10hz at the input and an intentional 180 phase shift due to the CE stage inverting gain stage but I want to understand what model parameter causes the 360 phase shift. Also, is this something I need to be concerned about? Rails are +/- 15V.

Here is the model:

.model mpsa18 npn (
+ Is=33.58f Xti=3 Eg=1.11 Vaf=100 Bf=2.365K Ne=1.579
+ Ise=166.7f Ikf=.1172 Xtb=1.5 Br=5.774 Nc=2 Isc=0 Ikr=0 Rc=1
+ Cjc=4.948p Mjc=.4109 Vjc=.75 Fc=.5 Cje=7.547p Mje=.3765 Vje=.75
+ Tr=800.3p Tf=310.1p Itf=.6 Vtf=6 Xtf=35 Rb=10)
 

Attachments

  • ce.png
    ce.png
    19 KB · Views: 210
  • phase.png
    phase.png
    43.3 KB · Views: 210
Are you asking why isn't the phase flat all the way past 20k?

Yes.

And this is not really a "graphing" issue, as it's displaying correctly, the simulation data points just change from negative to positive. This is what I would like an explanation on:

1.659587e+04 6.032661e-04 -3.14125e+00
1.698244e+04 5.895341e-04 -3.14127e+00
1.737801e+04 5.761147e-04 -3.14129e+00
1.778279e+04 5.630007e-04 -3.14131e+00
1.819701e+04 5.501853e-04 -3.14133e+00
1.862087e+04 5.376615e-04 -3.14135e+00
1.905461e+04 5.254229e-04 -3.14137e+00
1.949845e+04 5.134628e-04 -3.14138e+00
1.995262e+04 5.017750e-04 -3.14140e+00
2.041738e+04 4.903533e-04 -3.14142e+00
2.089296e+04 4.791915e-04 -3.14144e+00
2.137962e+04 4.682838e-04 -3.14146e+00
2.187762e+04 4.576244e-04 -3.14148e+00
2.238721e+04 4.472076e-04 -3.14150e+00
2.290868e+04 4.370279e-04 -3.14151e+00
2.344229e+04 4.270800e-04 -3.14153e+00
2.398833e+04 4.173585e-04 -3.14155e+00
2.454709e+04 4.078583e-04 -3.14157e+00
2.511886e+04 3.985743e-04 -3.14159e+00
2.570396e+04 3.895017e-04 3.141580e+00 <---change from - to +
2.630268e+04 3.806356e-04 3.141562e+00
2.691535e+04 3.719713e-04 3.141543e+00
2.754229e+04 3.635042e-04 3.141525e+00
2.818383e+04 3.552299e-04 3.141507e+00
2.884032e+04 3.471439e-04 3.141488e+00
2.951209e+04 3.392420e-04 3.141470e+00
3.019952e+04 3.315199e-04 3.141451e+00
3.090295e+04 3.239737e-04 3.141433e+00
3.162278e+04 3.165991e-04 3.141414e+00
3.235937e+04 3.093925e-04 3.141395e+00
3.311311e+04 3.023499e-04 3.141377e+00
 
Administrator
Joined 2004
Paid Member
There is no inherent reason in this circuit design or the model itself for this abrupt phase shift, it is an artifact of the simulation (software) itself.

I don't know what simulation software you are using but it is likely there is a configuration issue or math error.

Is Vee referenced to (spice) signal ground?
 
There is no inherent reason in this circuit design or the model itself for this abrupt phase shift, it is an artifact of the simulation (software) itself.

I don't know what simulation software you are using but it is likely there is a configuration issue or math error.

Is Vee referenced to (spice) signal ground?

I'm simulator i'm using is ngspice and yes vee is referenced to ground.
 
Administrator
Joined 2004
Paid Member
If you're using a PC running windows or linux (wine) try downloading and installing LTSpice IV which is free and very good. This should give you the expected result. I'm not familiar with ngspice so I can't advise as to what settings might be causing this result. What is the generator source you are using in the simulation? (sine source?)
 
If you're using a PC running windows or linux (wine) try downloading and installing LTSpice IV which is free and very good. This should give you the expected result. I'm not familiar with ngspice so I can't advise as to what settings might be causing this result. What is the generator source you are using in the simulation? (sine source?)

I'm running linux with linux compiled ngspice:

Ngspice circuit simulator - NEWS

In general this simulator is very good and I suspect it's something with either the model or some spice settings. Source is just a voltage source DC 0 AC 1. No time domain sinusoidal component.
 
When software outputs an angle it almost certainly comes from an arctan calculation, or something similar. Assuming you are dealing with normal angles, where 360 degrees = 0 degrees, then +180 and -180 are exactly the same thing. There is no sudden phase shift, just a smooth transition between 179 and 181 (=-179) or vice versa.

So this is not an artifact of the display or the calculation; it is simply a reflection of reality. That is how angles work! Some software can hide this reality from the user, by pretending that an angle greater than 360 is possible - but then the hiding is an artifact.
 
When software outputs an angle it almost certainly comes from an arctan calculation, or something similar. Assuming you are dealing with normal angles, where 360 degrees = 0 degrees, then +180 and -180 are exactly the same thing. There is no sudden phase shift, just a smooth transition between 179 and 181 (=-179) or vice versa.

So this is not an artifact of the display or the calculation; it is simply a reflection of reality. That is how angles work! Some software can hide this reality from the user, by pretending that an angle greater than 360 is possible - but then the hiding is an artifact.

In in the arctan function, there is some input in the arctan calculation that causes the output of arcan to go from -179.99 to 180.01 or something similar? Wouldn't that apply that there is a 3rd pole somewhere near 20khz? If so, why doesnt this show up in the gain plot? It's perfectly flat all the way out to 10MHz or 100MHz.
 
In AC analysis Spice opearates internaly with complex numbers (a+jb, where j^2=-1, see Complex number - Wikipedia, the free encyclopedia if You are not familiar with that). When You display magnitude or phase, then is computed from that complex numbers. Phase is computed using arctan function: phase=arctan(b/a) which always gives You value between -180deg and 180deg.

And also this is AC analysis, so is in frequency domain. There is no time delay, because there is no time. So there is no difference if phase is 365 deg or just 5deg. If You wanna see delay, use transient analysis. If there is really >360 phase shift (at some high frequency), You can see it(although it may be not so easy).
-------edit-------
In some commercial software phase is computed in way that it may exceed -180 - 180 boundaries - I don't know how it is done, but there is probably some simple trick. Mathematically there is no difference, just looks better on graphs.
 
Last edited:
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.