00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00028 #ifndef COST_DE_H
00029 #define COST_DE_H
00030
00031 using namespace std;
00032
00033 #include "tdsp/dsp_distances.h"
00034 #include "boss_utility/boss_config.h"
00035 #include "cost.h"
00036 #include "boss_node.h"
00037
00045 class CostDE: public Cost {
00046 private:
00047 dsp::Euclid< float > euclid;
00048 inline unsigned CostDE::translateStress (unsigned s) const {
00049 if (s == 1) s = 2;
00050 else if (s == 2) s = 1;
00051 return s;
00052 }
00053 double stress_cost(const BOSS_Node * u) const;
00054 double phrasing_cost(const BOSS_Node * u) const;
00055 double duration_cost(const BOSS_Node * u) const;
00056 double treal_cost(const BOSS_Node * u) const;
00057 float mel_dist(const BOSS_Node * l, const BOSS_Node * r) const;
00058
00059 float f0_dist(const BOSS_Node * l, const BOSS_Node * r) const;
00060 bool isSibilant(const string & s) const;
00061 bool isNasal(const string & s) const;
00062 public:
00063 CostDE(BOSS::Config & __cl);
00064 ~CostDE();
00065 float operator () (const BOSS_Node * l, const BOSS_Node * r);
00066 double operator () (const BOSS_Node * u) const;
00067 };
00068
00070 #endif
00071