2008 IEEE Workshop on
Nonlinear Circuit Networks, Tokushima, Dec 5-6, 2008

A Spice-Oriented Frequency Domain
Peak Search Algorithm
Akiko Kusaka†, Takaaki Kinouchi†, Yoshihiro Yamagami†, Yoshifumi Nishio†, Akio Ushida‡†Department of Electrical and Electronic Engineering,
Tokushima University
Email: {kusaka, t-kino, yamagami, nishio}@ee.tokushima-u.ac.jp‡Department of Mechanical and Electronic Engineering,
Tokushima Bunri University
Email: ushida@fe.bunri-u.ac.jp

Then, the current iC is given by

I. I NTRODUCTION
In the peak search of the frequency characteristics, it isdifficult to find the peak for large scale circuits. If we carryout frequency analysis as changing the frequency, we haveto increase the frequency gradually. However, if the changing
step is large, we may miss the peaks. Also there is no guaranteethat the peak values exist at the frequencies.
In this article, we propose an algorithm to find the peak of
the frequency characteristics by using the Sine-Cosine circuit[1]-[3] and nonlinear limiter to control the step size of SPICE.
II. P EAK POINTS TRACING ALGORITHM

iC = CThus, the coefficients of sin ωt, cos ωt are described by
ILS = −ωCVLC ,Sine-Cosine
Circuitω

Differentiator Nonlinear limitterFig. 1.

Thus, the coefficients of sin ωt, cos ωt are described by
VLC = ωLILS(2, 3)

Namely, the inductance is replaced by coupled currentcontrolled voltage sources in the Sine-Cosine transformationof the HB method. In the same way, let the voltage across acapacitor C bevC = VCS sin ωt + VCC cos ωtPeak detector of frequency response curve.

Since ωs at the peak voltages satisfyd|Vk (ω)|= 0,dω(2.1)

diL= − ωLILC sin ωt + ωLILS cos ωt (2.2)
vL = Ldt
VLS = −ωLILC ,E(1)Then, the voltage vL is given by(3, 3)Node voltage

Now, let us discuss the Sine-Cosine circuit corresponding tothe determining equation of the HB method.
Let the current through an inductance L be
iL = ILS sin ωt + ILC cos ωt

ILC = ωCVLS

Namely, the capacitor is replaced by the coupled voltagecontrolled current sources in the Sine-Cosine transformation.
The circuit corresponding to the determining equation of theHB method is driven by a constant voltage E = J and ω isgiven by (1).

Although, for relative low Q circuits, the AC analysis ofSpice and a cubic spline combining Newton method can be
usefully applied to find out the peak points, it may passover the points for high Q circuits. Thus, we propose a newalgorithm based on the HB method such that the determining
equation is solved by transient analysis of Spice, where ω isa function of time t as follows:ω = KtdvC= − ωCVLC sin ωt + ωCVLS cos ωt (3.2)
dt

k = 1, 2, . . . n,(4)on the response curve, we need to find the zero points
satisfying (4) Hence, |Vk (ω)| need to be firstly differentiatedby a differentiator. In order to detect the exact peak points,
the output is limited and expanded with a nonlinear limiteras shown in Fig. 1, which consists of a limiter and nonlinear
diodes. The output of the limiter is given byfor vin < −VL
 −Vmax :kvin:for − VL ≥ vin ≥ VLvL =(5.1)
Vmax:
for vin > VLwhere(3.1)- 29 -kVL = Vmax

(5.2)

Sine-circuit

In our example of section 3, we set VL = 2[µV ], Vmax =100[V ], and k = 0.5 × 108 . The outputs of diodes are{Is exp(λvo ):for vo > 0io =(5.3)−Is exp(−λvo ) :for vo < 0R I1S- ωI 1CV R I 2S- ωI 2C1SE

I 3S- ωI3C

-ω C V2C-ω C V1C

for Is = 10−12 and λ = 40.
The characteristic of the nonlinear limiter is shown in Fig. 2.
This means that the regions around d|Vk (ω)|/dω = 0 are
4[kA]

V2S R

V3S R

I 4S- ωI4C

V4S-ω C V 3C

DifferentiatorCd-ω C V4C
RdCosine-circuit

R I1C ωI

1S V1CR I 2C ωI

ωI
2S V2C R I 3C ωI 3SV R I 4C 4S V
3C4C2

ω CV2Sω CV1Sω CV3sω CV4S2SQRT(V kS+ VkC)

Nonlinear limitter

Nonlinear limitter2

Fig. 4. Sine-Cosine circuit combining with peak detector. Cd = 1[pF ] andRd = 1[Ω].

0-2-4-4Fig. 2.

0Input-2peaks 8 from the left hand side. The sharpnesses depend on
the quality factors so that we have changed them by Rs. We
found that although the resonant frequencies are almost samefor all Rs as shown in Table 1 and table 2, the peak values
are largely different.

[µV] 42

Input and output characteristic of nonlinear limiter.

largely expanded. Furthermore, the characteristic has large
nonlinearity around the zeros. Thus, the transient analysis
around the zero points is executed with a very small step size,
and we can find out precise peak points.

0.014

III. I LLUSTRATIVE EXAMPLE

0.012

0.01

Transmission line is usually modeled by discrete RLCG
ladder circuit as shown in Fig. 3, where we neglected G. Thistime, we analyzed the cases of the numbers of the ladder are
4 and 8.

0.008

V[V]

0.006

0.004

0.002

0RLRL

RLR

L

-0.002-0.0040E
ωCCC

2e-010C

4e-0106e-010Frequency[rad/sec]

8e-0101e-0098e-0101e-009(a)0.000140.00012Fig. 3. LRC ladder circuit(ladder is 4) C = 1[nF ], L = 10[mH], e(t) =E cos ωt and E = 1[µV ].

0.0001V[V]8e-005In order to obtain the frequency response curve, the circuit
is transformed by HB method into the Sine-Cosine circuit. The
peak detector given in section 2 is attached as shown in Fig. 4.
Note that the detector can be attached to an arbitrary node.
Now, we show the simulation results using the transient
analysis of Spice. The circuit in case of ladder is 4 which has
4 resonant points as shown by Figs. 5(a) and (b) which show
the voltages at the far end of the circuit in Fig. 3, where weset the peaks 1,2,3,4 from the left hand side. In the same way,
the circuit in case of ladder is 8 which has 8 resonant points
as shown by Figs. 6(a) and (b) which show the voltages at thefar end of the circuit, where we set from the peaks 1 to the6e-005

4e-0052e-0050-2e-005
02e-0104e-0106e-010Frequency[rad/sec](b)Fig. 5.
Frequency characteristics of the circuit in Fig. 4 (ladder is 4).
(a) R=1[Ω]. (b) R=100[Ω].

- 30 -In this case, we need to trace the resonant curve around thepeak 4 and peak 8 with a selection of much smaller initial
step size.

0.008
0.007
0.006
0.005

IV. C ONCLUSIONS AND REMARKS

V[V]

0.004

In this study, we have proposed an algorithm to find thepeaks of the frequency response curve by combining theSine-Cosine circuit based on the HB method. The circuit istraced by the transient analysis of Spice. Since the peak points
correspond to the gradient being to zeros, we differentiate thecurve and find its zero points. In order to find the exact zeropoints, we have developed the peak detector using nonlinear
limiter such that the regions are largely expanded. Thus, thestep size around zero values becomes small when we use
variable step size transient analysis.

0.003
0.002
0.001
0-0.001-0.00202e-0104e-0106e-010Frequency[rad/sec]

8e-0101e-009(a)8e-0057e-0056e-005R EFERENCES

5e-0054e-005V[V][1] A. Ushida, Y. Yamagami and Y. Nishio, “Frequency responses ofnonlinear networks using curve tracing algorithm,”Proc. of ISCAS’02,vol.I, pp.641-644, 2002.
[2] A. Ushida and M. Tanaka, Simulations of Electronic Circuits, Corona
Publishing Co., Ltd, 2002.
[3] T. Kinouchi, Y. Yamagami, Y. Nishio and A. Ushida, “Spice-oriented
harmonic balance Volterra series methods,” Proc. of NOLTA’07, pp.513516, 2007.

3e-0052e-0051e-0050-1e-005
02e-0104e-0106e-010Frequency[rad/sec]

8e-0101e-009(b)
Fig. 6. Frequency characteristics of the circuit (ladder is 8). (a) R=1[Ω].
(b) R=100[Ω].

Table 1 Calculated peak values (ladder is 4).
R=1[Ω]
ω[prad/sec]
V[mV]
R=100[Ω]ω[prad/sec]
V[µV ]

peak 1
175.1
13.6
peak 1
175.4
136.2

peak 2503.7
10.0
peak 2504.1
104.6

peak 3771.6
5.8
peak 3772.2
57.9

peak 4946.7
0.5
peak 4
944.8
16.5

Table 2 Calculated peak values (ladder is 8).
R=1[Ω]
ω[prad/sec]
V[mV]ω[prad/sec]
V[mV]
R=100[Ω]ω[prad/sec]
V[µV ]
ω[prad/sec]
V[µV ]

peak 1
93.1
7.3
peak 5744.4
3.3
peak 1
93.1
73.5
peak 5741.5
32.8

peak 2275.8
6.9
peak 6856.8
0.5
peak 2276.1
68.6
peak 6
854.4
20.2

peak 3
449.1
5.4
peak 7939.5
0.3
peak 3
449.5
59.4
peak 7937.0
9.6

peak 4607.1
4.2
peak 8990.7
0.04
peak 4606.4
47.2
peak 8980.2
2.6

It seems that the calculated peak 4 in table 1 and peak 8 in
table 2 for R = 1 are a little bit larger than the exact value. It isdue to pass over the point because the peak is too narrow andsmall to detect even when the nonlinear limiter is introduced.

- 31 -