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.

178 Chapter 5 THE DISCRETE FOURIER TRANSFORM<br />

% Check for length of x2<br />

if length(x2) > N<br />

error(’N must be >= the length of x2’)<br />

end<br />

x1=[x1 zeros(1,N-length(x1))];<br />

x2=[x2 zeros(1,N-length(x2))];<br />

m = [0:1:N-1]; x2 = x2(mod(-m,N)+1); H = zeros(N,N);<br />

for n = 1:1:N<br />

H(n,:) = cirshftt(x2,n-1,N);<br />

end<br />

y = x1*conj(H’);<br />

Problems P5.24 and P5.25 explore an approach to eliminate the for...<br />

end loop in the circonvt function. The third approach would be to implement<br />

the frequency-domain operation (5.40) using the dft function.<br />

This is explored in Problem P5.26.<br />

□ EXAMPLE 5.14 Let us use MATLAB to perform the circular convolution in Example 5.13.<br />

Solution The sequences are x 1(n) ={1, 2, 2} and x 2(n) ={1, 2, 3, 4}.<br />

MATLAB script:<br />

>> x1 = [1,2,2]; x2 = [1,2,3,4]; y = circonvt(x1, x2, 4)<br />

y =<br />

15 12 9 14<br />

Hence<br />

x 1(n) 4○ x 2(n) ={15, 12, 9, 14}<br />

as before.<br />

□<br />

□ EXAMPLE 5.15 In this example we will study the effect of N on the circular convolution. Obviously,<br />

N ≥ 4; otherwise there will be a time-domain aliasing for x 2(n). We will<br />

use the same two sequences from Example 5.13.<br />

a. Compute x 1(n) 5○ x 2(n).<br />

b. Compute x 1(n) 6○ x 2(n).<br />

c. Comment on the results.<br />

Solution<br />

The sequences are x 1(n) ={1, 2, 2} and x 2(n) ={1, 2, 3, 4}. Even though the<br />

sequences are the same as in Example 5.14, we should expect different results<br />

for different values of N. This is not the case with the linear convolution, which<br />

is unique, given two sequences.<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!