#include #include #include #include "mex.h" #define FALSE 0 #define TRUE 1 /* compute the convolution of two sequences or filter one from the other */ void convolute(double *in1, int len1,double *in2,int len2, double *out) { int i,j,k,m; double acc; m = 0; for (i=0; i len1 -1) { j = len1 -1; m++; } else j = i; k = m; for (; j>=0 ; j--) { acc += in1[j] * in2[k]; k++; if (k > len2 -1) break; } out[i] = acc; } } void stirling(int n, double *out) { int i,j, len1=2, len2=2; double in1[2]={1.0,-1.0}; double in2[2]; double *temp, *temp1; /* temp initialization */ temp = malloc(len1*sizeof(double)); for (j=0;j