jamie@1: /* libxtract feature extraction library jamie@1: * jamie@1: * Copyright (C) 2006 Jamie Bullock jamie@1: * jamie@1: * This program is free software; you can redistribute it and/or modify jamie@1: * it under the terms of the GNU General Public License as published by jamie@1: * the Free Software Foundation; either version 2 of the License, or jamie@1: * (at your option) any later version. jamie@1: * jamie@1: * This program is distributed in the hope that it will be useful, jamie@1: * but WITHOUT ANY WARRANTY; without even the implied warranty of jamie@1: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jamie@1: * GNU General Public License for more details. jamie@1: * jamie@1: * You should have received a copy of the GNU General Public License jamie@1: * along with this program; if not, write to the Free Software jamie@1: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, jamie@1: * USA. jamie@1: */ jamie@1: jamie@116: /** \file xtract_delta.h: declares functions that scalar or vector value from 2 or more input vectors */ jamie@1: jamie@56: #ifndef XTRACT_DELTA_H jamie@56: #define XTRACT_DELTA_H jamie@1: jamie@1: #ifdef __cplusplus jamie@1: extern "C" { jamie@1: #endif jamie@1: jamie@116: /** jamie@116: * \defgroup delta `delta' extraction functions jamie@116: * jamie@116: * Functions that extract a scalar or vector value from 2 or more input vectors jamie@116: * jamie@116: * @{ jamie@116: */ jamie@116: jamie@1: #include "xtract_types.h" jamie@1: jamie@116: /** \brief Extract flux jamie@106: * jamie@117: * \note FIX: don't be lazy -- take the lnorm of the difference vector! jamie@106: * An alias for xtract_lnorm() jamie@106: */ jamie@43: int xtract_flux(const float *data, const int N, const void *argv , float *result); jamie@106: jamie@116: /** \brief Extract the L-norm of a vector jamie@106: * jamie@106: * \param *data: a pointer to the first element in an array of floats representing the difference between two subsequent frames of output from a vector-based feature e.g. the *result from xtract_difference_vector() jamie@106: * \param N: the length of the array pointed to by *data jamie@106: * \param *argv: a pointer to an array of floats, the first representing the "norm order". The second argument represents the filter type determining what values we consider from the difference vector as given in the enumeration xtract_lnorm_filter_types_ (libxtract.h) jamie@106: * \param *result: a pointer to a float representing the flux jamie@106: * jamie@106: */ jamie@106: int xtract_lnorm(const float *data, const int N, const void *argv , float *result); jamie@1: /*xtract_frame_tracker *xf */ jamie@1: jamie@2: /** \brief Extract attack Time */ jamie@43: int xtract_attack_time(const float *data, const int N, const void *argv , float *result); jamie@1: /* xtract_amp_tracker *xa */ jamie@1: jamie@2: /** Extract temporal decrease */ jamie@43: int xtract_decay_time(const float *data, const int N, const void *argv, float *result); jamie@1: /* xtract_amp_tracker *xa */ jamie@1: jamie@1: jamie@106: /** \brief Extract the difference between two vectors jamie@106: * jamie@106: * \param *data a pointer to an array representing two distinct vectors, e.g. two successive magnitude spectra. jamie@106: * \param N the size of the array pointed to by *data jamie@106: * \param *argv a pointer to NULL jamie@106: * \param *result a pointer to an array of size N / 2 representing the difference between the two input vectors. jamie@106: * jamie@106: * */ jamie@106: int xtract_difference_vector(const float *data, const int N, const void *argv, float *result); jamie@1: /*xtract_frame_tracker *xf */ jamie@1: /*float frames*/ jamie@1: jamie@116: /** @} */ jamie@116: jamie@1: #ifdef __cplusplus jamie@1: } jamie@1: #endif jamie@1: jamie@1: #endif