ref: bd1a630f0d289fd6396ebeb5e3f7bd6058250630
parent: e5e693e033054b7b90b5e708d9d4a9344477fc94
author: Paul Brossier <piem@piem.org>
date: Wed Oct 7 15:39:11 EDT 2009
tests/src/test-filter.c: improve, indent
--- a/tests/src/test-filter.c
+++ b/tests/src/test-filter.c
@@ -1,23 +1,39 @@
#include <aubio.h>
-int main(){
- /* allocate some memory */
- uint_t win_s = 1024; /* window size */
- uint_t channels = 1; /* number of channel */
- fvec_t * in = new_fvec (win_s, channels); /* input buffer */
- fvec_t * out = new_fvec (win_s, channels); /* input buffer */
-
- /* allocate fft and other memory space */
- aubio_filter_t * o = new_aubio_filter_c_weighting (44100, channels);
+int
+main (void)
+{
+ /* allocate some memory */
+ uint_t win_s = 32; /* window size */
+ uint_t channels = 1; /* number of channel */
+ fvec_t *in = new_fvec (win_s, channels); /* input buffer */
+ fvec_t *out = new_fvec (win_s, channels); /* input buffer */
- aubio_filter_do(o,in);
- aubio_filter_do_outplace(o,in,out);
- aubio_filter_do_filtfilt(o,in,out);
- del_aubio_filter(o);
- del_fvec(in);
- del_fvec(out);
- aubio_cleanup();
+ aubio_filter_t *o = new_aubio_filter_c_weighting (44100, channels);
+ in->data[0][12] = 0.5;
+ fvec_print (in);
+ aubio_filter_do (o, in);
+ fvec_print (in);
+ del_aubio_filter (o);
- return 0;
+ aubio_filter_t *o = new_aubio_filter_c_weighting (44100, channels);
+ in->data[0][12] = 0.5;
+ fvec_print (in);
+ aubio_filter_do_outplace (o, in, out);
+ fvec_print (out);
+ del_aubio_filter (o);
+
+ aubio_filter_t *o = new_aubio_filter_c_weighting (44100, channels);
+ in->data[0][12] = 0.5;
+ fvec_print (in);
+ aubio_filter_do_filtfilt (o, in, out);
+ fvec_print (out);
+ del_aubio_filter (o);
+
+ del_fvec (in);
+ del_fvec (out);
+ aubio_cleanup ();
+
+ return 0;
}