Arithmatic Operations
clear all;N=21;
n=0:1:N-1;
%generating first sequence
x1=sin(0.1*pi*n);
subplot(3,2,1);
stem(n,x1);
xlabel('n');
ylabel('amplitude');
title('first sequence');
%generating second sequence
x2=sin(0.2*pi*n);
subplot(3,2,2);
stem(n,x2);
xlabel('n');
ylabel('amplitude');
title('second sequence');
%subtration of two signals
y=x1-x2;
subplot(3,2,3);
stem(n,y);
xlabel('n');
ylabel('amplitude');
title('subtration of two signs');
%multiplication of sinusoidal signals
z=x1.*x2;
subplot(3,2,4);
stem(n,z);
xlabel('n');
ylabel('amplitude');
title('multiplication of sines');
%division of sinusoidal signals
w=x1./x2;
subplot(3,2,5);
stem(n,w);
xlabel('n');
ylabel('amplitude');
title('division of two sines');
0 comments:
Post a Comment