02.10.2019 Views

UploadFile_6417

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

30 Chapter 2 DISCRETE-TIME SIGNALS AND SYSTEMS<br />

c. x(n) =cos(0.04πn)+0.2w(n), 0 ≤ n ≤ 50.<br />

>> n = [0:50]; x = cos(0.04*pi*n)+0.2*randn(size(n));<br />

>> subplot(2,2,2); stem(n,x); title(’Sequence in Problem 2.1c’)<br />

>> xlabel(’n’); ylabel(’x(n)’);<br />

The plot of the sequence is shown in Figure 2.1c.<br />

d. ˜x(n) ={..., 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, 5, 4, 3, 2, 1, ...}; −10 ≤ n ≤ 9.<br />

↑<br />

Note that over the given interval, the sequence ˜x (n) has four periods.<br />

>> n = [-10:9]; x = [5,4,3,2,1];<br />

>> xtilde = x’ * ones(1,4); xtilde = (xtilde(:))’;<br />

>> subplot(2,2,4); stem(n,xtilde); title(’Sequence in Problem 2.1d’)<br />

>> xlabel(’n’); ylabel(’xtilde(n)’);<br />

The plot of the sequence is shown in Figure 2.1d.<br />

□<br />

□ EXAMPLE 2.2 Let x(n) = {1, 2, 3, 4, 5, 6, 7, 6, 5, 4, 3, 2, 1}. Determine and plot the following<br />

↑<br />

sequences.<br />

a. x 1(n) =2x(n − 5) − 3x(n +4)<br />

b. x 2(n) =x(3 − n)+x(n) x(n − 2)<br />

Solution<br />

The sequence x(n) isnonzero over −2 ≤ n ≤ 10. Hence<br />

>> n = -2:10; x = [1:7,6:-1:1];<br />

will generate x(n).<br />

a. x 1(n) =2x(n − 5) − 3x(n + 4).<br />

The first part is obtained by shifting x(n) by5and the second part by<br />

shifting x(n) by−4. This shifting and the addition can be easily done using<br />

the sigshift and the sigadd functions.<br />

>> [x11,n11] = sigshift(x,n,5); [x12,n12] = sigshift(x,n,-4);<br />

>> [x1,n1] = sigadd(2*x11,n11,-3*x12,n12);<br />

>> subplot(2,1,1); stem(n1,x1); title(’Sequence in Example 2.2a’)<br />

>> xlabel(’n’); ylabel(’x1(n)’);<br />

The plot of x 1(n) isshown in Figure 2.2a.<br />

b. x 2(n) =x(3 − n)+x(n) x(n − 2).<br />

The first term can be written as x(−(n − 3)). Hence it is obtained by first<br />

folding x(n) and then shifting the result by 3. The second part is a multiplication<br />

of x(n) and x(n−2), both of which have the same length but different<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!