00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MARSYAS_CONVERSIONS_H
00020 #define MARSYAS_CONVERSIONS_H
00021
00022 #include "common_header.h"
00023
00024 #include <cmath>
00025 #include <string>
00026
00027 namespace Marsyas
00028 {
00035 marsyas_EXPORT mrs_real pitch2hertz(mrs_real pitch);
00036 marsyas_EXPORT mrs_real hertz2pitch(mrs_real hz);
00037
00038 marsyas_EXPORT mrs_natural hertz2samples(mrs_real hz, mrs_real srate);
00039
00040 marsyas_EXPORT mrs_real samples2hertz(mrs_real samples, mrs_real srate);
00041 marsyas_EXPORT mrs_real samples2hertz(mrs_natural samples, mrs_real srate);
00042
00043 marsyas_EXPORT mrs_natural time2samples(std::string time, mrs_real srate);
00044 marsyas_EXPORT mrs_natural time2usecs(std::string time);
00045
00046 marsyas_EXPORT mrs_real amplitude2dB(mrs_real a);
00047 marsyas_EXPORT mrs_real dB2amplitude(mrs_real a);
00048
00049 marsyas_EXPORT mrs_real hertz2octs(mrs_real f, mrs_real middleAfreq = 440.0);
00050
00051 marsyas_EXPORT mrs_real hertz2bark(mrs_real f, mrs_natural mode = 0);
00052 marsyas_EXPORT mrs_real bark2hertz(mrs_real f, mrs_natural mode = 0);
00053
00054 marsyas_EXPORT mrs_real hertz2erb(mrs_real f);
00055 marsyas_EXPORT mrs_real erb2hertz(mrs_real e);
00056
00057 marsyas_EXPORT mrs_real hertz2mel(mrs_real f, bool htk = false);
00058 marsyas_EXPORT mrs_real mel2hertz(mrs_real z, bool htk = false);
00059
00060 marsyas_EXPORT mrs_real bin2hertz(mrs_natural bin, mrs_real nyquistFreq,
00061 mrs_real framerate);
00062
00063 marsyas_EXPORT mrs_natural powerOfTwo(mrs_real v);
00064
00065 marsyas_EXPORT void string2parameters(std::string s, realvec &v, char d);
00066
00067 }
00068
00069 #endif