dsp浮点实验三(编辑修改稿)内容摘要:

E_MODE 1 define CALCULATE_MODE 2 /* GLOBAL DECLARATIONS */ int mode。 // mode 1 = collecting data points. mode 2 = calculating FFT int data_count。 //ADC sample Counter int out_count。 //DAC Output Counter int window。 //control the window type float Windows[NUM_POINTS]。 //Windows /* Use this array for calculating the FFT, then copy result into data[] */ int tempdata[NUM_POINTS]。 float fdata[NUM_POINTS]。 /* array to convertg int points to floats */ float Magnitude[NUM_POINTS]。 /* The output data is stored here */ int OutputBuffer[NUM_POINTS]。 /* FUNCTION PROTOTYPES */ void main (void)。 void sample_codec( void )。 void init_codec( void )。 /**************************************************************************** ** Procedure: sample_codec() ** ** Arguments: None ** ** Returns: None ** ** Desc: Gets data in from the codec and sends the output buffer to the codec. ** If mode = SAMPLE_MODE, 128 consecutive samples are taken from the ** codec for calculating the FFT. ** ****************************************************************************/ void sample_codec( void ) { // Copy output buffers to transmit data buffers. user_tx_buf[LEFT_CHANL] = OutputBuffer[out_count]。 user_tx_buf[RIGHT_CHNL] = OutputBuffer[out_count]。 out_count++。 if(out_count=NUM_POINTS) out_count=0。 user_tx_buf[TAG] = DOUT_TAG。 user_tx_ready = 1。 /* Put this sample in the array if we39。 re in sample mode */ if( mode == SAMPLE_MODE ) { tempdata[data_count] = user_rx_buf[LEFT_CHANL]。 data_count++。 /* If we have 128 samples, stop sampling and calculate */ if( data_count = 256 ) { data_count = 0。 mode = CALCULATE_MODE。 } } } /**************************************************************************** ** ** Procedure: init_codec() ** ** Arguments: None ** ** Returns: None ** ** Desc: Turns on the codec interrupt then initializes the codec ** source and record gain. ** ****************************************************************************/ void init_codec( void ) { asm(include )。 interrupt(SIG_SPT1I,(void (*)(int)。
阅读剩余 0%
本站所有文章资讯、展示的图片素材等内容均为注册用户上传(部分报媒/平媒内容转载自网络合作媒体),仅供学习参考。 用户通过本站上传、发布的任何内容的知识产权归属用户或原始著作权人所有。如有侵犯您的版权,请联系我们反馈本站将在三个工作日内改正。