Recursive and Nonrecursive Discrete-Time Systems

Một phần của tài liệu Signals and systems using matlab (Trang 498 - 503)

CHAPTER 8 Discrete-Time Signals and Systems

8.3.1 Recursive and Nonrecursive Discrete-Time Systems

Depending on the relation between the inputx[n]and the outputy[n]two types of discrete-time systems of interest are:

n Recursive system:

y[n]= − N−1

X k=1

aky[nk]+ M−1

X m=0

bmx[nm] n≥0

initial conditions y[−k], k=1,. . .,N−1 (8.28) This system is also calledinfinite-impulse response(IIR).

n Nonrecursive system:

y[n]= M−1

X m=0

bmx[nm] (8.29)

This system is also calledfinite-impulse response(FIR).

The recursive system is analogous to a continuous-time system represented by a differential equation.

For this type of system the discrete-time inputx[n] and the discrete-time outputy[n] are related by an (N−1)th-order difference equation. If such a difference equation is linear, with constant coefficients, zero initial conditions, and the input is zero forn<0, then it represents a linear and time-invariant system. For these systems the output at a present timen,y[n], depends or recurs on previous values of the output{y[nk], k=1,. . .,N−1}, and thus they are called recursive. We will see that these systems are also calledinfinite-impulse responseorIIRbecause their impulse responses are typically of infinite length.

On the other hand, if the outputy[n] does not depend on previous values of the output, but only on weighted and shifted inputs{bmx[nm], m=0,. . .,M−1}, the system is callednonrecursive. We will see that the impulse response of nonrecursive systems is of finite length; as such, these systems are also calledfinite impulse responseorFIR.

nExample 8.20

Moving-average discrete filter: A third-order moving-average filter (also called asmoother since it smooths out the input signal) is an FIR filter for which the inputx[n] and the outputy[n] are related by

y[n]= 1

3(x[n]+x[n−1]+x[n−2]) Show that this system is linear time invariant.

Solution

This is a nonrecursive system that uses a present sample,x[n], and two past values,x[n−1] and x[n−2], of the input to get an average,y[n], at everyn. Thus, its name,moving-average filter.

Linearity: If we let the input beax1[n]+bx2[n], and assume that{yi[n], i=1, 2}are the correspond- ing outputs to{xi[n], i=1, 2}, the filter output is

1

3[(ax1[n]+bx2[n])+(ax1[n−1]+bx2[n−1])+(ax1[n−2]+bx2[n−2])]=ay1[n]+by2[n]

That is, the system is linear.

Time invariance: If the input isx1[n]=x[nN], the corresponding output to it is 1

3(x1[n]+x1[n−1]+x1[n−2])= 1

3(x[nN]+x[nN−1]+x[nN−2])

=y[nN]

That is, the system is time invariant. n

nExample 8.21

Autoregressive discrete filter: The recursive discrete-time system represented by the first-order difference equation (with initial conditiony[−1])

y[n]=ay[n−1]+bx[n] n≥0, y[−1]

is also called anautoregressive(AR) filter. “Autoregressive” refers to the feedback in the output—that is, the present value of the outputy[n] depends on its previous valuey[n−1].

Find recursively the solution of the difference equation and determine under what conditions the system represented by this difference equation is linear and time invariant.

Solution

Let’s first discuss why the initial condition isy[−1]. The initial condition is the value needed to computey[0], which according to the difference equation

y[0]=ay[−1]+bx[0]

isy[−1] sincex[0] is known.

Assume that the initial condition is y[−1]=0, and that the input is x[n]=0 for n<0 (i.e., the system is not energized forn<0). The solution of the difference equation when the input x[n] is not defined can be found by a repetitive substitution of the input–output relationship.

Thus, replacing y[n−1]=ay[n−2]+bx[n−1] in the difference equation, and then replacing

8.3 Discrete-Time Systems 483

y[n−2]=ay[n−3]+bx[n−2], and so on, we obtain y[n]=a(ay[n−2]+bx[n−1])+bx[n]

=a(a(ay[n−3]+bx[n−2]))+abx[n−1]+bx[n]

= ã ã ã

= ã ã ãa3bx[n−3]+a2bx[n−2]+abx[n−1]+bx[n]

until we reachx[0]. The solution can be written as

y[n]=

n

X

k=0

bakx[nk] (8.30)

which we will see in the next section is the convolution sum of the impulse response of the system and the input.

To see that Equation (8.30) is actually the solution of the given difference equation, we need to show that when replacing the above expression fory[n] in the right term of the difference equation we obtain the left termy[n]. Indeed, we have that

ay[n−1]+bx[n]=a

"n−1 X

k=0

bakx[n−1−k]

#

+bx[n]

=

n

X

m=1

bamx[nm]+bx[n]=

n

X

m=0

bamx[nm]=y[n]

where the dummy variable in the sum was changed tom=k+1, so that the limits of the sum- mation became m=1 whenk=0, and m=n when k=n−1. The final equation is identical toy[n].

To establish if the system represented by the difference equation is linear, we use the solution Eq. (8.30) with input x[n]=αx1[n]+βx2[n], where the outputs{yi[n], i=1, 2}correspond to inputs{xi[n], i=1, 2}, andαandβ are constants. The output forx[n] is

n

X

k=0

bakx[nk]=

n

X

k=0

bak αx1[nk]+βx2[nk]

n

X

k=0

bakx1[nk]+β

n

X

k=0

bakx2[nk]=αy1[n]+βy2[n]

So the system is linear.

The time invariance is shown by letting the input bev[n]=x[nN],nN, and zero otherwise.

The corresponding output according to Equation (8.30) is

n

X

k=0

bakv[nk]=

n

X

k=0

bakx[nNk]

=

nN

X

k=0

bakx[nNk]+

n

X

k=nN+1

bakx[nNk]=y[nN]

since the summation

n

X

k=nN+1

bakx[nNk]=0

given thatx[−N]= ã ã ã =x[−1]=0 is assumed. Thus, the system represented by the above differ- ence equation is linear and time invariant. As in the continuous-time case, however, if the initial condition y[−1] is not zero, or ifx[n]6=0 for n<0, the system characterized by the difference

equation is not LTI. n

nExample 8.22

Autoregressive moving average filter:The recursive system represented by the first-order difference equation

y[n]=0.5y[n−1]+x[n]+x[n−1] n≥0, y[−1]

is called the autoregressive moving average given that it is the combination of the two systems discussed before. Consider two cases:

n Let the initial condition be y[−1]= −2, and the input bex[n]=u[n] first and thenx[n]= 2u[n].

n Let the initial condition bey[−1]=0, and the input bex[n]=u[n] first and thenx[n]=2u[n].

Determine in each of these cases if the system is linear.

Find the steady-state response—that is,

nlim→∞y[n]

8.3 Discrete-Time Systems 485

Solution

For an initial conditiony[−1]= −2 andx[n]=u[n], we get recursively y[0]=0.5y[−1]+x[0]+x[−1]=0 y[1]=0.5y[0]+x[1]+x[0]=2 y[2]=0.5y[1]+x[2]+x[1]=3

. . .

Let us then double the input (i.e.,x[n]=2u[n]) and call the responsey1[n]. As the initial condition remains the same (i.e.,y1[−1]= −2), we get

y1[0]=0.5y1[−1]+x[0]+x[−1]=1 y1[1]=0.5y1[0]+x[1]+x[0]=4.5 y1[2]=0.5y1[1]+x[2]+x[1]=6.25

. . .

It is clear that the y1[n] is not 2y[n]. Due to the initial condition not being zero, the system is nonlinear.

If the initial condition is set to zero, and the inputx[n]=u[n], the response is y[0]=0.5y[−1]+x[0]+x[−1]=1

y[1]=0.5y[0]+x[1]+x[0]=2.5 y[2]=0.5y[1]+x[2]+x[1]=3.25

. . .

If we double the input (i.e.,x[n]=2u[n]) and call the responsey1[n],y1[−1]=0, we obtain y1[0]=0.5y1[−1]+x[0]+x[−1]=2

y1[1]=0.5y1[0]+x[1]+x[0]=5 y1[2]=0.5y1[1]+x[2]+x[1]=6.5

. . .

For the zero initial condition, it is clear thaty1[n]=2y[n] when we double the input. One can also show that superposition holds for this system. For instance, if we let the input be the sum of the previous inputs,x[n]=u[n]+2u[n]=3u[n], and lety12[n] be the response when the initial condition is zero,y12[0]=0, we get

y12[0]=0.5y12[−1]+x[0]+x[−1]=3 y12[1]=0.5y12[0]+x[1]+x[0]=7.5 y12[2]=0.5y12[1]+x[2]+x[1]=9.75

. . .

showing thaty12[n] is the sum of the responses when the inputs are u[n] and 2u[n]. Thus, the system represented by the given difference equation with a zero initial condition is linear.

Although when the initial condition is −2 or 0, and x[n]=u[n] we cannot find a closed form for the response, we can see that the response is going toward a final value or a steady-state response. Assuming that asn→ ∞we have thatY=y[n]=y[n−1], and sincex[n]=x[n−1]= 1, according to the difference equation the steady-state valueYis found from

Y=0.5Y+2 or Y=4

independent of the initial condition. Likewise, whenx[n]=2u[n], the steady-state solutionY is obtained fromY=0.5Y+4 orY=8, independent of the initial condition. n Remarks

n Like in the continuous-time system, to show that a discrete-time system is linear and time invariant an explicit expression relating the input and the output is needed.

n Although the solution of linear difference equations can be obtained in the time domain, just like with differential equations, we will see in the next chapter that their solution can also be obtained using the Z-transform, just like the Laplace transform being used to solve linear differential equations.

Một phần của tài liệu Signals and systems using matlab (Trang 498 - 503)

Tải bản đầy đủ (PDF)

(769 trang)