From: Paul Brossier Date: Wed, 6 Sep 2017 11:50:16 +0000 (+0200) Subject: src/mathutils.c: add window type 'ones' X-Git-Tag: 0.4.6~45 X-Git-Url: https://git.aubio.org/?p=aubio.git;a=commitdiff_plain;h=e1d9cc30aa9498e91455bdfad4c77f2a7305e3a4 src/mathutils.c: add window type 'ones' --- 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