Debian Codegraph @

dwtools/Sound_to_MFCC.cpp

raw
1 /* Sound_to_MFCC.cpp
2 *
3 * Copyright (C) 1993-2017 David Weenink
4 *
5 * This code is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or (at
8 * your option) any later version.
9 *
10 * This code is distributed in the hope that it will be useful, but
11 * WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this work. If not, see <http://www.gnu.org/licenses/>.
17 */
18
19 /*
20 djmw 20010410
21 djmw 20020813 GPL header
22 */
23
24 #include "Sound_to_MFCC.h"
25 #include "Sound_and_Spectrogram_extensions.h"
26
27 autoMFCC Sound_to_MFCC (Sound me, integer numberOfCoefficients, double analysisWidth, double dt, double f1_mel, double fmax_mel, double df_mel) {
28 try {
29 autoMelSpectrogram mf = Sound_to_MelSpectrogram (me, analysisWidth, dt, f1_mel, fmax_mel, df_mel);
30 autoMFCC mfcc = MelSpectrogram_to_MFCC (mf.get(), numberOfCoefficients);
31 return mfcc;
32 } catch (MelderError) {
33 Melder_throw (me, U": no MFCC created.");
34 }
35 }
36
37 /* End of file Sound_to_MFCC.cpp */