Fix precomputed cosine table

This commit is contained in:
Alexander Kojevnikov 2016-03-27 15:09:15 -07:00
parent 1ef950dcbf
commit a00057b4c8

View File

@ -110,7 +110,7 @@ struct spek_pipeline * spek_pipeline_open(
if (!p->file->get_error()) { if (!p->file->get_error()) {
p->nfft = p->fft->get_input_size(); p->nfft = p->fft->get_input_size();
p->coss = (float*)malloc(p->nfft * sizeof(float)); p->coss = (float*)malloc(p->nfft * sizeof(float));
float cf = 2.0f * (float)M_PI / p->nfft; float cf = 2.0f * (float)M_PI / (p->nfft - 1.0f);
for (int i = 0; i < p->nfft; ++i) { for (int i = 0; i < p->nfft; ++i) {
p->coss[i] = cosf(cf * i); p->coss[i] = cosf(cf * i);
} }