Mercurial > hg > qm-dsp
comparison dsp/segmentation/ClusterMeltSegmenter.cpp @ 255:9edaa3ce62e8
* 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 | Chris Cannam <c.cannam@qmul.ac.uk> |
---|---|
date | Fri, 18 Jan 2008 13:24:12 +0000 |
parents | 89a2b34a098f |
children | 00603b8a940f |
comparison
equal
deleted
inserted
replaced
254:52c1a295d775 | 255:9edaa3ce62e8 |
---|---|
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; |