protect window types with aubio_win_
authorPaul Brossier <piem@altern.org>
Tue, 9 Aug 2005 08:58:47 +0000 (08:58 +0000)
committerPaul Brossier <piem@altern.org>
Tue, 9 Aug 2005 08:58:47 +0000 (08:58 +0000)
examples/tests/test-fft.c
src/mathutils.c
src/mathutils.h
src/phasevoc.c
swig/aubio.i

index 5fd57e1..c61e1b5 100644 (file)
@@ -19,7 +19,7 @@ int main(){
         for (i=0; i < channels; i++)
                 spec[i] = AUBIO_ARRAY(fft_data_t,win_s);
         /* initialize the window (see mathutils.c) */
-        window(w,win_s,hanningz);
+        window(w,win_s,aubio_win_hanningz);
   
         /* fill input with some data */
   
index 6adcfcd..88dce04 100644 (file)
 #include "sample.h"
 #include "mathutils.h"
 
-void window(smpl_t *w, uint_t size, window_type_t wintype) {
+void window(smpl_t *w, uint_t size, aubio_window_type_t wintype) {
   uint_t i;
   switch(wintype) {
-    case rectangle:
+    case aubio_win_rectangle:
       for (i=0;i<size;i++)
         w[i] = 0.5; 
       break;
-    case hamming:
+    case aubio_win_hamming:
       for (i=0;i<size;i++)
         w[i] = 0.54 - 0.46 * COS(TWO_PI * i / (size));
       break;
-    case hanning:
+    case aubio_win_hanning:
       for (i=0;i<size;i++)
         w[i] = 0.5 - (0.5 * COS(TWO_PI * i / (size)));
       break;
-    case hanningz:
+    case aubio_win_hanningz:
       for (i=0;i<size;i++)
         w[i] = 0.5 * (1.0 - COS(TWO_PI * i / (size)));
       break;
-    case blackman:
+    case aubio_win_blackman:
       for (i=0;i<size;i++)
         w[i] = 0.42
           - 0.50 * COS(    TWO_PI*i/(size-1.0))
           +    0.08 * COS(2.0*TWO_PI*i/(size-1.0));
       break;
-    case blackman_harris:
+    case aubio_win_blackman_harris:
       for (i=0;i<size;i++)
         w[i] = 0.35875 
           - 0.48829 * COS(    TWO_PI*i/(size-1.0))
           + 0.14128 * COS(2.0*TWO_PI*i/(size-1.0))
           - 0.01168 * COS(3.0*TWO_PI*i/(size-1.0));
       break;
-    case gaussian:
+    case aubio_win_gaussian:
       for (i=0;i<size;i++)
         w[i] = EXP(- 1.0 / SQR(size) * SQR(2.0*i-size));
       break;
-    case welch:
+    case aubio_win_welch:
       for (i=0;i<size;i++)
         w[i] = 1.0 - SQR((2*i-size)/(size+1.0));
       break;
-    case parzen:
+    case aubio_win_parzen:
       for (i=0;i<size;i++)
         w[i] = 1.0 - fabsf((2*i-size)/(size+1.0));
       break;
index b50915e..8925bdc 100644 (file)
@@ -94,19 +94,19 @@ extern "C" {
 #endif
 
 typedef enum {
-       rectangle,          
-       hamming,
-       hanning,
-       hanningz,
-       blackman,
-       blackman_harris,
-       gaussian,
-       welch,
-       parzen
-} window_type_t;
+       aubio_win_rectangle,          
+       aubio_win_hamming,
+       aubio_win_hanning,
+       aubio_win_hanningz,
+       aubio_win_blackman,
+       aubio_win_blackman_harris,
+       aubio_win_gaussian,
+       aubio_win_welch,
+       aubio_win_parzen
+} aubio_window_type_t;
 
 /** create window */
-void window(smpl_t *w, uint_t size, window_type_t wintype);
+void window(smpl_t *w, uint_t size, aubio_window_type_t wintype);
 
 /** principal argument
  *
index b2c9116..d25dbaa 100644 (file)
@@ -113,7 +113,7 @@ aubio_pvoc_t * new_aubio_pvoc (uint_t win_s, uint_t hop_s, uint_t channels) {
        pv->dataold  = new_fvec  (win_s-hop_s, channels);
        pv->synthold = new_fvec (win_s-hop_s, channels);
        pv->w        = AUBIO_ARRAY(smpl_t,win_s);
-       window(pv->w,win_s,hanningz);
+       window(pv->w,win_s,aubio_win_hanningz);
 
        pv->channels = channels;
        pv->hop_s    = hop_s;
index a8f21ce..bc654c2 100644 (file)
@@ -88,18 +88,18 @@ extern void aubio_hist_dyn_notnull (aubio_hist_t *s, fvec_t *input);
 
 /* mathutils */
 typedef enum {
-        rectangle,
-        hamming,
-        hanning,
-        hanningz,
-        blackman,
-        blackman_harris,
-        gaussian,
-        welch,
-        parzen
-} window_type_t;
-
-void window(smpl_t *w, uint_t size, window_type_t wintype);
+        aubio_win_rectangle,
+        aubio_win_hamming,
+        aubio_win_hanning,
+        aubio_win_hanningz,
+        aubio_win_blackman,
+        aubio_win_blackman_harris,
+        aubio_win_gaussian,
+        aubio_win_welch,
+        aubio_win_parzen
+} aubio_window_type_t;
+
+void window(smpl_t *w, uint_t size, aubio_window_type_t wintype);
 smpl_t unwrap2pi (smpl_t phase);
 smpl_t vec_mean(fvec_t *s);
 smpl_t vec_max(fvec_t *s);