Hi,

I’m trying to implement a BLEP oscillator but i’m not sure how to generate a correct kernel.

I’ve tried the following:

```
int num_zero_crossings = 1;
int oversampling = 2048;
long n = num_zero_crossings * oversampling * 2 + 1;
double blep_table[n];
double sum = 0;
double val = 0;
for (int i = 0; i < n; i++){
double t = (double) (i) / (double) (n - 1);
val = Sinc(num_zero_crossings + 2 * t * num_zero_crossings);
val *= 0.42 - 0.5 * cos(2.0 * PI * t) + 0.08 * cos(4.0 * PI * t); //Apply blackmann
sum += val; // To integrate
blep_table[i] = sum;
}
for (int i = 0; i < n; i++){
blep_table[i] = blep_table[i] / sum; // normalize
if (i > n / 2 - 1) { // subtract unit step
blep_table[i] -= 1;
}
blep_table[i] *= 2;
}
```

with:

```
static inline double Sinc(double x){
double pix;
if(x == 0){
return 1;
}
else{
pix = PI * x;
return sin(pix) / pix;
}
}
```

But I feel like I’m doing something wrong. Could someone comment on this ?

Thanks for your help,

Best regards, Louis