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

📄 tiir_df1.h

📁 ADI BF535 DSP IIR滤波算法汇编优化源码
💻 H
字号:
#include "mds_def.h"

#ifndef _FILTER_H
#define _FILTER_H
#define BUFFER_SIZE     64
#define BASE_NSAMPLES   64
#define DELAY_SIZE      15
#define TEST_ERROR  0x0620
#define MAX_PERMISSIBLE_ERROR 4

segment("mydata1") fract16 in[70]; 
segment("mydata1") fract16 out[70]; 
segment("mydata3") fract16 delay[10]; 
segment("mydata2") fract16 c[10]={
0x1EFD,
0x2B75,
0x1F04,
0x2776,
0xC6B1,
0x62ED,
0x26DB,
0x62F0,
0x6F10,
0x0108
};

/* Structures */

/********************************************************************
  Struct name :  fir_state_fr16

 *******************************************************************
  Description :  This FIR filter structure contains information 
                 regarding the state of the FIR filter.

 *******************************************************************/

typedef struct 
{
    fract16 *h;    /*  filter coefficients            */
    fract16 *d;    /*  start of delay line            */
    int k;         /*  number of coefficients         */
} fir_state_fr16;


/*******************************************************************

  Struct name :  iir_state

*******************************************************************
  Description :  This IIR filter structure contains information 
                 regarding the state of the IIR filter.
********************************************************************/

/* Macros */

#define fir_init(state, coef, delay, samples) \
    (state).h = (coef); \
    (state).d = (delay); \
    (state).k = (samples); \

#define iir_init(state, coef, delay, stages) \
    (state).c = (coef); \
    (state).d = (delay); \
    (state).k = (stages)
    

#endif

static fract16 INPPASS[BUFFER_SIZE] = {
0x0000,
0x0967,
0x0F37,
0x0F37,
0x0967,
0x0000,
0xF697,
0xF0C7,
0xF0C7,
0xF697,
0xFFFF,
0x0967,
0x0F37,
0x0F37,
0x0967,
0x0000,
0xF697,
0xF0C7,
0xF0C7,
0xF697,
0xFFFF,
0x0967,
0x0F37,
0x0F37,
0x0967,
0x0000,
0xF697,
0xF0C7,
0xF0C7,
0xF697,
0xFFFF,
0x0967,
0x0F37,
0x0F37,
0x0967,
0x0000,
0xF697,
0xF0C7,
0xF0C7,
0xF697,
0xFFFF,
0x0967,
0x0F37,
0x0F37,
0x0967,
0x0000,
0xF697,
0xF0C7,
0xF0C7,
0xF697,
0xFFFF,
0x0967,
0x0F37,
0x0F37,
0x0967,
0x0000,
0xF697,
0xF0C7,
0xF0C7,
0xF697,
0xFFFF,
0x0967,
0x0F37,
0x0F37
};

static fract16 thresh = 0x4050;

⌨️ 快捷键说明

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