Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- close all
- clear all
- x=input('Enter x: ')
- subplot(2,2,1)
- stem(x)
- h=input('Enter h: ')
- subplot(2,2,2)
- stem(h)
- m=length(x);
- n=length(h);
- X=[x,zeros(1,n)];
- H=[h,zeros(1,m)];
- for i=1:n+m-1
- Y(i)=0;
- for j=1:m
- if(i-j+1>0)
- Y(i)=Y(i)+X(j)*H(i-j+1);
- else
- end
- end
- end
- subplot(2,2,3)
- stem(Y);
- ylabel('Y[n]');
- xlabel('----->n');
- title('Convolution of Two Signals without conv function');
Add Comment
Please, Sign In to add comment