Author Topic: SPICE - Measuring impedance and phase  (Read 7335 times)

0 Members and 1 Guest are viewing this topic.

Offline ChryseusTopic starter

  • Regular Contributor
  • *
  • Posts: 87
  • Country: gb
    • My Website
SPICE - Measuring impedance and phase
« on: July 01, 2011, 09:28:28 pm »
Hey guys, I've started playing around with ngspice and LTspice and have been wondering how to do
input / output impedance measurement along with phase shift.

I've made a quick series RCL circuit that I've already worked out on paper, for a signal of 1MHz the
impedance should be 1004.63 ohms with a phase angle of -5.5 degrees.

Code: [Select]
RCL Impedance Test
V1 1 0 AC 1 DC 1
Vamm 1 2 AC 0 DC 0
R1 2 3 1k
C1 3 4 1nF
L1 4 0 10uH
.ac lin 2 1meg 1meg
.end

I have already worked out how to measure the input impedance with Z = V(1)/I(Vamm) which
works fine in LTspice but I get a rather odd result of 1009.279 ohms in ngspice.

I'm also not quite sure how to measure the phase or output impedance, Vamm in LTspice shows
5.5 degrees imaginary but I don't think that is right seeing as it is positive rather than negative.

Help would be very much appreciated.  :)
 

Offline Bored@Work

  • Super Contributor
  • ***
  • Posts: 3932
  • Country: 00
Re: SPICE - Measuring impedance and phase
« Reply #1 on: July 01, 2011, 10:36:05 pm »
See V(out) in attachment.
I delete PMs unread. If you have something to say, say it in public.
For all else: Profile->[Modify Profile]Buddies/Ignore List->Edit Ignore List
 

Offline ChryseusTopic starter

  • Regular Contributor
  • *
  • Posts: 87
  • Country: gb
    • My Website
Re: SPICE - Measuring impedance and phase
« Reply #2 on: July 01, 2011, 10:51:00 pm »
See V(out) in attachment.

Thanks mate that is very helpful, now all I need to do is figure out how to measure phase properly
and stop ngspice giving odd results.

edit
Never mind I got it all working now, I used the example you gave me and moved the constant current source to the input
which easily gives the input impedance and phase, ngspice is still giving garbage data though.
« Last Edit: July 01, 2011, 11:08:33 pm by Chryseus »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf