Merge branch 'master' into windows
[ardour.git] / libs / qm-dsp / dsp / segmentation / cluster_segmenter.h
1 #ifndef _CLUSTER_SEGMENTER_H
2 #define _CLUSTER_SEGMENTER_H
3
4 /*
5  *  cluster_segmenter.h
6  *  soundbite
7  *
8  *  Created by Mark Levy on 06/04/2006.
9  *  Copyright 2006 Centre for Digital Music, Queen Mary, University of London.
10
11     This program is free software; you can redistribute it and/or
12     modify it under the terms of the GNU General Public License as
13     published by the Free Software Foundation; either version 2 of the
14     License, or (at your option) any later version.  See the file
15     COPYING included with this distribution for more information.
16  *
17  */
18
19 #include <stdio.h>
20 #include <stdlib.h>
21 #include <math.h>
22 #include <float.h>
23
24 #include "segment.h"
25 #include "cluster_melt.h"
26 #include "hmm/hmm.h"
27 #include "maths/pca/pca.h"
28
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32
33 /* applies MPEG-7 normalisation to constant-Q features, storing normalised envelope (norm) in last feature dimension */
34 void mpeg7_constq(double** features, int nframes, int ncoeff);
35
36 /* converts constant-Q features to normalised chroma */
37 void cq2chroma(double** cq, int nframes, int ncoeff, int bins, double** chroma);
38
39 void create_histograms(int* x, int nx, int m, int hlen, double* h);
40
41 void cluster_segment(int* q, double** features, int frames_read, int feature_length, int nHMM_states, 
42                                          int histogram_length, int nclusters, int neighbour_limit);
43
44 void constq_segment(int* q, double** features, int frames_read, int bins, int ncoeff, int feature_type, 
45                          int nHMM_states, int histogram_length, int nclusters, int neighbour_limit);
46
47 #ifdef __cplusplus
48 }
49 #endif
50
51 #endif