
156 DISCRETE-SIGNAL ANALYSIS AND DESIGN
N := 8 n := 0,1.. N
VC := 1.5 IL := 1.0 R := 3 L := 1 C := 0.5
x(n) :=
VC
IL
if n = 0
T . +
0
1
L
−1
C
R
L
1
0
0
1
x(n− 1) if n > 0
0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8
0
0.3
0.6
0.9
1.2
1.5
V(C)
I(L)
x(n)0
x(n)1
n.T
Solution to matrix differential equation for initial conditions of VC = 1.5, IL = 1.
0
C
L
R
IL
VC
VL
+
++
−
−
−
u(t) VOUT
T := 0.1
Figure A-2 LCR Circuit differential equation solution for initial values
of VCand IL,Igen =0.
iC=CdvC
dt =u−iL
vL=LdiL
dt =vC−RiL(A-3)
vOUT =RiL

ADDITIONAL DISCRETE-SIGNAL ANALYSIS AND DESIGN INFORMATION 157
Rewrite Eq. (A-3) in state-variable format:
v·
C=0vC−1
CiL+1
Cu
õ·
L=1
LvC−R
LiL+0u(A-4)
vO=RiL
A nodal circuit analysis conÞrms these facts for this example. R,L,
and Care constant values, but they can easily be time-varying and/or
nonlinear functions of voltage and current. The discrete analysis method
deals with all of this very nicely.
We now add in the initial conditions at time zero, VC0and IL0:
v·
C=0(vC+VC0)−1
C(iL+IL0)+1
Cu
õ·
L=1
L(vC+VC0)−R
L(iL+IL0)+0u(A-5)
vO=RiL
The two derivatives appear on the left side. Note that if (vC+VC0)is
multiplied by zero, the rate of change of vCdoes not depend on that term,
and the rate of change of iLdoes not depend on uif the uis multiplied
by zero. The options of Eqs. (A-4) and (A-5) can easily be imagined.
Description of ßow-graph methods in [Dorf and Bishop, 2004, Chaps.
2 and 3] and in numerous other references are excellent tools that are
commonly used for these problems. We will not be able to get deeply
into that subject in this book, but Fig. A-4 is an example.
The next step is to rewrite Eq. (A-5) in matrix format. Also, vCis now
called X1,andILis now called X2.
˙
X1
˙
X2=0−1
C
1
L−R
LX1
X2+1
C
0(u) (A-6)
VO=RX2

158 DISCRETE-SIGNAL ANALYSIS AND DESIGN
Now write the (A-6) equations as follows:
˙
X1=0X1−1
CX2+1
Cu
˙
X2=1
LX1−R
LX2+0u(A-7)
VO=RX2
Next, we will solve Eq. (A-6) [same as Eq. (A-7) for X1(=vc), X2
(=iL), and VO]. Component uis the input signal generator.
This general idea applies to a wide variety of practical problems (see
[Dorf and Bishop, 2004, Chap. 3] and many other references). The meth-
ods of matrix algebra and matrix calculus operations are found in many
handbooks (e.g., [Zwillinger, 1996]).
The general format for state-variable equations, similar to Eqs. (A-4)
and (A-5), is
˙
x=Ax +Bu
y=Cx +Du (A-8)
in which A, B, C,andDare coefÞcient matrices whose numbers may
be complex and varying in some manner with time, voltage, or current,
upertains to complex signal sources, and yis the complex output for a
complex input signal u. The boldface letters denote matrices speciÞcally.
Comparing Eq. (A-6) with Eq. (A-5), the general idea is clear. At any
time t,xis the collection (vector) of voltages vand currents iin the
circuit, and ˙
xis the collection (vector) of their time derivatives.
Matrix algebra or matrix calculus, using Mathcad, Þnds all the values
of xand yat each value of time twith great rapidity, and plots graphs
of the results. Starting at t= 0, from a set of initial values of Vand I,we
can trace the history of the network through the transient period and into
the steady state.
We will look more closely at the general method of matrix construc-
tion for our speciÞc example. Equations (A-6), (A-7), and (A-9) can be
Laplace-transformed. In this process the unit matrix [I]=10
01
,and
this work must be in accordance with the rules of matrix algebra and the

ADDITIONAL DISCRETE-SIGNAL ANALYSIS AND DESIGN INFORMATION 159
Laplace transform:
1.sX(s)−x(0)=AX(s) +BU(s)
2.sX(s)−AX(s) =x(0)+BU(s)
3.X(s)[sI −A]=x(0)+BU(s)
4.X(s)=[sI −A]−1x(0)+[sI −A]−1BU(s)
(A-9)
This can be inverse-Laplace-transformed to get x(t), a function of time
for each X(s) [Dorf and Bishop, 2004, Sec. 3], but we want to use the dis-
crete derivative of Eq. (A-2) as an alternative for discrete-signal analysis
and design [Dorf and Bishop, 2004, Sec. 3].
USING THE DISCRETE DERIVATIVE
We now replace the ˙xmatrix in Eq. (A-6) by incorporating Eq. (A-2).
Using the intermediate steps in Eq. (A-10) and using the sequence index
x(n) method that we are already very familiar with produces the following
Mathcad program, expressed in Word for Windows format.
1.(if n=0)x0(n)
x1(n)=VC0
IL0
2.(if n>0)x0(n)
x1(n)=T0−1
C
1
L−R
L+10
01
(A-10)
×x0(n−1)
x1(n−1)+Tb0
b1u(n)
Figure A-3 shows this equation in Mathcad program form. We can imme-
diately use three options:
1. Initial conditions x0(0) and x1(0) can be zero, u(n) can have a dc
value or a time function such as a step or sine wave, and in this
example [Eqs. (A-6) and (A-7)] b0=1, b1=0, T=0.1, u(n)=1.0.
2. u(n) can be zero, and the transient response is driven by x(0), an
initial value of capacitor voltage or inductor current or both.

160 DISCRETE-SIGNAL ANALYSIS AND DESIGN
N
:= 1000 n := 0,1.. N
b := u(n) := 100 sin
x(n) : = if n = 0
T+
0
1
L
−1
C
R
L
1
0
0
1
.x(n− 1) + T b u(n) if n > 0
T := 0.01 R := 0.01 L := 0.5 C := 0.5
1
0
2π 4mA
n
N
0
0
0 200 400 600 800 1000
−400
−200
0
200
400
V(C)
I(L)
n
Figure A-3 Time response of the LCR network with zero initial condi-
tions and sine-wave current excitation.
3. x(0) and u(n) can both be operational at t=0 or later than zero.
There are a lot of options for this problem.
The Mathcad worksheet Fig. A-2 shows option 2 for initial condition
values of VCand IL,andu(n)=0. The values of x(n)0and x(n)1are
plotted.
Figure A-3 uses zero initial conditions and u(n)=100 mA sine wave,
frequency =4, b0=1.0, b1=0. The buildups from zero of x1(capacitor
volts) and x2(inductor amperes) are plotted. The lag of IL(peaks at a
later time) can be noticed.

