[tests] [filterbank] add get/set power/norm calls
[aubio.git] / tests / src / spectral / test-filterbank.c
index 3817f13..8b487c2 100644 (file)
@@ -1,6 +1,6 @@
 #include <aubio.h>
 
-int main ()
+int main (void)
 {
   uint_t win_s = 1024; // window size
   uint_t n_filters = 13; // number of filters
@@ -11,6 +11,15 @@ int main ()
   // create filterbank object
   aubio_filterbank_t *o = new_aubio_filterbank (n_filters, win_s);
 
+  smpl_t power = aubio_filterbank_get_power(o);
+  smpl_t norm = aubio_filterbank_get_norm(o);
+  if (aubio_filterbank_set_power(o, power)) {
+    return 1;
+  }
+  if (aubio_filterbank_set_norm(o, norm)) {
+    return 1;
+  }
+
   // apply filterbank ten times
   uint_t n = 10;
   while (n) {
@@ -23,6 +32,10 @@ int main ()
   coeffs = aubio_filterbank_get_coeffs (o);
   fmat_print (coeffs);
 
+  aubio_filterbank_set_coeffs (o, coeffs);
+  coeffs = aubio_filterbank_get_coeffs (o);
+  fmat_print (coeffs);
+
   //fvec_print (out_filters);
 
   // clean up