projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c2c3192
)
[specdesc] fix definition of rolloff (closes gh-318, thanks to @Polochon-street)
author
Paul Brossier
<piem@piem.org>
Sun, 16 Nov 2025 13:32:13 +0000
(14:32 +0100)
committer
Paul Brossier
<piem@piem.org>
Sun, 16 Nov 2025 14:09:54 +0000
(15:09 +0100)
We now return at least the first bin, and at most the last bin number, to
prevent returning a value greater than the length of the norm vector size.
src/spectral/statistics.c
patch
|
blob
|
history
diff --git
a/src/spectral/statistics.c
b/src/spectral/statistics.c
index
4fd66c0
..
d303364
100644
(file)
--- a/
src/spectral/statistics.c
+++ b/
src/spectral/statistics.c
@@
-199,6
+199,6
@@
aubio_specdesc_rolloff (aubio_specdesc_t *o UNUSED, const cvec_t * spec,
rollsum += SQR (spec->norm[j]);
j++;
}
- desc->data[0] =
j
;
+ desc->data[0] =
MAX (1, j) - 1.0f
;
}
}