Index: trunk/doc/tutorial/simulation/raw/06_passive_ac.html =================================================================== --- trunk/doc/tutorial/simulation/raw/06_passive_ac.html (nonexistent) +++ trunk/doc/tutorial/simulation/raw/06_passive_ac.html (revision 7843) @@ -0,0 +1,84 @@ + + +

Freqency domain simulation: ac

+ +

Scope

+

+In this simulation we are going to look at how a multi-stage RC filter behaves +when stimulated with different frequency sine waves. + +

The schematics

+

+The single-sheet schematics contains the filter, the voltage source and +spice command symbol. +

+

+ +
Click the image to get the sch-rnd sheet
+

+ +

SPICE: what an ac simulation is

+

+In the ac analysis the simulation a DC solution is calculated first +then a small signal sinusoidal stimulus is applied over a range of +frequencies. The result is typically a graph with frequency on the X axis +and gain or phase on the Y axis. The AC analysis is often used to get +a transfer function. + +

Preparing for simulation

+ +

V1

+

+In our example, V1 specifies an 1V AC signal with a DC component of 0V +on the in network. The syntax for this is (see in V1's spice/params): +

+dc 0 ac 1
+
+

+The frequency of the ac component is not specified because that will be +varied over a range by the analysis command. + +

Raw spice commands

+

+It contains the following script: +

+ac dec 10 1 100k
+
+settype decibel out
+plot vdb(out) xlimit 1 100k ylabel 'small signal gain'
+
+settype phase out
+plot cph(out) xlimit 1 100k ylabel 'phase (in rad)'
+
+let outd = 180/PI*cph(out)
+settype phase outd
+plot outd xlimit 1 100k ylabel 'phase (in deg)'
+
+

+The first line instructs spice to do the "ac analysis" in decade variation +mode (dec 10), to get a decade logarithmic output with 10 points in each +decade. It then specifies the range of interest for frequencies: anything +between 1 Hz and 100 kHz. +

+Then come three plots. The first is the output voltage in decibels, on +a logarithmic Y scale. Then the phase shift of the circuit, in radian +and converted to degrees. + +

Export and run ngspice

+

+Because of the plot commands the output is a set of drawing (if ngspice is ran +on X): three graphs with one curve each. +

+ +

+ +

+ + + +

Using other implementations

+

gnucap

+ +

xyce

+

+TODO Index: trunk/doc/tutorial/simulation/raw/06_passive_ac1.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/tutorial/simulation/raw/06_passive_ac1.png =================================================================== --- trunk/doc/tutorial/simulation/raw/06_passive_ac1.png (nonexistent) +++ trunk/doc/tutorial/simulation/raw/06_passive_ac1.png (revision 7843) Property changes on: trunk/doc/tutorial/simulation/raw/06_passive_ac1.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/doc/tutorial/simulation/raw/06_passive_ac2.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/tutorial/simulation/raw/06_passive_ac2.png =================================================================== --- trunk/doc/tutorial/simulation/raw/06_passive_ac2.png (nonexistent) +++ trunk/doc/tutorial/simulation/raw/06_passive_ac2.png (revision 7843) Property changes on: trunk/doc/tutorial/simulation/raw/06_passive_ac2.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property Index: trunk/doc/tutorial/simulation/raw/06_passive_ac3.png =================================================================== Cannot display: file marked as a binary type. svn:mime-type = application/octet-stream Index: trunk/doc/tutorial/simulation/raw/06_passive_ac3.png =================================================================== --- trunk/doc/tutorial/simulation/raw/06_passive_ac3.png (nonexistent) +++ trunk/doc/tutorial/simulation/raw/06_passive_ac3.png (revision 7843) Property changes on: trunk/doc/tutorial/simulation/raw/06_passive_ac3.png ___________________________________________________________________ Added: svn:mime-type ## -0,0 +1 ## +application/octet-stream \ No newline at end of property