You are not logged in.

#1 2006-10-13 18:25:16

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

ngspice: plot decibels

I'm hoping there is a SPICE guru around here somewhere... I'm using ngspice to simulate a circuit I'm designing for my uni project, and I would like to plot things like the frequency response of the circuit against decibels instead of against voltage (which it does just now).  Does anyone know how to do this?  I know that Gain(decibels) = 20Log(Vout/Vin), so if anyone can tell me how to get plot to do this, it'd be great.

Cheers.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

#2 2006-10-13 20:02:14

bboozzoo
Member
From: Poland
Registered: 2006-08-01
Posts: 125

Re: ngspice: plot decibels

I am not sure if I understand your question correctly. The frequency response is anything like voltage/current/gain (any unit here) vs frequency (which most commonly will be in logarithmic scale). So for your circuit you should use:

.ac dec 10 1 <high>
.plot ac vdb(output node) xlog
(not sure about VDB and xlog, haven't used spice for a while), at input you need to connect some AC voltage, sine would be ok.

Offline

#3 2006-10-13 20:52:06

chrismortimore
Member
From: Edinburgh, UK
Registered: 2006-07-15
Posts: 655

Re: ngspice: plot decibels

Cheers, I'll look into it.  From what I read so far in the spice manual, "vdb" does seem to be what I'm after.


Desktop: AMD Athlon64 3800+ Venice Core, 2GB PC3200, 2x160GB Maxtor DiamondMax 10, 2x320GB WD Caviar RE, Nvidia 6600GT 256MB
Laptop: Intel Pentium M, 512MB PC2700, 60GB IBM TravelStar, Nvidia 5200Go 64MB

Offline

Board footer

Powered by FluxBB