• No results found

Connections: System Representation in Various Forms

In document Analog and Digital Signal Processing (Page 130-147)

An LTI system may be described by a difference equation, impulse response, or input-output data. All three are related and, given one form, we should be able to access the others. We have already studied how to obtain the impulse response from a difference equation. Here we shall describe how to obtain the system difference equation from its impulse response or from input-output data.

5.7.1

Difference Equations from the Impulse Response

In the time domain, the process of finding the difference equation from its impulse response is tedious. It is much easier implemented by other methods (such as the z-transform, which we explore in Chapter 17). The central idea is that the terms in the impulse response are an indication of the natural response (and the roots of the characteristic equation) from which the difference equation may be reconstructed if we can describe the combination of the impulse response and its delayed versions by a sum of impulses. The process is best illustrated by some examples.

EXAMPLE 5.15 (Difference Equations from the Impulse Response)

(a) Let h[n] = u[n]. Then h[n − 1] = u[n − 1], and h[n] − h[n − 1] = u[n] − u[n − 1] = δ[n].

The difference equation corresponding to h[n] − h[n − 1] = δ[n] is simply y[n] − y[n − 1] = x[n]. (b) Let h[n] = 3(0.6)nu[n]. This suggests a difference equation whose left-hand side is y[n]− 0.6y[n − 1].

We then set up h[n] − 0.6h[n − 1] = 3(0.6)nu[n]− 1.8(0.6)n−1u[n− 1]. This simplifies to

h[n]− 0.6h[n − 1] = 3(0.6)nu[n]− 3(0.6)nu[n− 1] = 3(0.6)n(u[n] − u[n − 1]) = 3(0.6)nδ[n] = 3δ[n] The difference equation corresponding to h[n] − 0.6h[n − 1] = 3δ[n] is y[n] − 0.6y[n − 1] = 3x[n]. (c) Let h[n] = 2(−0.5)nu[n] + (0.5)nu[n]. This suggests a characteristic equation (z− 0.5)(z + 0.5).

The left-hand side of the difference equation is thus y[n] − 0.25y[n − 2]. We now compute

h[n]− 0.25h[n − 2] = 2(−0.5)nu[n] + (0.5)nu[n]− 0.25(2(−0.5)n−1u[n− 1] + (0.5)n−1u[n− 1]) This simplifies to

h[n]− 0.25h[n − 2] = [2(−0.5)n+ (0.5)n](u[n] − u[n − 2]) = [2(−0.5)n+ (0.5)n](δ[n] + δ[n − 2]) This simplifies further to h[n] − 0.25h[n − 2] = 3δ[n] − 0.5δ[n − 1].

Finally, the difference equation is y[n] − 0.25y[n − 2] = 3x[n] − 0.5x[n − 1].

5.7.2

Difference Equations from Input-Output Data

The difference equation of LTI systems may also be obtained from input-output data. The response of the system described by y[n] = 3x[n]+2x[n−1] to x[n] = δ[n] is y[n] = 3δ[n]+2δ[n−1]. Turning things around, the input δ[n] and output 3δ[n]+2δ[n−1] then corresponds to the difference equation y[n] = 3x[n]+2x[n−1]. Note how the coefficients of the input match the output data (and vice versa).

5.8 Application-Oriented Examples 117 REVIEW PANEL 5.16

Difference Equation of an LTI System from Input-Output Information

Example: If x[n] = {1, 2, 3} and y[n] = {3, 3}, then y[n] + 2y[n − 1] + 3y[n − 2] = 3x[n] + 3x[n − 1].

[n] y + 2y[n −1]+ 3y[n −2]= 3x[n]+ 3x[n −1] System Equation System 1 2 3 n 2 1 Input 3 3 n 1 Output

5.8

Application-Oriented Examples

5.8.1

Inverse Systems

Inverse systems are quite important in practical applications. For example, a measurement system (such as a transducer) invariably affects (distorts) the signal being measured. To undo the effects of the distortion requires a system that acts as the inverse of the measurement system. If an input x[n] to a system results in an output y[n], then its inverse is a system that recovers the signal x[n] in response to the input y[n], as illustrated in Figure 5.4.

y[n]

x[n] x[n]

System Inverse system

Figure 5.4 A system and its inverse

Not all systems have an inverse. For a system to have an inverse, or be invertible, distinct inputs must lead to distinct outputs. If a system produces an identical output for two different inputs, it does not have an inverse. For invertible LTI systems described by difference equations, finding the inverse system is as easy as switching the input and output variables.

REVIEW PANEL 5.17

Finding the Inverse of an LTI System? Try Switching the Input and Output

System: y[n] + 2y[n − 1] = 3x[n] + 4x[n − 1] Inverse system: 3y[n] + 4y[n − 1] = x[n] + 2x[n − 1] How to find the inverse from the impulse response h[n]? Find the difference equation first.

EXAMPLE 5.16 (Inverse Systems)

(a) Refer to the interconnected system shown in Figure E5.16A(1). Find the difference equation of the inverse system, sketch a realization of each system, and find the output of each system.

[n] y =x[n] - 0.5x[n -1 ] Inverse system 1 4 4 n Input Output

Figure E5.16A(1) The interconnected system for Example 5.16(a)

The original system is described by y[n] = x[n] − 0.5x[n − 1]. By switching the input and output, the inverse system is described by y[n] − 0.5y[n − 1] = x[n]. The realization of each system is shown in

118 Chapter 5 Discrete-Time Systems Figure E5.16A(2). Are they related? Yes. If you flip the realization of the echo system end-on-end and change the sign of the feedback signal, you get the inverse realization.

−1 z z−1 0.5 Input Output + + Inverse system

Σ

System 0.5 Input + Output −

Σ

Figure E5.16A(2) Realization of the system and its inverse for Example 5.16(a)

The response g[n] of the first system is simply

g[n] = (4δ[n] + 4δ[n− 1]) − (2δ[n − 1] + 2δ[n − 2]) = 4δ[n] + 2δ[n − 1]) − 2δ[n − 2]) If we let the output of the second system be y0[n], we have

y0[n] = 0.5y0[n − 1] + 4δ[n] + 2δ[n − 1]) − 2δ[n − 2]) Recursive solution gives

y0[0] = 0.5y0[−1] + 4δ[0] = 4 y0[1] = 0.5y0[0] + 2δ[0] = 4 y0[2] = 0.5y0[1] − 2δ[0] = 0 All subsequent values of y0[n] are zero since the input terms are zero for n > 2. The output is thus y0[n] = {

4, 4}, the same as the input to the overall system.

(b) The nonlinear system y[n] = x2[n] does not have an inverse. Two inputs, differing in sign, yield the same output. If we try to recover x[n] as #y[n], we run into a sign ambiguity.

(c) The linear (but time-varying) decimating system y[n] = x[2n] does not have an inverse. Two inputs, which differ in the samples discarded (for example, the signals {1, 2, 4, 5} and {1, 3, 4, 8} yield the same output {1, 4}). If we try to recover the original signal by interpolation, we cannot uniquely identify the original signal.

(d) The linear (but time-varying) interpolating system y[n] = x[n/2] does have an inverse. Its inverse is a decimating system that discards the very samples inserted during interpolation and thus recovers the original signal.

(e) The LTI system y[n] = x[n] + 2x[n − 1] also has an inverse. Its inverse is found by switching the input and output as y[n] + 2y[n − 1] = x[n]. This example also shows that the inverse of an FIR filter results in an IIR filter.

5.8 Application-Oriented Examples 119

5.8.2

Echo and Reverb

The digital processing of audio signals often involves digital filters to create various special effects such as echo and reverb, which are typical of modern-day studio sounds. An echo filter has the form

y[n] = x[n] + αx[n− D] (an echo filter) (5.29)

This describes an FIR filter whose output y[n] equals the input x[n] and its delayed (by D samples) and attenuated (by α) replica of x[n] (the echo term). Its realization is sketched in Figure 5.5. The D-sample delay is implemented by a cascade of D delay elements and represented by the block marked z−D. This filter is also called a comb filter (for reasons to be explained in later chapters).

z-D z-D Input + Output α An echo filter +

Σ

Input Output + + α A reverb filter

Σ

Figure 5.5 Echo and reverb filters

Reverberations are due to multiple echoes (from the walls and other structures in a concert hall, for example). For simplicity, if we assume that the signal suffers the same delay D and the same attenuation α in each round-trip to the source, we may describe the action of reverb by

y[n] = x[n] + αx[n− D] + α2x[n− 2D] + α3x[n− 3D] + · · · (5.30) If we delay both sides by D units, we get

αy[n− D] = αx[n − D] + α2x[n− 2D] + α3x[n− 3D] + α4x[n− 4D] + · · · (5.31) Subtracting the second equation from the first, we obtain a compact form for a reverb filter:

y[n]− αy[n − D] = x[n] (a reverb filter) (5.32)

This is an IIR filter whose realization is also sketched in Figure 5.5. Its form is reminiscent of the inverse of the echo system y[n] + αy[n − D] = x[n], but with α replaced by −α.

In concept, it should be easy to tailor the simple reverb filter to simulate realistic effects by including more terms with different delays and attenuation. In practice, however, this is no easy task, and the filter designs used by commercial vendors in their applications are often proprietary.

5.8.3

Periodic Sequences and Wave-Table Synthesis

Electronic music synthesizers typically possess tone banks of stored tone sequences that are replicated and used in their original or delayed forms or combined to synthesize new sounds and generate various musical effects. The periodic versions of such sequences can be generated by filters that have a recursive form developed from a nonrecursive filter whose impulse response corresponds to one period of the periodic signal. The difference equation of such a recursive filter is given by

120 Chapter 5 Discrete-Time Systems where x1[n] corresponds to one period (N samples) of the signal x[n]. This form actually describes a reverb system with no attenuation whose delay equals the period N. Hardware implementation often uses a circular buffer or wave-table (in which one period of the signal is stored), and cycling over it generates the periodic signal. The same wave-table can also be used to change the frequency (or period) of the signal (to double the frequency for example, we would cycle over alternate samples) or for storing a new signal.

EXAMPLE 5.17 (Generating Periodic Signals Using Recursive Filters) Suppose we wish to generate the periodic signal x[n] described by

x[n] ={2, 3, 1, 6, 2, 3, 1, 6, 2, 3, 1, 6, 2, 3, 1, 6, . . .} The impulse response sequence of a nonrecursive filter that generates this signal is simply

h[n] ={2, 3, 1, 6, 2, 3, 1, 6, 2, 3, 1, 6, 2, 3, 1, 6, . . .} If we delay this sequence by one period (four samples), we obtain

h[n− 4] = {0, 0, 0, 0, 2, 3, 1, 6, 2, 3, 1, 6, 2, 3, 1, 6, 2, 3, 1, 6, . . .} Subtracting the delayed sequence from the original gives us h[n] − h[n − 4] = {2, 3, 1, 6}.

Its recursive form is y[n] − y[n − 4] = x1[n], where x1[n] = {2, 3, 1, 6} describes one period of x[n].

5.8.4

How Difference Equations Arise

We conclude with some examples of difference equations, which arise in many ways in various fields ranging from mathematics and engineering to economics and biology.

1. y[n] = y[n − 1] + n, y[−1] = 1

This difference equation describes the number of regions y[n] into which n lines divide a plane if no two lines are parallel and no three lines intersect.

2. y[n + 1] = (n + 1)(y[n] + 1), y[0] = 0

This difference equation describes the number of multiplications y[n] required to compute the deter- minant of an n × n matrix using cofactors.

3. y[n + 2] = y[n + 1] + y[n], y[0] = 0, y[1] = 1

This difference equation generates the Fibonacci sequence {y[n] = 0, 1, 1, 2, 3, 5, . . .}, where each number is the sum of the previous two.

4. y[n + 2] − 2xy[n + 1] + y[n] = 0, y[0] = 1, y[1] = x

This difference equation generates the Chebyshev polynomials Tn(x) = y[n] of the first kind. We find that T2(x) = y[2] = 2x2− 1, T3(x) = y[3] = 4x3− 3x, etc. Similar difference equations called recurrence relations form the basis for generating other polynomial sets.

5. y[n + 1] = αy[n](1 − y[n])

In biology, this difference equation, called a logistic equation, is used to model the growth of populations that reproduce at discrete intervals.

6. y[n + 1] = (1 + α)y[n] + d[n]

This difference equation describes the bank balance y[n] at the beginning of the nth-compounding period (day, month, etc.) if the percent interest rate is α per compounding period and d[n] is the amount deposited in that period.

Chapter 5 Problems 121

CHAPTER 5

PROBLEMS

DRILL AND REINFORCEMENT

5.1 (Operators) Which of the following describe linear operators? (a) O{ } = 4{ } (b) O{ } = 4{ } + 3 (c) O{ } = α{ }

5.2 (System Classification) In each of the systems below, x[n] is the input and y[n] is the output. Check each system for linearity, shift invariance, memory, and causality.

(a) y[n] − y[n − 1] = x[n] (b) y[n] + y[n + 1] = nx[n] (c) y[n] − y[n + 1] = x[n + 2] (d) y[n + 2] − y[n + 1] = x[n] (e) y[n + 1] − x[n]y[n] = nx[n + 2] (f) y[n] + y[n − 3] = x2[n] + x[n + 6] (g) y[n] − 2ny[n] = x[n] (h) y[n] = x[n] + x[n − 1] + x[n − 2]

5.3 (Response by Recursion) Find the response of the following systems by recursion to n = 4 and try to discern the general form for y[n].

(a) y[n] − ay[n − 1] = δ[n] y[−1] = 0

(b) y[n] − ay[n − 1] = u[n] y[−1] = 1

(c) y[n] − ay[n − 1] = nu[n] y[−1] = 0

(d) y[n] + 4y[n − 1] + 3y[n − 2] = u[n − 2] y[−1] = 0 y[−2] = 1 5.4 (Forced Response) Find the forced response of the following systems.

(a) y[n] − 0.4y[n − 1] = u[n] (b) y[n] − 0.4y[n − 1] = (0.5)n (c) y[n] + 0.4y[n − 1] = (0.5)n (d) y[n] − 0.5y[n − 1] = cos(nπ/2) 5.5 (Forced Response) Find the forced response of the following systems.

(a) y[n] − 1.1y[n − 1] + 0.3y[n − 2] = 2u[n] (b) y[n] − 0.9y[n − 1] + 0.2y[n − 2] = (0.5)n (c) y[n] + 0.7y[n − 1] + 0.1y[n − 2] = (0.5)n (d) y[n] − 0.25y[n − 2] = cos(nπ/2)

5.6 (Zero-State Response) Find the zero-state response of the following systems. (a) y[n] − 0.5y[n − 1] = 2u[n] (b) y[n] − 0.4y[n − 1] = (0.5)n

(c) y[n] − 0.4y[n − 1] = (0.4)n (d) y[n] − 0.5y[n − 1] = cos(nπ/2)

5.7 (Zero-State Response) Find the zero-state response of the following systems.

(a) y[n] − 1.1y[n − 1] + 0.3y[n − 2] = 2u[n] (b) y[n] − 0.9y[n − 1] + 0.2y[n − 2] = (0.5)n (c) y[n] + 0.7y[n − 1] + 0.1y[n − 2] = (0.5)n (d) y[n] − 0.25y[n − 2] = cos(nπ/2)

5.8 (System Response) Let y[n]−0.5y[n−1] = x[n], with y[−1] = −1. Find the response of this system for the following inputs.

(a) x[n] = 2u[n] (b) x[n] = (0.25)nu[n] (c) x[n] = n(0.25)nu[n] (d) x[n] = (0.5)nu[n] (e) x[n] = n(0.5)n (f) x[n] = (0.5)ncos(0.5nπ)

122 Chapter 5 Discrete-Time Systems 5.9 (System Response) Find the response of the following systems.

(a) y[n] + 0.1y[n − 1] − 0.3y[n − 2] = 2u[n] y[−1] = 0 y[−2] = 0 (b) y[n] − 0.9y[n − 1] + 0.2y[n − 2] = (0.5)n y[−1] = 1 y[−2] = −4 (c) y[n] + 0.7y[n − 1] + 0.1y[n − 2] = (0.5)n y[−1] = 0 y[−2] = 3 (d) y[n] − 0.25y[n − 2] = (0.4)n y[−1] = 0 y[−2] = 3 (e) y[n] − 0.25y[n − 2] = (0.5)n y[−1] = 0 y[−2] = 0

5.10 (System Response) Sketch a realization for each system, assuming zero initial conditions. Then evaluate the complete response from the information given. Check your answer by computing the first few values by recursion.

(a) y[n] − 0.4y[n − 1] = x[n] x[n] = (0.5)nu[n] y[−1] = 0 (b) y[n] − 0.4y[n − 1] = 2x[n] + x[n − 1] x[n] = (0.5)nu[n] y[−1] = 0 (c) y[n] − 0.4y[n − 1] = 2x[n] + x[n − 1] x[n] = (0.5)nu[n] y[−1] = 5 (d) y[n] + 0.5y[n − 1] = x[n] − x[n − 1] x[n] = (0.5)nu[n] y[−1] = 2 (e) y[n] + 0.5y[n − 1] = x[n] − x[n − 1] x[n] = (−0.5)nu[n] y[−1] = 0

5.11 (System Response) For each system, evaluate the natural, forced, and total response. Assume that y[−1] = 0, y[−2] = 1. Check your answer for the total response by computing its first few values by recursion.

(a) y[n] + 4y[n − 1] + 3y[n − 2] = u[n] (b) y[n] + 4y[n − 1] + 4y[n − 2] = 2nu[n] (c) y[n] + 4y[n − 1] + 8y[n − 2] = cos(nπ)u[n] (d) {(1 + 2z−1)2}y[n] = n(2)nu[n] (e) {1 +3

4z−1+18z−2}y[n] = (13)nu[n] (f) {1 + 0.5z−1+ 0.25z−2}y[n] = cos(0.5nπ)u[n] (g) {z2+ 4z + 4}y[n] = 2nu[n] (h) {1 − 0.5z−1}y[n] = (0.5)ncos(0.5nπ)u[n] 5.12 (System Response) For each system, set up a difference equation and compute the zero-state,

zero-input, and total response, assuming x[n] = u[n] and y[−1] = y[−2] = 1. (a) {1 − z−1− 2z−2}y[n] = x[n] (b) {z2− z − 2}y[n] = x[n] (c) {1 −3

4z−1+18z−2}y[n] = {z−1}x[n] (d) {1 −34z−1+18z−2}y[n] = {1 + z−1}x[n] (e) {1 − 0.25z−2}y[n] = x[n] (f) {z2− 0.25}y[n] = {2z2+ 1}x[n]

5.13 (Impulse Response by Recursion) Find the impulse response h[n] by recursion up to n = 4 for each of the following systems.

(a) y[n] − y[n − 1] = 2x[n] (b) y[n] − 3y[n − 1] + 6y[n − 2] = x[n − 1]

(c) y[n] − 2y[n − 3] = x[n − 1] (d) y[n] − y[n − 1] + 6y[n − 2] = nx[n − 1] + 2x[n − 3]

5.14 (Analytical Form for Impulse Response) Classify each filter as recursive or FIR (nonrecursive), and causal or noncausal, and find an expression for its impulse response h[n].

(a) y[n] = x[n] + x[n − 1] + x[n − 2] (b) y[n] = x[n + 1] + x[n] + x[n − 1] (c) y[n] + 2y[n − 1] = x[n] (d) y[n] + 2y[n − 1] = x[n − 1]

(e) y[n] + 2y[n − 1] = 2x[n] + 6x[n − 1] (f) y[n] + 2y[n − 1] = x[n + 1] + 4x[n] + 6x[n − 1] (g) {1 + 4z−1+ 3z−2}y[n] = {z−2}x[n] (h) {z2+ 4z + 4}y[n] = {z + 3}x[n]

(i) {z2+ 4z + 8}y[n] = x[n] (j) y[n] + 4y[n − 1] + 4y[n − 2] = x[n] − x[n + 2] 5.15 (Stability) Investigate the causality and stability of the following systems.

(a) y[n] = x[n − 1] + x[n] + x[n + 1] (b) y[n] = x[n] + x[n − 1] + x[n − 2] (c) y[n] − 2y[n − 1] = x[n] (d) y[n] − 0.2y[n − 1] = x[n] − 2x[n + 2] (e) y[n] + y[n − 1] + 0.5y[n − 2] = x[n] (f) y[n] − y[n − 1] + y[n − 2] = x[n] − x[n + 1] (g) y[n] − 2y[n − 1] + y[n − 2] = x[n] − x[n − 3] (h) y[n] − 3y[n − 1] + 2y[n − 2] = 2x[n + 3]

Chapter 5 Problems 123

REVIEW AND EXPLORATION

5.16 (System Classification) Classify the following systems in terms of their linearity, time invariance, memory, causality, and stability.

(a) y[n] = 3nx[n] (b) y[n] = ejnπx[n]

(c) y[n] = cos(0.5nπ)x[n] (d) y[n] = [1 + cos(0.5nπ)]x[n] (e) y[n] = ex[n] (f) y[n] = x[n] + cos[0.5(n + 1)π]

5.17 (System Classification) Classify the following systems in terms of their linearity, time invariance, memory, causality, and stability.

(a) y[n] = x[n/3] (zero interpolation) (b) y[n] = cos(nπ)x[n] (modulation)

(c) y[n] = [1 + cos(nπ)]x[n] (modulation) (d) y[n] = cos(nπx[n]) (frequency modulation)

(e) y[n] = cos(nπ + x[n]) (phase modulation) (f) y[n] = x[n] − x[n − 1] (differencing operation) (g) y[n] = 0.5x[n] + 0.5x[n − 1] (averaging operation) (h) y[n] = 1

N

N−1$

k=0

x[n− k] (moving average)

(i) y[n] − αy[n − 1] = αx[n], 0 < α < 1 (exponential averaging) (j) y[n] = 0.4(y[n − 1] + 2) + x[n]

5.18 (Classification) Classify each system in terms of its linearity, time invariance, memory, causality, and stability.

(a) The folding system y[n] = x[−n]. (b) The decimating system y[n] = x[2n].

(c) The zero-interpolating system y[n] = x[n/2]. (d) The sign-inversion system y[n] = sgn{x[n]}.

(e) The rectifying system y[n] = |x[n]|.

5.19 (Classification) Classify each system in terms of its linearity, time invariance, causality, and stability. (a) y[n] = round{x[n]} (b) y[n] = median{x[n + 1], x[n], x[n − 1]}

(c) y[n] = x[n] sgn(n) (d) y[n] = x[n] sgn{x[n]}

5.20 (Inverse Systems) Are the following systems invertible? If not, explain why; if invertible, find the inverse system.

(a) y[n] = x[n] − x[n − 1] (differencing operation) (b) y[n] = 1

3(x[n] + x[n − 1] + x[n − 2]) (moving average operation)

(c) y[n] = 0.5x[n] + x[n − 1] + 0.5x[n − 2] (weighted moving average operation) (d) y[n] − αy[n − 1] = (1 − α)x[n], 0 < α < 1 (exponential averaging operation)

(e) y[n] = cos(nπ)x[n] (modulation) (f) y[n] = cos(x[n])

124 Chapter 5 Discrete-Time Systems 5.21 (An Echo System and Its Inverse) An echo system is described by y[n] = x[n] + 0.5x[n − N].

Assume that the echo arrives after 1 ms and the sampling rate is 2 kHz. (a) What is the value of N? Sketch a realization of this echo system. (b) What is the impulse response and step response of this echo system?

(c) Find the difference equation of the inverse system. Then, sketch its realization and find its impulse response and step response.

5.22 (Reverb) A reverb filter is described by y[n] = x[n] + 0.25y[n − N]. Assume that the echoes arrive every millisecond and the sampling rate is 2 kHz.

(a) What is the value of N? Sketch a realization of this reverb filter. (b) What is the impulse response and step response of this reverb filter?

(c) Find the difference equation of the inverse system. Then, sketch its realization and find its impulse response and step response.

5.23 (System Response) Consider the system y[n] − 0.5y[n − 1] = x[n]. Find its zero-state response to the following inputs.

(a) x[n] = u[n] (b) x[n] = (0.5)nu[n] (c) x[n] = cos(0.5nπ)u[n]

(d) x[n] = (−1)nu[n] (e) x[n] = jnu[n] (f) x[n] = (√j)nu[n] + (j)−nu[n]

5.24 (System Response) For the system realization shown in Figure P5.24, find the response to the following inputs and initial conditions.

(a) x[n] = u[n] y[−1] = 0 (b) x[n] = u[n] y[−1] = 4

(c) x[n] = (0.5)nu[n] y[−1] = 0 (d) x[n] = (0.5)nu[n] y[−1] = 6 (e) x[n] = (−0.5)nu[n] y[−1] = 0 (f) x[n] = (−0.5)nu[n] y[−1] = −2

[n] x y[n] −1 z +

Σ

0.5 −

Figure P5.24 System realization for Problem 5.24

5.25 (System Response) Find the response of the following systems. (a) y[n] − 0.4y[n − 1] = 2(0.5)n−1u[n− 1] y[−1] = 0 (b) y[n] − 0.4y[n − 1] = (0.4)nu[n] + 2(0.5)n−1u[n− 1] y[−1] = 2.5 (c) y[n] − 0.4y[n − 1] = n(0.5)nu[n] + 2(0.5)n−1u[n− 1] y[−1] = 2.5 5.26 (System Response) Find the impulse response of the following filters.

(a) y[n] = x[n] − x[n − 1] (differencing operation) (b) y[n] = 0.5x[n] + 0.5x[n − 1] (averaging operation)

(c) y[n] = 1 N N−1$ k=0 x[n− k], N = 3 (moving average) (d) y[n] = 2 N (N +1) N−1$ k=0

(N − k)x[n − k], N = 3 (weighted moving average) (e) y[n] − αy[n − 1] = (1 − α)x[n], N = 3, α = N−1

Chapter 5 Problems 125 5.27 (System Response) It is known that the response of the system y[n] + αy[n − 1] = x[n], α ̸= 0, is

given by y[n] = [5 + 3(0.5)n]u[n].

(a) Identify the natural response and forced response. (b) Identify the values of α and y[−1].

(c) Identify the zero-input response and zero-state response. (d) Identify the input x[n].

5.28 (System Response) It is known that the response of the system y[n]+0.5y[n−1] = x[n] is described by y[n] = [5(0.5)n+ 3(−0.5)n)]u[n].

(a) Identify the zero-input response and zero-state response.

(b) What is the zero-input response of the system y[n] + 0.5y[n − 1] = x[n] if y[−1] = 10? (c) What is the response of the relaxed system y[n] + 0.5y[n − 1] = x[n − 2]?

(d) What is the response of the relaxed system y[n] + 0.5y[n − 1] = x[n − 1] + 2x[n]?

5.29 (System Response) It is known that the response of the system y[n] + αy[n − 1] = x[n] is described by y[n] = (5 + 2n)(0.5)nu[n].

(a) Identify the zero-input response and zero-state response.

(b) What is the zero-input response of the system y[n] + αy[n − 1] = x[n] if y[−1] = 10? (c) What is the response of the relaxed system y[n] + αy[n − 1] = x[n − 1])?

(d) What is the response of the relaxed system y[n] + αy[n − 1] = 2x[n − 1] + x[n]? (e) What is the complete response of the y[n] + αy[n − 1] = x[n] + 2x[n − 1] if y[−1] = 4?

5.30 (System Interconnections) Two systems are said to be in cascade if the output of the first system acts as the input to the second. Find the response of the following cascaded systems if the input is a unit step and the systems are described as follows. In which instances does the response differ when the order of cascading is reversed? Can you use this result to justify that the order in which the systems are cascaded does not matter in finding the overall response if both systems are LTI?

(a) System 1: y[n] = x[n] − x[n − 1] System 2: y[n] = 0.5y[n − 1] + x[n] (b) System 1: y[n] = 0.5y[n − 1] + x[n] System 2: y[n] = x[n] − x[n − 1] (c) System 1: y[n] = x2[n] System 2: y[n] = 0.5y[n − 1] + x[n] (d) System 1: y[n] = 0.5y[n − 1] + x[n] System 2: y[n] = x2[n]

5.31 (Systems in Cascade and Parallel) Consider the realization of Figure P5.31.

[n] y −1 z −1 z −1 z [n] x α β + + + + + −

Σ

Σ

Σ

Figure P5.31 System realization for Problem 5.31

(a) Find its impulse response if α ̸= β. Is the overall system FIR or IIR?

(b) Find its difference equation and impulse response if α = β. Is the overall system FIR or IIR? (c) Find its difference equation and impulse response if α = β = 1. What is the function of the

126 Chapter 5 Discrete-Time Systems 5.32 (Difference Equations from Impulse Response) Find the difference equations describing the

following systems.

(a) h[n] = δ[n] + 2δ[n − 1] (b) h[n] = {2, 3, −1}⇓

(c) h[n] = (0.3)nu[n] (d) h[n] = (0.5)nu[n]− (−0.5)nu[n]

5.33 (Difference Equations from Impulse Response) A system is described by the impulse response h[n] = (−1)nu[n]. Find the difference equation of this system. Then find the difference equation of the inverse system. Does the inverse system describe an FIR filter or IIR filter? What function does it perform?

5.34 (Difference Equations from Differential Equations) Consider an analog system described by the differential equation y′′(t) + 3y(t) + 2y(t) = 2u(t).

(a) Confirm that this describes a stable analog system.

(b) Convert this to a difference equation using the backward Euler algorithm and check the stability of the resulting digital filter.

(c) Convert this to a difference equation using the forward Euler algorithm and check the stability of the resulting digital filter.

(d) Which algorithm is better in terms of preserving stability? Can the results be generalized to any arbitrary analog system?

5.35 (Difference Equations) For the filter realization shown in Figure P5.35, find the difference equation relating y[n] and x[n] if the impulse response of the filter is given by

(a) h[n] = δ[n] − δ[n − 1] (b) h[n] = 0.5δ[n] + 0.5δ[n − 1] [n] x y[n] −1 z +

Σ

− Filter

Figure P5.35 Filter realization for Problem 5.35

5.36 (Periodic Signal Generators) Find the difference equation of a filter whose impulse response is a periodic sequence with first period x[n] = {⇓1, 2, 3, 4, 6, 7, 8}. Sketch a realization for this filter. 5.37 (Recursive and IIR Filters) The terms recursive and IIR are not always synonymous. A recursive

filter could in fact have a finite impulse response. Use recursion to find the the impulse response h[n] for each of the following recursive filters. Which filters (if any) describe IIR filters?

(a) y[n] − y[n − 1] = x[n] − x[n − 2]

(b) y[n] − y[n − 1] = x[n] − x[n − 1] − 2x[n − 2] + 2x[n − 3]

5.38 (Recursive Forms of FIR Filters) An FIR filter may always be recast in recursive form by the simple expedient of including identical factors on the left-hand and right-hand side of its difference equation in operational form. For example, the filter y[n] = (1 − z−1)x[n] is FIR, but the identical filter (1 + z−1)y[n] = (1 + z−1)(1 − z−1)x[n] has the difference equation y[n] + y[n − 1] = x[n] − x[n − 2] and can be implemented recursively. Find two different recursive difference equations (with different orders) for each of the following filters.

Chapter 5 Problems 127 5.39 (Nonrecursive Forms of IIR Filters) An FIR filter may always be exactly represented in recursive form, but we can only approximately represent an IIR filter by an FIR filter by truncating its impulse response to N terms. The larger the truncation index N, the better is the approximation. Consider the IIR filter described by y[n] − 0.8y[n − 1] = x[n]. Find its impulse response h[n] and truncate it to three terms to obtain h3[n], the impulse response of the approximate FIR equivalent. Would you expect the greatest mismatch in the response of the two filters to identical inputs to occur for lower or higher values of n? Compare the step response of the two filters up to n = 6 to justify your expectations. 5.40 (Nonlinear Systems) One way to solve nonlinear difference equations is by recursion. Consider the

nonlinear difference equation y[n]y[n − 1] − 0.5y2[n − 1] = 0.5Au[n]. (a) What makes this system nonlinear?

(b) Using y[−1] = 2, recursively obtain y[0], y[1], and y[2].

(c) Use A = 2, A = 4, and A = 9 in the results of part (b) to confirm that this system finds the square root of A.

(d) Repeat parts (b) and (c) with y[−1] = 1 to check whether the choice of the initial condition affects system operation.

5.41 (LTI Concepts and Stability) Argue that neither of the following describes an LTI system. Then, explain how you might check for their stability and determine which of the systems are stable. (a) y[n] + 2y[n − 1] = x[n] + x2[n] (b) y[n] − 0.5y[n − 1] = nx[n] + x2[n]

5.42 (Response of Causal and Noncausal Systems) A difference equation may describe a causal or noncausal system depending on how the initial conditions are prescribed. Consider a first-order system governed by y[n] + αy[n − 1] = x[n].

(a) With y[n] = 0, n < 0, this describes a causal system. Assume y[−1] = 0 and find the first few terms y[0], y[1], . . . of the impulse response and step response, using recursion, and establish the general form for y[n].

(b) With y[n] = 0, n > 0, we have a noncausal system. Assume y[0] = 0 and rewrite the difference equation as y[n − 1] = {−y[n] + x[n]}/α to find the first few terms y[0], y[−1], y[−2], . . . of the impulse response and step response, using recursion, and establish the general form for y[n].

COMPUTATION AND DESIGN

dtsimgui

A GUI for System Response Simulation

The graphical user interface dtsimgui allows you to simulate and visualize the response of discrete- time systems.

You can select the input signal, the system parameters, and initial conditions. To explore this routine, type dtsimgui at the Matlab prompt.

5.43 (Numerical Integration Algorithms) Numerical integration algorithms approximate the area y[n] from y[n − 1] or y[n − 2] (one or more time steps away). Consider the following integration algorithms.

(a) y[n] = y[n − 1] + tsx[n] (rectangular rule) (b) y[n] = y[n − 1] + ts

128 Chapter 5 Discrete-Time Systems (c) y[n] = y[n − 1] + ts

12(5x[n] + 8x[n − 1] − x[n − 2]) (Adams-Moulton rule) (d) y[n] = y[n − 2] + ts

3(x[n] + 4x[n − 1] + x[n − 2]) (Simpson’s rule) (e) y[n] = y[n − 3] +3ts

8 (x[n] + 3x[n − 1] + 3x[n − 2] + x[n − 3]) (Simpson’s three-eighths rule) Use each of the rules to approximate the area of x(t) = sinc(t), 0 ≤ t ≤ 3, with ts= 0.1 s and ts= 0.3 s, and compare with the expected result of 0.53309323761827. How does the choice of the time step ts affect the results? Which algorithm yields the most accurate results?

5.44 (System Response) Use the Matlab routine filter to obtain and plot the response of the filter described by y[n] = 0.25(x[n] + x[n − 1] + x[n − 2] + x[n − 3]) to the following inputs and comment on your results. (a) x[n] = 1, 0 ≤ n ≤ 60 (b) x[n] = 0.1n, 0 ≤ n ≤ 60 (c) x[n] = sin(0.1nπ), 0 ≤ n ≤ 60 (d) x[n] = 0.1n + sin(0.5nπ), 0 ≤ n ≤ 60 (e) x[n] = ∞ $ k=−∞ δ[n− 5k], 0 ≤ n ≤ 60 (f) x[n] = ∞ $ k=−∞ δ[n− 4k], 0 ≤ n ≤ 60

5.45 (System Response) Use the Matlab routine filter to obtain and plot the response of the filter described by y[n] − y[n − 4] = 0.25(x[n] + x[n − 1] + x[n − 2] + x[n − 3]) to the following inputs and comment on your results.

(a) x[n] = 1, 0 ≤ n ≤ 60 (b) x[n] = 0.1n, 0 ≤ n ≤ 60 (c) x[n] = sin(0.1nπ), 0 ≤ n ≤ 60 (d) x[n] = 0.1n + sin(0.5nπ), 0 ≤ n ≤ 60 (e) x[n] = ∞ $ k=−∞ δ[n− 5k], 0 ≤ n ≤ 60 (f) x[n] = $∞ k=−∞ δ[n− 4k], 0 ≤ n ≤ 60

5.46 (System Response) Use Matlab to obtain and plot the response of the following systems over the range 0 ≤ n ≤ 199.

(a) y[n] = x[n/3], x[n] = (0.9)nu[n] (assume zero interpolation) (b) y[n] = cos(0.2nπ)x[n], x[n] = cos(0.04nπ) (modulation)

(c) y[n] = [1 + cos(0.2nπ)]x[n], x[n] = cos(0.04nπ) (modulation)

5.47 (System Response) Use Matlab to obtain and plot the response of the following filters, using direct commands (where possible) and also using the routine filter, and compare your results. Assume that the input is given by x[n] = 0.1n + sin(0.1nπ), 0 ≤ n ≤ 60. Comment on your results.

(a) y[n] = 1 N

N−1$

k=0

Chapter 5 Problems 129 (b) y[n] = 2

N (N +1)

N−1$

k=0

(N − k)x[n − k], N = 4 (weighted moving average) (c) y[n] − αy[n − 1] = (1 − α)x[n], N = 4, α = N−1

N +1 (exponential average)

5.48 (System Response) Use Matlab to obtain and plot the response of the following filters, using direct commands and using the routine filter, and compare your results. Use an input that consists of the sum of the signal x[n] = 0.1n + sin(0.1nπ), 0 ≤ n ≤ 60 and uniformly distributed random noise with a mean of 0. Comment on your results.

(a) y[n] = 1 N N−1$ k=0 x[n− k], N = 4 (moving average) (b) y[n] = 2 N (N +1) N−1$ k=0

(N − k)x[n − k], N = 4 (weighted moving average) (c) y[n] − αy[n − 1] = (1 − α)x[n], N = 4, α = N−1

N +1 (exponential averaging)

5.49 (System Response) Use the Matlab routine filter to obtain and plot the response of the following FIR filters. Assume that x[n] = sin(nπ/8), 0 ≤ n ≤ 60. Comment on your results. From the results, can you describe the the function of these filters?

(a) y[n] = x[n] − x[n − 1] (first difference)

(b) y[n] = x[n] − 2x[n − 1] + x[n − 2] (second difference) (c) y[n] = 1

3(x[n] + x[n − 1] + x[n − 2]) (moving average) (d) y[n] = 0.5x[n] + x[n − 1] + 0.5x[n − 2] (weighted average)

5.50 (System Response in Symbolic Form) The ADSP routine sysresp1 returns the system response in symbolic form. See Chapter 21 for examples of its usage. Obtain the response of the following filters and plot the response for 0 ≤ n ≤ 30.

(a) The step response of y[n] − 0.5y[n] = x[n] (b) The impulse response of y[n] − 0.5y[n] = x[n]

(c) The zero-state response of y[n] − 0.5y[n] = (0.5)nu[n]

(d) The complete response of y[n] − 0.5y[n] = (0.5)nu[n], y[−1] = −4

(e) The complete response of y[n] + y[n − 1] + 0.5y[n − 2] = (0.5)nu[n], y[−1] = −4, y[−2] = 3 5.51 (Inverse Systems and Echo Cancellation) A signal x(t) is passed through the echo-generating

system y(t) = x(t) + 0.9x(t − τ) + 0.8x(t − 2τ), with τ = 93.75 ms. The resulting echo signal y(t) is sampled at S = 8192 Hz to obtain the sampled signal y[n].

(a) The difference equation of a digital filter that generates the output y[n] from x[n] may be written as y[n] = x[n] + 0.9x[n − N] + 0.8x[n − 2N]. What is the value of the index N?

(b) What is the difference equation of an echo-canceling filter (inverse filter) that could be used to recover the input signal x[n]?

(c) The echo signal is supplied as echosig.mat. Load this signal into Matlab (using the command load echosig). Listen to this signal using the Matlab command sound. Can you hear the echoes? Can you make out what is being said?

(d) Filter the echo signal using your inverse filter and listen to the filtered signal. Have you removed the echoes? Can you make out what is being said? Do you agree with what is being said? If so, please thank Prof. Tim Schulz (http://www.ee.mtu.edu/faculty/schulz) for this problem.

Chapter 6

CONTINUOUS CONVOLUTION

6.0

Scope and Objectives

In the time domain, convolution may be regarded as a method of finding the zero-state response of a relaxed LTI system. This chapter describes the convolution operation and its properties, and establishes the key connections between time-domain and transformed-domain methods for signal and system analysis based on convolution. Frequency-domain viewpoints of convolution will be presented in later chapters.

6.1

Introduction

The convolution method for finding the zero-state response y(t) of a system to an input x(t) applies to linear time-invariant (LTI) systems. The system is assumed to be described by its impulse response h(t). An informal way to establish a mathematical form for y(t) is illustrated in Figure 6.1.

t Impulse approximation of input t t t t t t t t t t Output h(t) Input x(t) t t y(t) x(t) Superposition Impulse response Impulse input

Total input

Total response

In document Analog and Digital Signal Processing (Page 130-147)