Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void input(int[9],int);
- int sumall(int[3],int [9],int[9],int,int);
- int main()
- {
- int x[15]={0},y[15]={0},l,i,j,p=3;
- int f[3];
- cout<<"Enter the signal size :";
- cin>>l;
- input( x, l);
- cout<<"Enter the filter :"<<endl;
- input( f, p);
- sumall( f, x, y, l, p);
- for(int i=0; i<l; i++)
- {
- cout<<"X: "<<x[i];
- }
- for(int i=0; i<l; i++)
- {
- cout<<"Y: "<<y[i];
- }
- }
- void input(int x[9],int l)
- {
- for(int i=0; i<l; i++)
- {
- cout<<"["<<i<<"]= ";
- cin>>x[i];
- cout<<endl;
- }
- }
- int sumall(int f[3],int x[9],int y[9],int l,int p)
- {
- for(int i=0; i<l; i=i+3)
- {
- y[i]=x[i]*f[p-3]+x[i+1]*f[p-2]+x[i+2]*f[p-1];
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement