Thursday, 4 December 2014

matlab code program for sampling

using sine function and unit step function

a=0:0.03:6;
b=sin(2*pi*a);
subplot(3,1,1);
plot(a,b,'r*');
xlabel('value of a--');
ylabel('sin(a)--');
title('sin fun.');

x=0:0.5:6;
y=ones(size(x));
subplot(3,1,2);
stem(x,y,'k*');
xlabel('value of x---');
ylabel('value of y---');
title('unit step fun');

h=conv(b,y);
subplot(3,1,3);
stem(h,'r*');
xlabel('value of x');
ylabel('value of  y');
title('convoluted fun');
disp('sampling fig.');

No comments:

Post a Comment