?? fir.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 + -