Ardour
9.0-pre0-386-g96ef4d20f2
MFCC.h
Go to the documentation of this file.
1
/* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
2
3
/*
4
QM DSP Library
5
6
Centre for Digital Music, Queen Mary, University of London.
7
This file copyright 2005 Nicolas Chetry, copyright 2008 QMUL.
8
9
This program is free software; you can redistribute it and/or
10
modify it under the terms of the GNU General Public License as
11
published by the Free Software Foundation; either version 2 of the
12
License, or (at your option) any later version. See the file
13
COPYING included with this distribution for more information.
14
*/
15
16
#ifndef MFCC_H
17
#define MFCC_H
18
19
#include "
base/Window.h
"
20
21
class
FFTReal
;
22
23
struct
MFCCConfig
{
24
int
FS
;
25
int
fftsize
;
26
int
nceps
;
27
double
logpower
;
28
bool
want_c0
;
29
WindowType
window
;
30
MFCCConfig
(
int
_FS) :
31
FS
(_FS),
fftsize
(2048),
nceps
(19),
32
logpower
(1.0),
want_c0
(true),
window
(
HammingWindow
) { }
33
};
34
35
class
MFCC
36
{
37
public
:
38
MFCC
(
MFCCConfig
config);
39
virtual
~MFCC
();
40
46
int
process
(
const
double
*inframe,
double
*outceps);
47
54
int
process
(
const
double
*real,
const
double
*imag,
double
*outceps);
55
56
int
getfftlength
()
const
{
return
fftSize
; }
57
58
private
:
59
/* Filter bank parameters */
60
double
lowestFrequency
;
61
int
linearFilters
;
62
double
linearSpacing
;
63
int
logFilters
;
64
double
logSpacing
;
65
66
/* FFT length */
67
int
fftSize
;
68
69
int
totalFilters
;
70
double
logPower
;
71
72
/* Misc. */
73
int
samplingRate
;
74
int
nceps
;
75
76
/* MFCC vector */
77
double
*
ceps
;
78
79
double
**
mfccDCTMatrix
;
80
double
**
mfccFilterWeights
;
81
82
/* The analysis window */
83
Window<double>
*
window
;
84
85
/* For the FFT */
86
double
*
realOut
;
87
double
*
imagOut
;
88
double
*
fftMag
;
89
double
*
earMag
;
90
FFTReal
*
fft
;
91
92
/* Set if user want C0 */
93
int
WANT_C0
;
94
};
95
96
97
#endif
98
Window.h
WindowType
WindowType
Definition:
Window.h:23
HammingWindow
@ HammingWindow
Definition:
Window.h:26
FFTReal
Definition:
FFT.h:53
MFCC
Definition:
MFCC.h:36
MFCC::window
Window< double > * window
Definition:
MFCC.h:83
MFCC::fftSize
int fftSize
Definition:
MFCC.h:67
MFCC::linearSpacing
double linearSpacing
Definition:
MFCC.h:62
MFCC::ceps
double * ceps
Definition:
MFCC.h:77
MFCC::~MFCC
virtual ~MFCC()
MFCC::logFilters
int logFilters
Definition:
MFCC.h:63
MFCC::mfccDCTMatrix
double ** mfccDCTMatrix
Definition:
MFCC.h:79
MFCC::process
int process(const double *real, const double *imag, double *outceps)
MFCC::nceps
int nceps
Definition:
MFCC.h:74
MFCC::mfccFilterWeights
double ** mfccFilterWeights
Definition:
MFCC.h:80
MFCC::realOut
double * realOut
Definition:
MFCC.h:86
MFCC::fftMag
double * fftMag
Definition:
MFCC.h:88
MFCC::earMag
double * earMag
Definition:
MFCC.h:89
MFCC::linearFilters
int linearFilters
Definition:
MFCC.h:61
MFCC::logSpacing
double logSpacing
Definition:
MFCC.h:64
MFCC::fft
FFTReal * fft
Definition:
MFCC.h:90
MFCC::WANT_C0
int WANT_C0
Definition:
MFCC.h:93
MFCC::imagOut
double * imagOut
Definition:
MFCC.h:87
MFCC::lowestFrequency
double lowestFrequency
Definition:
MFCC.h:60
MFCC::logPower
double logPower
Definition:
MFCC.h:70
MFCC::MFCC
MFCC(MFCCConfig config)
MFCC::totalFilters
int totalFilters
Definition:
MFCC.h:69
MFCC::samplingRate
int samplingRate
Definition:
MFCC.h:73
MFCC::getfftlength
int getfftlength() const
Definition:
MFCC.h:56
MFCC::process
int process(const double *inframe, double *outceps)
Window< double >
MFCCConfig
Definition:
MFCC.h:23
MFCCConfig::logpower
double logpower
Definition:
MFCC.h:27
MFCCConfig::want_c0
bool want_c0
Definition:
MFCC.h:28
MFCCConfig::nceps
int nceps
Definition:
MFCC.h:26
MFCCConfig::fftsize
int fftsize
Definition:
MFCC.h:25
MFCCConfig::window
WindowType window
Definition:
MFCC.h:29
MFCCConfig::MFCCConfig
MFCCConfig(int _FS)
Definition:
MFCC.h:30
MFCCConfig::FS
int FS
Definition:
MFCC.h:24
libs
qm-dsp
dsp
mfcc
MFCC.h
Generated on Sun Nov 10 2024 05:34:28 for Ardour by
1.9.1