Using Other AC Analysis Statements

This section describes how to use other AC analysis statements.

.DISTO Statement -- AC Small-Signal Distortion Analysis

The .DISTO statement causes Star-Hspice to compute the distortion characteristics of the circuit in an AC small-signal, sinusoidal, steady-state analysis.The program computes and reports five distortion measures at the specified load resistor. The analysis is performed assuming that one or two signal frequencies are imposed at the input. The first frequency, F1 (used to calculate harmonic distortion), is the nominal analysis frequency set by the .AC statement frequency sweep. The optional second input frequency, F2 (used to calculate intermodulation distortion), is set implicitly by specifying the parameter skw2, which is the ratio F2/F1.

 

DIM2

Intermodulation distortion, difference. The relative magnitude and phase of the frequency component (F1 - F2).

DIM3

Intermodulation distortion, second difference. The relative magnitude and phase of the frequency component (2 · F1 - F2).

HD2

Second-order harmonic distortion. The relative magnitude and phase of the frequency component 2 · F1 (ignoring F2).

HD3

Third-order harmonic distortion. The relative magnitude and phase of the frequency component 3 · F1 (ignoring F2).

SIM2

Intermodulation distortion, sum. The relative magnitude and phase of the frequency component (F1 + F2).

 

The .DISTO summary report includes a set of distortion measures for each contributing component of every element, a summary set for each element, and a set of distortion measures representing a sum over all the elements in the circuit.

Syntax

.DISTO Rload <inter <skw2 <refpwr <spwf>>>>

where:

 

Rload

The resistor element name of the output load resistor into which the output power is fed

inter

Interval at which a distortion-measure summary is to be printed. Specifies a number of frequency points in the AC sweep (see the np parameter in Using the .AC Statement).

 

If inter is omitted or set to zero, no summary printout is made. In this case, the distortion measures can be printed or plotted with the .PRINT or .PLOT statement.

 

If inter is set to 1 or higher, a summary printout is made for the first frequency, and once for each inter frequency increment thereafter.

 

To obtain a summary printout for only the first and last frequencies, set inter equal to the total number of increments needed to reach fstop in the .AC statement. For a summary printout of only the first frequency, set inter to greater than the total number of increments required to reach fstop.

skw2

Ratio of the second frequency F2 to the nominal analysis frequency F1. The acceptable range is 1e-3 < skw2 <= 0.999. If skw2 is omitted, a value of 0.9 is assumed.

refpwr

Reference power level used in computing the distortion products. If omitted, a value of 1mW, measured in decibels magnitude (dbM), is assumed. The value must be >= 1e-10.

spwf

Amplitude of the second frequency F2. The value must be >= 1e-3. Default = 1.0.

Example

.DISTO RL 2 0.95 1.0E-3 0.75

Only one distortion analysis is performed per simulation. If more than one .DISTO statement is found, only the last is performed.


NOTE: The summary printout from the distortion analysis for each frequency listed is extensive. Use the "inter" parameter in the .DISTO statement to limit the amount of output generated.

.NOISE Statement -- AC Noise Analysis

Syntax

.NOISE ovv srcnam inter

where:

 

ovv

Nodal voltage output variable defining the node at which the noise is summed

srcnam

Name of the independent voltage or current source to be used as the noise input reference

inter

Interval at which a noise analysis summary is to be printed, inter specifies a number of frequency points summary in the AC sweep. If inter is omitted or set to zero, no summary printout is made. If inter is equal to or greater than one, a summary printout is made for the first frequency, and once for each inter frequency increment thereafter.

Example

.NOISE V(5) VIN 10

The .NOISE statement, used in conjunction with the AC statement, controls the noise analysis of the circuit.

Noise Calculations

The noise calculations in Star-Hspice are based on the complex AC nodal voltages, which in turn are based on the DC operating point. Noise models are described for each device type in the appropriate chapter in Volume II. A noise source is not assumed to be statistically correlated to the other noise sources in the circuit; each noise source is calculated independently. The total output noise voltage is the RMS sum of the individual noise contributions:

 

where:

 

onoise

Total output noise

I

Equivalent current due to thermal noise, shot or flicker noise

Z

Equivalent transimpedance between noise source and the output

n

Number of noise sources associated with all resistors, MOSFETs, diodes, JFETs, and BJTs

The equivalent input noise voltage is the total output noise divided by the gain or transfer function of the circuit. The contribution of each noise generator in the circuit is printed for each inter frequency point. The output and input noise levels are normalized with respect to the square root of the noise bandwidth, and have the units volts/Hz1/2 or amps/Hz1/2.

You can simulate flicker noise sources in the noise analysis by including values for the parameters KF and AF on the appropriate device model statements.

Use the .PRINT or .PLOT statement to print or plot the output noise and the equivalent input noise.

You can only perform one noise analysis per simulation. If more than one NOISE statement is present, only the last one is performed.

.SAMPLE Statement -- Noise Folding Analysis

For data acquisition of analog signals, data sampling noise often needs to be analyzed. This is accomplished with the .SAMPLE statement used in conjunction with the .NOISE and .AC statements.

The SAMPLE analysis causes Star-Hspice to perform a simple noise folding analysis at the output node.

Syntax

.SAMPLE FS = freq <TOL = val> <NUMF = val> <MAXFLD = val>
+ <BETA = val>

where:

 

FS = freq

Sample frequency, in Hertz

TOL

Sampling error tolerance: the ratio of the noise power in the highest folding interval to the noise power in baseband. Default = 1.0e-3.

NUMF

Maximum allowed number of user-specified frequencies. The algorithm requires approximately ten times this number of internally generated frequencies, so it should be kept small. Default = 100.

MAXFLD

Maximum allowed number of folding intervals. The highest frequency (in Hertz) considered by the algorithm is given by:

FMAX = MAXFLD · FS

Default = 10.0.

BETA

Integrator duty cycle; specifies an optional noise integrator at the sampling node

BETA = 0 no integrator
BETA = 1 simple integrator (default)

If the integrator is clocked (that is, it only integrates during a fraction of the sampling interval 1/FS), then BETA should be set to the duty cycle of the integrator.

.NET Statement - AC Network Analysis

The .NET statement computes the parameters for the impedance matrix Z, the admittance matrix Y, the hybrid matrix H, and the scattering matrix S. The input impedance, output impedance, and admittance are also computed. This analysis is a part of the AC small-signal analysis. Therefore, network analysis requires the specification of the AC statement frequency sweep.

Syntax

One-port network:

.NET input <RIN = val>

or

.NET input <val >

Two-port network:

.NET output input <ROUT = val> <RIN = val>

where:

 

input

AC input voltage or current source name

output

Output port. It can be an output voltage, V(n1,n2), or an output current, I(source), or I(element).

RIN

Input or source resistance keyword. The RIN value is used to calculate the output impedance and admittance, and also the scattering parameters. The RIN value defaults to 1 ohm.

ROUT

Output or load resistance keyword. The ROUT value is used to calculate the input impedance and admittance, and also the scattering parameters. The ROUT value defaults to 1 ohm.

Example

One-port network:

.NET		VINAC		RIN = 50
.NET		IIN		RIN = 50

Two-port network:

.NET  V(10,30)  VINAC   ROUT = 75   RIN = 50
.NET  I(RX)     VINAC   ROUT = 75   RIN = 50

AC Network Analysis - Output Specification

Syntax

Xij(z), ZIN(z), ZOUT(z), YIN(z), YOUT(z)

where:

 

X

Specifies Z for impedance, Y for admittance, H for hybrid, and S for scattering

ij

i and j can be 1 or 2. They identify which matrix parameter is to be printed.

z

Output type:

  • R: real part
  • I: imaginary part
  • M: magnitude
  • P: phase
  • DB: decibel
  • T: group time delay

ZIN

Input impedance. For the one port network, ZIN, Z11 and H11 are the same.

ZOUT

Output impedance

YIN

Input admittance. For the one port network, YIN and Y11 are the same.

YOUT

Output admittance

If "z" is omitted, output includes the magnitude of the output variable.

Example
.PRINT  AC Z11(R)  Z12(R)  Y21(I)  Y22 S11 S11(DB) Z11(T)
.PRINT  AC ZIN(R) ZIN(I) YOUT(M) YOUT(P) H11(M) H11(T)
.PLOT   AC S22(M) S22(P) S21(R) H21(P) H12(R) S22(T)

Bandpass Netlist: Goyal, Ravender. "S-Parameter Output From SPICE Program", MSN & CT, February 1988, pp. 63 and 66. Star-Hspice Network Analysis Results

*FILE: FBP_1.SP
.OPTIONS DCSTEP = 1 POST
*BAND PASS FILTER
C1  IN   2   3.166PF
L1  2    3   203NH
C2  3    0   3.76PF
C3  3    4   1.75PF
C4  4    0   9.1PF
L2  4    0  36.81NH
C5  4    5   1.07PF
C6  5    0   3.13PF
L3  5    6 233.17NH
C7  6    7   5.92PF
C8  7    0   4.51PF
C9  7    8   1.568PF
C10 8    0   8.866PF
L4  8    0  35.71NH
C11 8    9   2.06PF
C12 9    0   4.3PF
L5  9   10 200.97NH
C13 10 OUT   2.97PF
RX  OUT  0   1E14
VIN IN   0   AC 1
.AC LIN 41 200MEG 300MEG
.NET V(OUT) VIN ROUT = 50 RIN = 50
.PLOT AC S11(DB) (-50,10) S11(P) (-180,180)
.PLOT AC ZIN(M) (5,130) ZIN(P) (-90,90)
.END
Figure 12-2: S11 Magnitude and Phase Plots
Figure 12-3: ZIN Magnitude and Phase Plots

NETWORK Variable Specification

Star-Hspice uses the results of AC analysis to perform network analysis. The .NET statement defines the Z, Y, H, and S parameters to be calculated.

The following list shows various combinations of the .NET statement for network matrices that are initially calculated in Star-Hspice:

1) .NET Vout Isrc V = [Z] [I]

2) .NET Iout Vsrc I = [Y] [V]

3) .NET Iout Isrc [V1 I2] T = [H] [I1 V2] T

4) .NET Vout Vsrc [I1 V2] T = [S] [V1 I2] T

( [M ] T represents the transpose of matrix M )


NOTE: The preceding list does not mean that combination (1) must be used for calculating the Z parameters. However, if .NET Vout Isrc is specified, Star-Hspice initially evaluates the Z matrix parameters and then uses standard conversion equations to determine the S parameters or any other requested parameters.

The example in Parameters with .NET V(2) Isrc shows the importance of the variables used in the .NET statement. Here, Isrc and Vce are the DC biases applied to the BJT.

Figure 12-4: Parameters with .NET V(2) Isrc

This .NET statement provides an incorrect result for the Z parameters calculation:

.NET V(2) Isrc

When Star-Hspice performs AC analysis, all the DC voltage sources are shorted and all the DC current sources are open-circuited. As a result, V(2) is shorted to ground, and its value is zero for AC analysis, directly affecting the results of the network analysis. When Star-Hspice attempts to calculate the Z parameters Z11 and Z21, defined as Z11 = V1/I1 and Z21 = V2/I1 with I2=0, the requirement that I2 must be zero is not satisfied in the circuit above. Instead, V2 is zero, which results in incorrect values for Z11 and Z21.

The correct biasing configurations for performing network analysis for Z, Y, H, and S parameters are shown in Network Parameter Configurations.

 

Figure 12-5: Network Parameter Configurations

As an example, the H parameters are calculated by using the .NET statement.

.NET I(VC) IB

Here, VC denotes the voltage at node C, the collector of the BJT. With this statement, Star-Hspice calculates the H parameters immediately after AC analysis. The H parameters are calculated by:


 

For Hybrid parameter calculations of H11 and H21, V2 is set to zero (due to the DC voltage source VCE), while for H12 and H22 calculations, I1 is set to zero (due to the DC current source IB). Setting I1 and V2 equal to zero precisely meets the conditions of the circuit under examination; namely, that the input current source is open circuited and the output voltage source is shorted to ground.

External DC biases applied to a BJT can be driven by a data file of measured results. In some cases, not all of the DC currents and voltages at input and output ports are available. When performing network analysis, examine the circuit and select suitable input and output variables to obtain correctly calculated results. The following examples demonstrate the network analysis of a BJT using Star-Hspice.

Network Analysis Example: Bipolar Transistor

BJT network analysis
.option  nopage list
+ newtol reli = 1e-5 absi = 1e-10 relv = 1e-5 relvdc = 1e-7
+ nomod post gmindc = 1e-12
.op
.param vbe = 0 ib = 0 ic = 0 vce = 0
 
$ H-parameter
.NET i(vc) ibb rin = 50 rout = 50
ve    e   0        0                   
ibb   0   b        dc = 'ib' ac = 0.1
vc    c   0        'vce'   
q1    c   b  e 0   bjt
 
.model bjt  npn  subs = 1
+ bf = 1.292755e+02 br = 8.379600e+00
+ is = 8.753000e-18 nf = 9.710631e-01 nr = 9.643484e-01
+ ise = 3.428000e-16 isc = 1.855000e-17 iss = 0.000000e+00
+ ne = 2.000000e+00 nc = 9.460594e-01 ns = 1.000000e+00
+ vaf = 4.942130e+01 var = 4.589800e+00
+ ikf = 5.763400e-03 ikr = 5.000000e-03 irb = 8.002451e-07
+ rc = 1.216835e+02 rb = 1.786930e+04 rbm = 8.123460e+01
+ re = 2.136400e+00
+ cje = 9.894950e-14 mje = 4.567345e-01 vje = 1.090217e+00
+ cjc = 5.248670e-14 mjc = 1.318637e-01 vjc = 5.184017e-01
+ xcjc = 6.720303e-01
+ cjs = 9.671580e-14 mjs = 2.395731e-01 vjs = 5.000000e-01
+ tf = 3.319200e-11 itf = 1.457110e-02 xtf = 2.778660e+01 
+ vtf = 1.157900e+00 ptf = 6.000000e-05
+ xti = 4.460500e+00 xtb = 1.456600e+00 eg = 1.153300e+00
+ tikf1 = -5.397800e-03 tirb1 = -1.071400e-03
+ tre1 = -1.121900e-02 trb1 = 3.039900e-03 
+ trc1 = -4.020700e-03 trm1 = 0.000000e+00
 
.print ac par('ib') par('ic')
+ h11(m) h12(m) h21(m) h22(m)
+ z11(m) z12(m) z21(m) z22(m)
+ s11(m) s21(m) s12(m) s22(m)
+ y11(m) y21(m) y12(m) y22(m)
 
.ac Dec 10  1e6  5g  sweep  data = bias
 
 
.data bias
     vbe         vce            ib           ic    
 771.5648m    292.5047m      1.2330u    126.9400u  
 797.2571m    323.9037m      2.6525u    265.0100u  
 821.3907m    848.7848m      5.0275u    486.9900u  
 843.5569m      1.6596       8.4783u    789.9700u  
 864.2217m      2.4031      13.0750u      1.1616m  
 884.3707m      2.0850      19.0950u      1.5675m  
.enddata
.end

Other possible biasing configurations for the network analysis follow.

$S-parameter

.NET v(c) vbb rin = 50 rout = 50
ve   e 0      0                      
vbb  b 0      dc = 'vbe' ac = 0.1
icc  0 c      'ic'   
q1   c b e 0  bjt

$Z-parameter

.NET v(c) ibb rin = 50 rout = 50
ve  e 0       0
ibb  0 b      dc = 'ib' ac = 0.1  
icc  0 c      'ic'
q1  c b e 0   bjt

$Y-parameter

.NET i(vc) vbb rin = 50 rout = 50
ve  e 0      0                
vbb b 0      'vbe' ac = 0.1
vc  c 0      'vce'
q1  c b e 0  bjt
 
References

Goyal, Ravender. "S-Parameter Output From SPICE Program", MSN & CT, February 1988, pp. 63 and 66.

 

 

Star-Hspice Manual - Release 2001.2 - June 2001