Changeset b4b0324 for src/mathutils.c


Ignore:
Timestamp:
Aug 9, 2005, 10:58:47 AM (14 years ago)
Author:
Paul Brossier <piem@altern.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
32669d9
Parents:
876c5e7
Message:

protect window types with aubio_win_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r876c5e7 rb4b0324  
    2424#include "mathutils.h"
    2525
    26 void window(smpl_t *w, uint_t size, window_type_t wintype) {
     26void window(smpl_t *w, uint_t size, aubio_window_type_t wintype) {
    2727  uint_t i;
    2828  switch(wintype) {
    29     case rectangle:
     29    case aubio_win_rectangle:
    3030      for (i=0;i<size;i++)
    3131        w[i] = 0.5;
    3232      break;
    33     case hamming:
     33    case aubio_win_hamming:
    3434      for (i=0;i<size;i++)
    3535        w[i] = 0.54 - 0.46 * COS(TWO_PI * i / (size));
    3636      break;
    37     case hanning:
     37    case aubio_win_hanning:
    3838      for (i=0;i<size;i++)
    3939        w[i] = 0.5 - (0.5 * COS(TWO_PI * i / (size)));
    4040      break;
    41     case hanningz:
     41    case aubio_win_hanningz:
    4242      for (i=0;i<size;i++)
    4343        w[i] = 0.5 * (1.0 - COS(TWO_PI * i / (size)));
    4444      break;
    45     case blackman:
     45    case aubio_win_blackman:
    4646      for (i=0;i<size;i++)
    4747        w[i] = 0.42
     
    4949          +     0.08 * COS(2.0*TWO_PI*i/(size-1.0));
    5050      break;
    51     case blackman_harris:
     51    case aubio_win_blackman_harris:
    5252      for (i=0;i<size;i++)
    5353        w[i] = 0.35875
     
    5656          - 0.01168 * COS(3.0*TWO_PI*i/(size-1.0));
    5757      break;
    58     case gaussian:
     58    case aubio_win_gaussian:
    5959      for (i=0;i<size;i++)
    6060        w[i] = EXP(- 1.0 / SQR(size) * SQR(2.0*i-size));
    6161      break;
    62     case welch:
     62    case aubio_win_welch:
    6363      for (i=0;i<size;i++)
    6464        w[i] = 1.0 - SQR((2*i-size)/(size+1.0));
    6565      break;
    66     case parzen:
     66    case aubio_win_parzen:
    6767      for (i=0;i<size;i++)
    6868        w[i] = 1.0 - fabsf((2*i-size)/(size+1.0));
Note: See TracChangeset for help on using the changeset viewer.