fir_mex.cpp

来自「浮点fir设计工具」· C++ 代码 · 共 44 行

CPP
44
字号
//       AccelDSP 9.1.00 build 868 Production, compiled Feb 16 2007 
// 
//    THIS IS UNPUBLISHED, LICENSED SOFTWARE THAT IS THE CONFIDENTIAL 
//        AND PROPRIETARY PROPERTY OF XILINX OR ITS LICENSORS 
// 
//      Copyright(c) Xilinx, Inc., 2000-2007, All Rights Reserved. 
//   Reproduction or reuse, in any form, without the explicit written 
//          consent of Xilinx, Inc., is strictly prohibited. 
// 
//  User: WangQian 
//  Machine: A2D3DF917F70473 (i1586, Windows XP Service Pack 2, 5.01.2600) 
//  Date: Mon May 12 10:45:42 2008 
// 
#include "mex.h"
#include "fir.h"

extern void AccelMexInit();
extern void AccelMexExit();

extern void fir( double indatabuf, double & outdatabuf );

__declspec( dllexport ) void mexFunction( int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[] )
{
    static int firstCall = 1;
    double * outdatabuf = 0;
    double indatabuf = 0;
    if ( firstCall ) {
        firstCall = 0;
        AccelMexInit();
    }

    if ( nrhs == 0 ) {
        AccelMexExit();
        return;
    }

    plhs[0] = mxCreateDoubleMatrix( 1, 1, mxREAL );
    outdatabuf = (double*)mxGetPr( plhs[0] );

    indatabuf = *(double*)mxGetPr( prhs[0] );

    fir( indatabuf, *outdatabuf );
}

⌨️ 快捷键说明

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