# Since is the convolution of two rectangles the

This preview shows page 1. Sign up to view the full content.

This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: = x1_15; x2_30 = zeros(1,length(n_30)); x2_30(1:15) = x2_15; k = 0:5; X = fft(x,6); subplot(2,1,1) stem(n,x) k_30 = 0:29; X1_30 = fft(x1_30,30); X2_30 = fft(x2_30,30); subplot(2,1,2) stem(k,X) iX1_30 = ifft(X1_30,30); iX2_30 = ifft(X2_30,30); %% Problem #4a figure subplot(2,3,1) stem(n_30,x1_30) n_15 = 0:14; x1_15 = zeros(1,length(n_15)); x1_15(1:10) = 1; x2_15 = ones(1,length(n_15)); k_15 = 0:14; X1_15 = fft(x1_15,15); X2_15 = fft(x2_15,15); iX1_15 = ifft(X1_15,15); iX2_15 = ifft(X2_15,15); figure subplot(2,3,1) stem(n_15,x1_15) subplot(2,3,2) stem(k_15,X1_15) subplot(2,3,3) stem(n_15,iX1_15) subplot(2,3,4) stem(n_15,x2_15) subplot(2,3,5) stem(k_15,X2_15) subplot(2,3,6) stem(n_15,iX2_15) subplot(2,3,2) stem(k_30,X1_30) subplot(2,3,3) stem(n_30,iX1_30) subplot(2,3,4) stem(n_30,x2_30) subplot(2,3,5) stem(k_30,X2_30) subplot(2,3,6) stem(n_30,iX2_30) BE 401 Problem Set #8 %% Problem 4c-e X1X2_15 = X1_15.*X2_15; X1X2_30 = X1_30.*X2_30; iX1X2_15 = ifft(X1X2_15,15); iX1X2_30 = ifft(X1X2_30,30); x1convx2_15 x1convx2_30 n_conv_15 = n_conv_30 = = conv(x1_15,x2_15); = conv(x1_30,x2_30); 0:length(x1convx2_15)-1; 0:length(x1convx2_30)-1; figure subplot(2,4,1) stem(k_15,X1X2_15) title('X_1[k] x X_2[k]') xlabel('k') xlim([-1 15]) subplot(2,4,2) stem(n_15,iX1X2_15) subplot(2,4,3) stem(n_conv_15,x1convx2_15) subplot(2,4,4) hold on stem(n_15,iX1X2_15,'r') stem(n_conv_15(1:15),x1convx2_15(1:15),'b') subplot(2,4,5) stem(k_30,X1X2_30) subplot(2,4,6) stem(n_30,iX1X2_30) subplot(2,4,7) stem(n_conv_30,x1convx2_30) subplot(2,4,8) hold on stem(n_30,iX1X2_30,'r') stem(n_conv_30(1:30),x1convx2_30(1:30),'b') 10- 31- 12 9...
View Full Document

Ask a homework question - tutors are online