当前位置: 首页>>代码示例>>C++>>正文


C++ LTFAT_NAME函数代码示例

本文整理汇总了C++中LTFAT_NAME函数的典型用法代码示例。如果您正苦于以下问题:C++ LTFAT_NAME函数的具体用法?C++ LTFAT_NAME怎么用?C++ LTFAT_NAME使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了LTFAT_NAME函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: LTFAT_NAME

void LTFAT_NAME(ltfatMexFnc)( int UNUSED(nlhs), mxArray *plhs[],
                              int UNUSED(nrhs), const mxArray *prhs[] )
{
   int M, N, L, gl, W;

   // Get matrix dimensions.
   M= mxGetM(prhs[0]);
   N= ltfatGetN(prhs[0]);
   gl= mxGetNumberOfElements(prhs[1]);
   W = mxGetNumberOfElements(prhs[0])/(M*N);

   L=N*M;

   plhs[0] = ltfatCreateMatrix(L,W,LTFAT_MX_CLASSID,LTFAT_MX_COMPLEXITY);

   const LTFAT_TYPE* c = (const LTFAT_TYPE*) mxGetData(prhs[0]);
   const LTFAT_TYPE* g = (const LTFAT_TYPE*) mxGetData(prhs[1]);
   LTFAT_TYPE* f = (LTFAT_TYPE*) mxGetData(plhs[0]);

   if(gl<L)
   {
      LTFAT_NAME(idwiltiii_fb)(c,g,L,gl,W,M,f);
   }
   else
   {
      LTFAT_NAME(idwiltiii_long)(c,g,L,W,M,f);
   }
}
开发者ID:ltfat,项目名称:ltfat,代码行数:28,代码来源:comp_idwiltiii.c

示例2: LTFAT_NAME

void LTFAT_NAME(fftrealAtExit)()
{
   if(LTFAT_NAME(p_old)!=0)
   {
     LTFAT_FFTW(destroy_plan)(LTFAT_NAME(p_old));
   }
}
开发者ID:jsloboda,项目名称:GhostVision,代码行数:7,代码来源:comp_fftreal.c

示例3: LTFAT_NAME

static void LTFAT_NAME(dctMexAtExitFnc)()
{
    if (LTFAT_NAME(p_old) != 0)
    {
        LTFAT_FFTW(destroy_plan)(LTFAT_NAME(p_old));
    }
}
开发者ID:Steve3nto,项目名称:NoiseReductionProject,代码行数:7,代码来源:comp_dct.c

示例4: LTFAT_NAME

void LTFAT_NAME(ltfatMexFnc)( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] )
{
   // UGLY, but there are no cd_dwilt_long cs_dwilt_long functions
   // Other option is to use forwarder functions
   #undef LTFAT_NAME
   #ifdef LTFAT_SINGLE
   #  define LTFAT_NAME(name) LTFAT_NAME_SINGLE(name)
   #else
   #  define LTFAT_NAME(name) LTFAT_NAME_DOUBLE(name)
   #endif

   int M, N, L, W;

   mwSize ndim;
   mwSize dims[3];

   // Get matrix dimensions.
   M=(int)mxGetScalar(prhs[2]);
   L=(int)mxGetScalar(prhs[3]);
   W = mxGetN(prhs[0]);

   N=L/M;

   dims[0]=2*M;
   dims[1]=N/2;

   if (W==1)
   {
      ndim=2;
   }
   else
   {
      ndim=3;
      dims[2]=W;
   }

   plhs[0] = ltfatCreateNdimArray(ndim,dims,LTFAT_MX_CLASSID,LTFAT_MX_COMPLEXITY);

   const LTFAT_TYPE* f = (const LTFAT_TYPE*) mxGetData(prhs[0]);
   const LTFAT_TYPE* g = (const LTFAT_TYPE*) mxGetData(prhs[1]);
   LTFAT_TYPE* cout = (LTFAT_TYPE*) mxGetData(plhs[0]);


   #ifdef LTFAT_COMPLEXTYPE
      LTFAT_NAME(dwilt_long)((const LTFAT_REAL (*)[2])f,
                             (const LTFAT_REAL (*)[2])g,
                              L, W, M,
                             (LTFAT_REAL (*)[2]) cout);
   #else
      LTFAT_NAME(dwiltreal_long)(f,g,L, W, M, cout);
   #endif


   return;
}
开发者ID:LarocheC,项目名称:voice-extraction,代码行数:55,代码来源:comp_dwilt_long.c

示例5: LTFAT_NAME

void LTFAT_NAME(ltfatMexFnc)( int UNUSED(nlhs), mxArray* plhs[],
                              int UNUSED(nrhs), const mxArray* prhs[] )
{
    // Get inputs
    const mxArray* mxs  = prhs[0];
    const LTFAT_REAL* s     = mxGetData(mxs);
    const LTFAT_REAL* tgrad = mxGetData(prhs[1]);
    const LTFAT_REAL* fgrad = mxGetData(prhs[2]);
    const double* maskDouble  = mxGetData(prhs[3]);
    mwSize a      = (mwSize)mxGetScalar(prhs[4]);
    LTFAT_REAL tol = (LTFAT_REAL)mxGetScalar(prhs[6]);
    const LTFAT_REAL* knownphase = mxGetData(prhs[8]);
    int phasetype = (int)mxGetScalar(prhs[7]);
    switch (phasetype)
    {
        case 0: phasetype = LTFAT_FREQINV; break;
        case 1: phasetype = LTFAT_TIMEINV; break;
    }

    // Get matrix dimensions.
    mwSize M = (int) mxGetScalar(prhs[5]);
    mwSize M2 = mxGetM(prhs[0]);
    mwSize N = ltfatGetN(prhs[0]);
    mwSize L = N * a;
    mwSize W = 1;

    if (mxGetNumberOfDimensions(mxs) > 2)
        W = mxGetDimensions(mxs)[2];

    int* mask = ltfat_malloc(M2 * N * W * sizeof * mask);

    for (mwSize w = 0; w < M2 * N * W; w++ )
        mask[w] = (int) maskDouble[w];

    // Create output matrix and zero it.
    plhs[0] = ltfatCreateNdimArray(mxGetNumberOfDimensions(mxs),
                                   mxGetDimensions(mxs),
                                   LTFAT_MX_CLASSID, mxREAL);

    // Get pointer to output
    LTFAT_REAL* phase = mxGetData(plhs[0]);

    memcpy(phase, knownphase, M2 * N * W * sizeof * phase);

    if (phasetype == 2)
        LTFAT_NAME(maskedheapintreal)(s, tgrad, fgrad, mask, a, M, L, W, tol,
                                      phase );
    else
        LTFAT_NAME(maskedheapintreal_relgrad)(s, tgrad, fgrad, mask, a, M, L, W,
                                              tol, phasetype, phase );

    ltfat_free(mask);
}
开发者ID:ltfat,项目名称:ltfat,代码行数:53,代码来源:comp_maskedheapintreal.c

示例6: main

int main( int argc, char *argv[] )
{
   if (argc<3)
   {
      printf("Correct parameters: L, K, nrep\n");     
      return(1);
   }
   int nrep = 1;
   if (argc>3)
   {
     nrep = atoi(argv[3]);
   }
   
   const size_t L = atoi(argv[1]);
   const size_t K = atoi(argv[2]);
   
   LTFAT_REAL *f = (LTFAT_REAL*)ltfat_malloc(L*sizeof(LTFAT_REAL));
   LTFAT_COMPLEXH *c = (LTFAT_COMPLEXH*)ltfat_malloc(K*sizeof(LTFAT_COMPLEXH));

   LTFAT_NAME_COMPLEX(fillRand)(f,L);
   
 
   double o = 0.1;
   double deltao = 2.0*PI/100.0;


   double st0,st1;
   #ifndef CZT_WITH_PLAN
   st0=ltfat_time();
   for (int jj=0;jj<nrep;jj++)
   {
      LTFAT_NAME(chzt)(f,L,1,K,deltao,o,c);
   }
   st1=ltfat_time();
   #else
   LTFAT_NAME(chzt_plan) p = LTFAT_NAME(create_chzt_plan)(K,L);
   st0=ltfat_time();
   for (int jj=0;jj<nrep;jj++)
   {
      LTFAT_NAME(chzt_with_plan)(p,f,1,deltao,o,c);
   }
   st1=ltfat_time();
   LTFAT_NAME(destroy_chzt_plan)(p);
   #endif
   
   //printf("Length: %i, avr. %f ms \n",L,(st1-st0)/((double)nrep));
   printf("%i, %f\n",L,(st1-st0)/((double)nrep));
  
   ltfat_free(f);
   ltfat_free(c);
   
}
开发者ID:guneshwor,项目名称:ltfat,代码行数:52,代码来源:time_czt.c

示例7: LTFAT_NAME

LTFAT_API int
LTFAT_NAME(fft)(LTFAT_COMPLEX in[], ltfat_int L, ltfat_int W,
                LTFAT_COMPLEX out[])
{
    LTFAT_NAME(fft_plan)* p = NULL;
    int status = LTFATERR_SUCCESS;

    CHECKSTATUS( LTFAT_NAME(fft_init)(L, W, in, out, FFTW_ESTIMATE, &p));
    LTFAT_NAME(fft_execute)(p);
    LTFAT_NAME(fft_done)(&p);
error:
    return status;
}
开发者ID:ltfat,项目名称:ltfat,代码行数:13,代码来源:fftw_wrappers.c

示例8: LTFAT_NAME

LTFAT_EXTERN void
LTFAT_NAME(dgtreal_ola)(const LTFAT_REAL *f, const LTFAT_REAL *g,
		    const int L, const int gl,
		    const int W, const int a, const int M, const int bl,
		    LTFAT_COMPLEX *cout)
{
  LTFAT_NAME(dgtreal_ola_plan) plan =
    LTFAT_NAME(dgtreal_ola_init)(g, gl, W, a, M, bl, FFTW_ESTIMATE);

  LTFAT_NAME(dgtreal_ola_execute)(plan, f, L, cout);

  LTFAT_NAME(dgtreal_ola_done)(plan);

}
开发者ID:LarocheC,项目名称:voice-extraction,代码行数:14,代码来源:dgt.c

示例9: LTFAT_NAME

LTFAT_API void
LTFAT_NAME(gabdualreal_fac)(const LTFAT_COMPLEX* gf, ltfat_int L,
                            ltfat_int R,
                            ltfat_int a, ltfat_int M,
                            LTFAT_COMPLEX* gdualf)
{

    ltfat_int h_a, h_m;

    LTFAT_COMPLEX* Sf;

    const LTFAT_COMPLEX zzero = (LTFAT_COMPLEX) 0.0;
    const LTFAT_COMPLEX alpha = (LTFAT_COMPLEX) 1.0; //{1.0, 0.0 };

    ltfat_int N = L / a;

    ltfat_int c = ltfat_gcd(a, M, &h_a, &h_m);
    ltfat_int p = a / c;
    ltfat_int q = M / c;
    ltfat_int d = N / q;

    /* This is a floor operation. */
    ltfat_int d2 = d / 2 + 1;

    Sf = LTFAT_NAME_COMPLEX(malloc)(p * p);

    /* Copy the contents of gf to gdualf because LAPACK overwrites it input
     * argument
     */
    memcpy(gdualf, gf, sizeof(LTFAT_COMPLEX)*L * R);

    for (ltfat_int rs = 0; rs < c * d2; rs++)
    {
        LTFAT_NAME(gemm)(CblasNoTrans, CblasConjTrans, p, p, q * R,
                               &alpha,
                               gf + rs * p * q * R, p,
                               gf + rs * p * q * R, p,
                               &zzero, Sf, p);

        LTFAT_NAME(posv)(p, q * R, Sf, p,
                               gdualf + rs * p * q * R, p);

    }

    /* Clear the work-array. */
    ltfat_free(Sf);


}
开发者ID:ltfat,项目名称:ltfat,代码行数:49,代码来源:gabdual_fac.c

示例10: LTFAT_NAME_COMPLEX

LTFAT_EXTERN void
LTFAT_NAME_COMPLEX(dgt_fb)(const LTFAT_COMPLEX *f, const LTFAT_COMPLEX *g,
		     const int L, const int gl,
		     const int W,  const int a, const int M,
		     LTFAT_COMPLEX *cout)
{

  LTFAT_NAME(dgt_fb_plan) plan =
    LTFAT_NAME(dgt_fb_init)(g, gl, a, M, FFTW_ESTIMATE);

  LTFAT_NAME(dgt_fb_execute)(plan, f, L, W, cout);

  LTFAT_NAME(dgt_fb_done)(plan);

}
开发者ID:LarocheC,项目名称:voice-extraction,代码行数:15,代码来源:dgt.c

示例11: LTFAT_NAME

void LTFAT_NAME(ltfatMexFnc)( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] )
{
   int a, M, N, L, W;
   double tol;

   const LTFAT_REAL *s, *tgrad, *fgrad;
   LTFAT_REAL *phase;

   // Get inputs
   s     = (const LTFAT_REAL*) mxGetPr(prhs[0]);
   tgrad = (const LTFAT_REAL*) mxGetPr(prhs[1]);
   fgrad = (const LTFAT_REAL*) mxGetPr(prhs[2]);
   a     = (int)mxGetScalar(prhs[3]);
   tol   = mxGetScalar(prhs[4]);

   // Get matrix dimensions.
   M = mxGetM(prhs[0]);
   N = mxGetN(prhs[0]);
   L = N*a;
   W = 1;

   // Create output matrix and zero it.
   plhs[0] = ltfatCreateMatrix(M,N, LTFAT_MX_CLASSID, mxREAL);

   // Get pointer to output
   phase= (LTFAT_REAL*) mxGetPr(plhs[0]);

   LTFAT_NAME(heapint)(s,tgrad,fgrad, a, M, L, W,tol, phase);
}
开发者ID:jsloboda,项目名称:GhostVision,代码行数:29,代码来源:comp_heapint.c

示例12: LTFAT_NAME_COMPLEX

LTFAT_EXTERN void
LTFAT_NAME_COMPLEX(idwiltiii_fb)(const LTFAT_COMPLEX *c, const LTFAT_COMPLEX *g,
                                 const ltfatInt L, const ltfatInt gl,
                                 const ltfatInt W, const ltfatInt M,
                                 LTFAT_COMPLEX *f)
{
    const ltfatInt N = L / M;
    const ltfatInt M2 = 2 * M;
    const ltfatInt M4 = 4 * M;
    const LTFAT_REAL scalconst = 1.0 / sqrt(2.0);
    const LTFAT_COMPLEX eipi4 = cexp(I * PI / 4.0);
    const LTFAT_COMPLEX emipi4 = cexp(-I * PI / 4.0);

    LTFAT_COMPLEX *coef2 = ltfat_calloc(2 * M * N * W, sizeof * coef2);
    LTFAT_COMPLEX *f2 = ltfat_malloc(L * W * sizeof * f2);


    const LTFAT_COMPLEX *pcoef  = c;
    LTFAT_COMPLEX *pcoef2 = coef2;

    PREPROC_COMPLEX

    LTFAT_NAME(idgt_fb)(coef2, g, L, gl, W, M, 2 * M, FREQINV, f2);

    POSTPROC_COMPLEX

    LTFAT_SAFEFREEALL(coef2, f2);

}
开发者ID:Steve3nto,项目名称:NoiseReductionProject,代码行数:29,代码来源:iwmdct.c

示例13: LTFAT_NAME_REAL

LTFAT_EXTERN void
LTFAT_NAME_REAL(idwiltiii_long)(const LTFAT_REAL *c, const LTFAT_REAL *g,
                                const ltfatInt L, const ltfatInt W,
                                const ltfatInt M, LTFAT_REAL *f)
{
    const ltfatInt N = L / M;
    const ltfatInt M2 = 2 * M;
    const ltfatInt M4 = 4 * M;
    const LTFAT_REAL scalconst = 1.0 / sqrt(2.0);
    const LTFAT_COMPLEX eipi4 = cexp(I * PI / 4.0);
    const LTFAT_COMPLEX emipi4 = cexp(-I * PI / 4.0);

    LTFAT_COMPLEX *coef2 = ltfat_calloc(2 * M * N * W, sizeof * coef2);
    LTFAT_COMPLEX *f2 = ltfat_malloc(L * W * sizeof * f2);
    LTFAT_COMPLEX *g2 = ltfat_malloc(L * sizeof * g2);
    for (ltfatInt ii = 0; ii < L; ii++)
        g2[ii] = g[ii];


    const LTFAT_REAL *pcoef  = c;
    LTFAT_COMPLEX *pcoef2 = coef2;

    PREPROC_COMPLEX

    LTFAT_NAME(idgt_long)(coef2, g2, L, W, M, 2 * M, FREQINV, f2);

    POSTPROC_REAL

    LTFAT_SAFEFREEALL(coef2, f2, g2);

}
开发者ID:Steve3nto,项目名称:NoiseReductionProject,代码行数:31,代码来源:iwmdct.c

示例14: LTFAT_NAME

void LTFAT_NAME(ltfatMexFnc)( int UNUSED(nlhs), mxArray *plhs[],
                              int UNUSED(nrhs), const mxArray *prhs[] )
{
   int L, R, N, c, d, p, q;
   ltfatInt a,M,h_a,h_m;

   // Get matrix dimensions.
   L = mxGetM(prhs[0]);
   R = mxGetN(prhs[0]);

   a=(ltfatInt)mxGetScalar(prhs[1]);
   M=(ltfatInt)mxGetScalar(prhs[2]);

   N=L/a;

   c=gcd(a, M, &h_a, &h_m);
   p=a/c;
   q=M/c;
   d=N/q;

   plhs[0] = ltfatCreateMatrix(p*q*R, c*d,LTFAT_MX_CLASSID,mxCOMPLEX);
   LTFAT_COMPLEX* gf_combined = mxGetData(plhs[0]);
   const LTFAT_TYPE* g_combined = mxGetData(prhs[0]);
   LTFAT_NAME(wfac)(g_combined, L, R, a, M, gf_combined);
}
开发者ID:Steve3nto,项目名称:NoiseReductionProject,代码行数:25,代码来源:comp_wfac.c

示例15: LTFAT_NAME

void LTFAT_NAME(ltfatMexFnc)( int nlhs, mxArray *plhs[],int nrhs, const mxArray *prhs[] )
{
    int a, M, N, L, W, s0, s1, br;

    // Get matrix dimensions.
    L  = mxGetM(prhs[0]);
    W  = mxGetN(prhs[0]);

    a  = (int)mxGetScalar(prhs[2]);
    M  = (int)mxGetScalar(prhs[3]);
    s0 = (int)mxGetScalar(prhs[4]);
    s1 = (int)mxGetScalar(prhs[5]);
    br = (int)mxGetScalar(prhs[6]);

    N  = L/a;

    mwSize dims[]= { M, N, W};
    mwSize ndim=W>1?3:2;
    plhs[0] = ltfatCreateNdimArray(ndim,dims,LTFAT_MX_CLASSID,mxCOMPLEX);
    const LTFAT_COMPLEX* f_combined = (const LTFAT_COMPLEX*) mxGetData(prhs[0]);
    const LTFAT_COMPLEX* g_combined = (const LTFAT_COMPLEX*) mxGetData(prhs[1]);
    LTFAT_COMPLEX* out_combined = (LTFAT_COMPLEX*) mxGetData(plhs[0]);

    LTFAT_NAME(dgt_shear)(f_combined,g_combined,L,W,a,M,s0,s1,br,out_combined);
}
开发者ID:jsloboda,项目名称:GhostVision,代码行数:25,代码来源:comp_nonsepdgt_shear.c


注:本文中的LTFAT_NAME函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。