Skip to content

Commit

Permalink
Make spectral rolloff return bound values
Browse files Browse the repository at this point in the history
  • Loading branch information
Polochon-street committed Nov 16, 2020
1 parent 05ed7f5 commit 1f61fcc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/spectral/statistics.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,10 @@ aubio_specdesc_rolloff (aubio_specdesc_t *o UNUSED, const cvec_t * spec,
} else {
cumsum *= 0.95;
j = 0;
rollsum += SQR (spec->norm[j]);
while (rollsum < cumsum) {
rollsum += SQR (spec->norm[j]);
j++;
rollsum += SQR (spec->norm[j]);
}
desc->data[0] = j;
}
Expand Down

0 comments on commit 1f61fcc

Please sign in to comment.