Using G and E Elements

This section describes how to use the G and E Elements.

Laplace Transform Function Call

Use the Star-Hspice G and E Elements (controlled behavioral sources) as linear functional blocks or elements with specific frequency responses in the following forms:

The frequency response is called the impulse response and is denoted by H(s), where s is a complex frequency variable ( ). In Star-Hspice, the frequency response is obtained by performing an AC analysis with AC=1 in the input source (the Laplace transform of an impulse is 1). The input and output of the G and E Elements with specified frequency response are related by the expression:

 

where X, Y and H are the input, the output, and the transfer function at
frequency f.

For AC analysis, the frequency response is determined by the above relation at any frequency. For operating point and DC sweep analysis, the relation is the same, but the frequency is zero.

The transient analysis is more complicated than the frequency response. The output is a convolution of the input waveform with the impulse response h(t):

 

In discrete form, the output is

, k = 0, 1, 2, ...

where the h(t) can be obtained from H(f) by the inverse Fourier integral:

 

The inverse discrete Fourier transform is given by

, m = 0, 1, 2, ..., N-1

where N is the number of equally spaced time points and is the time interval or time resolution.

For the frequency response table form (FREQ) of the LAPLACE function, Star-Hspice`s performance-enhanced algorithm is used to convert H(f) to h(t). This algorithm requires N to be a power of 2. The frequency point f n is determined by

, n = 0, 1, 2, ..., N-1

where n > N/2 represents the negative frequencies. The Nyquist critical frequency is given by

 

Since the negative frequencies responses are the image of the positive ones, only N/2 frequency points are required to evaluate N time points of h(t). The larger f c is, the more accurate the transient analysis results are. However, for large f c , the becomes smaller, and computation time increases. The maximum frequency of interest depends on the functionality of the linear network. For example, in a low-pass filter, f c can be set to the frequency at which the response drops by 60 dB (a factor of 1000).

 

Once f c is selected or calculated, then can be determined by

 

Notice the frequency resolution

 

is inversely proportional to the maximum time (N· ) over which h(t) is evaluated. Therefore, the transient analysis accuracy also depends on the frequency resolution or the number of points (N).You can specify the frequency resolution DELF and maximum frequency MAXF in the G or E Element statement. N is calculated by 2·MAXF/DELF. Then, N is modified to be a power of 2. The effective DELF is determined by 2·MAXF/N to reflect the changes in N.

Laplace Transform

The syntax of the LAPLACE function is:

Transconductance H(s):

Gxxx n+ n- LAPLACE in+ in- k0, k1, ..., kn / d0,
+ d1, ..., dm

<SCALE=val> <TC1=val> <TC2=val> <M=val>

Voltage Gain H(s):

Exxx n + n - LAPLACE in + in - k 0 , k 1 , ..., k n / d 0 ,
+ d 1 , ..., d m

<SCALE=val> <TC1=val> <TC2=val>

H(s) is a rational function in the following form:

 

All the coefficients k0, k1, ..., d0, d1, ..., can be parameterized.

Example
Glowpass  0  out  LAPLACE  in  0   1.0 / 1.0  2.0  2.0  1.0
Ehipass out  0 LAPLACE  in  0   0.0,0.0,0.0,1.0 / 1.0,2.0,2.0,1.0

The Glowpass element statement describes a third-order low-pass filter with the transfer function

 

The Ehipass element statement describes a third-order high-pass filter with the transfer function

 

Pole-Zero Function

The syntax is:

Transconductance H(s):

Gxxx n+ n- POLE in+ in- a z1, fz1, ..., zn, fzn / b,
+ p1, fp1, ..., pm, fpm <SCALE=val> <TC1=val>
+ <TC2=val> <M=val>

Voltage Gain H(s):

Exxx n + n - POLE in + in - a z1, fz1, ..., zn, fzn / b,
+ p1, fp1, ..., pm, fpm <SCALE=val> <TC1=val>
+ <TC2=val>

H(s) in terms of poles and zeros is defined by:

 

Notice the complex poles or zeros are in conjugate pairs. In the element description, only one of them is specified, and the program includes the conjugate. The a, b, , and f values can be parameterized.

Example
Ghigh_pass 0 out POLE in 0 1.0 0.0,0.0 / 1.0 0.001,0.0
Elow_pass out 0 POLE in 0 1.0 / 1.0, 1.0,0.0 0.5,0.1379

The Ghigh_pass statement describes a high-pass filter with transfer function

 

The Elow_pass statement describes a low-pass filter with transfer function

 

Frequency Response Table

The syntax is:

Transconductance H(s):

Gxxx n+ n- FREQ in+ in- f 1 , a 1 , 1, ..., f i , a i , 1

+ <DELF=val> <MAXF=val> <SCALE=val> <TC1=val>

+ <TC2=val> <M=val> <LEVEL=val>

+ <INTERPOLATION=val> <EXTRAPOLATION=val>

+ <ACCURACY=val>

Voltage Gain H(s):

Exxx n+ n- FREQ in+ in- f 1 , a 1 , 1, ..., f i , a i , 1

+ <DELF=val> <MAXF=val> <SCALE=val> <TC1=val>
+ <TC2=val>

Each f i is a frequency point in hertz, a i is the magnitude in dB, and 1 is the phase in degrees. At each frequency the network response, magnitude, and phase are calculated by interpolation. The magnitude (in dB) is interpolated logarithmically as a function of frequency. The phase (in degrees) is interpolated linearly as a function of frequency.

 

 

Example
Eftable  output   0  FREQ  input   0   
+  1.0k   -3.97m   293.7
+  2.0k   -2.00m   211.0
+  3.0k   17.80m   82.45
+  ...	...	...
+ 10.0k  -53.20    -1125.5

The first column is frequency in hertz, the second is magnitude in dB, and third is phase in degrees. The LEVEL must be set to 1 for a high-pass filter, and the last frequency point must be the highest frequency response value that is a real number with zero phase. The frequency, magnitude, and phase in the table can be parameterized.

Element Statement Parameters

These keywords are common to the three forms, Laplace, pole-zero, and frequency response table described above.

ACCURACY Used only in G element with frequency response table.

0: default. The most accurate control voltage at each time point is achieved by linear interpolation of closest 2 time points

1: faster mode. The control voltage at each time point is determined from the simulated time point just before the target. The smaller the time step is set, the closer the result will be to the most accurate mode.

2: method used in release 2000.4 and prior.

DELF, DELTA Frequency resolution f. The inverse of DELF is the time window over which h(t) is calculated from H(s). The smaller DELF is, the more accurate the transient analysis, and the longer the CPU time. The number of points, N, used in the conversion of H(s) to h(t) is N=2·MAXF/DELF. Since N must be a power of 2, the DELF is adjusted. The default is 1/TSTOP. In G element with FREQ and ACCURACY = 0 or 1, circular convolution for periodic input will be done by limiting the period by setting DELF = 1/T :T < TSTOP.

EXTRAPOLATION Extrapolation scheme used only in G element with frequency response table.

0: default. Linear interpolation using the last two boundary points

1: the last boundary point is used

FREQ Keyword to indicate that the transfer function is described by a frequency response table. Do not use FREQ as a node name in a G or E Element.

INTERPOLATION Interpolation scheme used only in G element with frequency response table.

0: default. piece wise linear

1: piece wise step

2: b-spline curve fit

LAPLACE Keyword to indicate the transfer function is described by a Laplace transform function. Do not use LAPLACE as a node name on a G or E Element.

LEVEL Used only in elements with frequency response table. This parameter must be set to 1 if the element represents a high-pass filter.

M G Element multiplier. This parameter is used to represent M G Elements in parallel. Default is 1.

MAXF, MAX Maximum or the Nyquist critical frequency. The larger the MAXF the more accurate the transient results and the longer is the CPU time. The default is . Thee parameters are applicable only when the FREQ parameter is also used.

POLE Keyword to indicate the transfer function is described by the pole and zero location. Do not use POLE as a node name on a G or E Element.

SCALE Element value multiplier

TC1,TC2 First- and second-order temperature coefficients. The default is zero. The SCALE is updated by temperature:

Notes

Laplace Band-Reject Filter

This example models an active band-reject filter Williams, Arthur B., and Taylor, Fred J. Electronic Filter Design Handbook. New York: McGraw-Hill, 1988, pp. 6-20 to 6-23. with 3-dB points at 100 and 400 Hz and greater than 35 dB of attenuation between 175 and 225 Hz. The band-reject filter is made up of low-pass and high-pass filters and an adder. The low-pass and high-pass filters are fifth order Chebyshev with a 0.5-dB ripple.

 

Figure 29-1: Band-Reject Filter
Example
BandstopL.sp band_reject filter
.OPTIONS PROBE POST=2
.AC DEC 50 10 5k
.PROBE AC VM(out_low) VM(out_high) VM(out) 
.PROBE AC VP(out_low) VP(out_high) VP(out) 
.TRAN .01m 12m 
.PROBE V(out_low) V(out_high) V(out)
.GRAPH v(in)  V(out)
Vin in 0 AC 1 SIN(0,1,250)
Band_Reject Filter Circuit
Elp3 out_low3  0  LAPLACE  in 0
+ 1 / 1 6.729m 15.62988u 27.7976n
Elp  out_low   0  LAPLACE  out_low3 0
+ 1 / 1 0.364m 2.7482u
Ehp3 out_high3 0  LAPLACE  in 0 
+ 0,0,0,9.261282467p /
+ 1,356.608u,98.33419352n,9.261282467p
Eph  out_high  0  LAPLACE  out_high3 0 
+ 0 0 144.03675n / 1 83.58u 144.03675n  
Eadd   out 0  VOL='-V(out_low) - V(out_high)'
Rl out 0 1e6
.END

 

Figure 29-2: Frequency Response of the Band-Reject Filter

 

Figure 29-3: Transient Response of the Band-Reject Filter to a 250 Hz Sine Wave

Laplace Low-Pass Filter

This example simulates a third-order low-pass filter with a Butterworth transfer function, comparing the results of the actual circuit and the functional G Element with third-order Butterworth transfer function for AC and transient analysis.

 

Figure 29-4: Third-Order Active Low-Pass Filter

The third-order Butterworth transfer function that describes the above circuit is:

 

The following is the input listing of the above filter. Notice the pole locations are parameterized on the G Element. Also, only one of the complex poles is specified. The conjugate pole is derived by the program. The output of the circuit is node "out" and the output of the functional element is "outg".

Example

This is an example of a third-order low-pass Butterworth filter:

Low_Pass.sp 3rd order low-pass Butterworth
.OPTIONS  POST=2 PROBE INTERP=1 DCSTEP=1e8
.PARAM a=1.0 b=1.0 ap1=1.0 fp1=0.0 ap2=0.5 fp2=0.1379
.AC DEC 25 0.01 10
.PROBE AC VDB(out) VDB(outg) VP(out) VP(outg) 
.TRAN .5 200 
.PROBE V(in) V(outg) V(out)
.GRAPH  V(outg) V(out)
VIN in 0  AC 1   PULSE(0,1,0,1,1,48,100)
* 3rd order low-pass described by G Element
Glow_pass 0 outg POLE in 0 a / b ap1,fp1 ap2,fp2
Rg outg 0 1
Circuit Description
R1 in 2 1
R2 2  3 1
R3 3  4 1
C1 2  0 1.392
C2 4  0 0.2024
C3 3  out 3.546
Eopamp out 0   OPAMP  4 out 
.END
 

 

Figure 29-5: Frequency Response of Circuit and Functional Element

 

Figure 29-6: Transient Response of Circuit and Functional Element to a Pulse

Circular Convolution Example

This example simulates a 30 degree phase shift filter using circular convolution. By setting DELF = 10MHz, the period of time domain response of the G element which will be obtained by IFFT based on input frequency table will be set to 100n seconds. FREQ G element performs convolution integral from t - T to t assuming that all the control voltage at t<0 is zero. Here, t is the target time point and T is the period of time domain response of the G element.

In this example, during time point is from 0 to 100n seconds, higher than 10MHz harmonics components due to input transition at t=0 is taken. So the circuit does not behave as a phase shift filter. After one period (t>100n seconds), circular convolution based on 100n seconds period will be performed and the transient result represents 30 degree phase shift for continuous periodic control voltage.

Notes

30 Degree Phase Shift Circuit File

This example illustrates a 30 degree phase shift filter.

.tran 0.1n 300n

.options post=2 ingold=2 accurate

 

Vctrl ctrl gnd sin (0 1 10e6)

 

Gtest gnd test freq ctrl gnd

+ 1.0e00 0 30

+ 1.0e01 0 30

+ 1.0e02 0 30

+ 1.0e03 0 30

+ 1.0e04 0 30

+ 1.0e05 0 30

+ 1.0e06 0 30

+ 1.0e07 0 30

+ 1.0e08 0 30

+ 1.0e09 0 30

+ 1.0e10 0 30

+ MAXF=1.0e9 DELF=10e6

 

Rtest test gnd 1

 

Iexpected gnd 3 sin (0 1 10e6 0 0 30)

Vmes 2 3 expected 0v

Rexpected expected gnd 1

.end

Figure 29-7: Transient Response of the 30 Degree Phase Shift Filter

 

Star-Hspice Manual - Release 2001.2 - June 2001