CHAPTER 8 Discrete-Time Signals and Systems
8.4 What Have We Accomplished? Where Do We Go from Here?
As you saw in this chapter the theory of discrete-time signals and systems is very similar to the the- ory of continuous-time signals and systems. Many of the results in the continuous-time theory are changed by swapping integrals for sums and differential equations for difference equations. However, there are significant differences imposed by the way the discrete-time signals and systems are gener- ated. For instance, the discrete frequency can be considered finite but circular, and it depends on the sampling time. Discrete sinusoids, as another example, are not necessarily periodic. Thus, despite the similarities there are also significant differences between the continuous-time and the discrete-time signals and systems.
Now that we have a basic structure for discrete-time signals and systems, we will continue developing the theory of linear time-invariant discrete-time systems using transforms. Again, you will find a great deal of similarity but also some very significant differences. In the next chapters, carefully notice the relation that exists between the Z-transform and the Fourier representations of discrete-time signals and systems, not only with each other but with the Laplace and Fourier transforms. There is a great deal of connection among all of these transforms, and a clear understanding of this would help you with the analysis and synthesis of discrete-time signals and systems.
PROBLEMS
8.1. Discrete sequence—MATLAB Consider the following formula
x[n]=x[n−1]+x[n−3] n≥3 x[0]=0
x[1]=1 x[2]=2
Find the rest of the sequence for0≤n≤50and plot it using the MATLAB functionstem.
8.2. Finite-energy signals—MATLAB Given the discrete signalx[n]=0.5nu[n]:
(a) Use MATLAB to plot the signalx[n]forn= −5to200.
(b) Is this a finite-energy discrete-time signal? That is compute the infinite sum X∞
n=−∞
|x[n]|2
Hint: Show that
X∞
n=0
αn= 1 1−α
Problems 503
or equivalently that
(1−α)X∞ n=0
αn=1
provided|α|<1.
(c) Verify your results by using symbolic MATLAB to find an expression for the above sum.
8.3. Periodicity of sampled signals—MATLAB
Consider an analog periodic sinusoidx(t)=cos(3πt+π/4)being sampled using a sampling periodTsto obtain the discrete-time signalx[n]=x(t)|t=nTs =cos(3πTsn+π/4).
(a) Determine the discrete frequency ofx[n].
(b) Choose a value ofTsfor which the discrete-time signalx[n]is periodic. Use MATLAB to plot a few periods ofx[n], and verify its periodicity.
(c) Choose a value ofTsfor which the discrete-time signalx[n]is not periodic. Use MATLAB to plotx[n]
and choose an appropriate length to show the signal is not periodic.
(d) Determine under what condition the value ofTsmakesx[n]periodic.
8.4. Even and odd decomposition and energy—MATLAB Suppose you sample the analog signal
x(t)=
1−t 0≤t≤1
0 otherwise
with a sampling periodTs=0.25to generatex[n]=x(t)|t=nTs. (a) Use MATLAB to plotx[−n]for an appropriate interval.
(b) Findxe[n]=0.5[x[n]+x[−n]]and plot it carefully using MATLAB.
(c) Findxo[n]=0.5[x[n]−x[−n]]and plot it carefully using MATLAB.
(d) Verify thatxe[n]+xo[n]=x[n]graphically.
(e) Compute the energy ofx[n]and compare it to the sum of the energies ofxe[n]andxo[n].
8.5. Signal representation in terms ofu[n]—MATLAB
We have shown how any discrete-time signal can be represented as a sum of weighted and shifted versions ofδ[n]. Given that
δ[n]=u[n]−u[n−1]
it should be possible to represent any signal as a combination of unit-step functions. Consider a discrete- time rampr[n]=nu[n], which in terms ofδ[n]is written as
r[n]= X∞
k=−∞
r[k]δ[n−k]
Replacer[k]=ku[k]and useδ[n]=u[n]−u[n−1]to show thatr[n]can be expressed in terms ofu[n]as
r[n]=
∞ X k=1
u[n−k]
Does this equation make sense? Use MATLAB to plot the obtainedr[n]to help you answer this.
8.6. Generation of periodic discrete-time signals—MATLAB
Periodic signals can be generated by obtaining a period and adding shifted versions of this period. Suppose we wish to generate a train of triangular pulses. A period of the signal is
x[n]=r[n]−2r[n−1]+r[n−2]
wherer[n]=nu[n]is the discrete-time ramp signal.
(a) Carefully plotx[n].
(b) Let
y[n]= X∞
k=−∞
x[n−2k]
and carefully plot it. Indicate the periodNofy[n].
(c) Write a MATLAB script to generate and plot the periodic signaly[n].
8.7. Expansion and compression of discrete-time signals—MATLAB Consider the discrete-time signalx[n]=cos(2πn/7).
(a) The discrete-time signal can be compressed by getting rid of some of its samples (downsampling).
Consider the downsampling by 2. Write a MATLAB script to obtain and plotz[n]=x[2n]. Plot also x[n]and compare it withz[n]. What happended? Explain.
(b) The expansion for discrete-time signals requires interpolation, and we will see it later. However, a first step of this process is the so-calledupsampling. Upsampling by 2 consists in defining a new signal y[n]such thaty[n]=x[n/2]forneven, andy[n]=0 otherwise. Write a MATLAB script to perform upsampling onx[n]. Plot the resulting signaly[n]and explain its relation withx[n].
(c) Ifx[n]resulted from sampling a continuous-time signalx(t)=cos(2πt)using a sampling periodTs and with no frequency aliasing, determineTs. How would you sample the analog signalx(t)to get the downsampled signalsz[n]? That is, choose a value for the sampling periodTsto getz[n]directly from x(t). Can you chooseTsto gety[n]fromx(t)directly? Explain.
8.8. Absolutely summable and finite-energy discrete-time signals—MATLAB Suppose we sample the analog signalx(t)=e−2tu(t)using a sample periodTs=1.
(a) Expressing the sampled signal asx(nTs)=x[n]=αnu[n], what is the corresponding value ofα? Use MATLAB to plotx[n].
(b) Show thatx[n]is absolutely summable—that is, show the following sum is finite:
X∞
n=−∞
|x[n]|
(c) If you know thatx[n]is absolutely summable, could you say thatx[n]is a finite-energy signal? Use MATLAB to plot|x[n]|andx2[n]in the same plot to help you decide.
(d) In general, for what values ofαare signalsy[n]=αnu[n]finite energy? Explain.
8.9. Discrete-time periodic signals
Determine whether the following discrete-time sinusoids are periodic or not. If periodic, determine its periodN0.
x[n]=2 cos(πn−π/2) y[n]=sin(n−π/2) z[n]=x[n]+y[n]
v[n]=sin(3πn/2)
Problems 505
8.10. Periodicity of discrete-time signals
Consider periodic signalsx[n], of periodN1=4, andy[n], of periodN2=6. What would be the period of z[n]=x[n]+y[n]
v[n]=x[n]y[n]
w[n]=x[2n]
8.11. Periodicity of sum and product of periodic signals—MATLAB Ifx[n]is periodic of periodN1>0andy[n]is periodic of periodN2>0:
(a) What should be the condition for the sum ofx[n]andy[n]to be periodic?
(b) What would be the period of the productx[n]y[n]?
(c) Would the formula
N1N2 gcd(N1,N2)
(gcd(N1,N2)stands for the greatest common divisor ofN1andN2) give the period of the sum and the product of the two signalsx[n]andy[n]?
(d) Use MATLAB to plot the signalsx[n]=cos(2πn/3)u[n], andy[n]=(1+sin(6πn/7))u[n], their sum and product, and to find their periods and to verify your analytic results.
8.12. Echoing of music—MATLAB
An effect similar to multipath in acoustics is echoing or reverberation. To see the effects of an echo in an acoustic signal consider the simulation of echoes on the “handel.mat” signaly[n]. Pretend that this piece is being played in a round theater where the orchestra is in the middle of two concentric circles and the walls on one half side are at a radial distances of 17.15 meters (corresponding to the inner circle) and 34.3 meters (corresponding to the outer circle) on the other side (yes, an usual theater!) from the orchestra. The speed of sound is 343 meters/sec. Assume that the recorded signal is the sum of the original signaly[n]and attenuated echoes from the two walls so that the recorded signal is given by
r[n]=y[n]+0.8y[n−N1]+0.6y[n−N2]
where N1 is the delay caused by the closest wall andN2 is the delay caused by the farther wall. The recorder is at the center of the auditorium where the orchestra is and we record for 1.5 seconds.
(a) Find the values of the two delaysN1andN2. Give the expression for the discrete-time recorded signal r[n]. The sampling frequencyFsof “handel.mat” is given when you load it in MATLAB.
(b) Simulate the echo signal. Plotr[n]. Usesoundto listen to the original and the echoed signals.
8.13. Envelope modulation—MATLAB
In the generation of music by computer, the process of modulation is extremely important. When playing an instrument, the player typically does it in three stages: (1) rise time or attack, (2) sustained time, and (3) decay time. Suppose we model these three stages as an envelope continuous-time signal given by
e(t)= 1
3[r(t)−r(t−3)]− 1
0.1[r(t−20)+r(t−30)]
wherer(t)is the ramp signal.
(a) For a simple tonex(t)=cos(2π/T0t), the modulated signal isy(t)=x(t)e(t). Find the periodT0so that 100 cycles of the sinusoid occur for the duration of the envelope signal.
(b) Simulate in MATLAB the modulated signal using the value ofT0=1and a simulation sampling time of0.1T0. Ploty(t)ande(t)(discretized with the sampling period0.1T0) and listen to the modulated signal usingsound.
8.14. LTI of ADCs
An ADC can be thought of as composed of three subsystems: a sampler, a quantizer, and a coder.
(a) The sampler, as a system, has as input an analog signalx(t)and as output a discrete-time signal x(nTs)=x(t)|t=nTswhereTsis the sampling period. Determine whether the sampler is a linear system or not.
(b) Samplex(t)=cos(0.5πt)u(t)andx(t−0.5)usingTs=1to gety(nTs)andz(nTs), respectively. Plot x(t), x(t−0.5), andy(nTs)andz(nTs). Isz(nTs)a shifted version ofy(nTs)so that you can say the sampler is time invariant? Explain.
8.15. LTI of ADCs (part 2)
A two-bit quantizer of an ADC has as inputx(nTs)and as outputx(nTˆ s), such that if k1≤x(nTs) < (k+1)1 → ˆx(nTs)=k1 k= −2,−1, 0, 1 (a) Is this system time invariant? Explain.
(b) Suppose that the value of1in the quantizer is0.25, and the sampled signal isx(nTs)=nTs,Ts=0.1 and−5≤n≤5. Use the sampled signal to determine whether the quantizer is a linear system or not.
Explain.
(c) From the results in this and the previous problem, would you say that the ADC is an LTI system?
Explain.
8.16. Rectangular windowing system—MATLAB
A window is a signal w[n]that is used to highlight part of another signal. The windowing process consists in multiplying an input signalx[n]by the window signal w[n], so that the output is
y[n]=x[n]w[n]
There are different types of windows used in signal processing. One of them is the so-calledrectangular window, which is given by
w[n]=u[n]−u[n−N]
(a) Determine whether the rectangular windowing system is linear. Explain.
(b) Supposex[n]=nu[n]. Plot the outputy[n]of the windowing system (withN=6).
(c) Let the input bex[n−6]. Plot the corresponding output of the rectangular windowing system, and indicate whether the rectangular windowing system is time invariant.
8.17. Impulse response of an IIR system—MATLAB
A discrete-time IIR system is represented by the difference equation y[n]=0.15y[n−2]+x[n] n≥0 wherex[n]is the input andy[n]is the output.
(a) To find the impulse responseh[n]of the system, letx[n]=δ[n],y[n]=h[n], and the initial conditions be zero,y[n]=h[n]=0, n<0. Find recursively the values ofh[n]for values ofn≥0.
(b) As a second way to do it, replace the relation between the input and the output given by the difference equation to obtain a convolution sum representation that will give the impulse responseh[n]. What ish[n]?
(c) Use the MATLAB functionfilterto get the impulse responseh[n](usehelpto learn about the function filter).
Problems 507
8.18. FIR filter—MATLAB
An FIR filter has a nonrecursive input–output relation
y[n]= 5 X k=0
kx[n−k]
(a) Find and plot using MATLAB the impulse responseh[n]of this filter.
(b) Is this a causal and stable filter? Explain.
(c) Find and plot the unit-step responses[n]for this filter.
(d) If the inputx[n]for this filter is bounded, i.e.,|x[n]|<3, what would be a minimum boundMfor the output (i.e.,|y[n]| ≤M)?
(e) Use the MATLAB functionfilterto compute the impulse responseh[n]and the unit-step responses[n]
for the given filter and plot them.
8.19. LTI and convolution sum—MATLAB
The impulse response of a discrete-time system ish[n]=(−0.5)nu[n].
(a) If the input of the system isx[n]=δ[n]+δ[n−1]+δ[n−2], use the linearity and time invariance of the system to find the corresponding outputy[n].
(b) Find the convolution sum corresponding to the above input, and show that your solution coincides with the outputy[n]obtained above.
(c) Use the MATLAB functionconvto find the outputy[n]due to the given inputx[n]. Plotx[n],h[n], and y[n]using MATLAB.
8.20. Steady state of IIR systems—MATLAB
Suppose an IIR system is represented by a difference equation
y[n]=ay[n−1]+x[n]
wherex[n]is the input andy[n]is the output.
(a) If the inputx[n]=u[n]and it is known that the steady-state response isy[n]=2, what would beafor that to be possible (in steady statex[n]=1andy[n]=y[n−1]=2sincen→ ∞).
(b) Writing the system input as x[n]=u[n]=δ[n]+δ[n−1]+δ[n−2]+ ã ã ã then according to the linearity and time invariance, the output should be
y[n]=h[n]+h[n−1]+h[n−2]+ ã ã ã
Use the value forafound above, that the initial condition is zero (i.e.,y[−1]=0) and that the input is x[n]=u[n], to find the values of the impulse responseh[n]forn≥0using the above equation. The system is causal.
(c) Use the MATLAB functionfilterto compute the impulse responseh[n]and compare it with the one obtained above.
8.21. Causal systems and real-time processing
Systems that operate under real-time conditions need to be causal—that is, they can only process present and past inputs. When no real-time processing is needed the system can be noncausal.
(a) Consider the case of averaging an input signalx[n]under real-time conditions. Suppose you are given two different filters,
• y[n]= 1 N
N−1 X k=0
x[n−k]
• y[n]= 1 N
N−1 X k=−N+1
x[n−k]
Which one of these would you use and why?
(b) If you are given a tape with the data, which of the two filters would you use? Why? Would you use either? Explain.
8.22. IIR versus FIR systems
A significant difference between IIR and FIR discrete-time systems is stability. Consider an IIR filter with the difference equation
y1[n]=x[n]−0.5y1[n−1]
wherex[n]is the input andy1[n]is the output. Then consider an FIR filter y2[n]=x[n]+0.5x[n−1]+3x[n−2]+x[n−5]
wherex[n]is the input andy2[n]is the output.
(a) Since to check the stability of these filters we need their impulse responses, find the impulse responses h1[n]corresponding to the IIR filter by recursion, andh2[n]corresponding to the FIR filter.
(b) Use the impulse responseh1[n]to check the stability of the IIR filter.
(c) Use the impulse responseh2[n]to check the stability of the FIR filter.
(d) Since the impulse response of a FIR filter has a finite number of nonzero terms, would it be correct to say that FIR filters are always stable? Explain.
8.23. Unit-step versus impulse response—MATLAB The unit-step response of a discrete-time LTI system is
s[n]=2[(−0.5)n−1]u[n]
Use this information to find
(a) The impulse responseh[n]of the discrete-time LTI system.
(b) The response of the LTI system to a ramp signalx[n]=nu[n]. Use the MATLAB functionfilterand superposition to find it.
8.24. Convolution sum—MATLAB
A discrete-time system has a unit-impulse responseh[n].
(a) Let the input to the discrete-time system be a pulsex[n]=u[n]−u[n−4]. Compute the output of the system in terms of the impulse response.
(b) Leth[n]=0.5nu[n]. What would be the response of the systemy[n]tox[n]=u[n]−u[n−4]? Plot the outputy[n].
(c) Use the convolution sum to verify your responsey[n].
(d) Use the MATLAB functionconvto compute the responsey[n]tox[n]=u[n]−u[n−4]. Plot both the input and output.
8.25. Discrete envelope detector—MATLAB
Consider anenvelope detectorthat would be used to detect the message sent in an AM system. Consider the envelope detector as a system composed of the cascading of two systems: one which computes the
Problems 509
absolute value of the input, and a second one that low-pass filters its input. A circuit that is used as an envelope detector consists of a diode circuit that does the absolute value operation, and an RC circuit that does the low-pass filtering. The following is an implementation of these operations in the discrete-time system.
Let the input to the envelope detector be a sampled signal,
x(nTs)=p(nTs)cos(2000πnTs) where
p(nTs)=u(nTs)−u(nTs−20Ts)+u(nTs−40Ts)−u(nTs−60Ts) where two pulses of duration20Tsand amplitude equal to one.
(a) ChooseTs=0.01, and generate 100 samples of the input signalx(nTs)and plot it.
(b) Consider then the subsystem that computes the absolute value of the inputx(nTs)and compute and plot100samples ofy(nTs)= |x(nTs)|.
(c) Let the low-pass filtering be done by a moving averager of order 15—that is, ify(nTs)is the input, then the output of the filter is
z(nTs)= 1 15
14 X k=0
y(nTs−kTs)
Implement this filter using the MATLAB functionfilter, and plot the result. Explain your results.
(d) Is this a linear system? Come up with an example using the script developed above to show that the system is linear or not.