LINEAR CONVOLUTION

//LINEAR CONVOLUTION
#include<iostream.h>
#include<conio.h>
void main()
{
int i=0,j=0,k,m,n,r;
cout<<“LINEAR CONVOLUTION”;
cout<<endl;
cout<<endl;
cout<<endl;
cout<<“enter m,n”;
cin>>m>>n;
r=m+n-1;
int x[10],y[10],h[10];
for(i=0;i<=10;i++)
{
y[i]=0;
x[i]=0;
h[i]=0;
}
cout<<“enter input matrix”;
for(i=0;i<m;i++)
{
cin>>x[i];
}
cout<<“enter impulse matrix”;
for(j=0;j<n;j++)
{
cin>>h[j];
}

cout<<“the input matrix is x[n]=”;
for(i=0;i<m;i++)
{
cout<<x[i]<<“,”;
} cout<<endl;
cout<<“the impulse matrix is h[n]=”;
for(i=0;i<n;i++)
{
cout<<h[i]<<“,”;
} cout<<endl;

for(i=0;i<r;i++)
{
for(k=0;k<=i;k++)
{
y[i]+=x[k]*h[i-k];
}
}

cout<<“the op matrix is y[n]=”;
for(i=0;i<r;i++)
{
cout<<y[i]<<“,”;
}

}

Comments
  1. Abe Olinick says:

    Hi there, just became alert to your blog through Google, and found that it’s really informative. I’m going to watch out for brussels. I will be grateful if you continue this in future. Numerous people will be benefited from your writing. Cheers!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s