comparison dsp/onsets/DetectionFunction.h @ 241:a98dd8ec96f8

* Move dsp/maths to maths ; bring PCA and HMM across from Soundbite
author Chris Cannam <c.cannam@qmul.ac.uk>
date Wed, 09 Jan 2008 10:31:29 +0000
parents 135f16b49065
children 5bec06ecc88a
comparison
equal deleted inserted replaced
240:1a406914b3a9 241:a98dd8ec96f8
9 */ 9 */
10 10
11 #ifndef DETECTIONFUNCTION_H 11 #ifndef DETECTIONFUNCTION_H
12 #define DETECTIONFUNCTION_H 12 #define DETECTIONFUNCTION_H
13 13
14 #include "dsp/maths/MathUtilities.h" 14 #include "maths/MathUtilities.h"
15 #include "dsp/maths/MathAliases.h" 15 #include "maths/MathAliases.h"
16 #include "dsp/phasevocoder/PhaseVocoder.h" 16 #include "dsp/phasevocoder/PhaseVocoder.h"
17 #include "base/Window.h" 17 #include "base/Window.h"
18 18
19 #define DF_HFC (1) 19 #define DF_HFC (1)
20 #define DF_SPECDIFF (2) 20 #define DF_SPECDIFF (2)
21 #define DF_PHASEDEV (3) 21 #define DF_PHASEDEV (3)
22 #define DF_COMPLEXSD (4) 22 #define DF_COMPLEXSD (4)
23 #define DF_BROADBAND (5) 23 #define DF_BROADBAND (5)
24 #define DF_POWER (6)
25 24
26 struct DFConfig{ 25 struct DFConfig{
27 double stepSecs; // DF step in seconds 26 double stepSecs; // DF step in seconds
28 unsigned int stepSize; // DF step in samples 27 unsigned int stepSize; // DF step in samples
29 unsigned int frameLength; // DF analysis window - usually 2*step 28 unsigned int frameLength; // DF analysis window - usually 2*step
50 double HFC( unsigned int length, double* src); 49 double HFC( unsigned int length, double* src);
51 double specDiff( unsigned int length, double* src); 50 double specDiff( unsigned int length, double* src);
52 double phaseDev(unsigned int length, double *srcPhase); 51 double phaseDev(unsigned int length, double *srcPhase);
53 double complexSD(unsigned int length, double *srcMagnitude, double *srcPhase); 52 double complexSD(unsigned int length, double *srcMagnitude, double *srcPhase);
54 double broadband(unsigned int length, double *srcMagnitude); 53 double broadband(unsigned int length, double *srcMagnitude);
55 double power(unsigned int length, double *src);
56 54
57 private: 55 private:
58 void initialise( DFConfig Config ); 56 void initialise( DFConfig Config );
59 void deInitialise(); 57 void deInitialise();
60 58