jamie@107: /* libxtract feature extraction library jamie@107: * jamie@107: * Copyright (C) 2006 Jamie Bullock jamie@107: * jamie@107: * This program is free software; you can redistribute it and/or modify jamie@107: * it under the terms of the GNU General Public License as published by jamie@107: * the Free Software Foundation; either version 2 of the License, or jamie@107: * (at your option) any later version. jamie@107: * jamie@107: * This program is distributed in the hope that it will be useful, jamie@107: * but WITHOUT ANY WARRANTY; without even the implied warranty of jamie@107: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the jamie@107: * GNU General Public License for more details. jamie@107: * jamie@107: * You should have received a copy of the GNU General Public License jamie@107: * along with this program; if not, write to the Free Software jamie@107: * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, jamie@107: * USA. jamie@107: */ jamie@107: jamie@107: /* xtract_window_private.h: declares window generation functions */ jamie@107: jamie@107: #define PI 3.1415926535897931 jamie@107: jamie@107: /** \brief generate a Gaussian window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * \param sd the standard deviation of the "distribution" represented by the Gaussian curve. The higher the value of sd, the wider the curve. Generally sd <= 0.5 jamie@107: * jamie@107: */ jamie@107: void gauss(float *window, const int N, const float sd); jamie@107: jamie@107: /** \brief generate a Hamming window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void hamming(float *window, const int N); jamie@107: jamie@107: /** \brief generate a Hann window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void hann(float *window, const int N); jamie@107: jamie@107: /** \brief generate a Bartlett window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void bartlett(float *window, const int N); jamie@107: jamie@107: /** \brief generate a Triangular window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void triangular(float *window, const int N); jamie@107: jamie@107: /** \brief generate a Bartlett-Hann window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void bartlett_hann(float *window, const int N); jamie@107: jamie@107: /** \brief generate a Blackman window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void blackman(float *window, const int N); jamie@107: jamie@107: /** \brief generate a Kaiser window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * \param alpha The larger the value of |alpha|, the narrower the window becomes jamie@107: * jamie@107: */ jamie@107: void kaiser(float *window, const int N, const float alpha); jamie@107: jamie@107: /** \brief generate a Blackman-Harris window jamie@107: * jamie@107: * \param *window a pointer to an array to contain the window data jamie@107: * \param N the number of elements in the array pointed to by *window jamie@107: * jamie@107: */ jamie@107: void blackman_harris(float *window, const int N); jamie@107: