You try this!
void convolution(double *signal, int nt, double *wind, int r, double *rm)
{
int i,j;
printf("%u\n", sizeof(wind)); // Why you do this? this just returns the size of the pointer only
int l = (nt+r-1);
double one[l];
double two[l];
for(i=0;i<l;i++)
{
if (i < nt)
one[i] = signal[i];
else
one[i] = 0;
if (i < r)
two[i] = wind[i];
else
two[i] = 0;
}
printf("signal\n");
for(i=0; i<l; i++)
printf("%lf\n",one[i]);
for(i=0;i<l;i++)
{
rm[i]=0;
for(j=0;j<=i;j++)
{
rm[i] = (rm[i]+(one[j]*two[i-j]) );
}
}
}
1
solved what is the mistake in this program? [closed]