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

📄 fouriertransform.h

📁 这是一个从音频信号里提取特征参量的程序
💻 H
📖 第 1 页 / 共 2 页
字号:
    return true;    }  // method: setInputLength  //  boolean setInputLength(const long ilen = DEF_LENGTH) {    ilen_d = ilen;    return true;  }  // method: setOutputLength  //  boolean setOutputLength(long olen = DEF_LENGTH) {    olen_d = olen;    return true;  }    // method: setOrder  //  boolean setOrder(long order) {    order_d = order;    resolution_d = FIXED;    is_valid_d = false;    return true;    }  // method: setNormalization  //  boolean setNormalization(NORM normalization) {    normalization_d = normalization;    return true;    }  // method: set  //  boolean set(ALGORITHM algorithm = DFT,	      IMPLEMENTATION implementation = CONVENTIONAL,	      DIRECTION direction = FORWARD,	      OTYPE otype = FULL,	      RESOLUTION resolution = AUTO,	      long order = DEF_ORDER,	      NORM normalization = DEF_NORM) {    setAlgorithm(algorithm);    setImplementation(implementation);    setDirection(direction);    setOutputType(otype);    setResolution(resolution);    if (resolution == FIXED) setOrder(order);    setNormalization(normalization);    return true;  }    //---------------------------------------------------------------------------  //  // class-specific public methods  //  get methods  //  //---------------------------------------------------------------------------    // method: getAlgorithm  //  ALGORITHM getAlgorithm() const {    return algorithm_d;  }  // method: getImplementation  //  IMPLEMENTATION getImplementation() const {    return implementation_d;  }  // method: getDirection  //  DIRECTION getDirection() const {    return direction_d;    }  // method: getOutputType  //  OTYPE getOutputType() const {    return otype_d;    }  // method: getResolution  //  RESOLUTION getResolution() const {    return resolution_d;    }      // method: getInputLength  //  long getInputLength() const {    return ilen_d;  }  // method: getOutputLength  //  long getOutputLength() const {    return olen_d;  }    // method: getOrder  //  long getOrder() const {    return order_d;  }  // method: getNormalization  //  NORM getNormalization() const {    return normalization_d;  }  // method: get  //  boolean get(ALGORITHM& algorithm, IMPLEMENTATION& implementation,	      DIRECTION& direction, OTYPE& otype,	      RESOLUTION& resolution, long& order, NORM& normalization) const {    algorithm = algorithm_d;    implementation = implementation_d;    direction = direction_d;    resolution = resolution_d;    order = order_d;    normalization = normalization_d;    return true;  }    //---------------------------------------------------------------------------  //  // class-specific public methods:  //  computational methods  //  //  the first two methods use a conservative approach for computing the  //  fourier transform. if the chosen fourier transform algorithm supports  //  computation on a vector the length of the input vector then that  //  algorithm is used, otherwise a discrete fourier transform is used.  //  //  the second set of methods are more aggressive in following the user's  //  desires. if the input vector length is less than the specified  //  transform order, the input vector is zero-padded up to the length of  //  the specified "required_order". if the input vector is greater than the  //  specified order, then only the elements up to the specified  //  required order are used (i.e. the input is truncated).  //  //  note that these methods do not alter the input vector. i.e. the user is  //  assured that the input vector after the call to compute() will be no  //  different than the input vector they passed in.  //  //---------------------------------------------------------------------------  // single-channel compute methods  //  boolean compute(VectorComplexFloat& output, const VectorFloat& input,		  AlgorithmData::COEF_TYPE input_coef_type = DEF_COEF_TYPE,		  long chan = DEF_CHANNEL_INDEX);  boolean compute(VectorFloat& output, const VectorComplexFloat& input,		  AlgorithmData::COEF_TYPE input_coef_type =		  AlgorithmData::SPECTRUM, long chan = DEF_CHANNEL_INDEX);  boolean compute(VectorComplexFloat& output, const VectorComplexFloat& input,		  AlgorithmData::COEF_TYPE input_coef_type = DEF_COEF_TYPE,		  long chan = DEF_CHANNEL_INDEX);  boolean compute(VectorFloat& output, const VectorFloat& input,		  AlgorithmData::COEF_TYPE input_coef_type = DEF_COEF_TYPE,		  long chan = DEF_CHANNEL_INDEX);  //---------------------------------------------------------------------------  //  // class-specific public methods:  //  public methods required by the AlgorithmBase interface contract  //  //---------------------------------------------------------------------------  // assign method  //  boolean assign(const AlgorithmBase& arg);    // equality method  //  boolean eq(const AlgorithmBase& arg) const;  // method: className  //  const String& className() const {    return CLASS_NAME;  }  // apply method  //  boolean apply(Vector<AlgorithmData>& output,		const Vector< CircularBuffer<AlgorithmData> >& input);    // method to set the parser  //  boolean setParser(SofParser* parser);  //---------------------------------------------------------------------------  //  // private methods  //  //---------------------------------------------------------------------------private:  // common i/o methods  //  boolean readDataCommon(Sof& sof, const String& pname,			 long size, boolean param, boolean nested);  boolean writeDataCommon(Sof& sof, const String& pname) const;  // miscellaneous math methods  //  static boolean isPower(long& exponent, long base, long value);  // algorithm checking methods:  //  check the order of the algorithm and assign a default algorithm  //  if the chosen algorithm does not support the provided order  //  boolean validateImplementation();    // algorithm-specific computation methods: FORWARD  //  boolean computeForward(VectorComplexFloat& output,			 const VectorFloat& input);    boolean computeForward(VectorComplexFloat& output,			 const VectorComplexFloat& input);  boolean computeForward(VectorFloat& output,			 const VectorFloat& input);    // algorithm-specific computation methods: INVERSE  //  boolean computeInverse(VectorComplexFloat& output,			 const VectorComplexFloat& input);    boolean computeInverse(VectorFloat& output,			 const VectorComplexFloat& input);  boolean computeInverse(VectorFloat& output,			 const VectorFloat& input);  boolean computeInverse(VectorComplexFloat& output,			 const VectorFloat& input);    // algorithm-specific methods: DFT  //  the init methods are called to set up the lookup tables for each  //  algorithm as needed. the real and complex computation methods  //  generate fourier transform coefficients for real and complex input  //  respectively.  //  boolean dfInit(long order);  boolean dfReal(VectorFloat& output, const VectorFloat& input);  boolean dfComplex(VectorFloat& output, const VectorFloat& input);  // algorithm-specific methods: TRIGONOMETRIC  //  boolean triInit(long order);  boolean triReal(VectorFloat& output, const VectorFloat& input);  boolean triComplex(VectorFloat& output, const VectorFloat& input);    // algorithm-specific methods: SPLIT_RADIX  //  boolean srInit(long order);  boolean srReal(VectorFloat& output, const VectorFloat& input);  boolean srComplex(VectorFloat& output, const VectorFloat& input);    // algorithm-specific methods: RAD_2  //  boolean rad2Init(long order);  boolean rad2Real(VectorFloat& output, const VectorFloat& input);  boolean rad2Complex(VectorFloat& output, const VectorFloat& input);  // algorithm-specific methods: RAD_4  //  boolean rad4Init(long order);  boolean rad4Real(VectorFloat& output, const VectorFloat& input);  boolean rad4Complex(VectorFloat& output, const VectorFloat& input);    // algorithm-specific methods: FAST_HARTLEY  //  boolean fhInit(long order);  boolean fhReal(VectorFloat& output, const VectorFloat& input,		 boolean isReal = true);  boolean fhComplex(VectorFloat& output, const VectorFloat& input);      // algorithm-specific methods: QFT  //  boolean qfInit(long order);    boolean qfReal(VectorFloat& output, const VectorFloat& input);  boolean qfComplex(VectorFloat& output, const VectorFloat& input);      // algorithm-specific methods: DITF  //  boolean ditfInit(long order);  boolean ditfReal(VectorFloat& output, const VectorFloat& input);  boolean ditfComplex(VectorFloat& output, const VectorFloat& input);  // algorithm-specific methods: DCT TYPE_I  //  boolean dct1Init(long order);  boolean dct1Real(VectorFloat& output, const VectorFloat& input);  boolean dct1Complex(VectorFloat& output, const VectorFloat& input);  // algorithm-specific methods: DCT TYPE_II  //  boolean dct2Init(long order);  boolean dct2Real(VectorFloat& output, const VectorFloat& input);  boolean dct2Complex(VectorFloat& output, const VectorFloat& input);  // algorithm-specific methods: DCT TYPE_III  //  boolean dct3Init(long order);  boolean dct3Real(VectorFloat& output, const VectorFloat& input);  boolean dct3Complex(VectorFloat& output, const VectorFloat& input);  // algorithm-specific methods: DCT TYPE_IV  //  boolean dct4Init(long order);  boolean dct4Real(VectorFloat& output, const VectorFloat& input);  boolean dct4Complex(VectorFloat& output, const VectorFloat& input);    // miscellaneous DCT/DST methods  //  boolean dct_real_cc(VectorFloat& output, const VectorFloat& input);  boolean dst_real_cc(VectorFloat& output, const VectorFloat& input);};// end of include file// #endif

⌨️ 快捷键说明

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