ref: ff9d00c3fd1b335633d54c83556e44652441455c
parent: d84d19ef7188d77eaa5dfd53e84b912c04fd0858
author: Paul Brossier <piem@piem.org>
date: Fri Sep 25 00:23:21 EDT 2009
tests/src/test-window.c: update to new_aubio_window
--- a/tests/src/test-window.c
+++ b/tests/src/test-window.c
@@ -1,35 +1,36 @@
#include <aubio.h>
#include <stdlib.h>
-void print_array(fvec_t *f);
-void print_array(fvec_t *f){
- uint_t i,j;
- for (i=0;i<f->channels;i++)
- {
- for (j=0;j<f->length;j++)
- {
- printf("%1.3e, ", f->data[i][j]);
- }
- printf(";\n");
- }
-}
-
int main( int argc, char** argv )
{
uint_t length;
for (length = 2; length <= 5; length++)
{
- fvec_t *t = new_fvec(length,9);
- aubio_window(t->data[0],t->length,aubio_win_rectangle);
- aubio_window(t->data[1],t->length,aubio_win_hamming);
- aubio_window(t->data[2],t->length,aubio_win_hanning);
- aubio_window(t->data[3],t->length,aubio_win_hanningz);
- aubio_window(t->data[4],t->length,aubio_win_blackman);
- aubio_window(t->data[5],t->length,aubio_win_blackman_harris);
- aubio_window(t->data[6],t->length,aubio_win_gaussian);
- aubio_window(t->data[7],t->length,aubio_win_welch);
- aubio_window(t->data[8],t->length,aubio_win_parzen);
- print_array(t);
+ fvec_t *t = new_aubio_window(length,aubio_win_rectangle);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_hamming);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_hanning);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_hanningz);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_blackman);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_blackman_harris);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_gaussian);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_welch);
+ fvec_print(t);
+ del_fvec(t);
+ t = new_aubio_window(length,aubio_win_parzen);
+ fvec_print(t);
del_fvec(t);
}
return 0;