From e1d9cc30aa9498e91455bdfad4c77f2a7305e3a4 Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Wed, 6 Sep 2017 13:50:16 +0200 Subject: [PATCH] src/mathutils.c: add window type 'ones' --- src/mathutils.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/mathutils.c b/src/mathutils.c index 209d2ca3..6a55fce1 100644 --- a/src/mathutils.c +++ b/src/mathutils.c @@ -28,6 +28,7 @@ /** Window types */ typedef enum { + aubio_win_ones, aubio_win_rectangle, aubio_win_hamming, aubio_win_hanning, @@ -63,7 +64,9 @@ uint_t fvec_set_window (fvec_t *win, char_t *window_type) { if (window_type == NULL) { AUBIO_ERR ("window type can not be null.\n"); return 1; - } else if (strcmp (window_type, "rectangle") == 0) + } else if (strcmp (window_type, "ones") == 0) + wintype = aubio_win_ones; + else if (strcmp (window_type, "rectangle") == 0) wintype = aubio_win_rectangle; else if (strcmp (window_type, "hamming") == 0) wintype = aubio_win_hamming; @@ -88,9 +91,11 @@ uint_t fvec_set_window (fvec_t *win, char_t *window_type) { return 1; } switch(wintype) { + case aubio_win_ones: + fvec_ones(win); + break; case aubio_win_rectangle: - for (i=0;i