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

📄 firtest1.c

📁 使用在TI DSP c54xx系列的 xdaix
💻 C
字号:
/*

 *  Copyright 2003 by Texas Instruments Incorporated.

 *  All rights reserved. Property of Texas Instruments Incorporated.

 *  Restricted rights to use, duplicate or disclose this code are

 *  granted through contract.

 *

 *  @(#) XDAS 2.51.00 11-29-2003 (xdas-2.50.00.9)

 */

/*

 *  ======== firtest1.c ========

 *  This example shows how vendor specific extensions can 

 *  be used directly by an application.

 */

#include <std.h>

#include <log.h>

#include <fir_ti.h>



#ifdef _28_

#define far  

#endif



extern LOG_Obj trace;



#define NUMFRAMES   2



Int coeff[] = {1, 2, 3, 4, 4, 3, 2, 1};

Int inout[] = {1, 0, 0, 0, 0, 0, 0, 0, 0, 0};



#define FRAMELEN    ((sizeof (inout) / sizeof (Int)) / NUMFRAMES)

#define FILTERLEN   (sizeof (coeff) / sizeof (Int))



static Void display(Int a[], Int n);



/*

 *  ======== main ========

 */

Int main(Int argc, String argv[])

{

    FIR_TI_Params firParams;

    FIR_TI_Handle fir;

    

    FIR_TI_init();

    

    firParams = FIR_TI_PARAMS;

    firParams.filterLen = FILTERLEN;

    firParams.frameLen = FRAMELEN;

    firParams.coeffPtr = coeff;



    if ((fir = FIR_TI_create(&firParams)) != NULL) {

        FIR_TI_nApply(fir, inout, NUMFRAMES);   /* filter data in-place */

        display(inout, NUMFRAMES * FRAMELEN);   /* display the result */

        FIR_TI_delete(fir);                     /* delete the filter */

    }



    FIR_TI_exit();



    return (0);

}



/*

 *  ======== display ========

 */

static Void display(Int a[], Int n)

{

    Int i;

    

    for (i = 0; i < n; i++) {

        LOG_printf(&trace, "%d ", (Arg)a[i]);

    }



    LOG_printf(&trace, "\n");

}

⌨️ 快捷键说明

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