大侠你好!!我是刚刚学习DSP的小白!现在看到了一个主函数,不明白,能否帮忙解释哈!!
最好是逐行标示一下!!!
跪谢了.......
// 测试时音频插孔J5接音源,J7接扬声器。
#include "5509.h"
#include "util.h"
#include <stdio.h>
#include "melp.h"
#include "spbstd.h"
#include "mat.h"
/* compiler constants */
#define ANA_SYN 0
#define ANALYSIS 1
#define SYNTHESIS 2
/* note: CHSIZE is shortest integer number of words in channel packet */
#define CHSIZE 9
#define NUM_CH_BITS 54
/* external memory */
int melpmode = ANA_SYN;
char in_name[80], out_name[80];/*声明数组类型*/
void wait( unsigned int cycles );
void EnableAPLL( );
void main() //主函数
{
int length, frame, eof_reached;
int num_frames = 0;
float speech_in[FRAME];
float speech_out[FRAME];
static struct melp_param melp_par; /* melp parameters */
unsigned int chbuf[CHSIZE];
/*硬件初始化*/
SDRAM_init();
EnableAPLL();
PLL_Init(40);
AIC23_Init();
melp_ana_init();
melp_syn_init();
while(1)
{
AIC23_Mixer();
}
}
void wait( unsigned int cycles )
{
int i;
for ( i = 0 ; i < cycles ; i++ ){ }
}
void EnableAPLL( )
{
/* Enusre DPLL is running */
*( ioport volatile unsigned short* )0x1f00 = 4;
wait( 25 );
*( ioport volatile unsigned short* )0x1f00 = 0;
*( ioport volatile unsigned short* )0x1f00 = 0x3000;
*( ioport volatile unsigned short* )0x1f00 |= 0x4F8;
wait( 25 );
*( ioport volatile unsigned short* )0x1f00 |= 2;
wait( 30000 );
*( ioport volatile unsigned short* )0x1e80 = 1;
wait( 60000 );
}
|