andrew@0: /* andrew@0: Copyright (C) 2003 Paul Brossier andrew@0: andrew@0: This program is free software; you can redistribute it and/or modify andrew@0: it under the terms of the GNU General Public License as published by andrew@0: the Free Software Foundation; either version 2 of the License, or andrew@0: (at your option) any later version. andrew@0: andrew@0: This program is distributed in the hope that it will be useful, andrew@0: but WITHOUT ANY WARRANTY; without even the implied warranty of andrew@0: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the andrew@0: GNU General Public License for more details. andrew@0: andrew@0: You should have received a copy of the GNU General Public License andrew@0: along with this program; if not, write to the Free Software andrew@0: Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. andrew@0: andrew@0: */ andrew@0: andrew@0: /** \file andrew@0: * peak picking utilities function andrew@0: * andrew@0: * \todo check/fix peak picking andrew@0: */ andrew@0: andrew@0: #ifndef PEAKPICK_H andrew@0: #define PEAKPICK_H andrew@0: andrew@0: #ifdef __cplusplus andrew@0: extern "C" { andrew@0: #endif andrew@0: andrew@0: /** function pointer to thresholding function */ andrew@0: typedef smpl_t (*aubio_thresholdfn_t)(fvec_t *input); andrew@0: /** function pointer to peak-picking function */ andrew@0: typedef ba_uint_t (*aubio_pickerfn_t)(fvec_t *input, ba_uint_t pos); andrew@0: /** peak-picker structure */ andrew@0: typedef struct _aubio_pickpeak_t aubio_pickpeak_t; andrew@0: andrew@0: /** peak-picker creation function */ andrew@0: aubio_pickpeak_t * new_aubio_peakpicker(smpl_t threshold); andrew@0: /** real time peak picking function */ andrew@0: ba_uint_t aubio_peakpick_pimrt(fvec_t * DF, aubio_pickpeak_t * p); andrew@0: /** function added by Miguel Ramirez to return the onset detection amplitude in peakval */ andrew@0: ba_uint_t aubio_peakpick_pimrt_wt( fvec_t* DF, aubio_pickpeak_t* p, smpl_t* peakval ); andrew@0: /** get current peak value */ andrew@0: smpl_t aubio_peakpick_pimrt_getval(aubio_pickpeak_t * p); andrew@0: /** destroy peak picker structure */ andrew@0: void del_aubio_peakpicker(aubio_pickpeak_t * p); andrew@0: andrew@0: /** set peak picking threshold */ andrew@0: void aubio_peakpicker_set_threshold(aubio_pickpeak_t * p, smpl_t threshold); andrew@0: /** get peak picking threshold */ andrew@0: smpl_t aubio_peakpicker_get_threshold(aubio_pickpeak_t * p); andrew@0: /** set peak picker thresholding function */ andrew@0: void aubio_peakpicker_set_thresholdfn(aubio_pickpeak_t * p, aubio_thresholdfn_t thresholdfn); andrew@0: /** get peak picker thresholding function */ andrew@0: aubio_thresholdfn_t aubio_peakpicker_get_thresholdfn(aubio_pickpeak_t * p); andrew@0: andrew@0: #ifdef __cplusplus andrew@0: } andrew@0: #endif andrew@0: andrew@0: #endif /* PEAKPICK_H */