Question: Task: Implementation of Convolution Write a function that implements the convolution of x[n] with h[n], resulting in y[n]. You can use any programming language you

Task: Implementation of Convolution Write a function that implements the convolution of x[n] with h[n], resulting in y[n]. You can use any programming language you want. Make sure you test your function with various inputs. The Clanguage prototype of such a function is given below: void conv(int M, double* h, int L, double* x, double* y); /* h = filter array, x = input array, y = output array *M = filter order, L = input length */ A sample code snippet is given below: #define M3 #define L5 double h[]={1, 2, 3, 2 }; double x[]={-1,1,0, 2,-2 }; double *y; y = (double *) calloc(L+M, sizeof(double)); conv(M, h, L, X, Y); printf("y[n] = ["); for (int i=0; i
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
