projects
/
aubio.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b173ca1
)
src/mathutils.c: fix computation of gauss window
author
Paul Brossier
<piem@piem.org>
Sun, 3 Mar 2013 03:48:49 +0000
(22:48 -0500)
committer
Paul Brossier
<piem@piem.org>
Sun, 3 Mar 2013 03:48:49 +0000
(22:48 -0500)
src/mathutils.c
patch
|
blob
|
history
diff --git
a/src/mathutils.c
b/src/mathutils.c
index 38431c976e89b883ee6c40454e836b32764cab49..69a79c607ce9e954b79da631a3bf8c96e28bbbfb 100644
(file)
--- a/
src/mathutils.c
+++ b/
src/mathutils.c
@@
-104,8
+104,16
@@
new_aubio_window (char_t * window_type, uint_t size)
- 0.01168 * COS(3.0*TWO_PI*i/(size-1.0));
break;
case aubio_win_gaussian:
- for (i=0;i<size;i++)
- w[i] = EXP(- 1.0 / SQR(size) * SQR(2.0*i-size));
+ {
+ lsmp_t a, b, c = 0.5;
+ uint_t n;
+ for (n = 0; n < size; n++)
+ {
+ a = (n-c*(size-1))/(SQR(c)*(size-1));
+ b = -c*SQR(a);
+ w[n] = EXP(b);
+ }
+ }
break;
case aubio_win_welch:
for (i=0;i<size;i++)