view dsp/segmentation/Segmenter.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 dc30e3864ceb
children 67899fda84f5
line wrap: on
line source
/*
 *  Segmenter.cpp
 *  soundbite
 *
 *  Created by Mark Levy on 04/04/2006.
 *  Copyright 2006 Centre for Digital Music, Queen Mary, University of London. All rights reserved.
 *
 */

#include <iomanip>

#include "Segmenter.h"

ostream& operator<<(ostream& os, const Segmentation& s)
{
	os << "structure_name : begin_time end_time\n";
	
	for (int i = 0; i < s.segments.size(); i++)
	{
		Segment seg = s.segments[i];
		os << std::fixed << seg.type << ':' << '\t' << std::setprecision(6) << seg.start / static_cast<double>(s.samplerate) 
			<< '\t' << std::setprecision(6) << seg.end / static_cast<double>(s.samplerate) << "\n";
	}
	
	return os;
}