How to perform pole zero analysis with spice3f?

Jan 04, 2007 42 Replies

Le Thu, 11 Jan 2007 20:18:10 +0100, Helmut Sennewald a écrit :

Yes you're right Helmut, there is an error when lauching ngspice in batch-mode, but in interactive mode, PZ analysis work with print all command, believe me. Just read documentation about PZ analysis within ngspice (? .pz and ? .print).

See what i did with the (very simple) Hugo's circuit :

habib@aldebaran:~/GNU-TOOLS/ng-spice-rework-17/tests/polezero$ ngspice ......

ngspice 425 -> source test.cir

Circuit: test

ngspice 426 -> pz 1 0 3 0 vol pz Doing analysis at TEMP = 300.150000 and TNOM = 300.150000

No. of Data Rows : 1 ngspice 427 -> print all pole(1) = -2.61803e+00,0.000000e+00 pole(2) = -3.81966e-01,0.000000e+00 zero(1) = -3.33333e-01,0.000000e+00 ngspice 428 ->

Cheers, Habib

I discovered a bug when running make after ./configure: /home/coolens/rommel/ng-spice-rework-17/src/frontend/misccoms.c:241: undefined reference to `history_file' collect2: ld returned 1 exit status make[3]: *** [ngspice] Error 1 make[3]: Leaving directory `/home/coolens/rommel/ng-spice-rework-17/src' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/home/coolens/rommel/ng-spice-rework-17/src' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/home/coolens/rommel/ng-spice-rework-17' make: *** [all] Error 2

There is a variable in src/frontend/misccoms.c, called history_file which is not referenced=20

regards,

hugo

When testing software I always start with _very_ simple circuits, the problems I'm facing with ngspice wouldn't disappear using a complex circuit...I suppose

I'm curious about the usefulness of PZ analysis.

Doesn't a Bode plot (with phase) tell you what you need to know?

Once upon a time (33 years ago) I had a need to convert Bode to PZ, to ease the quick making of active filters, but I see no need anymore.

...Jim Thompson

-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | |

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

snipped-for-privacy@gmail.com wrote: : I discovered a bug when running make after ./configure:

: There is a variable in src/frontend/misccoms.c, called history_file : which is not referenced

This is a bug. However, my question is: what configure options did you use? If you configure with --with-readline?

Stuart

Le Fri, 12 Jan 2007 07:54:06 -0700, Jim Thompson a écrit :

Hey Jim, the discussion was not about the usefullness of PZ, but the ability of ngpice to perform that kind of calculation.

PS : a man who enjoy wines is not a really bad man.

Of course not. I'm really a teddy-bear, except for my Genghis Khan tendencies ;-)

...Jim Thompson

| James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC\'s and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | | http://www.analog-innovations.com | 1962 | I love to cook with wine. Sometimes I even put it in the food.

./configure --with-readline=yes --enable-xspice

and to complete the picture: I use Debian Sarge and installed the following packages already trying to make install ngspice correctly: libxaw7-dev libreadline5-dev libreadline5-dbg

regards, hugo

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

Not in my experience with passive filter design. If you have a reasonably high-order filter (e.g., 4+), a bode plot shows up that your filter isn't behaving exactly as you want, but a pole-zero listing (or, better still, plot) makes it much more obvious how you have to change component values to get the filter response to be what you want it to be.

There's a filter design program out there -- NuHertz Filter, by Jeff Kahler, who's actually right down there in Phoenix with you -- that dynamically updatesa filter's response as you drag poles and zeroes around in the S plane; it's quite handy at times.

---Joel

What I want is to enter a pass-band, stop-band, ripple, etc., then have the program spit out groups of Laplace expressions, each with order no higher than 3 ;-)

...Jim Thompson

-- | James E.Thompson, P.E. | mens | | Analog Innovations, Inc. | et | | Analog/Mixed-Signal ASIC's and Discrete Systems | manus | | Phoenix, Arizona Voice:(480)460-2350 | | | E-mail Address at Website Fax:(480)460-2142 | Brass Rat | |

formatting link
| 1962 | I love to cook with wine. Sometimes I even put it in the food.

"Jim Thompson" wrote in message news: snipped-for-privacy@4ax.com...

It'll spit out the complete transfer function, and you can then use Matlab or a freebie alternative to do the partial fraction decomposition into bi-quads or similar.

My conclusions so far concerning the current version of ngspice:"ng-spice-rework-17"

  1. There is a bug in the source concerning an unreferened variable history_file in src/frontend/misccoms.c
  2. The versions I got working do perform pz analysis only in interactive mode When trying to perform pz analysis in batch mode i.e. "ngspice

"habib.bouaziz-viallet" schrieb im Newsbeitrag news: snipped-for-privacy@mynewsserverpostfix.com...

Hello Habib,

I have now installed Suse-Linux 10.2, downloaded NGSPICE and compiled it. The pz-analysis runs fine with your instructions. I compared the result of the PZ-analysis with the original circuit response in LTspice. E1 A 0 1 0 Laplace=(s+3.33333e-1)/((s+2.61803)*(s+3.81966e-1)) The Laplace version with the values from the PZ-analysis match perfectly the result from the circuit with the resistors and capacitors. (The difference is only a contant factor of 3 in the absolute amplitude.) I also tried a more difficult example with R1 replaced by an inductor with

1H. The result from the pz-analysis also matched the result from the circuit.

Habib, again thanks for your outstanding help.

Best regards, Helmut

can you try to run it in batch mode too? ngspice

Hello Hugo,

NGSPICE failed to run the PZ-analysis in batch mode.

ngspice > I compared the result of the PZ-analysis with the original circuit

Thanks for this idea.

I don't have a real need for PZ-analysis until now, but I think it's a good educational feature and it seems to work very well with NGSPICE.

Best regards, Helmut

snipped-for-privacy@gmail.com wrote: : My conclusions so far concerning the current version of : ngspice:"ng-spice-rework-17"

: 1. There is a bug in the source concerning an unreferened variable : history_file in src/frontend/misccoms.c

: 2. The versions I got working do perform pz analysis only in : interactive mode : When trying to perform pz analysis in batch mode i.e. "ngspice :

Le Sun, 14 Jan 2007 00:57:00 +0100, Helmut Sennewald a écrit :

I have heard about LTSpice. Since you're running Linux, please point me somewhere i can download/install LTSpice package. After gooooogling LTSpice Linux, i have no precise informations about.

Since i'm using ngspice for years, i'm please to help ng-spice users.

Habib

I'm trying know to plot the pole zero diagram like this: source inputfile run plot pole(1) pole(2) ylimit -1 1 xlimit -10 0

I hoped to see the poles displayed with a "x" and the zero with a "o" Unfortunately that seems not the way to do it. I do get a grid with the correctly scaled axis but I can't distinguish the poles and zeroes on it. Is this possible with ngspice?

regards, hugo

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required