Commit 4ad5cf5e authored by 袁通's avatar 袁通
Browse files
parents 8321fb5d 96a88328
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
% Problem 2.4(e)
% TODO Check it!!!!

x1 = [1 1 1 1 0 0 0 0 0 0];
nx1 = 0:1:9;

@@ -23,17 +23,21 @@ subplot(3,1,1);
hold on
stem(nye1, ye1, 'm--s');
stem(nye1, ye1_inter, 'r--p');
legend('y_{e1}[n] = x_1[n]*h_{e1}[n]', 'y_{e1}[n] = x_1[n]*h_{e1}[n]', 'Location', 'northeast');
legend('y_{e1}[n] = x_1[n]*h_{e1}[n]', 'y_{e1}[n] = h_{e1}[n]*x_1[n]', 'Location', 'northeast');

subplot(3,1,2);
hold on
stem(nye2, ye2, 'm--s');
stem(nye2, ye2_inter, 'r--p');
legend('y_{e2}[n] = x_2[n]*h_{e2}[n]', 'y_{e2}[n] = h_{e2}[n]*x_2[n]', 'Location', 'northeast');


subplot(3,1,3);
hold on
stem(nye1, ye1, 'm--s');
stem(nye1+2, ye1, 'm--s');
stem(nye2, ye2, 'r--p');
legend('y_{e1}[n-n_0]', 'y_{e2}[n]', 'Location', 'northeast');


saveas(gcf, "plots/P2_4_e_out.png");
close;
+1 −1
Original line number Diff line number Diff line
@@ -20,7 +20,7 @@ hf2 = h1;
nhf2 = nh1;

hseries = conv(hf1, hf2);
nhseries = (nhf1(1)+nhf2(1)):1:(nhf1(end)+nhf2(end));
nhseries = (nhf1(1)+nhf2(1)):(nhf1(end)+nhf2(end));

yf2 = conv(x1, hseries);
nyf2 = (nx1(1)+nhseries(1)):(nx1(end)+nhseries(end));

LAB2/P2_4_f_out.png

deleted100644 → 0
−12.2 KiB
Loading image diff...
+1 −0
Original line number Diff line number Diff line
@@ -79,6 +79,7 @@ subplot(3, 1, 1);
hold on;
stem(nz, s1, 'm--s');
stem(nz, z1, 'r--p');
legend('s_1[n]', 'z_1[n]', 'Location', 'northeast');
title('s_1[n] & z_1[n]');
xlabel('n');
ylabel('s_1[n] / z_1[n]');
+8.11 KiB (21.6 KiB)
Loading image diff...
Loading