comparison dsp/segmentation/ClusterMeltSegmenter.cpp @ 30:a251fb0de594

* Make MFCC able to accept already-FFT'd input, and simplify API a bit * Add log power value to MFCC, restore windowing, and avoid some heap allocs * In HMM, bail out of iteration if loglik hits NaN
author cannam
date Fri, 18 Jan 2008 13:24:12 +0000
parents b678e72323df
children 00603b8a940f
comparison
equal deleted inserted replaced
29:1c9c4d2c0592 30:a251fb0de594
90 90
91 if (decimationFactor > 1) { 91 if (decimationFactor > 1) {
92 decimator = new Decimator(getWindowsize(), decimationFactor); 92 decimator = new Decimator(getWindowsize(), decimationFactor);
93 } 93 }
94 94
95 MFCCConfig config; 95 MFCCConfig config(samplerate / decimationFactor);
96 config.FS = samplerate / decimationFactor;
97 config.fftsize = 2048; 96 config.fftsize = 2048;
98 config.nceps = 19; 97 config.nceps = 19;
99 config.want_c0 = true; 98 config.want_c0 = true;
100 99
101 mfcc = new MFCC(config); 100 mfcc = new MFCC(config);
276 } else { 275 } else {
277 frame[i] = 0.0; 276 frame[i] = 0.0;
278 } 277 }
279 } 278 }
280 279
281 mfcc->process(fftsize, frame, ccout); 280 mfcc->process(frame, ccout);
282 281
283 for (int i = 0; i < ncoeff; ++i) { 282 for (int i = 0; i < ncoeff; ++i) {
284 cc[i] += ccout[i]; 283 cc[i] += ccout[i];
285 } 284 }
286 ++frames; 285 ++frames;