summaryrefslogtreecommitdiff
path: root/tests/src/test-mathutils-window.c
blob: 4b45e7f185f30495ce71797797c024f835842d6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include "aubio.h"
#include "utils_tests.h"

int main (void)
{
  uint_t length = 0;
  uint_t n_length = 4, n_types = 10, i, t;
  uint_t lengths[4] = { 8, 10, 15, 16 };
  char *method = "default";
  char *window_types[10] = { "default",
    "rectangle", "hamming", "hanning", "hanningz",
    "blackman", "blackman_harris", "gaussian", "welch", "parzen"};

  for ( t = 0; t < n_types; t ++ ) {
    for ( i = 0; i < n_length; i++)
    {
      length = lengths[i];
      method = window_types[t];

      fvec_t * window = new_aubio_window(method, length);

      fvec_set_window(window, method);
      fprintf(stdout, "length: %d, method: %s, window:, ", length, method);
      fvec_print(window);

      del_fvec(window);
    }
  }
  return 0;
}