2 Copyright (C) 2007-2013 Paul Brossier <piem@aubio.org>
3 and Amaury Hazan <ahazan@iua.upf.edu>
5 This file is part of aubio.
7 aubio is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation, either version 3 of the License, or
10 (at your option) any later version.
12 aubio is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with aubio. If not, see <http://www.gnu.org/licenses/>.
24 Filterbank object coefficients initialization
26 Functions to create set the ::aubio_filterbank_t coefficients to
27 - ::aubio_filterbank_set_triangle_bands: overlapping triangular bands,
28 - ::aubio_filterbank_set_mel_coeffs_slaney: Mel frequency bands.
30 \example spectral/test-filterbank_mel.c
34 #ifndef AUBIO_FILTERBANK_MEL_H
35 #define AUBIO_FILTERBANK_MEL_H
42 /** filterbank initialization with triangular and overlapping bands
44 \param fb filterbank object
45 \param freqs arbitrary array of boundary frequencies
46 \param samplerate audio sampling rate
48 This function computes the coefficients of the filterbank based on the
49 boundaries found in freqs, in Hz, and using triangular overlapping bands.
52 uint_t aubio_filterbank_set_triangle_bands (aubio_filterbank_t * fb,
53 const fvec_t * freqs, smpl_t samplerate);
55 /** filterbank initialization for Mel filters using Slaney's coefficients
57 \param fb filterbank object
58 \param samplerate audio sampling rate
60 The filter coefficients are built to match exactly Malcolm Slaney's Auditory
61 Toolbox implementation (see file mfcc.m). The number of filters should be 40.
66 Malcolm Slaney, *Auditory Toolbox Version 2, Technical Report #1998-010*
67 https://engineering.purdue.edu/~malcolm/interval/1998-010/
70 uint_t aubio_filterbank_set_mel_coeffs_slaney (aubio_filterbank_t * fb,
73 /** Mel filterbank initialization
75 \param fb filterbank object
76 \param samplerate audio sampling rate
77 \param fmin start frequency, in Hz
78 \param fmax end frequency, in Hz
80 The filterbank will be initialized with bands linearly spaced in the mel
81 scale, from `fmin` to `fmax`.
86 Malcolm Slaney, *Auditory Toolbox Version 2, Technical Report #1998-010*
87 https://engineering.purdue.edu/~malcolm/interval/1998-010/
90 uint_t aubio_filterbank_set_mel_coeffs(aubio_filterbank_t * fb,
91 smpl_t samplerate, smpl_t fmin, smpl_t fmax);
93 /** Mel filterbank initialization
95 \param fb filterbank object
96 \param samplerate audio sampling rate
97 \param fmin start frequency, in Hz
98 \param fmax end frequency, in Hz
100 The bank of filters will be initalized to to cover linearly spaced bands in
101 the Htk mel scale, from `fmin` to `fmax`.
106 Douglas O'Shaughnessy (1987). *Speech communication: human and machine*.
107 Addison-Wesley. p. 150. ISBN 978-0-201-16520-3.
109 HTK Speech Recognition Toolkit: http://htk.eng.cam.ac.uk/
112 uint_t aubio_filterbank_set_mel_coeffs_htk(aubio_filterbank_t * fb,
113 smpl_t samplerate, smpl_t fmin, smpl_t fmax);
119 #endif /* AUBIO_FILTERBANK_MEL_H */