- Timestamp:
- Sep 5, 2015, 12:27:38 PM (9 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:
- f264b17
- Parents:
- b257b60 (diff), f45dd12 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - Location:
- src
- Files:
-
- 34 edited
Legend:
- Unmodified
- Added
- Removed
-
src/aubio.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 19 19 */ 20 20 21 /** \mainpage 22 21 /** \mainpage 22 23 23 \section introduction Introduction 24 24 25 25 aubio is a library to extract annotations from audio signals: it provides a 26 26 set of functions that take an input audio signal, and output pitch estimates, 27 27 attack times (onset), beat location estimates, and other annotation tasks. 28 29 \section basics Basics 30 28 29 \section basics Basics 30 31 31 All object structures in aubio share the same function prefixes and suffixes: 32 32 33 33 - \p new_aubio_foo creates the object \p foo 34 34 - \p aubio_foo_do executes the object \p foo … … 38 38 functions. Optionally, more than one \p _do methods are available. 39 39 Additional parameters can be adjusted and observed using: 40 40 41 41 - \p aubio_foo_get_param, getter function, gets the value of a parameter 42 42 - \p aubio_foo_set_param, setter function, changes the value of a parameter -
src/aubio_priv.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-20 09Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 21 21 /** @file 22 22 * Private include file 23 * 23 * 24 24 * This file is for inclusion from _within_ the library only. 25 25 */ … … 30 30 /********************* 31 31 * 32 * External includes 32 * External includes 33 33 * 34 34 */ … … 72 72 73 73 /**** 74 * 74 * 75 75 * SYSTEM INTERFACE 76 76 * … … 197 197 #define DB2LIN(g) (POW(10.0,(g)*0.05f)) 198 198 #define LIN2DB(v) (20.0*LOG10(v)) 199 #define SQR(_a) (_a*_a) 200 201 #define MAX(a,b) ( a > b ? a : b) 202 #define MIN(a,b) ( a < b ? a : b) 199 #define SQR(_a) ((_a)*(_a)) 200 201 #ifndef MAX 202 #define MAX(a,b) (((a)>(b))?(a):(b)) 203 #endif /* MAX */ 204 #ifndef MIN 205 #define MIN(a,b) (((a)<(b))?(a):(b)) 206 #endif /* MIN */ 203 207 204 208 #define ELEM_SWAP(a,b) { register smpl_t t=(a);(a)=(b);(b)=t; } -
src/cvec.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. -
src/fmat.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2009-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2009-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 63 63 \param s vector to read from 64 64 \param channel channel to read from 65 \param position sample position to read from 65 \param position sample position to read from 66 66 67 67 */ … … 70 70 /** write sample value in a buffer 71 71 72 \param s vector to write to 72 \param s vector to write to 73 73 \param data value to write in s->data[channel][position] 74 \param channel channel to write to 75 \param position sample position to write to 74 \param channel channel to write to 75 \param position sample position to write to 76 76 77 77 */ … … 102 102 smpl_t ** fmat_get_data(fmat_t *s); 103 103 104 /** print out fmat data 104 /** print out fmat data 105 105 106 \param s vector to print out 106 \param s vector to print out 107 107 108 108 */ … … 117 117 void fmat_set(fmat_t *s, smpl_t val); 118 118 119 /** set all elements to zero 119 /** set all elements to zero 120 120 121 121 \param s vector to modify … … 124 124 void fmat_zeros(fmat_t *s); 125 125 126 /** set all elements to ones 126 /** set all elements to ones 127 127 128 128 \param s vector to modify … … 149 149 void fmat_weight(fmat_t *s, fmat_t *weight); 150 150 151 /** make a copy of a matrix 151 /** make a copy of a matrix 152 152 153 153 \param s source vector -
src/fvec.c
rb257b60 r60fc05b 21 21 #include "aubio_priv.h" 22 22 #include "fvec.h" 23 24 #ifdef HAVE_ACCELERATE 25 #include <Accelerate/Accelerate.h> 26 #if !HAVE_AUBIO_DOUBLE 27 #define aubio_vDSP_mmov vDSP_mmov 28 #define aubio_vDSP_vmul vDSP_vmul 29 #define aubio_vDSP_vfill vDSP_vfill 30 #else /* HAVE_AUBIO_DOUBLE */ 31 #define aubio_vDSP_mmov vDSP_mmovD 32 #define aubio_vDSP_vmul vDSP_vmulD 33 #define aubio_vDSP_vfill vDSP_vfillD 34 #endif /* HAVE_AUBIO_DOUBLE */ 35 #endif 23 36 24 37 fvec_t * new_fvec( uint_t length) { … … 61 74 62 75 void fvec_set_all (fvec_t *s, smpl_t val) { 76 #ifndef HAVE_ACCELERATE 63 77 uint_t j; 64 78 for (j=0; j< s->length; j++) { 65 79 s->data[j] = val; 66 80 } 81 #else 82 aubio_vDSP_vfill(&val, s->data, 1, s->length); 83 #endif 67 84 } 68 85 69 86 void fvec_zeros(fvec_t *s) { 70 #if HAVE_MEMCPY_HACKS 87 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) 88 fvec_set_all (s, 0.); 89 #else 90 #if defined(HAVE_MEMCPY_HACKS) 71 91 memset(s->data, 0, s->length * sizeof(smpl_t)); 72 92 #else 73 fvec_set_all (s, 0.); 93 aubio_vDSP_vclr(s->data, 1, s->length); 94 #endif 74 95 #endif 75 96 } … … 87 108 88 109 void fvec_weight(fvec_t *s, fvec_t *weight) { 110 #ifndef HAVE_ACCELERATE 89 111 uint_t j; 90 112 uint_t length = MIN(s->length, weight->length); … … 92 114 s->data[j] *= weight->data[j]; 93 115 } 116 #else 117 aubio_vDSP_vmul(s->data, 1, weight->data, 1, s->data, 1, s->length); 118 #endif /* HAVE_ACCELERATE */ 94 119 } 95 120 … … 100 125 return; 101 126 } 102 #if HAVE_MEMCPY_HACKS 103 memcpy(t->data, s->data, t->length * sizeof(smpl_t)); 104 #else 127 #if !defined(HAVE_MEMCPY_HACKS) && !defined(HAVE_ACCELERATE) 105 128 uint_t j; 106 129 for (j=0; j< t->length; j++) { 107 130 t->data[j] = s->data[j]; 108 131 } 132 #else 133 #if defined(HAVE_MEMCPY_HACKS) 134 memcpy(t->data, s->data, t->length * sizeof(smpl_t)); 135 #else 136 aubio_vDSP_mmov(s->data, t->data, 1, s->length, 1, 1); 137 #endif 109 138 #endif 110 139 } -
src/fvec.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 87 87 88 88 \param s vector to read from 89 \param position sample position to read from 89 \param position sample position to read from 90 90 91 91 */ … … 94 94 /** write sample value in a buffer 95 95 96 \param s vector to write to 96 \param s vector to write to 97 97 \param data value to write in s->data[position] 98 \param position sample position to write to 98 \param position sample position to write to 99 99 100 100 */ … … 108 108 smpl_t * fvec_get_data(fvec_t *s); 109 109 110 /** print out fvec data 110 /** print out fvec data 111 111 112 \param s vector to print out 112 \param s vector to print out 113 113 114 114 */ … … 123 123 void fvec_set_all (fvec_t *s, smpl_t val); 124 124 125 /** set all elements to zero 125 /** set all elements to zero 126 126 127 127 \param s vector to modify … … 130 130 void fvec_zeros(fvec_t *s); 131 131 132 /** set all elements to ones 132 /** set all elements to ones 133 133 134 134 \param s vector to modify -
src/io/audio_unit.c
rb257b60 r60fc05b 20 20 21 21 #include "config.h" 22 #ifdef TARGET_OS_IPHONE22 #ifdef HAVE_AUDIO_UNIT 23 23 #include "aubio_priv.h" 24 24 … … 775 775 } 776 776 777 #endif /* TARGET_OS_IPHONE*/777 #endif /* HAVE_AUDIO_UNIT */ -
src/io/sink_sndfile.c
rb257b60 r60fc05b 33 33 #define MAX_CHANNELS 6 34 34 #define MAX_SIZE 4096 35 36 #if !HAVE_AUBIO_DOUBLE 37 #define aubio_sf_write_smpl sf_write_float 38 #else /* HAVE_AUBIO_DOUBLE */ 39 #define aubio_sf_write_smpl sf_write_double 40 #endif /* HAVE_AUBIO_DOUBLE */ 35 41 36 42 struct _aubio_sink_sndfile_t { … … 126 132 AUBIO_ERR("sink_sndfile: Failed opening %s. %s\n", s->path, sf_strerror (NULL)); 127 133 return AUBIO_FAIL; 128 } 134 } 129 135 130 136 s->scratch_size = s->max_size*s->channels; … … 135 141 return AUBIO_FAIL; 136 142 } 137 s->scratch_data = AUBIO_ARRAY( float,s->scratch_size);143 s->scratch_data = AUBIO_ARRAY(smpl_t,s->scratch_size); 138 144 139 145 return AUBIO_OK; … … 141 147 142 148 void aubio_sink_sndfile_do(aubio_sink_sndfile_t *s, fvec_t * write_data, uint_t write){ 143 uint_t i, j, 149 uint_t i, j, channels = s->channels; 144 150 int nsamples = 0; 145 151 smpl_t *pwrite; … … 162 168 } 163 169 164 written_frames = sf_write_float(s->handle, s->scratch_data, nsamples);170 written_frames = aubio_sf_write_smpl (s->handle, s->scratch_data, nsamples); 165 171 if (written_frames/channels != write) { 166 172 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n", … … 171 177 172 178 void aubio_sink_sndfile_do_multi(aubio_sink_sndfile_t *s, fmat_t * write_data, uint_t write){ 173 uint_t i, j, 179 uint_t i, j, channels = s->channels; 174 180 int nsamples = 0; 175 181 smpl_t *pwrite; … … 192 198 } 193 199 194 written_frames = sf_write_float(s->handle, s->scratch_data, nsamples);200 written_frames = aubio_sf_write_smpl (s->handle, s->scratch_data, nsamples); 195 201 if (written_frames/channels != write) { 196 202 AUBIO_WRN("sink_sndfile: trying to write %d frames to %s, but only %d could be written\n", -
src/io/source_avcodec.c
rb257b60 r60fc05b 23 23 24 24 #ifdef HAVE_LIBAV 25 26 // determine whether we use libavformat from ffmpe or libav 27 #define FFMPEG_LIBAVFORMAT (LIBAVFORMAT_VERSION_MICRO > 99) 25 28 26 29 #include <libavcodec/avcodec.h> … … 101 104 102 105 // try to make sure max_analyze_duration is big enough for most songs 106 #if FFMPEG_LIBAVFORMAT 107 avFormatCtx->max_analyze_duration2 *= 100; 108 #else 103 109 avFormatCtx->max_analyze_duration *= 100; 110 #endif 104 111 105 112 // retrieve stream information -
src/io/source_sndfile.c
rb257b60 r60fc05b 91 91 AUBIO_ERR("source_sndfile: Failed opening %s: %s\n", s->path, sf_strerror (NULL)); 92 92 goto beach; 93 } 93 } 94 94 95 95 /* get input specs */ -
src/lvec.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 62 62 63 63 \param s vector to read from 64 \param position sample position to read from 64 \param position sample position to read from 65 65 66 66 */ … … 69 69 /** write sample value in a buffer 70 70 71 \param s vector to write to 71 \param s vector to write to 72 72 \param data value to write in s->data[position] 73 \param position sample position to write to 73 \param position sample position to write to 74 74 75 75 */ … … 83 83 lsmp_t * lvec_get_data(lvec_t *s); 84 84 85 /** print out lvec data 85 /** print out lvec data 86 86 87 \param s vector to print out 87 \param s vector to print out 88 88 89 89 */ … … 98 98 void lvec_set_all(lvec_t *s, smpl_t val); 99 99 100 /** set all elements to zero 100 /** set all elements to zero 101 101 102 102 \param s vector to modify … … 105 105 void lvec_zeros(lvec_t *s); 106 106 107 /** set all elements to ones 107 /** set all elements to ones 108 108 109 109 \param s vector to modify -
src/mathutils.c
rb257b60 r60fc05b 159 159 fvec_mean (fvec_t * s) 160 160 { 161 uint_t j;162 161 smpl_t tmp = 0.0; 162 #ifndef HAVE_ACCELERATE 163 uint_t j; 163 164 for (j = 0; j < s->length; j++) { 164 165 tmp += s->data[j]; 165 166 } 166 167 return tmp / (smpl_t) (s->length); 168 #else 169 #if !HAVE_AUBIO_DOUBLE 170 vDSP_meanv(s->data, 1, &tmp, s->length); 171 #else /* HAVE_AUBIO_DOUBLE */ 172 vDSP_meanvD(s->data, 1, &tmp, s->length); 173 #endif /* HAVE_AUBIO_DOUBLE */ 174 return tmp; 175 #endif /* HAVE_ACCELERATE */ 167 176 } 168 177 … … 170 179 fvec_sum (fvec_t * s) 171 180 { 172 uint_t j;173 181 smpl_t tmp = 0.0; 182 #ifndef HAVE_ACCELERATE 183 uint_t j; 174 184 for (j = 0; j < s->length; j++) { 175 185 tmp += s->data[j]; 176 186 } 187 #else 188 #if !HAVE_AUBIO_DOUBLE 189 vDSP_sve(s->data, 1, &tmp, s->length); 190 #else /* HAVE_AUBIO_DOUBLE */ 191 vDSP_sveD(s->data, 1, &tmp, s->length); 192 #endif /* HAVE_AUBIO_DOUBLE */ 193 #endif /* HAVE_ACCELERATE */ 177 194 return tmp; 178 195 } -
src/mathutils.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 4Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 83 83 84 84 /** swap the left and right halves of a vector 85 85 86 86 This function swaps the left part of the signal with the right part of the 87 87 signal. Therefore 88 88 89 89 \f$ a[0], a[1], ..., a[\frac{N}{2}], a[\frac{N}{2}+1], ..., a[N-1], a[N] \f$ 90 90 91 91 becomes 92 92 93 93 \f$ a[\frac{N}{2}+1], ..., a[N-1], a[N], a[0], a[1], ..., a[\frac{N}{2}] \f$ 94 94 … … 96 96 can be used before computing the FFT to simplify the phase relationship of the 97 97 resulting spectrum. See Amalia de Götzen's paper referred to above. 98 98 99 99 */ 100 100 void fvec_shift (fvec_t * v); … … 112 112 113 113 The High Frequency Content is defined as \f$ \sum_0^{N-1} (k+1) v[k] \f$. 114 115 \param v vector to get the energy from 114 115 \param v vector to get the energy from 116 116 117 117 \return the HFC of v 118 118 119 119 */ 120 120 smpl_t fvec_local_hfc (fvec_t * v); 121 121 122 /** computes the p-norm of a vector 123 122 /** computes the p-norm of a vector 123 124 124 Computes the p-norm of a vector for \f$ p = \alpha \f$ 125 125 126 126 \f$ L^p = ||x||_p = (|x_1|^p + |x_2|^p + ... + |x_n|^p ) ^ \frac{1}{p} \f$ 127 127 128 128 If p = 1, the result is the Manhattan distance. 129 129 … … 134 134 135 135 References: 136 136 137 137 - <a href="http://en.wikipedia.org/wiki/Lp_space">\f$L^p\f$ space</a> on 138 138 Wikipedia … … 142 142 143 143 \return the p-norm of v 144 144 145 145 */ 146 146 smpl_t fvec_alpha_norm (fvec_t * v, smpl_t p); … … 148 148 /** alpha normalisation 149 149 150 This function divides all elements of a vector by the p-norm as computed by 150 This function divides all elements of a vector by the p-norm as computed by 151 151 fvec_alpha_norm(). 152 152 … … 166 166 167 167 /** remove the minimum value of the vector to each elements 168 168 169 169 \param v vector to remove minimum from 170 170 … … 177 177 position of a vector, taking the median among post elements before and up to 178 178 pre elements after pos. 179 179 180 180 \param v input vector 181 181 \param tmp temporary vector of length post+1+pre 182 \param post length of causal part to take before pos 182 \param post length of causal part to take before pos 183 183 \param pre length of anti-causal part to take after pos 184 \param pos index to compute threshold for 185 186 \return moving median threshold value 184 \param pos index to compute threshold for 185 186 \return moving median threshold value 187 187 188 188 */ … … 197 197 \param v input vector 198 198 \param tmp temporary vector of length post+1+pre 199 \param post length of causal part to take before pos 199 \param post length of causal part to take before pos 200 200 \param pre length of anti-causal part to take after pos 201 201 … … 203 203 void fvec_adapt_thres (fvec_t * v, fvec_t * tmp, uint_t post, uint_t pre); 204 204 205 /** returns the median of a vector 205 /** returns the median of a vector 206 206 207 207 The QuickSelect routine is based on the algorithm described in "Numerical … … 216 216 217 217 \return the median of v 218 218 219 219 */ 220 220 smpl_t fvec_median (fvec_t * v); … … 249 249 250 250 /** Quadratic interpolation using Lagrange polynomial. 251 251 252 252 Inspired from ``Comparison of interpolation algorithms in real-time sound 253 processing'', Vladimir Arnost, 254 255 \param s0,s1,s2 are 3 consecutive samples of a curve 253 processing'', Vladimir Arnost, 254 255 \param s0,s1,s2 are 3 consecutive samples of a curve 256 256 \param pf is the floating point index [0;2] 257 257 258 258 \return \f$ s0 + (pf/2.)*((pf-3.)*s0-2.*(pf-2.)*s1+(pf-1.)*s2); \f$ 259 259 -
src/musicutils.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 30 30 #endif 31 31 32 /** create window 32 /** create window 33 33 34 34 \param window_type type of the window to create 35 35 \param size length of the window to create (see fvec_set_window()) 36 36 37 37 */ 38 38 fvec_t *new_aubio_window (char_t * window_type, uint_t size); … … 50 50 51 51 References: 52 52 53 53 - <a href="http://en.wikipedia.org/wiki/Window_function">Window 54 54 function</a> on Wikipedia … … 69 69 70 70 \param phase unwrapped phase to map to the unit circle 71 71 72 72 \return equivalent phase wrapped to the unit circle 73 73 … … 94 94 95 95 /** clean up cached memory at the end of program 96 96 97 97 This function should be used at the end of programs to purge all cached 98 98 memory. So far it is only useful to clean FFTW's cache. … … 138 138 139 139 /** check if buffer level in dB SPL is under a given threshold 140 140 141 141 \param v vector to get level from 142 142 \param threshold threshold in dB SPL -
src/onset/onset.c
rb257b60 r60fc05b 68 68 } 69 69 } else { 70 // we are at the beginning of the file, and we don't find silence 71 if (o->total_frames <= o->delay && o->last_onset < o ->minioi && aubio_silence_detection(input, o->silence) == 0) { 72 //AUBIO_DBG ("beginning of file is not silent, marking as onset\n"); 73 isonset = o->delay / o->hop_size; 74 o->last_onset = o->delay; 70 // we are at the beginning of the file 71 if (o->total_frames <= o->delay) { 72 // and we don't find silence 73 if (aubio_silence_detection(input, o->silence) == 0) { 74 uint_t new_onset = o->total_frames; 75 if (o->total_frames == 0 || o->last_onset + o->minioi < new_onset) { 76 isonset = o->delay / o->hop_size; 77 o->last_onset = o->total_frames + o->delay; 78 } 79 } 75 80 } 76 81 } -
src/onset/peakpicker.h
rb257b60 r60fc05b 19 19 */ 20 20 21 /** \file 22 21 /** \file 22 23 23 Peak picking utilities function 24 24 25 25 \example onset/test-peakpicker.c 26 26 27 27 */ 28 28 -
src/pitch/pitchyinfft.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 20 20 21 21 /** \file 22 22 23 23 Pitch detection using a spectral implementation of the YIN algorithm 24 24 25 25 This algorithm was derived from the YIN algorithm. In this implementation, a 26 26 Fourier transform is used to compute a tapered square difference function, 27 27 which allows spectral weighting. Because the difference function is tapered, 28 28 the selection of the period is simplified. 29 29 30 30 Paul Brossier, [Automatic annotation of musical audio for interactive 31 31 systems](http://aubio.org/phd/), Chapter 3, Pitch Analysis, PhD thesis, … … 46 46 typedef struct _aubio_pitchyinfft_t aubio_pitchyinfft_t; 47 47 48 /** execute pitch detection on an input buffer 49 48 /** execute pitch detection on an input buffer 49 50 50 \param o pitch detection object as returned by new_aubio_pitchyinfft 51 51 \param samples_in input signal vector (length as specified at creation time) 52 52 \param cands_out pitch period candidates, in samples 53 53 54 54 */ 55 55 void aubio_pitchyinfft_do (aubio_pitchyinfft_t * o, fvec_t * samples_in, fvec_t * cands_out); 56 56 /** creation of the pitch detection object 57 57 58 58 \param samplerate samplerate of the input signal 59 \param buf_size size of the input buffer to analyse 60 59 \param buf_size size of the input buffer to analyse 60 61 61 */ 62 62 aubio_pitchyinfft_t *new_aubio_pitchyinfft (uint_t samplerate, uint_t buf_size); 63 63 /** deletion of the pitch detection object 64 64 65 65 \param o pitch detection object as returned by new_aubio_pitchyinfft() 66 66 67 67 */ 68 68 void del_aubio_pitchyinfft (aubio_pitchyinfft_t * o); 69 69 70 /** get tolerance parameter for YIN algorithm 71 72 \param o YIN pitch detection object 70 /** get tolerance parameter for YIN algorithm 71 72 \param o YIN pitch detection object 73 73 74 74 \return tolerance parameter for minima selection [default 0.15] … … 77 77 smpl_t aubio_pitchyinfft_get_tolerance (aubio_pitchyinfft_t * o); 78 78 79 /** set tolerance parameter for YIN algorithm 80 81 \param o YIN pitch detection object 79 /** set tolerance parameter for YIN algorithm 80 81 \param o YIN pitch detection object 82 82 \param tol tolerance parameter for minima selection [default 0.15] 83 83 -
src/spectral/fft.c
rb257b60 r60fc05b 67 67 #warning "Using aubio in double precision with fftw3 in single precision" 68 68 #endif /* HAVE_AUBIO_DOUBLE */ 69 #define real_t float 69 #define real_t float 70 70 #else /* HAVE_FFTW3F */ 71 71 #if !HAVE_AUBIO_DOUBLE 72 72 #warning "Using aubio in single precision with fftw3 in double precision" 73 73 #endif /* HAVE_AUBIO_DOUBLE */ 74 #define real_t double 74 #define real_t double 75 75 #endif /* HAVE_FFTW3F */ 76 76 … … 82 82 // https://developer.apple.com/library/mac/#documentation/Accelerate/Reference/vDSPRef/Reference/reference.html 83 83 #include <Accelerate/Accelerate.h> 84 85 #if !HAVE_AUBIO_DOUBLE 86 #define aubio_vDSP_ctoz vDSP_ctoz 87 #define aubio_vDSP_fft_zrip vDSP_fft_zrip 88 #define aubio_vDSP_ztoc vDSP_ztoc 89 #define aubio_vDSP_zvmags vDSP_zvmags 90 #define aubio_vDSP_zvphas vDSP_zvphas 91 #define aubio_vDSP_vsadd vDSP_vsadd 92 #define aubio_vDSP_vsmul vDSP_vsmul 93 #define aubio_vDSP_create_fftsetup vDSP_create_fftsetup 94 #define aubio_vDSP_destroy_fftsetup vDSP_destroy_fftsetup 95 #define aubio_DSPComplex DSPComplex 96 #define aubio_DSPSplitComplex DSPSplitComplex 97 #define aubio_FFTSetup FFTSetup 98 #define aubio_vvsqrt vvsqrtf 99 #else 100 #define aubio_vDSP_ctoz vDSP_ctozD 101 #define aubio_vDSP_fft_zrip vDSP_fft_zripD 102 #define aubio_vDSP_ztoc vDSP_ztocD 103 #define aubio_vDSP_zvmags vDSP_zvmagsD 104 #define aubio_vDSP_zvphas vDSP_zvphasD 105 #define aubio_vDSP_vsadd vDSP_vsaddD 106 #define aubio_vDSP_vsmul vDSP_vsmulD 107 #define aubio_vDSP_create_fftsetup vDSP_create_fftsetupD 108 #define aubio_vDSP_destroy_fftsetup vDSP_destroy_fftsetupD 109 #define aubio_DSPComplex DSPDoubleComplex 110 #define aubio_DSPSplitComplex DSPDoubleSplitComplex 111 #define aubio_FFTSetup FFTSetupD 112 #define aubio_vvsqrt vvsqrt 113 #endif /* HAVE_AUBIO_DOUBLE */ 84 114 85 115 #else // using OOURA … … 96 126 real_t *in, *out; 97 127 fftw_plan pfw, pbw; 98 fft_data_t * specdata; /* complex spectral data */128 fft_data_t * specdata; /* complex spectral data */ 99 129 #else 100 130 #ifdef HAVE_ACCELERATE // using ACCELERATE 101 131 int log2fftsize; 102 #if !HAVE_AUBIO_DOUBLE 103 FFTSetup fftSetup; 104 DSPSplitComplex spec; 105 float *in, *out; 106 #else 107 FFTSetupD fftSetup; 108 DSPDoubleSplitComplex spec; 109 double *in, *out; 110 #endif 132 aubio_FFTSetup fftSetup; 133 aubio_DSPSplitComplex spec; 134 smpl_t *in, *out; 111 135 #else // using OOURA 112 136 smpl_t *in, *out; … … 120 144 aubio_fft_t * new_aubio_fft (uint_t winsize) { 121 145 aubio_fft_t * s = AUBIO_NEW(aubio_fft_t); 146 if ((sint_t)winsize < 1) { 147 AUBIO_ERR("fft: got winsize %d, but can not be < 1\n", winsize); 148 goto beach; 149 } 122 150 #ifdef HAVE_FFTW3 123 151 uint_t i; … … 154 182 s->compspec = new_fvec(winsize); 155 183 s->log2fftsize = (uint_t)log2f(s->fft_size); 156 #if !HAVE_AUBIO_DOUBLE 157 s->in = AUBIO_ARRAY(float, s->fft_size); 158 s->out = AUBIO_ARRAY(float, s->fft_size); 159 s->spec.realp = AUBIO_ARRAY(float, s->fft_size/2); 160 s->spec.imagp = AUBIO_ARRAY(float, s->fft_size/2); 161 s->fftSetup = vDSP_create_fftsetup(s->log2fftsize, FFT_RADIX2); 162 #else 163 s->in = AUBIO_ARRAY(double, s->fft_size); 164 s->out = AUBIO_ARRAY(double, s->fft_size); 165 s->spec.realp = AUBIO_ARRAY(double, s->fft_size/2); 166 s->spec.imagp = AUBIO_ARRAY(double, s->fft_size/2); 167 s->fftSetup = vDSP_create_fftsetupD(s->log2fftsize, FFT_RADIX2); 168 #endif 169 #else // using OOURA 184 s->in = AUBIO_ARRAY(smpl_t, s->fft_size); 185 s->out = AUBIO_ARRAY(smpl_t, s->fft_size); 186 s->spec.realp = AUBIO_ARRAY(smpl_t, s->fft_size/2); 187 s->spec.imagp = AUBIO_ARRAY(smpl_t, s->fft_size/2); 188 s->fftSetup = aubio_vDSP_create_fftsetup(s->log2fftsize, FFT_RADIX2); 189 #else // using OOURA 190 if (aubio_is_power_of_two(winsize) != 1) { 191 AUBIO_ERR("fft: can only create with sizes power of two," 192 " requested %d\n", winsize); 193 goto beach; 194 } 170 195 s->winsize = winsize; 171 196 s->fft_size = winsize / 2 + 1; … … 179 204 #endif /* HAVE_FFTW3 */ 180 205 return s; 206 beach: 207 AUBIO_FREE(s); 208 return NULL; 181 209 } 182 210 … … 192 220 AUBIO_FREE(s->spec.realp); 193 221 AUBIO_FREE(s->spec.imagp); 194 #if !HAVE_AUBIO_DOUBLE 195 vDSP_destroy_fftsetup(s->fftSetup); 196 #else 197 vDSP_destroy_fftsetupD(s->fftSetup); 198 #endif 222 aubio_vDSP_destroy_fftsetup(s->fftSetup); 199 223 #else // using OOURA 200 224 AUBIO_FREE(s->w); … … 219 243 void aubio_fft_do_complex(aubio_fft_t * s, fvec_t * input, fvec_t * compspec) { 220 244 uint_t i; 245 #ifndef HAVE_MEMCPY_HACKS 221 246 for (i=0; i < s->winsize; i++) { 222 247 s->in[i] = input->data[i]; 223 248 } 249 #else 250 memcpy(s->in, input->data, s->winsize * sizeof(smpl_t)); 251 #endif /* HAVE_MEMCPY_HACKS */ 224 252 #ifdef HAVE_FFTW3 // using FFTW3 225 253 fftw_execute(s->pfw); … … 238 266 #else /* HAVE_FFTW3 */ 239 267 #ifdef HAVE_ACCELERATE // using ACCELERATE 240 #if !HAVE_AUBIO_DOUBLE241 268 // convert real data to even/odd format used in vDSP 242 vDSP_ctoz((DSPComplex*)s->in, 2, &s->spec, 1, s->fft_size/2);269 aubio_vDSP_ctoz((aubio_DSPComplex*)s->in, 2, &s->spec, 1, s->fft_size/2); 243 270 // compute the FFT 244 vDSP_fft_zrip(s->fftSetup, &s->spec, 1, s->log2fftsize, FFT_FORWARD); 245 #else 246 // convert real data to even/odd format used in vDSP 247 vDSP_ctozD((DSPDoubleComplex*)s->in, 2, &s->spec, 1, s->fft_size/2); 248 // compute the FFT 249 vDSP_fft_zripD(s->fftSetup, &s->spec, 1, s->log2fftsize, FFT_FORWARD); 250 #endif 271 aubio_vDSP_fft_zrip(s->fftSetup, &s->spec, 1, s->log2fftsize, FFT_FORWARD); 251 272 // convert from vDSP complex split to [ r0, r1, ..., rN, iN-1, .., i2, i1] 252 273 compspec->data[0] = s->spec.realp[0]; … … 258 279 // apply scaling 259 280 smpl_t scale = 1./2.; 260 #if !HAVE_AUBIO_DOUBLE 261 vDSP_vsmul(compspec->data, 1, &scale, compspec->data, 1, s->fft_size); 262 #else 263 vDSP_vsmulD(compspec->data, 1, &scale, compspec->data, 1, s->fft_size); 264 #endif 281 aubio_vDSP_vsmul(compspec->data, 1, &scale, compspec->data, 1, s->fft_size); 265 282 #else // using OOURA 266 283 rdft(s->winsize, 1, s->in, s->ip, s->w); … … 305 322 s->out[2 * i + 1] = compspec->data[s->winsize - i]; 306 323 } 307 #if !HAVE_AUBIO_DOUBLE308 324 // convert to split complex format used in vDSP 309 vDSP_ctoz((DSPComplex*)s->out, 2, &s->spec, 1, s->fft_size/2);325 aubio_vDSP_ctoz((aubio_DSPComplex*)s->out, 2, &s->spec, 1, s->fft_size/2); 310 326 // compute the FFT 311 vDSP_fft_zrip(s->fftSetup, &s->spec, 1, s->log2fftsize, FFT_INVERSE);327 aubio_vDSP_fft_zrip(s->fftSetup, &s->spec, 1, s->log2fftsize, FFT_INVERSE); 312 328 // convert result to real output 313 vDSP_ztoc(&s->spec, 1, (DSPComplex*)output->data, 2, s->fft_size/2);329 aubio_vDSP_ztoc(&s->spec, 1, (aubio_DSPComplex*)output->data, 2, s->fft_size/2); 314 330 // apply scaling 315 331 smpl_t scale = 1.0 / s->winsize; 316 vDSP_vsmul(output->data, 1, &scale, output->data, 1, s->fft_size); 317 #else 318 // convert to split complex format used in vDSP 319 vDSP_ctozD((DSPDoubleComplex*)s->out, 2, &s->spec, 1, s->fft_size/2); 320 // compute the FFT 321 vDSP_fft_zripD(s->fftSetup, &s->spec, 1, s->log2fftsize, FFT_INVERSE); 322 // convert result to real output 323 vDSP_ztocD(&s->spec, 1, (DSPDoubleComplex*)output->data, 2, s->fft_size/2); 324 // apply scaling 325 smpl_t scale = 1.0 / s->winsize; 326 vDSP_vsmulD(output->data, 1, &scale, output->data, 1, s->fft_size); 327 #endif 332 aubio_vDSP_vsmul(output->data, 1, &scale, output->data, 1, s->fft_size); 328 333 #else // using OOURA 329 334 smpl_t scale = 2.0 / s->winsize; … … 392 397 uint_t i; 393 398 for (i = 0; i < compspec->length / 2 + 1; i++) { 394 compspec->data[i] = 399 compspec->data[i] = 395 400 spectrum->norm[i]*COS(spectrum->phas[i]); 396 401 } -
src/spectral/fft.h
rb257b60 r60fc05b 19 19 */ 20 20 21 /** \file 21 /** \file 22 22 23 23 Fast Fourier Transform … … 40 40 41 41 /** FFT object 42 42 43 43 This object computes forward and backward FFTs. 44 44 … … 52 52 */ 53 53 aubio_fft_t * new_aubio_fft (uint_t size); 54 /** delete FFT object 54 /** delete FFT object 55 55 56 56 \param s fft object as returned by new_aubio_fft … … 62 62 63 63 \param s fft object as returned by new_aubio_fft 64 \param input input signal 65 \param spectrum output spectrum 64 \param input input signal 65 \param spectrum output spectrum 66 66 67 67 */ … … 70 70 71 71 \param s fft object as returned by new_aubio_fft 72 \param spectrum input spectrum 73 \param output output signal 72 \param spectrum input spectrum 73 \param output output signal 74 74 75 75 */ … … 79 79 80 80 \param s fft object as returned by new_aubio_fft 81 \param input real input signal 81 \param input real input signal 82 82 \param compspec complex output fft real/imag 83 83 … … 87 87 88 88 \param s fft object as returned by new_aubio_fft 89 \param compspec real/imag input fft array 90 \param output real output array 89 \param compspec real/imag input fft array 90 \param output real output array 91 91 92 92 */ 93 93 void aubio_fft_rdo_complex (aubio_fft_t *s, fvec_t * compspec, fvec_t * output); 94 94 95 /** convert real/imag spectrum to norm/phas spectrum 95 /** convert real/imag spectrum to norm/phas spectrum 96 96 97 \param compspec real/imag input fft array 98 \param spectrum cvec norm/phas output array 97 \param compspec real/imag input fft array 98 \param spectrum cvec norm/phas output array 99 99 100 100 */ 101 101 void aubio_fft_get_spectrum(fvec_t * compspec, cvec_t * spectrum); 102 /** convert real/imag spectrum to norm/phas spectrum 102 /** convert real/imag spectrum to norm/phas spectrum 103 103 104 \param compspec real/imag input fft array 105 \param spectrum cvec norm/phas output array 104 \param compspec real/imag input fft array 105 \param spectrum cvec norm/phas output array 106 106 107 107 */ 108 108 void aubio_fft_get_realimag(cvec_t * spectrum, fvec_t * compspec); 109 109 110 /** compute phas spectrum from real/imag parts 110 /** compute phas spectrum from real/imag parts 111 111 112 \param compspec real/imag input fft array 113 \param spectrum cvec norm/phas output array 112 \param compspec real/imag input fft array 113 \param spectrum cvec norm/phas output array 114 114 115 115 */ 116 116 void aubio_fft_get_phas(fvec_t * compspec, cvec_t * spectrum); 117 /** compute imaginary part from the norm/phas cvec 117 /** compute imaginary part from the norm/phas cvec 118 118 119 \param spectrum norm/phas input array 120 \param compspec real/imag output fft array 119 \param spectrum norm/phas input array 120 \param compspec real/imag output fft array 121 121 122 122 */ 123 123 void aubio_fft_get_imag(cvec_t * spectrum, fvec_t * compspec); 124 124 125 /** compute norm component from real/imag parts 125 /** compute norm component from real/imag parts 126 126 127 \param compspec real/imag input fft array 128 \param spectrum cvec norm/phas output array 127 \param compspec real/imag input fft array 128 \param spectrum cvec norm/phas output array 129 129 130 130 */ 131 131 void aubio_fft_get_norm(fvec_t * compspec, cvec_t * spectrum); 132 /** compute real part from norm/phas components 132 /** compute real part from norm/phas components 133 133 134 \param spectrum norm/phas input array 135 \param compspec real/imag output fft array 134 \param spectrum norm/phas input array 135 \param compspec real/imag output fft array 136 136 137 137 */ -
src/spectral/filterbank_mel.h
rb257b60 r60fc05b 59 59 60 60 The filter coefficients are built according to Malcolm Slaney's Auditory 61 Toolbox, available at http:// cobweb.ecn.purdue.edu/~malcolm/interval/1998-010/61 Toolbox, available at http://engineering.purdue.edu/~malcolm/interval/1998-010/ 62 62 (see file mfcc.m). 63 63 -
src/spectral/mfcc.h
rb257b60 r60fc05b 22 22 /** \file 23 23 24 Mel-frequency cepstrum coefficients object 24 Mel-Frequency Cepstrum Coefficients object 25 26 This object computes MFCC coefficients on an input cvec_t. 27 28 The implementation follows the specifications established by Malcolm Slaney 29 in its Auditory Toolbox, available online (see file mfcc.m). 30 31 http://engineering.ecn.purdue.edu/~malcolm/interval/1998-010/ 25 32 26 33 \example spectral/test-mfcc.c -
src/spectral/phasevoc.h
rb257b60 r60fc05b 57 57 58 58 /** compute spectral frame 59 59 60 60 This function accepts an input vector of size [hop_s]. The 61 61 analysis buffer is rotated and filled with the new data. After windowing of … … 64 64 65 65 \param pv phase vocoder object as returned by new_aubio_pvoc 66 \param in new input signal (hop_s long) 66 \param in new input signal (hop_s long) 67 67 \param fftgrain output spectral frame 68 68 … … 75 75 synthesis is then computed using the previously synthetised frames, and the 76 76 output stored in out. 77 77 78 78 \param pv phase vocoder object as returned by new_aubio_pvoc 79 79 \param fftgrain input spectral frame 80 \param out output signal (hop_s long) 80 \param out output signal (hop_s long) 81 81 82 82 */ … … 98 98 #ifdef __cplusplus 99 99 } 100 #endif 100 #endif 101 101 102 102 #endif /* _AUBIO_PHASEVOC_H */ -
src/spectral/tss.h
rb257b60 r60fc05b 63 63 64 64 /** split input into transient and steady states components 65 65 66 66 \param o tss object as returned by new_aubio_tss() 67 67 \param input input spectral frame … … 73 73 cvec_t * stead); 74 74 75 /** set transient / steady state separation threshold 76 75 /** set transient / steady state separation threshold 76 77 77 \param o tss object as returned by new_aubio_tss() 78 78 \param thrs new threshold value … … 82 82 83 83 /** set parameter a, defaults to 3 84 84 85 85 \param o tss object as returned by new_aubio_tss() 86 86 \param alpha new value for alpha parameter … … 90 90 91 91 /** set parameter b, defaults to 3 92 92 93 93 \param o tss object as returned by new_aubio_tss() 94 94 \param beta new value for beta parameter -
src/tempo/beattracking.c
rb257b60 r60fc05b 136 136 uint_t numelem = 4; 137 137 138 smpl_t phase; // beat alignment (step - lastbeat) 139 smpl_t beat; // beat position 138 smpl_t phase; // beat alignment (step - lastbeat) 139 smpl_t beat; // beat position 140 140 smpl_t bp; // beat period 141 141 uint_t a, b; // used to build shift invariant comb filterbank … … 227 227 beat = bp - phase; 228 228 229 // AUBIO_DBG ("bp: %f, phase: %f, lastbeat: %f, step: %d, winlen: %d\n", 229 // AUBIO_DBG ("bp: %f, phase: %f, lastbeat: %f, step: %d, winlen: %d\n", 230 230 // bp, phase, bt->lastbeat, step, winlen); 231 231 … … 319 319 } 320 320 321 //now look for step change - i.e. a difference between gp and rp that 321 //now look for step change - i.e. a difference between gp and rp that 322 322 // is greater than 2*constthresh - always true in first case, since gp = 0 323 323 if (counter == 0) { … … 342 342 } 343 343 } else if (counter > 0) { 344 //if counter doesn't = 1, 344 //if counter doesn't = 1, 345 345 counter = counter - 1; 346 346 } -
src/tempo/beattracking.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Matthew Davies and Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Matthew Davies and Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 35 35 36 36 \example tempo/test-beattracking.c 37 37 38 38 */ 39 39 #ifndef _AUBIO_BEATTRACKING_H … … 50 50 51 51 \param winlen length of the onset detection window 52 \param hop_size number of onset detection samples [512] 52 \param hop_size number of onset detection samples [512] 53 53 \param samplerate samplerate of the input signal 54 54 … … 57 57 uint_t samplerate); 58 58 59 /** track the beat 59 /** track the beat 60 60 61 61 \param bt beat tracking object 62 62 \param dfframes current input detection function frame, smoothed by 63 adaptive median threshold. 64 \param out stored detected beat locations 63 adaptive median threshold. 64 \param out stored detected beat locations 65 65 66 66 */ … … 78 78 smpl_t aubio_beattracking_get_bpm(aubio_beattracking_t * bt); 79 79 80 /** get current tempo confidence 80 /** get current tempo confidence 81 81 82 82 \param bt beat tracking object -
src/temporal/a_weighting.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 25 25 26 26 A-weighting filter coefficients 27 27 28 28 This file creates an A-weighting digital filter, which reduces low and high 29 29 frequencies and enhance the middle ones to reflect the ability of the human 30 30 hearing. 31 31 32 32 The implementation is based on the following standard: 33 33 34 34 - IEC/CD 1672: Electroacoustics-Sound Level Meters, IEC, Geneva, Nov. 1996, 35 35 for A- and C-weighting filters. 36 36 37 37 See also: 38 38 39 39 - <a href="http://en.wikipedia.org/wiki/A-weighting">A-Weighting on 40 40 Wikipedia</a> … … 43 43 - <a href="http://www.mathworks.com/matlabcentral/fileexchange/69">Christophe 44 44 Couvreur's 'octave' toolbox</a> 45 45 46 46 The coefficients in this file have been computed using Christophe Couvreur's 47 47 scripts in octave 3.0 (debian package 1:3.0.5-6+b2 with octave-signal … … 63 63 /** create new A-design filter 64 64 65 \param samplerate sampling frequency of the signal to filter. Should be one of 65 \param samplerate sampling frequency of the signal to filter. Should be one of 66 66 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 67 67 192000 Hz … … 75 75 76 76 \param f filter object to get coefficients from 77 \param samplerate sampling frequency of the signal to filter. Should be one of 77 \param samplerate sampling frequency of the signal to filter. Should be one of 78 78 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 79 79 192000 Hz -
src/temporal/biquad.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 22 22 #define _AUBIO_FILTER_BIQUAD_H 23 23 24 /** \file 24 /** \file 25 25 26 26 Second order Infinite Impulse Response filter 27 27 28 28 This file implements a normalised biquad filter (second order IIR): 29 29 30 30 \f$ y[n] = b_0 x[n] + b_1 x[n-1] + b_2 x[n-2] - a_1 y[n-1] - a_2 y[n-2] \f$ 31 31 -
src/temporal/c_weighting.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 25 25 26 26 C-weighting filter coefficients 27 27 28 28 This file creates a C-weighting digital filter, which reduces low and high 29 29 frequencies and enhance the middle ones to reflect the ability of the human 30 30 hearing. 31 31 32 32 The implementation is based on the following standard: 33 33 34 34 - IEC/CD 1672: Electroacoustics-Sound Level Meters, IEC, Geneva, Nov. 1996, 35 35 for A- and C-weighting filters. 36 36 37 37 See also: 38 38 39 39 - <a href="http://en.wikipedia.org/wiki/A-weighting">A-Weighting on 40 40 Wikipedia</a> … … 43 43 - <a href="http://www.mathworks.com/matlabcentral/fileexchange/69">Christophe 44 44 Couvreur's 'octave' toolbox</a> 45 45 46 46 The coefficients in this file have been computed using Christophe Couvreur's 47 47 scripts in octave 3.0 (debian package 1:3.0.5-6+b2 with octave-signal … … 63 63 /** create new C-design filter 64 64 65 \param samplerate sampling frequency of the signal to filter. Should be one of 65 \param samplerate sampling frequency of the signal to filter. Should be one of 66 66 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 67 67 192000 Hz … … 75 75 76 76 \param f filter object to get coefficients from 77 \param samplerate sampling frequency of the signal to filter. Should be one of 77 \param samplerate sampling frequency of the signal to filter. Should be one of 78 78 8000, 11025, 16000, 22050, 24000, 32000, 44100, 48000, 88200, 96000, and 79 79 192000 Hz -
src/temporal/filter.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 22 22 #define _AUBIO_FILTER_H 23 23 24 /** \file 24 /** \file 25 25 26 26 Digital filter … … 28 28 This object stores a digital filter of order \f$n\f$. 29 29 It contains the following data: 30 - \f$ n*1 b_i \f$ feedforward coefficients 31 - \f$ n*1 a_i \f$ feedback coefficients 30 - \f$ n*1 b_i \f$ feedforward coefficients 31 - \f$ n*1 a_i \f$ feedback coefficients 32 32 - \f$ n*c x_i \f$ input signal 33 33 - \f$ n*c y_i \f$ output signal … … 41 41 The function aubio_filter_do_outplace() computes the following output signal 42 42 \f$ y[n] \f$ from the input signal \f$ x[n] \f$: 43 43 44 44 \f{eqnarray*}{ 45 45 y[n] = b_0 x[n] & + & b_1 x[n-1] + b_2 x[n-2] + ... + b_P x[n-P] \\ … … 54 54 operation. 55 55 56 Some convenience functions are provided: 56 Some convenience functions are provided: 57 57 - new_aubio_filter_a_weighting() and aubio_filter_set_a_weighting(), 58 58 - new_aubio_filter_c_weighting() and aubio_filter_set_c_weighting(). … … 60 60 61 61 \example temporal/test-filter.c 62 62 63 63 */ 64 64 … … 164 164 165 165 /** delete a filter object 166 166 167 167 \param f filter object to delete 168 168 -
src/temporal/resampler.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 23 23 24 24 /** \file 25 25 26 26 Resampling object 27 27 28 28 This object resamples an input vector into an output vector using 29 29 libsamplerate. See http://www.mega-nerd.com/SRC/ 30 30 31 31 */ 32 32 … … 38 38 typedef struct _aubio_resampler_t aubio_resampler_t; 39 39 40 /** create resampler object 40 /** create resampler object 41 41 42 \param ratio output_sample_rate / input_sample_rate 42 \param ratio output_sample_rate / input_sample_rate 43 43 \param type libsamplerate resampling type, see http://www.mega-nerd.com/SRC/api_misc.html#Converters 44 44 -
src/types.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2003-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2003-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio. … … 23 23 24 24 /** \file 25 25 26 26 Definition of data types used in aubio 27 27 28 28 */ 29 29 -
src/utils/parameter.h
rb257b60 r60fc05b 61 61 uint_t aubio_parameter_set_target_value ( aubio_parameter_t * param, smpl_t value ); 62 62 63 /** get next parameter 63 /** get next parameter 64 64 65 65 \param param parameter, created by ::new_aubio_parameter -
src/utils/scale.h
rb257b60 r60fc05b 21 21 /** \file 22 22 23 Vector scaling function 24 23 Vector scaling function 24 25 25 This object, inspired from the scale object in FTS, the jMax engine, scales 26 26 the values of a vector according to an affine function defined as follow: 27 28 \f$ y = (x - ilow)*(ohig-olow)/(ihig-ilow) + olow \f$ 29 27 28 \f$ y = (x - ilow)*(ohig-olow)/(ihig-ilow) + olow \f$ 29 30 30 */ 31 31 #ifndef _AUBIO_SCALE_H … … 40 40 41 41 /** create a scale object 42 42 43 43 \param flow lower value of output function 44 44 \param fhig higher value of output function … … 49 49 aubio_scale_t * new_aubio_scale(smpl_t flow, smpl_t fhig, 50 50 smpl_t ilow, smpl_t ihig); 51 /** delete a scale object 51 /** delete a scale object 52 52 53 53 \param s scale object as returned by new_aubio_scale … … 76 76 #ifdef __cplusplus 77 77 } 78 #endif 78 #endif 79 79 80 80 #endif /* _AUBIO_SCALE_H */ -
src/vecutils.h
rb257b60 r60fc05b 1 1 /* 2 Copyright (C) 2009-201 3Paul Brossier <piem@aubio.org>2 Copyright (C) 2009-2015 Paul Brossier <piem@aubio.org> 3 3 4 4 This file is part of aubio.
Note: See TracChangeset
for help on using the changeset viewer.