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

📄 fir.c

📁 基于visual dsp++开发环境
💻 C
字号:
/*	fir.c
 *
 *	Example of the FIR routine from the Blackfin DSP library.
 *	Use fir_data.m to generate input data.
 *
 *  The default input data file is a sum of two sinusoids
 *  The default coefficients implement a LPF that filters out one of the sine terms
 *
 *	See the C/C++ Compiler and Library Manual for more info on the DSP routines
 *
 */

#include <fract.h>
#include <filter.h>

#define VEC_SIZE 256	// length of the input vector
#define NUM_TAPS 8	// number of filter coefficients

fract16 in[VEC_SIZE] = {
#include "in.dat"
};

fract16 coefs[NUM_TAPS] = {
#include "coefs.dat"
};

fract16 delay[NUM_TAPS];

fract16 out[VEC_SIZE + NUM_TAPS - 1];

fir_state_fr16 state;	// declare filter state

int main()
{
	fir_init(state, coefs, delay, NUM_TAPS, 1);	// initialize filter state  
	fir_fr16(in, out, VEC_SIZE, &state);	// apply the filter to the data
}

⌨️ 快捷键说明

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