Changeset 5b41ef9
- Timestamp:
- Nov 17, 2013, 6:23:34 PM (11 years ago)
- 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:
- af3cfb3
- Parents:
- c1ddeb8
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubiopitch.c
rc1ddeb8 r5b41ef9 41 41 aubio_pitch_do (o, ibuf, pitch); 42 42 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) ); 45 44 if (freq != 0.0) { 46 45 aubio_wavetable_set_freq ( wavetable, freq ); -
src/mathutils.c
rc1ddeb8 r5b41ef9 264 264 265 265 smpl_t 266 fvec_local_energy(fvec_t * f)266 aubio_level_lin (fvec_t * f) 267 267 { 268 268 smpl_t energy = 0.; … … 509 509 aubio_db_spl (fvec_t * o) 510 510 { 511 return 10. * LOG10 ( fvec_local_energy(o));511 return 10. * LOG10 (aubio_level_lin (o)); 512 512 } 513 513 -
src/mathutils.h
rc1ddeb8 r5b41ef9 108 108 */ 109 109 smpl_t fvec_sum (fvec_t * v); 110 111 /** compute the energy of a vector112 113 This function compute the sum of the squared elements of a vector, normalised114 by its length.115 116 \param v vector to get the energy from117 118 \return the energy of v119 120 */121 smpl_t fvec_local_energy (fvec_t * v);122 110 123 111 /** compute the High Frequency Content of a vector -
src/musicutils.h
rc1ddeb8 r5b41ef9 101 101 smpl_t aubio_zero_crossing_rate (fvec_t * v); 102 102 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 */ 112 smpl_t aubio_level_lin (fvec_t * v); 113 103 114 /** compute sound pressure level (SPL) in dB 104 115 105 116 This quantity is often wrongly called 'loudness'. 117 118 This gives ten times the log10 of the average of the square amplitudes. 106 119 107 120 \param v vector to compute dB SPL from -
src/pitch/pitchmcomb.c
rc1ddeb8 r5b41ef9 112 112 newmag->data[j] = fftgrain->norm[j]; 113 113 /* detect only if local energy > 10. */ 114 //if ( fvec_local_energy(newmag) * newmag->length > 10.) {114 //if (aubio_level_lin (newmag) * newmag->length > 10.) { 115 115 //hfc = fvec_local_hfc(newmag); //not used 116 116 aubio_pitchmcomb_spectral_pp (p, newmag); … … 147 147 newmag->data[j] = fftgrain->norm[j]; 148 148 /* detect only if local energy > 10. */ 149 if ( fvec_local_energy(newmag) * newmag->length > 10.) {149 if (aubio_level_lin (newmag) * newmag->length > 10.) { 150 150 /* hfc = fvec_local_hfc(newmag); do not use */ 151 151 aubio_pitchmcomb_spectral_pp (p, newmag);
Note: See TracChangeset
for help on using the changeset viewer.