Generate an accompaniement for a given melody
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
ObsPresenceStats Class Reference

An observation class based on statitistics of presence of the notes. We compute a the percentage each note appears in the measure. As a distance, we use the distance induced by the infinite norm on these vectors of percentage. More...

#include <Observation.hpp>

Inheritance diagram for ObsPresenceStats:
Measure

Public Member Functions

 ObsPresenceStats (const Measure &M, double grain)
 Construction from a measure. More...
 
bool operator== (const ObsPresenceStats &o) const __attribute__((pure))
 
HMM::ObsId getClosestObs (const std::vector< ObsPresenceStats > &m) const __attribute__((pure))
 Compute the closest observation. More...
 

Static Public Attributes

static const int TypeID = 1
 Mandatory id of the class (must be unique amongst Observation classes)
 

Protected Member Functions

double distanceFrom (const ObsPresenceStats &other) const __attribute__((pure))
 Compute distance from other observation. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const ObsPresenceStats &m)
 

Detailed Description

An observation class based on statitistics of presence of the notes. We compute a the percentage each note appears in the measure. As a distance, we use the distance induced by the infinite norm on these vectors of percentage.

Constructor & Destructor Documentation

ObsPresenceStats::ObsPresenceStats ( const Measure M,
double  grain 
)

Construction from a measure.

Parameters
MThe measure from which the observation must be deduced

Member Function Documentation

double ObsPresenceStats::distanceFrom ( const ObsPresenceStats other) const
protected

Compute distance from other observation.

Parameters
otherthe other observation
Returns
the distance (according to infinite norm)
HMM::ObsId ObsPresenceStats::getClosestObs ( const std::vector< ObsPresenceStats > &  m) const

Compute the closest observation.

Given a set of known observation, this function has to find the closest match, if not an exact match. The distance used is based on the infinite norm.

Parameters
mThe vector giving the known observations
Returns
The id of the selected observation.

The documentation for this class was generated from the following file: