From c0307f0181ac077da3719e7507d206f7225a361c Mon Sep 17 00:00:00 2001 From: Paul Brossier Date: Mon, 17 Sep 2007 02:04:17 +0200 Subject: [PATCH] bark.{c,h}: remove unused code from libxtract --- src/bark.c | 54 ------------------------------------------------------ src/bark.h | 53 ----------------------------------------------------- 2 files changed, 107 deletions(-) delete mode 100644 src/bark.c delete mode 100644 src/bark.h diff --git a/src/bark.c b/src/bark.c deleted file mode 100644 index 652f125d..00000000 --- a/src/bark.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - Copyright (C) 2006 Amaury Hazan - Ported to aubio from LibXtract - http://libxtract.sourceforge.net/ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#define XTRACT_BARK_BANDS 26 -#include "bark.c" - -int xtract_init_bark(int N, float sr, int *band_limits){ - - float edges[] = {0, 100, 200, 300, 400, 510, 630, 770, 920, 1080, 1270, 1480, 1720, 2000, 2320, 2700, 3150, 3700, 4400, 5300, 6400, 7700, 9500, 12000, 15500, 20500, 27000}; /* Takes us up to sr = 54kHz (CCRMA: JOS)*/ - - int bands = XTRACT_BARK_BANDS; - - while(bands--) - band_limits[bands] = edges[bands] / sr * N; - /*FIX shohuld use rounding, but couldn't get it to work */ - - return XTRACT_SUCCESS; -} - - - - -int xtract_bark_coefficients(const float *data, const int N, const void *argv, float *result){ - - int *limits, band, n; - - limits = (int *)argv; - - for(band = 0; band < XTRACT_BARK_BANDS - 1; band++){ - for(n = limits[band]; n < limits[band + 1]; n++) - result[band] += data[n]; - } - - return XTRACT_SUCCESS; -} \ No newline at end of file diff --git a/src/bark.h b/src/bark.h deleted file mode 100644 index 7c03394f..00000000 --- a/src/bark.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - Copyright (C) 2006 Amaury Hazan - Ported to aubio from LibXtract - http://libxtract.sourceforge.net/ - - - This program is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; either version 2 of the License, or - (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -*/ - -#ifndef BARK_H -#define BARK_H - - -// Initalization - -/** \brief A function to initialise bark filter bounds - * - * A pointer to an array of BARK_BANDS ints most be passed in, and is populated with BARK_BANDS fft bin numbers representing the limits of each band - * - * \param N: the audio block size - * \param sr: The sample audio sample rate - * \param *band_limits: a pointer to an array of BARK_BANDS ints - */ -int xtract_init_bark(int N, float sr, int *band_limits); - -// Computation - -/** \brief Extract Bark band coefficients based on a method - * \param *data: a pointer to the first element in an array of floats representing the magnitude coefficients from the magnitude spectrum of an audio vector, (e.g. the first half of the array pointed to by *result from xtract_spectrum(). - * \param N: the number of array elements to be considered - * \param *argv: a pointer to an array of ints representing the limits of each bark band. This can be obtained by calling xtract_init_bark. - * \param *result: a pointer to an array containing resultant bark coefficients - * - * The limits array pointed to by *argv must be obtained by first calling xtract_init_bark - * - */ -int xtract_bark_coefficients(const float *data, const int N, const void *argv, float *result); - - -#endif \ No newline at end of file -- 2.26.2