0% found this document useful (0 votes)
71 views8 pages

06 02 45 52 PDF

This document discusses difference equations that are used to represent discrete systems and digital signal processing algorithms. It makes three key points: 1) Difference equations can use forward or backward differences to describe how a variable changes over time. Forward differences look at changes from one time step to the next, while backward differences look at changes from the current time step to the previous one. 2) Linear difference equations with constant coefficients can be used to model discrete systems and their behavior over time. These equations relate the output of a system to its inputs and previous outputs. 3) Different types of difference equations include state-space equations and input-output equations. The best type of equation to use depends on the application and how the

Uploaded by

Bhily Quipo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views8 pages

06 02 45 52 PDF

This document discusses difference equations that are used to represent discrete systems and digital signal processing algorithms. It makes three key points: 1) Difference equations can use forward or backward differences to describe how a variable changes over time. Forward differences look at changes from one time step to the next, while backward differences look at changes from the current time step to the previous one. 2) Linear difference equations with constant coefficients can be used to model discrete systems and their behavior over time. These equations relate the output of a system to its inputs and previous outputs. 3) Different types of difference equations include state-space equations and input-output equations. The best type of equation to use depends on the application and how the

Uploaded by

Bhily Quipo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

RADIOENGINEERING, VOL. 15, NO.

2, JUNE 2006 45

Difference Equations with Forward and Backward


Differences and Their Usage
in Digital Signal Processor Algorithms
Zdeněk SMÉKAL

Dept. of Telecommunications, Brno University of Technology, Purkyňova 118, 612 00 Brno, Czech Republic

[email protected]

Abstract. In the paper the relation is given between linear lation of graph transfer from the chosen input node to the
difference equations with constant coefficients those ob- output node [7]. The computer analysis of the realization
tained via the application of forward and backward diffe- structures of discrete systems is performed much the same
rences. Relation is also established between input-output as with the method of nodal voltages in analog circuits and
difference equations and state-space difference equations, systems, and is of fundamental significance in the analysis
which define the state of inner quantities of a discrete sys- of the properties of discrete systems [10, 11]. To make full
tem. In conclusion, the state-space representation of a dis- use of all the knowledge obtained so far by applying diffe-
crete system is given, which is suitable for implementing a rence equations in the representation of discrete systems it
discrete system in the microprocessor and digital signal is necessary to put the different notations of difference
processor. The resultant solution consists of the response equations and their derived functions into a correct mutual
to input signal and the response to non-zero initial condi- relationship.
tions.

2. Difference Equations with Forward


Keywords and Backward Differences
Forward and backward differences, difference equa- In mathematics the term difference equations refers to
tions, digital signal processor algorithms. equations in which in addition to the argument and the
sought function of this argument there are also their diffe-
rences. The difference equation can be understood as the
1. Introduction function:
Difference equations that represent algorithms for the y[n + 1] = f ( y[n ] ) . (1)
digital signal processing can be expressed in several ways.
In the field of digital signal processing, in particular in Function differences were first defined as approximations
digital filters, the representation using the backward diffe- of function derivatives since for an n-th continuous deriva-
rence is mostly used [6], [7], [8]. In mathematics and in the tive of function f(x) at point x it holds:
field of informatics and automatic control, difference equa-
Δn f (x )
tions with forward differences are used [1], [2], [3], [4]. f (n ) ( x ) = lim . (2)
Δ x →0 Δ x n
Difference equations can further be divided into space-state
difference equations [2], [3], [4], [12], and [13] and input-
If we consider a uniform (equidistant) distribution of the
output difference equations [1], [7], [8]. Each of these four
values of independent variable x, we can successively mo-
types of difference equation uses a different method of pro-
dify the function difference to the form:
gramming algorithms. An incorrectly chosen type of algo-
rithm can then often lead to errors when implementing the Δ f [n ] = f [n + 1] − f [n ] . (3)
algorithm, in particular in the case of fixed-point digital
signal processors. For a graphical representation of diffe- This equation defines the so-called forward difference. In
rence equations both block diagrams and signal flow this way, the backward difference equation of the first or-
graphs can be used [2, 3, 4, and 7]. In addition to the clas- der can also be defined:
sical mathematical analysis [1] the Z-transform is frequent- Δ z f [n ] = f [n ] − f [n − 1] . (4)
ly used [5, 6] to solve difference equations. In reverse
examination of the transfer function implemented in the Z- The properties of continuous systems are mostly described
transform, Mason’s gain rule can be used for the calcu- using the differential equations. Similarly, the properties of
46 Z. SMÉKAL, DIFFERENCE EQUATIONS WITH FORWARD AND BACKWARD DIFFERENCES AND THEIR USAGE ...

discrete systems can be defined using the difference equa- The complete solution of non-homogeneous equation (7)
tions. Consider first a linear stationary discrete system of consists of two parts:
the s-th order whose properties can be represented by a
linear difference equation of the s-th order with constant y[n] = y h [n] + y p [n] . (9)
coefficients [1], [8]:
The general solution yh[n] of homogeneous difference equ-
Bs Δs y[n] + Bs −1 Δs −1 y[n] + Bs − 2 Δs − 2 y[n] + ation will be obtained by solving equation (7) with zero
+ Bs −3 Δs −3 y[n] + L + B1 Δy[n] + B0 y[n] = (5)
right-hand side under non-zero initial conditions:

= As Δ x[n] + As −1 Δ x[n] + As − 2 Δ
s s −1 s−2
x[n] + y[s − 1] , y[s − 2] , L , y[1] , y[0] . (10)
L + A1 Δ x[n] + A0 x[n] . The particular solution of yp[n] depends on the form of the
The constants B0, B1, … , Bs and A0, A1, … , As are the right-hand side of equation (7). The analytical solution is a
difference equation coefficients, the discrete signal x[n] complete solution but it is often very difficult. Analytical
represents the input signal of discrete system, and y[n] is solution for different types of difference equations is des-
the output signal of discrete system. As can be seen, diffe- cribed, for example, in [1]. For practical tasks of digital
rence equation (5) describes the properties of a discrete signal processing there are certain limitations, and for the
system with one input and one output. If the discrete sys- solution the one-sided Z-transform is used [5], [6], [7]:
tem has several inputs and several outputs, difference equ- ∞
ations must be set up for each input and each output. It is F (z ) = Z { f [n] } = ∑ f [n] z − n ⇔ f [n] . (11)
then of advantage to use the matrix notation for a group of n =0
these difference equations. To obtain an analytical solution
of equation (5) we need to know the initial conditions In the solution of difference equation (7) via the Z-trans-
form in the form of (11) the following property of the
Δs −1 y[0], Δs − 2 y[0], Δs −3 y[0], L , Δ y[0], y[0] . transform is exploited:

If we use the forward difference according to (3) to rewrite f [n + s ] ⇔ Z { f [n + s ] } =


equation (5), then the general relation for s-th order diffe- (12)
⎛ s −1

rence can be used: = z s ⎜ F ( z ) − ∑ f [i ] z −i ⎟ .
⎝ i =0 ⎠
Δs f [n] = Δs −1 f [n + 1] − Δs −1 f [n] =
s (6) Using the Z-transform in the form of (11) and property (12)
s!
= ∑ (− 1) f [n + s − i ] .
s
will yield equation (7) in the form:
i =0 i !(s − i )!
Y (z) = H (z) X (z) +
Using equation (6) we can obtain from rewritten equation s −1 (13)
1
(5) the following form: +
B (z)
∑ { F ( z ) y [i ] − G ( z ) x [ i ] }
i i

bs y[n + s ] + bs −1 y[n + s − 1] + bs − 2 y[n + s − 2] + s i =0

+ L + b1 y[n + 1] + b0 y[n] = (7)


where Y(z) is the one-sided Z-transform of output signal
y[n], or y[n] ⇔ Y(z), and X(z) is the one-sided Z-transform
= a s x[n + s ] + a s −1 x[n + s − 1] +
of output signal x[n], or x[n] ⇔ X(z). The polynomials F(z)
+ L + a1 x[n + 1] + a 0 x[n] . and G(z) are defined as follows:
This difference equation will be referred to as non-homo- F0 ( z ) = bs z s + bs −1 z s −1 + L + b2 z 2 + b1 z ,
geneous linear difference equation of the s-th order with
constant coefficients ai, bi, i = 0, 1, ..., s–1, s. This type of F1 (z ) = bs z s −1 + bs −1 z s − 2 + L + b3 z 2 + b2 z ,
difference equation is sometimes referred to as recurrent F2 ( z ) = bs z s − 2 + bs −1 z s −3 + L + b4 z 2 + b3 z ,
equation of the s-th order, because we can write:
M
b b
y[n + s ] = − s −1 y[n + s − 1] − s −2 y[n + s − 2] + Fs −3 (z ) = bs z 3 + bs −1 z s − 2 + bs − 2 z ,
bs bs (14)
Fs − 2 ( z ) = bs z 2 + bs −1 z ,
b1 b
+L− y[n + 1] − 0 y[n] + Fs −1 (z ) = bs z ,
bs bs (8)
a a G0 ( z ) = a s z s + a s −1 z s −1 + L + a 2 z 2 + a1 z ,
+ s x[n + s ] + s −1 x[n + s − 1] +
bs bs G1 ( z ) = a s z s −1 + a s −1 z s − 2 + L + a3 z 2 + a 2 z ,
a1 a G2 (z ) = a s z s − 2 + a s −1 z s −3 + L + a 4 z 2 + a3 z ,
+L+ x[n + 1] + 0 x[n] .
bs bs M
RADIOENGINEERING, VOL. 15, NO. 2, JUNE 2006 47

M We calculate the difference equation from the equation in


the Z-transform, which forms only a part of equation (13):
Gs −3 ( z ) = as z 3 + as −1 z s − 2 + as − 2 z ,
Gs − 2 ( z ) = as z 2 + as −1 z , Y (z ) = H (z ) X (z ) . (18)

Gs −1 ( z ) = as z. After substituting transfer function (16) into equation (18),


using the inverse Z-transform and rewriting we obtain the
In [14] a comparison is given of the analytical solution and difference equation:
the solution using the Z-transform for 2nd-order non-homo-
geneous equation, which has the form: y[n] + d1 y[n − 1] + d 2 y[n − 2] + L
y[n + 2] − 1.25 y[n + 1] + 0.78125 y[n ] = + d s −2 y[n − s + 2] + d s −1 y[n − s + 1] + d s y[n − s ] = (19)
= x[n + 2] − x[n ] . = c0 x[n] + c1 x[n − 1] + c 2 x[n − 2] + L
The input signal considered is unity impulse x[n] = δ[n]. + c s −2 x[n − s + 2] + c s −1 x[n − s + 1] + c s x[n − s ] .
The function H(z) in equation (13) is called the system
transfer function of discrete system and is defined as: or after substituting coefficients ai and bi:

As ( z ) bs y[n] + bs −1 y[n − 1] + bs −2 y[n − 2] + L


H (z ) = =
Bs ( z ) + b2 y[n − s + 2] + b1 y[n − s + 1] + b0 y[n − s ] = (20)
s −1 s −2
a z + a s −1 z + a s − 2 z + a s −3 z + L
s s −3
(15) a s x[n] + a s −1 x[n − 1] + a s − 2 x[n − 2] + L
= s s
bs z + bs −1 z s −1 + bs − 2 z s − 2 + bs −3 z s −3 + L + a 2 x[n − s + 2] + a1 x[n − s + 1] + a 0 x[n − s ] .
L + a 2 z + a1 z + a0
2
. The recurrent equation can again be obtained via rewriting:
L + b2 z 2 + b1 z + b0
bs −1 b
Linear stationary (time-invariant) discrete dynamic systems y[n] = − y[n − 1] − s − 2 y[n − 2] − L
also embrace the IIR and FIR digital filters. In their design bs bs
the transfer function H(z) is mostly started from, which is b2 b b
written in a form other than (15): − y[n − s + 2] − 1 y[n − s + 1] − 0 y[n − s ] +
bs bs bs (21)
−1 −2 −3
c0 + c1 z + c2 z + c3 z + L as a a
H ( z) = + x[n] + s −1 x[n − 1] + s − 2 x[n − 2] + L
1 + d1 z −1 + d 2 z −2 + d3 z −3 + L (16) bs bs bs
L + cs − 2 z − s + 2 + cs −1 z − s +1 + cs z − s Y ( z) a2 a a
= . + x[n − s + 2] + 1 x[n − s + 1] + 0 x[n − s ] .
L + d s−2 z − s+2
+ d s −1 z − s +1
+ ds z −s
X ( z) bs bs bs

If we compare equations (15) and (16), we can see the con- The complete solution of non-homogeneous equation in the
nection: form of (20) or (21) will be obtained on the assumption
that we know the initial conditions:
as a a
c0 = , c1 = s −1 , c2 = s −2 , L ,
bs bs bs y[− 1], y[− 2], L , y[− s + 1], y[− s ] . (22)
a1 a
c s −1 = , cs = 0 , As can be seen, we obtain the form of linear difference
bs bs (17) equations with backward differences (4), which is com-
bs −1 b b monly used in digital filter theory.
d1 = , d 2 = s − 2 , d 3 = s −3 , L ,
bs bs bs Conclusion No. 1: If we start from a linear non-ho-
b b mogeneous difference equation with constant coefficients
d s −1 = 1 , d s = 0 . in the form of (5), then after substituting forward and back-
bs bs
ward differences according to (3) or (4) we obtain equiva-
Using different methods of digital filter design (bilinear lent difference equations in the form of (7) and (8) or (20)
transformation, the Remez algorithm, etc.) the coefficients and (21). We can see that we are concerned here with an
ai, bi, i = 0, 1, 2, ... , s (or ci, di) are sought such that the equivalent form if we apply the substitution n = m + s to
requirements, for example, of the tolerance diagram for the equation (20) or (21). It should be noted that this equiva-
width and placement of pass, stop and transition frequency lence only concerns linear difference equations with cons-
bands of digital filter are satisfied [7], [8]. Now we are in- tant coefficients. This equivalence does not hold for non-
terested in what form of difference equation corresponds to linear difference equations or linear difference equations
a procedure that starts directly from transfer function (16). with varying coefficients.
48 Z. SMÉKAL, DIFFERENCE EQUATIONS WITH FORWARD AND BACKWARD DIFFERENCES AND THEIR USAGE ...

3. State-Space Difference Equations and successively substitute this equation in other equations
of (23). After rewriting we obtain the following state-space
and Input-Output Difference difference equations:
Equations
bs −1 ⎛ a ⎞
Non-homogeneous difference equations in the form v1 [n + 1] = v 2 [n] − v1 [n] + ⎜⎜ a s −1 − bs −1 s ⎟⎟ x[n] ,
bs ⎝ bs ⎠
of (5), (7) or (8) only express the relation between input
signal x[n] and output signal y[n] of a discrete system (or b ⎛ a ⎞
between the input and the output signals for a system with v 2 [n + 1] = v3 [n] − s − 2 v1 [n] + ⎜⎜ a s − 2 − bs − 2 s ⎟⎟ x[n] ,
bs ⎝ bs ⎠
several inputs and outputs, in which case a group of diffe-
rence equations is used). The form of input-output diffe- M (25)
rence equation is not very suitable for writing algorithms
b1 ⎛ a ⎞
because it is difficult to determine the value of initial con- v s −1 [n + 1] = v s [n] − v1 [n] + ⎜⎜ a1 − b1 s ⎟⎟ x[n] ,
ditions. As can be seen from conditions (10) and (22), we bs ⎝ bs ⎠
must determine s initial values of output signal y[n], which
b ⎛ a ⎞
are distributed in time and thus influence the rate of pro- v s [n + 1] = − 0 v1 [n] + ⎜⎜ a 0 − b0 s ⎟⎟ x[n] .
cessing the input signal by the discrete system. Of greater bs ⎝ bs ⎠
advantage would be the requirement of initial values defi-
ned for one instant of time, which appears in the solution Writing in matrix notation we obtain:
of difference equation (5). In mathematics, of course, it is v [n + 1] = A v[n ] + B x[n ] , (26)
not customary to do an analysis of difference equations in
the form of (5); in most cases, difference equations in the where the vectors are defined as follows:
form of (7) or (8) are solved. It would be more convenient
v [n + 1] = [v s [n + 1] v s −1 [n + 1] L v 2 [n + 1] v1 [n + 1] ]
T
if we introduced a model of the discrete system with inner
variables. This model is then referred to as state-space
and
model because it will give the values of inner state-space
variables at one instant of time. Let us show a very simple v [n] = [v s [n] v s −1 [n] L v 2 [n] v1 [n] ] .
T

method of deriving the inner state-space description. We


will successively put together differently shifted input and The symbol T expresses the vector transposition operation.
output signals: Matrices A and B are in the form:
v1 [n] = bs y[n] − a s x[n] , ⎡ b0 ⎤ ⎡ a ⎤
⎢ 000 L 00 − a 0 − b0 s
v 2 [n] = bs −1 y[n] + bs y[n + 1] − a s −1 x[n] − a s x[n + 1] , bs ⎥ ⎢ bs ⎥
⎢ ⎥ ⎢ ⎥
v3 [n] = bs − 2 y[n] + bs −1 y[n + 1] + bs y[n + 2] − ⎢ b1 ⎥ ⎢ as ⎥
⎢ 10 0 L 00 − ⎥ ⎢a1 − b1 ⎥
− a s − 2 x[n] − a s −1 x[n + 1] − a s x[n + 2] , ⎢ bs ⎥ ⎢ bs ⎥
M (23) ⎢ b2 ⎥ ⎢ as ⎥
⎢ 010 L 00 − ⎥ ⎢a 2 − b2 ⎥
v s [n] = b1 y[n] + b2 y[n + 1] + b3 y[n + 2] + L A=⎢ bs ⎥ , B = ⎢ bs ⎥ .
+ bs −1 y[n + s − 2] + bs y[n + s − 1] − ⎢M ⎥ ⎢M ⎥
⎢ ⎥ ⎢ ⎥
− a1 x[n] − a 2 x[n + 1] − a3 x[n + 2] − L ⎢ 000 L bs − 2 ⎥ ⎢ as ⎥
10 − a − bs − 2
− a s −1 x[n + s − 2] − a s x[n + s − 1] . ⎢ bs ⎥ ⎢ s −2 bs ⎥
⎢ ⎥ ⎢ ⎥
⎢ bs −1 ⎥ ⎢ as ⎥
We have obtained a group of new state-space variables
⎢ 000 L 01 − ⎢a s −1 − bs −1 b ⎥
vi[n], i = 1, 2, 3, ... , s . Formally we can also write a diffe- ⎣ bs ⎥⎦ ⎣ s ⎦
rence equation that is in agreement with equation (7):
Matrix notation for a group of state-space difference equ-
v s +1 [n] = b0 y[n] + b1 y[n + 1] + b2 y[n + 2] + L ations has the advantage that it can represent in a clear way
+ bs −1 y[n + s − 1] + bs y[n + s ] not only a discrete system with one input and one output
but also systems with many inputs and outputs. In that case
− a 0 x[n] − a1 x[n + 1] − a 2 x[n + 2] + L signals x[n] and y[n] will be replaced by vectors. This man-
− a s −1 x[n + s − 1] − a s x[n + s ] = 0 . ner of notation of difference equations is primarily employ-
ed in the field of automatic measurement and control. Simi-
From the first equation in (23) we will calculate the output larly, for output signal y[n] we obtain the matrix equation:
signal:
y[n ] = C v[n ] + D x[n ] . (28)
1 a
y[n ] = v1 [n ] + s x[n ] (24) In our case, matrices C and D are in the form:
bs bs
RADIOENGINEERING, VOL. 15, NO. 2, JUNE 2006 49

⎡ 1⎤ ⎡ as ⎤ The output equation remains the same as in the preceding


C = ⎢0 0 0 L 0 0 ⎥, D=⎢ ⎥. (29) case:
⎣ bs ⎦ ⎣ bs ⎦
1 a
Conclusion No. 2: State-space description of difference y[n ] = v1 [n] + s x[n] . (31)
bs bs
equations provides a more advantageous description of the
properties of a linear time-invariant discrete system with To solve the system of difference equations we will use the
several inputs and several outputs. Initial conditions are one-sided Z-transform. For individual Z-transforms of sta-
defined by the state-space vector v[n] for all state-space te-space variables in equations (30) we obtain:
quantities at one instant of time; for example, for n = 0 the
initial conditions are defined by vector V1 ( z ) = a s −1 X ( z ) z −1 − bs −1 Y ( z ) z −1 + V2 (z ) z −1 + v1 [0],
v [0] = [ v s [0] v s −1 [0] L v 2 [0] v1 [0] ] .
T V2 (z ) = a s − 2 X ( z ) z −1 − bs − 2 Y (z ) z −1 + V3 (z ) z −1 + v 2 [0],
V3 ( z ) = a s −3 X ( z ) z −1 − bs −3 Y ( z ) z −1 + V4 (z ) z −1 + v3 [0],
To follow the dynamic change in the discrete system pro-
perties, matrix equation (26) is used, which determines the M (32)
values of state quantities for the subsequent instant of time. Vs −1 ( z ) = a1 X ( z ) z − b1 Y (z ) z + Vs (z ) z + v s −1 [0],
−1 −1 −1
Based on the knowledge of state-space vector v[n] the va-
lues of output signal or signals can be determined at any Vs ( z ) = a0 X (z ) z −1 − b0 Y ( z ) z −1 + v s [0].
instant of time.
The one-sided Z-transform of the equation is:
bs Y ( z ) = V1 ( z ) + a s X (z ) . (33)
4. State-Space Difference Equations
Equation (32) is successively substituted into equation (33)
for Implementation on Digital and after rewriting we obtain:
Signal Processor s
Y (z ) = H (z ) X (z ) + ∑ H i ( z ) vi [0] . (34)
A limiting factor of implementing algorithms for di- i =1
gital signal processing in fixed-point digital signal proces-
sors is the representation of positive and negative numbers The system transfer function is the same as in the equation
in data arithmetic-logic units (DALU) of digital signal pro- (15):
cessors. For the representation of binary numbers the two’s
As ( z )
complement in fraction representation is used. Its dynamic H (z ) = =
range of numbers is limited to the interval between the hig- Bs ( z )
hest positive number 1 − 2−b and the lowest negative num- a s z s + a s −1 z s −1 + a s − 2 z s −2 + a s −3 z s −3 + L (35)
ber −1. The symbol b denotes the number of bits of the
binary number. Although accumulators in the DALUs of bs z s + bs −1 z s −1 + bs −2 z s − 2 + bs −3 z s −3 + L
digital signal processors have additional bits that increase L + a 2 z 2 + a1 z + a0
this dynamic range in partial calculations, the algorithms .
L + b2 z 2 + b1 z + b0
need to be pre-modified lest the range is exceeded. The
respective modification depends on the architecture of The remaining transfer functions in equation (34) have the
digital signal processor and on the algorithm structure. In form:
the implementation of the properties of discrete systems,
state-space difference equations are used that also start zs z s −1 z s−2
H 1 (z ) = , H 2 (z ) = , H 3 (z ) = ,
from the form of (23) but the subsequent modification is Bs (z ) Bs ( z ) Bs ( z ) (36)
performed in a different way. In state-space equations no
z2 z
substitution is performed for output signal y[n], which is L H s −1 (z ) = , H s (z ) = .
obtained from equation (24). Eventually we obtain the Bs ( z ) Bs ( z )
following system of s first-order state-space difference
equations: If using the inverse Z-transform we transform equation
(34) into the time domain, we obtain the resultant solution
v1 [n + 1] = a s −1 x[n] − bs −1 y[n] + v 2 [n] , of state-space difference equations (30) and (31) in the
v 2 [n + 1] = a s −2 x[n] − bs − 2 y[n] + v3 [n] , form:
v3 [n + 1] = a s −3 x[n] − bs −3 y[n] + v 4 [n] , s
(30) y[n] = h[n] ∗ x[n] + ∑ hi [n] vi [0] . (37)
M i =1

v s −1 [n + 1] = a1 x[n] − b1 y[n] + v s [n] , Sequence h[n] is the impulse response of discrete system,
v s [n + 1] = a 0 x[n] − b0 y[n] . which we obtain using the inverse Z-transform of transfer
function:
50 Z. SMÉKAL, DIFFERENCE EQUATIONS WITH FORWARD AND BACKWARD DIFFERENCES AND THEIR USAGE ...

1
h[n] = ∫ H (z ) z
n−1
dz. (38)
2 πj C

Similarly, impulse responses hi[n] can be determined from


impulse functions Hi[z]. The symbol * denotes the opera-
tion of discrete convolution, which has the form:

h[n] ∗ x[n] = ∑ h[m] x[n − m] . (39)
m = −∞

Conclusion No. 3: First-order state-space difference equ-


ations in the form of (30) have advantageous properties for
implementing discrete systems in the digital signal proces-
sor or in another type of microprocessor. The initial state of
discrete system is defined by the values of state quantities
vi[0]. The response of the system to initial conditions is
given by the sum of impulse responses hi[n] of identical
form, which are only differently shifted in time. The form
of impulse responses is defined by the nominator of system
transfer function H(z). Fig. 2. Series connection of 6 partial sections of 2nd order for the
realization of rejection filter.

The incorrect selection itself of the structure of partial


5. Example section can make the algorithm non-functional. E.g., if we
choose the 2nd canonic structure (Direct Form [7]) as the
On the example of a type IIR digital filter in the form structure of partial sections, this filter cannot be implemen-
of a three-band rejection filter we will show how important ted at all, since the values of internal state-space variables
it is to select a correct realization algorithm that matches v1i[n] and v2i[n], i = 1, 2, 3, 4, 5, and 6, will exceed the
the given architecture of digital signal processor. Let us permissible imaging range of numbers in two’s comple-
choose the currently most powerful fixed-point digital sig- ment. As an example, see the waveform of state-space
nal processor TMS320C6416 (Texas Instruments). Its ar- variable v1i[n] of partial section No. 1 for the 1st canonic
chitecture is of the VLIW type and the computation power structure (Fig. 3) and the 2nd canonic structure (Fig. 4).
of the digital signal processor is over 8000 MIPS. The Similar waveforms can be determined for the remaining
amplitude frequency response of the rejection filter can be state-space variables of further sections. Using the 2nd
seen in Fig. 1. canonic structure we would have to choose a floating-point
digital signal processor, which might be slower and more
expensive for a given application. The description of the
whole simulation procedure can be found in [9].

Fig. 1. Amplitude frequency response of 12th-order rejection filter.

Since the sampling frequency fs is comparatively high in


Fig. 3. State-space variable v11[n] of the first partial section of
comparison with the centre frequencies of individual re-
2nd order, which is realized in the 1st canonic form.
jection filters, this digital filter is highly sensitive to the
quantization of coefficients and intermediate results of In addition to selecting the optimum structure and coping
arithmetic operations. Chosen for the realization was the with the effect of quantizing, etc., it is also important on
classical structure of the series connection of 6 partial sec- how the given structure depends on the setting of non-zero
tions of 2nd order, which can be seen in Fig. 2. initial conditions. This involves, for example, the form of
RADIOENGINEERING, VOL. 15, NO. 2, JUNE 2006 51

transfer functions Hi(z) in equation (34), which has been etc.), in automotive industry (various types of drive cont-
calculated for the 1st canonic structure of type IIR digital rol), in computer technology (disk drive management), and
filters. Let the input signal be formed by the sum of 4 har- the like. It is therefore important to seek optimum structu-
monic components of 50 Hz, 100 Hz, 150 Hz and 200 Hz res of realizing algorithms for digital signal processing.
frequencies in the form: Linear stationary discrete systems are most frequently
described by means of linear difference equations with
x[n] = 0.245 cos (2π 50 n / f s ) + 0.245 cos (2π 100 n / f s ) +
constant coefficients. Best suited for implementation in
+ 0.245 cos (2 π 150 n / f s ) + 0.245 cos (2 π 200 n / f s ) , fixed-point digital signal processors are state-space diffe-
f s = 8 kHz . (40) rence equations in the so-called canonic form, which are
defined by equations (30). They have a homogeneous
In Fig. 5 we can see the waveform and DFT spectrum, computation structure so that their application is advanta-
which can be displayed directly in the Code Composer geous for both digital signal processor with Harvard archi-
Studio development environment, for filtering the input tecture and digital signal processors with type VLIW archi-
signal (40) in a form when all initial conditions are set to tecture, which use a high degree of parallelism in the pro-
zero. The spectrum only contains the 200 Hz, harmonic cessing.
component because the other components have been filte-
red by the rejection filter. In a similar way, other currently used structures of
discrete systems can be analyzed, such as lattice, linear
prediction, cepstral or continued-fraction-expansion struc-
tures, which are usually also described by systems of dif-
ference equations.

Acknowledgements
The paper was supported by the National Research
Project “Information Society” No 1ET301710509 and with
the support of the research plan MSM 262200022.

References
Fig. 4. State-space variable v11[n] of the first partial section of
[1] ELAYDI S.N. An Introduction to Difference Equations. Second
2nd order, which is realized in the 2nd canonic form.
Edition. New York: Springer, 1999.
For the same filter and the same input signal we will now [2] ZADEH, L.A. DESOER, C.A. Linear System Theory: The State-
change all the initial conditions to a non-zero value (0.1). Space Approach. New York: McGraw-Hill, 1963.
In Fig. 6 we can see that saturation will occur, i.e. the num- [3] SIEBERT, W. McC. Circuits, Signals, and Systems. New York: The
ber range of the representation of numbers in two’s com- MIT Press, McGraw-Hill Company, 1986.
plement will be exceeded, which will result in non- linear [4] KWAKERNAK, H., SIVAN, R., STRUBOS, R.C.W. Modern Sig-
operations being inserted. Due to saturation the spectrum nals and Systems. New Jersey: Prentice Hall, 1991.
will spread and contain several components instead of one [5] JURY, E.I. Theory and Application of the z-Transform Method. New
component. York: Wiley, 1964.

This undesirable situation must be solved in several [6] VÍCH, R. Z-Transform Theory and Applications. Dordrecht: D. Rei-
del Publishing Company. 1987.
possible ways such that saturation does not occur. It is
therefore important that prior to implementing the given [7] MITRA, S.K. Digital Signal Processing: A Computer Based Appro-
ach. Fourth Edition., New York: McGraw-Hill, 2006.
algorithm in a digital signal processor a mathematical ana-
lysis should be performed such that the algorithm is best [8] VÍCH R., SMÉKAL Z. Digital Filters. Prague: Academia, 2000.
adapted to the architecture of the digital signal processor [9] SMÉKAL, Z., SYSEL, P. Digital Signal Processors and their
used. Applications. Prague: Sdělovací technika s.r.o, 2006 (In Czech).
[10] VLACH, J., SINGHAL, K. Computer Methods for Circuit Analysis
and Design. Van Nostrand Reinhold Company, 1983.

6. Summary [11] TASSIGNON, H., SMÉKAL, Z. Semi-symbolic CAD discrete sys-


tem analysis. In Proceedings of the 16th International Conference on
Hybrid microcontrollers and fixed-point digital signal Electronic Speech Signal Processing joined with 15th Czech-German
Workshop "Speech Processing". Dresden: TUD Press, 2005, p. 466
processors are frequently used in a great number of appli- to 471.
cations. These are in particular applications in telecommu-
[12] PSENICKA, B., UGALDE, F.G. Synthesis of digital structure by
nications (modems, mobile phones, speech encoding, sub-
matrix method. In Proceedings of the 7th IASTED International
channel coding, etc.), in consumer electronics (type Conference on Signal and Image Processing. Honolulu (USA), 2005,
MPEG3 recorders, multimedia games, digital cameras, p.190–194.
52 Z. SMÉKAL, DIFFERENCE EQUATIONS WITH FORWARD AND BACKWARD DIFFERENCES AND THEIR USAGE ...

[13] PSENICKA, B., BUSTAMANTE BELLO, R., RODRIGUEZ, M. A. [14] DIBLÍK, J., SMÉKAL, Z. About solution of difference equation of
Analysis and synthesis of digital structure by matrix method. In Pro- y(n+2)-1,25y(n+1) + 0,78125y(n) = x(n+2)-x(n). Elektrorevue –
ceedings of the 2nd International Conference on Informatics in Cont- Internet journal (http://www.elektrorevue.cz), ISSN 1213-1539,
rol, Automation and Robotics. Barcelona (Spain), 2005, p.22–29. 2005, no. 1, p.1–14. (In Czech)

Fig. 5. Waveform and spectrum of input and output signals when filtering by rejection filter for zero initial conditions obtained by simulation on
a TMS320C6416 digital signal processor in the Code Composer Studio development environment (Texas Instruments).

Fig. 6. Waveform and spectrum of input and output signals from Fig. 5 after all initial conditions have been set to non-zero.

You might also like