⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 fouriertransform.h

📁 这是一个从音频信号里提取特征参量的程序
💻 H
📖 第 1 页 / 共 2 页
字号:
// file: $isip/class/algo/FourierTransform/FourierTransform.h// version: $Id: FourierTransform.h,v 1.41 2002/07/08 20:41:33 parihar Exp $//// make sure definitions are only made once//#ifndef ISIP_FOURIER_TRANSFORM#define ISIP_FOURIER_TRANSFORM// isip include files//#ifndef ISIP_ALGORITHM_BASE#include <AlgorithmBase.h>#endif#ifndef ISIP_VECTORFLOAT#include <VectorFloat.h>#endif#ifndef ISIP_LONG#include <Long.h>#endif#ifndef ISIP_MEMORY_MANAGER#include <MemoryManager.h>#endif// FourierTransform: a class to compute a fourier transform //class FourierTransform : public AlgorithmBase {  //---------------------------------------------------------------------------  //  // public constants  //  //---------------------------------------------------------------------------public:    // define the class name  //  static const String CLASS_NAME;  //----------------------------------------  //  // other important constants  //  //----------------------------------------  // define algorithm choices  //  enum ALGORITHM { DFT = 0, FFT, DCT, DEF_ALGORITHM = FFT };  // define implementation choices  //  enum IMPLEMENTATION { CONVENTIONAL = 0, TRIGONOMETRIC,			SPLIT_RADIX, RADIX_2, RADIX_4, FAST_HARTLEY, QF, DITF,			TYPE_I, TYPE_II, TYPE_III, TYPE_IV,			DEF_IMPLEMENTATION = SPLIT_RADIX};  // define algorithm choices  //  enum DIRECTION { FORWARD = 0, INVERSE, DEF_DIRECTION = FORWARD };  // define algorithm output mode  //  enum OTYPE { FULL = 0, SYMMETRIC, DEF_OTYPE = FULL };  // define algorithm resolution  //  enum RESOLUTION { AUTO = 0, FIXED, DEF_RESOLUTION = AUTO };  // define normalization choices  //  enum NORM { NONE = 0, UNIT_ENERGY, DEF_NORM = NONE };    // define static NameMap objects  //  static const NameMap ALGO_MAP;  static const NameMap IMPL_MAP;  static const NameMap DIRE_MAP;  static const NameMap OUTM_MAP;  static const NameMap RESO_MAP;    static const NameMap NORM_MAP;    //----------------------------------------  //  // i/o related constants  //  //----------------------------------------  static const String DEF_PARAM;  static const String PARAM_ALGORITHM;  static const String PARAM_IMPLEMENTATION;  static const String PARAM_DIRECTION;  static const String PARAM_OTYPE;  static const String PARAM_RESOLUTION;  static const String PARAM_INPUT_LEN;  static const String PARAM_OUTPUT_LEN;  static const String PARAM_ORDER;  static const String PARAM_NORMALIZATION;  //----------------------------------------  //  // default values and arguments  //  //----------------------------------------      // define the default fast fourier transform  //  static const IMPLEMENTATION DEF_FFT = SPLIT_RADIX;    // define the default order of the fourier transform and i/o length  //  static const long DEF_LENGTH = -1;  static const long DEF_ORDER = 1024;  // define default argument(s)  //  static const AlgorithmData::COEF_TYPE DEF_COEF_TYPE = AlgorithmData::SIGNAL;  //----------------------------------------  //  // error codes  //  //----------------------------------------      static const long ERR = 70800;  static const long ERR_INIT = 70801;  static const long ERR_OUTLEN = 70802;  static const long ERR_OUTTYP = 70803;    //---------------------------------------------------------------------------  //  // protected data  //  //---------------------------------------------------------------------------protected:    // parameters related to the algorithm specification  //  ALGORITHM algorithm_d;		// algorithm type  IMPLEMENTATION implementation_d;      // implementation type  DIRECTION direction_d;                // direction type  OTYPE otype_d;                        // FFT and DFT output type  RESOLUTION resolution_d;              // resolution type  NORM normalization_d;                 // normalization name  Long ilen_d;                          // user specified input length  Long olen_d;                          // user specified output length  Long order_d;                         // FFT transform order  // parameters related to fourier transform computation  //  VectorFloat wd_real_d;  VectorFloat wd_imag_d;  VectorFloat tempd_d;  // parameters storing implementation type and transform order used last time  //  IMPLEMENTATION prev_implementation_d;  Long prev_order_d;    // parameters related to the Decimation In Time Frequency (DITF)  // transformation  //  VectorFloat ditf_trans_factor_indices_d;  VectorFloat ditf_indices_d;  // parameters related to the Quick Fourier (QF) transformation  //  VectorFloat qf_comp_real_coeff_d;  VectorFloat qf_comp_imag_coeff_d;  VectorFloat qf_comp_temp_d;  // workspace related pointers for Quick Fourier (QF) transformation  //  VectorFloat qf_ws_d;  // workspace  long qf_sc_d;	        // secant table addr.	  long qf_nc_d;	        // current QFT length	  long qf_ic_d;	        // current secant inc.	  long qf_mc_d;	        // current output pruning  long qf_nn_d;	        // pruned QFT input length  long qf_mm_d;	        // pruned QFT output length  long qf_ii_d;	        // current QFT recursion level  long qf_input_d;         // dct/dst calling arguments  long qf_output_d;        // dct/dst calling arguments    // static memory manager  //  static MemoryManager mgr_d;    //---------------------------------------------------------------------------  //  // required public methods  //  //---------------------------------------------------------------------------public:      // method: name  //  static const String& name() {    return CLASS_NAME;  }  // other static methods  //     static boolean diagnose(Integral::DEBUG debug_level);    // method: setDebug  //  these methods are inherited from the AlgorithmBase class  // other debug methods  //  boolean debug(const unichar* msg) const;  // method: destructor  //  ~FourierTransform() {}  // method: default constructor  //  FourierTransform(ALGORITHM algorithm = DEF_ALGORITHM);    // method: copy constructor  //  FourierTransform(const FourierTransform& arg) {    assign(arg);  }   // assign methods  //  boolean assign(const FourierTransform& arg);  // method: operator=  //  FourierTransform& operator= (const FourierTransform& arg) {    assign(arg);    return *this;  }    // i/o methods  //  long sofSize() const;    boolean read(Sof& sof, long tag, const String& name = CLASS_NAME);    boolean write(Sof& sof, long tag, const String& name = CLASS_NAME) const;    boolean readData(Sof& sof, const String& pname = DEF_PARAM,		   long size = SofParser::FULL_OBJECT,		   boolean param = true,		   boolean nested = false);    boolean writeData(Sof& sof, const String& pname = DEF_PARAM) const;  // equality methods  //  boolean eq(const FourierTransform& arg) const;    // method: new  //  static void* operator new(size_t size) {    return mgr_d.get();  }  // method: new[]  //  static void* operator new[](size_t size) {    return mgr_d.getBlock(size);  }    // method: delete  //  static void operator delete(void* ptr) {    mgr_d.release(ptr);  }  // method: delete[]  //  static void operator delete[](void* ptr) {    mgr_d.releaseBlock(ptr);  }  // method: setGrowSize  //  static boolean setGrowSize(long grow_size) {    return mgr_d.setGrow(grow_size);  }  // other memory management methods  //  boolean clear(Integral::CMODE ctype = Integral::DEF_CMODE);  //---------------------------------------------------------------------------  //  // class-specific public methods  //  set methods  //  //---------------------------------------------------------------------------  // method: setAlgorithm  //  boolean setAlgorithm(const ALGORITHM algorithm) {    if (algorithm_d != algorithm) {      is_valid_d = false;    }    algorithm_d = algorithm;    return true;    }  // method: setImplementation  //  boolean setImplementation(const IMPLEMENTATION implementation) {    implementation_d = implementation;    return true;    }  // method: setDirection  //  boolean setDirection(const DIRECTION direction) {    direction_d = direction;    return true;  }    // method: setOutputType  //  boolean setOutputType(const OTYPE otype) {    otype_d = otype;    return true;  }  // method: setResolution  //  boolean setResolution(const RESOLUTION arg) {    resolution_d = arg;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -