Gaia

This class computes the rhythm distance of a given descriptor. More...

#include <rhythmdistance.h>

Inheritance diagram for gaia2::RhythmDistance:
gaia2::DistanceFunction

Public Member Functions

 RhythmDistance (const PointLayout &layout, const ParameterMap &params)
 
Real operator() (const Point &p1, const Point &p2, int seg1, int seg2) const
 This function computes the distance between the two given points. More...
 
- Public Member Functions inherited from gaia2::DistanceFunction
 DistanceFunction (const PointLayout &layout, const ParameterMap &params)
 
const PointLayoutlayout () const
 
const RegioncheckFixedLength (const Region &region) const
 Checks that the given Region only contains fixed-length descriptors and throws an exception if not. More...
 

Protected Member Functions

Real distance (const Real &x, const Real &yi, const QString &t1, const QString &t2) const
 

Protected Attributes

bool _fixedLength
 
int _index
 
Real _alpha
 
GVarLengthArray< Real, 16 > _indexRange
 
GVarLengthArray< Real, 16 > _alphaWeights
 
- Protected Attributes inherited from gaia2::DistanceFunction
PointLayout _layout
 
ParameterMap _params
 
Region _region
 

Additional Inherited Members

- Public Attributes inherited from gaia2::DistanceFunction
QString name
 Name for the metric, usually the key that was used to instantiate it from the factory.
 
QStringList validParams
 List of valid parameters this analyzer accepts. More...
 

Detailed Description

This class computes the rhythm distance of a given descriptor.

It is defined as $d_{BPM}(X,Y) = \min_{i=1,2,4,6,...}{\alpha_{BPM}^{i-1}|\frac{X_{BPM}}{Y_{BPM}} - i|}, X_{BPM} > Y_{BPM}$ .

Parameters
descriptorNamethe names of the descriptor to be used for the computation of the distance. Only accepts real descriptors.
alphathe alpha coefficient (from the formula)
indexRangethe list of indices upon which to iterate.

Member Function Documentation

Real RhythmDistance::operator() ( const Point p1,
const Point p2,
int  seg1,
int  seg2 
) const
virtual

This function computes the distance between the two given points.

It needs to be implemented in each subclass. It takes as optional arguments the number of the segments on which to operate.

Implements gaia2::DistanceFunction.

References gaia2::Point::name().


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