Sunday, 21 October 2012
Linear Convolution Commutative Law (Prove) in MATLAB
Just create a new file with extension .m and paste the code below in that .m file. Then Run it.
clear all
clc
x=input('enter the x(n) signal : ');
h=input('enter the h(n) signal : ');
s1=input('starting value of x(n) : ');
s2=input('starting value of h1(n) : ');
l1=length(x);
l2=length(h);
l3=l1+l2-1;
s3=s1+s2;
n1=s1:1:s1+l1-1;
n2=s2:1:s2+l2-1;
n3=s3:1:s3+l3-1;
y1=conv(x,h);
y2=conv(h,x);
subplot(4,1,1);
stem(n1,x);
xlabel('time');
ylabel('amplitude');
title('original signal 1');
subplot(4,1,2);
stem(n2,h);
xlabel('time');
ylabel('amplitude');
title('original signal2');
subplot(4,1,3);
stem(n3,y1);
xlabel('time');
ylabel('amplitude');
title('convoluted signal of x(n)*h(n)');
subplot(4,1,4);
stem(n3,y2);
xlabel('time');
ylabel('amplitude');
title('convoluted signal of h(n)*x(n)');
at
14:25
Labels:
commutative,
computer,
convolution,
language,
law,
linear,
matlab,
programming,
property,
prove,
windows
Posted by
Unknown
![](https://resources.blogblog.com/img/icon18_edit_allbkg.gif)
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment