annotate dsp/segmentation/cluster_segmenter.h @ 73:dcb555b90924

* Key detector: when returning key strengths, use the peak value of the three underlying chromagram correlations (from 36-bin chromagram) corresponding to each key, instead of the mean. Rationale: This is the same method as used when returning the key value, and it's nice to have the same results in both returned value and plot. The peak performed better than the sum with a simple test set of triads, so it seems reasonable to change the plot to match the key output rather than the other way around. * FFT: kiss_fftr returns only the non-conjugate bins, synthesise the rest rather than leaving them (perhaps dangerously) undefined. Fixes an uninitialised data error in chromagram that could cause garbage results from key detector. * Constant Q: remove precalculated values again, I reckon they're not proving such a good tradeoff.
author cannam
date Fri, 05 Jun 2009 15:12:39 +0000
parents 8bdbda7fb893
children e5907ae6de17
rev   line source
cannam@18 1 #ifndef _CLUSTER_SEGMENTER_H
cannam@18 2 #define _CLUSTER_SEGMENTER_H
cannam@18 3
cannam@18 4 /*
cannam@18 5 * cluster_segmenter.h
cannam@18 6 * soundbite
cannam@18 7 *
cannam@18 8 * Created by Mark Levy on 06/04/2006.
cannam@18 9 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved.
cannam@18 10 *
cannam@18 11 */
cannam@18 12
cannam@18 13 #include <stdio.h>
cannam@18 14 #include <stdlib.h>
cannam@18 15 #include <math.h>
cannam@18 16 #include <float.h>
cannam@18 17
cannam@18 18 #include "segment.h"
cannam@18 19 #include "cluster_melt.h"
cannam@20 20 #include "hmm/hmm.h"
cannam@20 21 #include "maths/pca/pca.h"
cannam@20 22
cannam@20 23 #ifdef __cplusplus
cannam@20 24 extern "C" {
cannam@20 25 #endif
cannam@18 26
cannam@18 27 /* applies MPEG-7 normalisation to constant-Q features, storing normalised envelope (norm) in last feature dimension */
cannam@18 28 void mpeg7_constq(double** features, int nframes, int ncoeff);
cannam@18 29
cannam@18 30 /* converts constant-Q features to normalised chroma */
cannam@18 31 void cq2chroma(double** cq, int nframes, int ncoeff, int bins, double** chroma);
cannam@18 32
cannam@18 33 void create_histograms(int* x, int nx, int m, int hlen, double* h);
cannam@18 34
cannam@18 35 void cluster_segment(int* q, double** features, int frames_read, int feature_length, int nHMM_states,
cannam@18 36 int histogram_length, int nclusters, int neighbour_limit);
cannam@18 37
cannam@18 38 void constq_segment(int* q, double** features, int frames_read, int bins, int ncoeff, int feature_type,
cannam@18 39 int nHMM_states, int histogram_length, int nclusters, int neighbour_limit);
cannam@18 40
cannam@20 41 #ifdef __cplusplus
cannam@20 42 }
cannam@20 43 #endif
cannam@18 44
cannam@20 45 #endif