Changeset 5c4ec3c for src/mathutils.c


Ignore:
Timestamp:
Oct 2, 2009, 1:19:10 AM (10 years ago)
Author:
Paul Brossier <piem@piem.org>
Branches:
feature/autosink, feature/constantq, feature/pitchshift, feature/pydocstrings, feature/timestretch, master, pitchshift, sampler, timestretch, yinfft+
Children:
38e9732
Parents:
2f64b0e
Message:

src/mathutils.{c,h}: rename all vec_ to fvec_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    r2f64b0e r5c4ec3c  
    9393}
    9494
    95 smpl_t vec_sum(fvec_t *s) {
     95smpl_t fvec_sum(fvec_t *s) {
    9696  uint_t i,j;
    9797  smpl_t tmp = 0.0f;
     
    142142}
    143143
    144 void vec_shift(fvec_t *s) {
     144void fvec_shift(fvec_t *s) {
    145145  uint_t i,j;
    146146  //smpl_t tmp = 0.0f;
     
    154154}
    155155
    156 smpl_t vec_local_energy(fvec_t * f) {
     156smpl_t fvec_local_energy(fvec_t * f) {
    157157  smpl_t locE = 0.;
    158158  uint_t i,j;
     
    163163}
    164164
    165 smpl_t vec_local_hfc(fvec_t * f) {
     165smpl_t fvec_local_hfc(fvec_t * f) {
    166166  smpl_t locE = 0.;
    167167  uint_t i,j;
     
    172172}
    173173
    174 smpl_t vec_alpha_norm(fvec_t * DF, smpl_t alpha) {
     174smpl_t fvec_alpha_norm(fvec_t * DF, smpl_t alpha) {
    175175  smpl_t tmp = 0.;
    176176  uint_t i,j;
     
    181181}
    182182
    183 void vec_dc_removal(fvec_t * mag) {
     183void fvec_dc_removal(fvec_t * mag) {
    184184    smpl_t mini = 0.;
    185185    uint_t length = mag->length, i=0, j;
     
    190190}
    191191
    192 void vec_alpha_normalise(fvec_t * mag, uint_t alpha) {
     192void fvec_alpha_normalise(fvec_t * mag, uint_t alpha) {
    193193  smpl_t alphan = 1.;
    194194  uint_t length = mag->length, i=0, j;
    195   alphan = vec_alpha_norm(mag,alpha);
     195  alphan = fvec_alpha_norm(mag,alpha);
    196196  for (j=0;j<length;j++){
    197197    mag->data[i][j] /= alphan;
     
    199199}
    200200
    201 void vec_add(fvec_t * mag, smpl_t threshold) {
     201void fvec_add(fvec_t * mag, smpl_t threshold) {
    202202  uint_t length = mag->length, i=0, j;
    203203  for (j=0;j<length;j++) {
     
    206206}
    207207
    208 void vec_adapt_thres(fvec_t * vec, fvec_t * tmp,
     208void fvec_adapt_thres(fvec_t * vec, fvec_t * tmp,
    209209    uint_t post, uint_t pre) {
    210210  uint_t length = vec->length, i=0, j;
    211211  for (j=0;j<length;j++) {
    212     vec->data[i][j] -= vec_moving_thres(vec, tmp, post, pre, j);
    213   }
    214 }
    215 
    216 smpl_t vec_moving_thres(fvec_t * vec, fvec_t * tmpvec,
     212    vec->data[i][j] -= fvec_moving_thres(vec, tmp, post, pre, j);
     213  }
     214}
     215
     216smpl_t fvec_moving_thres(fvec_t * vec, fvec_t * tmpvec,
    217217    uint_t post, uint_t pre, uint_t pos) {
    218218  smpl_t * medar = (smpl_t *)tmpvec->data[0];
     
    237237      medar[k] = 0.; /* 0-padding at the end */
    238238  }
    239   return vec_median(tmpvec);
    240 }
    241 
    242 smpl_t vec_median(fvec_t * input) {
     239  return fvec_median(tmpvec);
     240}
     241
     242smpl_t fvec_median(fvec_t * input) {
    243243  uint_t n = input->length;
    244244  smpl_t * arr = (smpl_t *) input->data[0];
     
    291291}
    292292
    293 smpl_t vec_quadint(fvec_t * x,uint_t pos, uint_t span) {
     293smpl_t fvec_quadint(fvec_t * x,uint_t pos, uint_t span) {
    294294  smpl_t s0, s1, s2;
    295295  uint_t x0 = (pos < span) ? pos : pos - span;
     
    308308}
    309309
    310 uint_t vec_peakpick(fvec_t * onset, uint_t pos) {
     310uint_t fvec_peakpick(fvec_t * onset, uint_t pos) {
    311311  uint_t i=0, tmp=0;
    312312  /*for (i=0;i<onset->channels;i++)*/
Note: See TracChangeset for help on using the changeset viewer.