Changeset 5b41ef9


Ignore:
Timestamp:
Nov 17, 2013, 6:23:34 PM (6 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:
af3cfb3
Parents:
c1ddeb8
Message:

src/mathutils.h: move fvec_local_energy to aubio_level_lin, move to musicutils.h

Files:
5 edited

Legend:

Unmodified
Added
Removed
  • examples/aubiopitch.c

    rc1ddeb8 r5b41ef9  
    4141      aubio_pitch_do (o, ibuf, pitch);
    4242      smpl_t freq = fvec_read_sample(pitch, 0);
    43       smpl_t amp = powf(10., aubio_db_spl(ibuf)*.05 );
    44       aubio_wavetable_set_amp ( wavetable, amp );
     43      aubio_wavetable_set_amp ( wavetable, aubio_level_lin (ibuf) );
    4544      if (freq != 0.0) {
    4645        aubio_wavetable_set_freq ( wavetable, freq );
  • src/mathutils.c

    rc1ddeb8 r5b41ef9  
    264264
    265265smpl_t
    266 fvec_local_energy (fvec_t * f)
     266aubio_level_lin (fvec_t * f)
    267267{
    268268  smpl_t energy = 0.;
     
    509509aubio_db_spl (fvec_t * o)
    510510{
    511   return 10. * LOG10 (fvec_local_energy (o));
     511  return 10. * LOG10 (aubio_level_lin (o));
    512512}
    513513
  • src/mathutils.h

    rc1ddeb8 r5b41ef9  
    108108*/
    109109smpl_t fvec_sum (fvec_t * v);
    110 
    111 /** compute the energy of a vector
    112 
    113   This function compute the sum of the squared elements of a vector, normalised
    114   by its length.
    115  
    116   \param v vector to get the energy from
    117 
    118   \return the energy of v
    119  
    120 */
    121 smpl_t fvec_local_energy (fvec_t * v);
    122110
    123111/** compute the High Frequency Content of a vector
  • src/musicutils.h

    rc1ddeb8 r5b41ef9  
    101101smpl_t aubio_zero_crossing_rate (fvec_t * v);
    102102
     103/** compute sound level on a linear
     104
     105  This gives the average of the square amplitudes.
     106
     107  \param v vector to compute dB SPL from
     108
     109  \return level of v
     110
     111*/
     112smpl_t aubio_level_lin (fvec_t * v);
     113
    103114/** compute sound pressure level (SPL) in dB
    104115
    105116  This quantity is often wrongly called 'loudness'.
     117
     118  This gives ten times the log10 of the average of the square amplitudes.
    106119
    107120  \param v vector to compute dB SPL from
  • src/pitch/pitchmcomb.c

    rc1ddeb8 r5b41ef9  
    112112    newmag->data[j] = fftgrain->norm[j];
    113113  /* detect only if local energy > 10. */
    114   //if (fvec_local_energy(newmag) * newmag->length > 10.) {
     114  //if (aubio_level_lin (newmag) * newmag->length > 10.) {
    115115  //hfc = fvec_local_hfc(newmag); //not used
    116116  aubio_pitchmcomb_spectral_pp (p, newmag);
     
    147147    newmag->data[j] = fftgrain->norm[j];
    148148  /* detect only if local energy > 10. */
    149   if (fvec_local_energy (newmag) * newmag->length > 10.) {
     149  if (aubio_level_lin (newmag) * newmag->length > 10.) {
    150150    /* hfc = fvec_local_hfc(newmag); do not use */
    151151    aubio_pitchmcomb_spectral_pp (p, newmag);
Note: See TracChangeset for help on using the changeset viewer.