Changeset d84d19e


Ignore:
Timestamp:
Sep 25, 2009, 4:20:27 AM (15 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
Children:
ff9d00c
Parents:
e4284c9
Message:

src/mathutils.{c,h}: change prototype from aubio_window to new_aubio_window, allocating an fvec, use new function everywhere

Files:
6 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    re4284c9 rd84d19e  
    2525#include "config.h"
    2626
    27 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype) {
     27fvec_t * new_aubio_window(uint_t size, aubio_window_type wintype) {
     28  // create fvec of size x 1 channel
     29  fvec_t * win = new_fvec( size, 1);
     30  smpl_t * w = win->data[0];
    2831  uint_t i;
    2932  switch(wintype) {
     
    7275      break;
    7376  }
     77  return win;
    7478}
    7579
  • src/mathutils.h

    re4284c9 rd84d19e  
    5656
    5757/** create window */
    58 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype);
     58fvec_t * new_aubio_window(uint_t size, aubio_window_type wintype);
    5959
    6060/** principal argument
  • src/pitch/pitchfcomb.c

    re4284c9 rd84d19e  
    5454  p->fftLastPhase = new_fvec(bufsize,1);
    5555  p->fft = new_aubio_fft(bufsize, 1);
    56   p->win = new_fvec(bufsize,1);
    57   aubio_window(p->win->data[0], bufsize, aubio_win_hanning);
     56  p->win = new_aubio_window(bufsize, aubio_win_hanning);
    5857  return p;
    5958}
  • src/pitch/pitchyinfft.c

    re4284c9 rd84d19e  
    5555  p->res    = new_cvec(bufsize,1);
    5656  p->yinfft = new_fvec(bufsize/2+1,1);
    57   p->win    = new_fvec(bufsize,1);
    58   aubio_window(p->win->data[0], bufsize, aubio_win_hanningz);
     57  p->win    = new_aubio_window(bufsize, aubio_win_hanningz);
    5958  p->weight      = new_fvec(bufsize/2+1,1);
    6059  {
  • src/spectral/phasevoc.c

    re4284c9 rd84d19e  
    3535  fvec_t * data;      /** current input grain [win_s] */
    3636  fvec_t * dataold;   /** last input frame [win_s-hop_s] */
    37   smpl_t * w;         /** grain window [win_s] */
     37  fvec_t * w;         /** grain window [win_s] */
    3838};
    3939
     
    5454        datanew->data[i],pv->win_s,pv->hop_s);
    5555    /* windowing */
    56     for (j=0; j<pv->win_s; j++) pv->data->data[i][j] *= pv->w[j];
     56    fvec_weight(pv->data, pv->w);
    5757  }
    5858  /* shift */
     
    9696  pv->dataold  = new_fvec  (win_s-hop_s, channels);
    9797  pv->synthold = new_fvec (win_s-hop_s, channels);
    98   pv->w        = AUBIO_ARRAY(smpl_t,win_s);
    99   aubio_window(pv->w,win_s,aubio_win_hanningz);
     98  pv->w        = new_aubio_window (win_s, aubio_win_hanningz);
    10099
    101100  pv->channels = channels;
     
    111110  del_fvec(pv->dataold);
    112111  del_fvec(pv->synthold);
     112  del_fvec(pv->w);
    113113  del_aubio_fft(pv->fft);
    114   AUBIO_FREE(pv->w);
    115114  AUBIO_FREE(pv);
    116115}
  • swig/aubio.i

    re4284c9 rd84d19e  
    128128} aubio_window_type;
    129129
    130 void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype);
     130fvec_t * new_aubio_window(uint_t size, aubio_window_type wintype);
    131131smpl_t aubio_unwrap2pi (smpl_t phase);
    132132smpl_t vec_mean(fvec_t *s);
Note: See TracChangeset for help on using the changeset viewer.