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

📄 fir.c

📁 tms320c6713 is the code for sine wave
💻 C
字号:
#include "dsk6713.h"
#include "bs2700.cof" //coefficient file
#include "dsk6713_aic23.h" 

//codec-dsk support file
Uint32 fs=DSK6713_AIC23_FREQ_48KHZ; //set sampling rate
Uint32 yn = 0; //initialize filter's output
Uint32 dlx[N]; //delay samples
//Uint32 dlx[N]; //delay samples
DSK6713_AIC23_Config config = {
    0x0017, // 0 DSK6713_AIC23_LEFTINVOL  Left line input channel volume
    0x0017, // 1 DSK6713_AIC23_RIGHTINVOL Right line input channel volume
    0x00d8, // 2 DSK6713_AIC23_LEFTHPVOL  Left channel headphone volume
    0x00d8, // 3 DSK6713_AIC23_RIGHTHPVOL Right channel headphone volume
    0x0011, // 4 DSK6713_AIC23_ANAPATH    Analog audio path control
    0x0000, // 5 DSK6713_AIC23_DIGPATH    Digital audio path control
    0x0000, // 6 DSK6713_AIC23_POWERDOWN  Power down control
    0x0043, // 7 DSK6713_AIC23_DIGIF      Digital audio interface format
    0x0001, // 8 DSK6713_AIC23_SAMPLERATE Sample rate control
    0x0001  // 9 DSK6713_AIC23_DIGACT     Digital interface activation
};

short i;
void main()
{
  DSK6713_AIC23_CodecHandle hCodec;
    /* Initialize the board support library, must be called first */
   DSK6713_init();
   
   hCodec = DSK6713_AIC23_openCodec(0, &config);
while(1)
 //infinite loop
{
while(!DSK6713_AIC23_read(hCodec, &dlx[0])); //input newest sample

yn = 0; //initialize filter's output
for (i = 0; i< N; i++)
yn += (h[i] * dlx[i]); //y(n) += h(i)* x(n-i)
for (i = N-1; i > 0; i--) //starting @ end of buffer
dlx[i] = dlx[i-1]; //update delays with data move
// scale output filter sample
 while (!DSK6713_AIC23_write(hCodec, yn ));
// send data to r i g h t channel
 while (!DSK6713_AIC23_write(hCodec, yn ));

}
/* Close the codec */
  // DSK6713_AIC23_closeCodec(hCodec);
}

⌨️ 快捷键说明

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