Changeset 28d8c4a for src/mathutils.c


Ignore:
Timestamp:
Aug 9, 2005, 12:09:36 PM (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:
5e9c68a
Parents:
ea865c9
Message:

prefix mathutils function with aubio_

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mathutils.c

    rea865c9 r28d8c4a  
    2424#include "mathutils.h"
    2525
    26 void window(smpl_t *w, uint_t size, aubio_window_type_t wintype) {
     26void aubio_window(smpl_t *w, uint_t size, aubio_window_type wintype) {
    2727  uint_t i;
    2828  switch(wintype) {
     
    7474
    7575
    76 smpl_t unwrap2pi(smpl_t phase) {
     76smpl_t aubio_unwrap2pi(smpl_t phase) {
    7777  /* mod(phase+pi,-2pi)+pi */
    7878  return phase + TWO_PI * (1. + floorf(-(phase+PI)/TWO_PI));
     
    319319    /* increase frac */
    320320    for (frac = 0.; frac < 2.; frac = frac + step) {
    321       res = quadfrac(s0, s1, s2, frac);
     321      res = aubio_quadfrac(s0, s1, s2, frac);
    322322      if (res > resold)
    323323        resold = res;
     
    331331}
    332332
    333 smpl_t quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf) {
     333smpl_t aubio_quadfrac(smpl_t s0, smpl_t s1, smpl_t s2, smpl_t pf) {
    334334  smpl_t tmp = s0 + (pf/2.) * (pf * ( s0 - 2.*s1 + s2 ) - 3.*s0 + 4.*s1 - s2);
    335335  return tmp;
     
    345345}
    346346
    347 smpl_t freqtomidi(smpl_t freq) {
     347smpl_t aubio_freqtomidi(smpl_t freq) {
    348348  smpl_t midi = freq/6.875;
    349349  /* log(freq/A-2)/log(2) */
     
    354354}
    355355
    356 smpl_t bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize) {
     356smpl_t aubio_bintofreq(smpl_t bin, smpl_t samplerate, smpl_t fftsize) {
    357357  smpl_t freq = samplerate/fftsize;
    358358  return freq*bin;
     
    360360
    361361
    362 smpl_t bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize) {
    363   smpl_t midi = bintofreq(bin,samplerate,fftsize);
    364   return freqtomidi(midi);
     362smpl_t aubio_bintomidi(smpl_t bin, smpl_t samplerate, smpl_t fftsize) {
     363  smpl_t midi = aubio_bintofreq(bin,samplerate,fftsize);
     364  return aubio_freqtomidi(midi);
    365365}
    366366
Note: See TracChangeset for help on using the changeset viewer.