ConstantQTransform.hxx
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef ConstantQTransform_hxx
00023 #define ConstantQTransform_hxx
00024
00025 #include <vector>
00026 #include <cmath>
00027
00028 namespace Simac
00029 {
00030
00057 class ConstantQTransform
00058 {
00059 public:
00060 typedef std::vector<double> ConstantQSpectrum;
00061 typedef std::vector<double> Spectrum;
00062 private:
00063 ConstantQSpectrum cqdata;
00064 unsigned FS;
00065 double fmin;
00066 double fmax;
00067 double Q;
00068 unsigned _binsPerOctave;
00069 unsigned mSpectrumSize;
00070 unsigned K;
00071
00072
00073
00074 std::vector<unsigned> mSparseKernelIs;
00075 std::vector<unsigned> mSparseKernelJs;
00076 std::vector<double> mSparseKernelImagValues;
00077 std::vector<double> mSparseKernelRealValues;
00078 public:
00079 void doIt(const std::vector<double> & fftData);
00080
00081
00082 public:
00083 ConstantQTransform(unsigned FS, double fmin, double fmax, unsigned binsPerOctave);
00084 void sparsekernel(double);
00085 ~ConstantQTransform();
00086
00087 const ConstantQSpectrum & constantQSpectrum() const {return cqdata;}
00088 double getQ() const {return Q;}
00089 int getK() const {return K;}
00090 int getfftlength() const {return mSpectrumSize;}
00091 private:
00092 double Hamming(int len, int n) {
00093 double out = 0.54 - 0.46*std::cos(2*M_PI*n/len);
00094 return(out);
00095 }
00096 };
00097
00098 }
00099
00100 #endif//ConstantQTransform_hxx
00101