基本信息
源码名称:FIR滤波器 C5000 DSP的实现
源码大小:0.07M
文件格式:.rar
开发语言:C/C++
更新时间:2017-12-13
友情提示:(无需注册或充值,赞助后即可获取资源下载链接)
嘿,亲!知识可是无价之宝呢,但咱这精心整理的资料也耗费了不少心血呀。小小地破费一下,绝对物超所值哦!如有下载和支付问题,请联系我们QQ(微信同号):813200300
本次赞助数额为: 4 元×
微信扫码支付:4 元
×
请留下您的邮箱,我们将在2小时内将文件发到您的邮箱
源码介绍
用c语言实现的FIR算法 高通滤波器
/*****************************************************************************/ /* Codec.c */ /* */ /* Digital Loopback example */ /* */ /*****************************************************************************/ #include <type.h> #include <board.h> #include <codec.h> #include <mcbsp54.h> volatile s16 *buffer=(volatile s16*)0x8000; extern void fir(void); /*****************************************************************************/ /* Function Prototypes */ /*****************************************************************************/ /* This delay routine does not conflict with DSP/BIOS. It is used in this */ /* example rather than brd_delay_msec which causes DSP/BIOS conflicts just */ /* because of this. If you are not using DSP/BIOS, you can change the code */ /* to use brd_delay_msec. */ void delay(s16 period); /*****************************************************************************/ /* Global Variables */ /*****************************************************************************/ HANDLE hHandset; s16 data; /*****************************************************************************/ /* MAIN */ /*****************************************************************************/ void main() { s16 cnt=2; int i; for(i=0;i<32;i ) buffer[i]=0; if (brd_init(100)) return; /* blink the leds a couple times */ while ( cnt-- ) { brd_led_toggle(BRD_LED0); /* brd_delay_msec(1000); */ delay(1000); brd_led_toggle(BRD_LED1); /* brd_delay_msec(1000); */ delay(1000); brd_led_toggle(BRD_LED2); /* brd_delay_msec(1000); */ delay(1000); } /* Open Handset Codec */ hHandset = codec_open(HANDSET_CODEC); /* Acquire handle to codec */ /* Set codec parameters */ codec_dac_mode(hHandset, CODEC_DAC_15BIT); /* DAC in 15-bit mode */ codec_adc_mode(hHandset, CODEC_ADC_15BIT); /* ADC in 15-bit mode */ codec_ain_gain(hHandset, CODEC_AIN_6dB); /* 6dB gain on analog input to ADC */ codec_aout_gain(hHandset, CODEC_AOUT_MINUS_6dB); /* -6dB gain on analog output from DAC */ codec_sample_rate(hHandset,SR_16000); /* 16KHz sampling rate */ /* Polling and digital loopback */ while (1) { /* Wait for sample from handset */ while (!MCBSP_RRDY(HANDSET_CODEC)) {}; /* Read sample from and write back to handset codec */ data = *(volatile u16*)DRR1_ADDR(HANDSET_CODEC); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); *buffer = data; asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); fir(); asm(" nop"); asm(" nop"); asm(" nop"); asm(" nop"); *(volatile u16*)DXR1_ADDR(HANDSET_CODEC) = *buffer; } } void delay(s16 period) { int i, j; for(i=0; i<period; i ) { for(j=0; j<period>>1; j ); } }