Changeset 09b082d


Ignore:
Timestamp:
Nov 30, 2004, 11:28:53 PM (19 years ago)
Author:
Paul Brossier <piem@altern.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:
33bf500
Parents:
65f1edc
Message:

src/pitchyin.c

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    r65f1edc r09b082d  
    112004-11-39  Paul Brossier <piem@altern.org>
    22        * configure.ac: added -lmx on macosx
     3        * python/aubiocut: seeks for local minima before peak
     4        * src/pitchyinc.c: adds draft for all-in-one faster function
    35
    462004-10-28  Paul Brossier <piem@altern.org>
  • src/pitchyin.c

    r65f1edc r09b082d  
    8787}
    8888
     89
     90/* all the above in one */
     91void aubio_pitchyin_getpitchfast(fvec_t * input, fvec_t * yin){
     92        uint_t c,j,tau;
     93        smpl_t tmp, tmp2;
     94        for (c=0;c<input->channels;c++)
     95        {
     96                for (tau=0;tau<yin->length;tau++)
     97                {
     98                        yin->data[c][tau] = 0.;
     99                }
     100                for (tau=1;tau<yin->length;tau++)
     101                {
     102                        for (j=0;j<yin->length;j++)
     103                        {
     104                                tmp = input->data[c][j] - input->data[c][j+tau];
     105                                yin->data[c][tau] += SQR(tmp);
     106                        }
     107                }
     108                tmp2 = 0.;
     109                yin->data[c][0] = 1.;
     110                for (tau=1;tau<yin->length;tau++)
     111                {
     112                        tmp += yin->data[c][tau];
     113                        yin->data[c][tau] *= tau/tmp;
     114                }
     115        }
     116        /* should merge the following with above */
     117        do
     118        {
     119                if(yin->data[c][tau] < 0.1) {
     120                        while (yin->data[c][tau+1] < yin->data[c][tau]) {
     121                                tau++;
     122                        }
     123                        return tau;
     124                }
     125                tau++;
     126        } while (tau<yin->length);
     127        return 0;
     128}
     129
Note: See TracChangeset for help on using the changeset viewer.