Commit 0b599861 authored by 袁通's avatar 袁通
Browse files

change and add

parent a13e52e3
Loading
Loading
Loading
Loading

LAB1/LAB1.md

0 → 100644
+6 −0
Original line number Diff line number Diff line
# Lab Report 1

## Problem 1.4

### Question a
+9 −3
Original line number Diff line number Diff line
n = -5:1:5; 
x1=[zeros(1,5) 1 zeros(1,5)];
x2=2*x1;

y1=sin((pi/2)*x1);
y2=sin((pi/2)*x2);

%Plot
subplot(2,1,1);
stem(n,y1);
title('1.4 (a)-1');
xlabel('n');
ylabel('sin(\pi/2) x[n]');
ylabel('y_1=sin(\pi/2) x_1[n]');

subplot(2,1,2);
stem(n,y2,'r');
title('1.4(a)-2');
xlabel('n');
ylabel('sin(\pi/2) x[n]');
 No newline at end of file
ylabel('y_2=sin(\pi/2) x_2[n]');

saveas(gcf, "LAB1/P1_4_a_out.png")
 No newline at end of file

LAB1/P1_4_a_out.png

0 → 100644
+24.4 KiB
Loading image diff...
+12 −4
Original line number Diff line number Diff line
@@ -2,19 +2,27 @@ n1=-5:9;
n2=-6:9;
x1=[zeros(1,5),ones(1,10)];
x2=[zeros(1,4),ones(1,11)];

subplot(3,1,1);
stem(n1,x1,'b--^');
xlim([-6 10]);
title('1.4(b)-1');
xlabel('n');
ylabel('x[n]=u[n]');

subplot(3,1,2);
stem(n1,x2,'m--h');
title('1.4(b)-2');
stem(n1,x2,'b--^');
xlim([-6 10]);
title('1.4(b)-1');
xlabel('n');
ylabel('x[n+1]=u[n+1]');

y1=[0 x1+x2];
subplot(3,1,3);
stem(n2,y1,'r--p');
title('1.4(b)-3');
xlim([-6 10]);
title('1.4(b)-2');
xlabel('n');
ylabel('y[n]=x[n]+x[n+1]');

saveas(gcf, "LAB1/P1_4_b_out.png")
 No newline at end of file

LAB1/P1_4_b_out.png

0 → 100644
+23.7 KiB
Loading image diff...
Loading