mirror of
https://github.com/alexkay/spek.git
synced 2025-04-18 17:37:39 +03:00
Fix precomputed cosine table
This commit is contained in:
parent
1ef950dcbf
commit
a00057b4c8
@ -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);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user