根据python的Scipy里的代码改写而来
原文地址https://github.com/scipy/scipy/blob/v0.13.0/scipy/signal/wavelets.py#L267
double *rickerwavelet(int points, double a)
{
const double pi = 3.14159265359;
double A = 2 / (sqrt(3 * a) * pow(pi, 0.25));
const double wsq = a * a;
double tsq, mod, gauss;
double *wricker;
double vec;
int i;
wricker = (double*) calloc (points, sizeof(double));
for (i = 0; i < points; ++i) {
vec = i - (points - 1.0) / 2;
tsq = vec * vec;
mod = (1 - tsq / wsq);
gauss = exp(-tsq / (2 * wsq));
wricker[i] = A * mod * gauss;
}
return(wricker);
}