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

📄 feat_calc.h

📁 Intel开发的IPP库的应用实例
💻 H
字号:
/*
//
//                  INTEL CORPORATION PROPRIETARY INFORMATION
//     This software is supplied under the terms of a license agreement or
//     nondisclosure agreement with Intel Corporation and may not be copied
//     or disclosed except in accordance with the terms of that agreement.
//          Copyright(c) 1999-2006 Intel Corporation. All Rights Reserved.
//
//     Intel(R) Integrated Performance Primitives Gaussian Mixture Sample for Windows*
//
//  By downloading and installing this sample, you hereby agree that the
//  accompanying Materials are being provided to you under the terms and
//  conditions of the End User License Agreement for the Intel(R) Integrated
//  Performance Primitives product previously accepted by you. Please refer
//  to the file ippEULA.rtf located in the root directory of your Intel(R) IPP
//  product installation for more information.
//
//
//     Feature Calculation Class
//
//     Produces features frame_number vectors of length space_dim
//     For fake feature vectors consists of zeroes
//     For HTK file feature vectors are read from feature file, last element
//     (energy) deleted and 1 or 2 deltas calculated if necessary
//     space_dim should be equal [1,2,3]*(raw_dim[-1])
//
//     frame_number frame number
//     space_dim    feature vector length
//                  for HTK file should be equal [1,2,3]*(raw_dim[-1])
//     raw_dim      raw feature vector length
//
*/

#ifndef aaaFEAT_CALC_Haaa
#define aaaFEAT_CALC_Haaa

#include <stdio.h>
#include <stdlib.h>

#define WIN_SIZE 2

typedef struct {
   int   frames;      // number of frames
   int   period;      // sample period
   short len;         // feature vector length (bytes)
   short type;        // feature type
} Feat_Header;

class Feat_Calc {

   protected:

      int    frame_number;     // frame number
      int    space_dim;        // feature space dimension
      int    max_delay;        // maximal feature portion
      int    raw_dim;          // raw feature space dimension
      int    space_dim4;       // aligned feature space dimension
      int    feat_type;        // feature producer type
                               // 0 - fake, zero features
                               // 1 - reads HTK feature file
      int    rem;              // remained frames
      int    deltas;           // deltas to calculate (0, 1, 2)
      int    delta_delay;      // number of partially calculated features

      float *raw;              // raw features buffer
      float *curraw;           //
      float *oldraw;           //
      float *mean;             //
      int   *pindx;            // vector for 0 deltas indirect copy

      int    ready;            //

      Feat_Header header;

   public:

      int   Delta_Delay(void)   {return delta_delay;}
      int   Feature_Length(void) {return space_dim;}
      virtual bool Ready(void)   {return ready==0;}

      virtual int  Get_Feature(float *dst, int len, bool* end);

      int   Write_LogHeader(FILE *flog);
      int   Init_Feat(char *file);
      int   Init_Feat(int frame_number);

      Feat_Calc (int space_dim, int max_delay);
      virtual ~Feat_Calc(void);
};

#endif

⌨️ 快捷键说明

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