Commit a9bb7b34 authored by 袁通's avatar 袁通
Browse files

update LAB 2

parent 51078d88
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -14,4 +14,5 @@ ny = nh1(1)+nx1(1):1:nh1(end)+nx1(end)
subplot(2,1,1), stem(ny, y1), title("y_1[n]=x_1[n]*h_1[n]");
subplot(2,1,2), stem(ny, y2), title("y_2[n]=h_1[n]*x_1[n]");

saveas(gcf, "P2_4_b_out.png")
 No newline at end of file
saveas(gcf, "plots/P2_4_b_out.png");
close;
 No newline at end of file
+2 −1
Original line number Diff line number Diff line
@@ -14,4 +14,5 @@ ny = nh1(1)+nx1(1):1:nh1(end)+nx1(end)
subplot(2,1,1), stem(ny, y1), title("y_1[n]=x_1[n]*(h_1[n]+h_2[n]");
subplot(2,1,2), stem(ny, y2), title("y_2[n]=x_1[n]*h_1[n]+x_1[n]*h_2[n]");

saveas(gcf, "P2_4_c_out.png")
saveas(gcf, "plots/P2_4_c_out.png");
close;
+2 −1
Original line number Diff line number Diff line
@@ -15,4 +15,5 @@ ny = nh1(1)+nx1(1):1:nh1(end)+nh1(end)+nx1(end)
subplot(2,1,1), stem(ny, y1), title("y_2[n]=(x_1[n]*h_1[n])*h_2[n]");
subplot(2,1,2), stem(ny, y2), title("y_1[n]=x_1[n]*(h_1[n]+h_2[n])");

saveas(gcf, "P2_4_d_out.png")
saveas(gcf, "plots/P2_4_d_out.png");
close;
+3 −2
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@ nh1 = 0:1:4;

he1 = h1;
he2 = [0 0 h1];
nhe2 = 1:1:6;
nhe2 = 0:1:6;

nye1 = nh1(1)+nx1(1):1:nh1(end)+nx1(end);
nye2 = nhe2(1)+nx1(1):1:nhe2(end)+nx1(end);
@@ -34,5 +34,6 @@ hold on
stem(nye1, ye1);
stem(nye2, ye2);

saveas(gcf, "P2_4_e.png");
saveas(gcf, "plots/P2_4_e_out.png");
close;
+3 −0
Original line number Diff line number Diff line
@@ -29,5 +29,8 @@ figure;
stem(nyf1, yf1);
stem(nyf2, yf2);

saveas(gcf, "P2_4_f_out.png");
close;


Loading