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: /** @file andrew@0: * andrew@0: * Histogram function andrew@0: * andrew@0: * Big hacks to implement an histogram andrew@0: */ andrew@0: andrew@0: #ifndef HIST_H andrew@0: #define HIST_H andrew@0: andrew@0: #ifdef __cplusplus andrew@0: extern "C" { andrew@0: #endif andrew@0: andrew@0: /** histogram object */ andrew@0: typedef struct _aubio_hist_t aubio_hist_t; andrew@0: andrew@0: /** histogram creation andrew@0: * \param flow minimum input andrew@0: * \param fhig maximum input andrew@0: * \param nelems number of histogram columns andrew@0: * \param channels number of channels andrew@0: */ andrew@0: aubio_hist_t * new_aubio_hist(smpl_t flow, smpl_t fhig, ba_uint_t nelems, ba_uint_t channels); andrew@0: /** histogram deletion */ andrew@0: void del_aubio_hist(aubio_hist_t *s); andrew@0: /** compute the histogram */ andrew@0: void aubio_hist_do(aubio_hist_t *s, fvec_t * input); andrew@0: /** compute the histogram ignoring null elements */ andrew@0: void aubio_hist_do_notnull(aubio_hist_t *s, fvec_t * input); andrew@0: /** compute the mean of the histogram */ andrew@0: smpl_t aubio_hist_mean(aubio_hist_t *s); andrew@0: /** weight the histogram */ andrew@0: void aubio_hist_weigth(aubio_hist_t *s); andrew@0: /** compute dynamic histogram for non-null elements */ andrew@0: void aubio_hist_dyn_notnull (aubio_hist_t *s, fvec_t *input); andrew@0: andrew@0: #ifdef __cplusplus andrew@0: } andrew@0: #endif andrew@0: andrew@0: #endif