Mercurial > hg > qm-dsp
annotate dsp/segmentation/Segmenter.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 | 8e90a56b4b5f |
children | 67899fda84f5 |
rev | line source |
---|---|
cannam@18 | 1 /* |
cannam@18 | 2 * Segmenter.cpp |
cannam@18 | 3 * soundbite |
cannam@18 | 4 * |
cannam@18 | 5 * Created by Mark Levy on 04/04/2006. |
cannam@18 | 6 * Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved. |
cannam@18 | 7 * |
cannam@18 | 8 */ |
cannam@18 | 9 |
cannam@18 | 10 #include <iomanip> |
cannam@18 | 11 |
cannam@18 | 12 #include "Segmenter.h" |
cannam@18 | 13 |
cannam@18 | 14 ostream& operator<<(ostream& os, const Segmentation& s) |
cannam@18 | 15 { |
cannam@18 | 16 os << "structure_name : begin_time end_time\n"; |
cannam@18 | 17 |
cannam@18 | 18 for (int i = 0; i < s.segments.size(); i++) |
cannam@18 | 19 { |
cannam@18 | 20 Segment seg = s.segments[i]; |
cannam@18 | 21 os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) |
cannam@18 | 22 << '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n"; |
cannam@18 | 23 } |
cannam@18 | 24 |
cannam@18 | 25 return os; |
cannam@18 | 26 } |