Commit 44935a25 authored by 代育津's avatar 代育津
Browse files

Merge branch 'main' of...

parents 07023898 309dc753
Loading
Loading
Loading
Loading
+13 −10
Original line number Diff line number Diff line
@@ -4,25 +4,28 @@ x2=5*[zeros(1,5) 1 zeros(1,5)];
y1=sin((pi/2)*x1);
y2=sin((pi/2)*x2);

subplot(3,1,1);
subplot(4,1,1);
stem(n,x1);
title('1.4 (d)-1');
xlabel('n');
ylabel('x1[n]');
ylabel('x_1[n]');

subplot(3,1,2);
subplot(4,1,2);
stem(n,x2);
title('1.4 (d)-2');
xlabel('n');
ylabel('x2[n]');
ylabel('x_2[n]');

subplot(3,1,3);
stem(n,y1,'b--s');
hold on;
stem(n,y2,'r--h');
legend('sin(\pi/2) x1[n]','sin(\pi/2) x2[n]')
subplot(4,1,3);
stem(n,y1,'m--s');
title('1.4 (d)-3');
xlabel('n');
ylabel('y[n]');
ylabel('(sin(\pi/2) x_1[n])');

subplot(4,1,4);
stem(n,y2,'r--h');
title('1.4(d)-4');
xlabel('n');
ylabel('(sin(\pi/2) x_2[n])');

saveas(gcf, "LAB1/P1_4_d_out.png")
 No newline at end of file
+19.4 KiB (41.1 KiB)
Loading image diff...
+6 −6
Original line number Diff line number Diff line
% Linearity not satified
n=-5:1:5;
x1=n;
x2=3*n;
x1=n>=0;
x2=3*x1;

y1=x1.^3;
y2=x2.^3;

stem(x1,y1);
stem(n,y1);
hold on
stem(x1,y2,'r');
stem(n,y2,'r');
title('1.4(e)');
legend({'x[n]=n','x[n]=3n'}, 'Location', 'northeast');
legend({'x[n]=u[n]','x[n]=3u[n]'}, 'Location', 'northeast');
xlabel('x[n]');
ylabel('y[n]');
ylabel('y[n]=x^3[n]');

saveas(gcf, "LAB1/P1_4_e_out1.png")
 No newline at end of file
+4.1 KiB (21.9 KiB)
Loading image diff...
+9.9 KiB (39.7 KiB)
Loading image diff...
Loading