echo.c

来自「一个滤波器和一个音效处理程序 TI 的CCS 编译器编程。」· C语言 代码 · 共 43 行

C
43
字号

#include   "echo.h"



#define McBSP0_DRR2  (*(volatile unsigned int *)0x0020)
#define McBSP0_DRR1  (*(volatile unsigned int *)0x0021)
#define McBSP0_DXR2  (*(volatile unsigned int *)0x0022)
#define McBSP0_DXR1  (*(volatile unsigned int *)0x0023)

/***********************************************************************
**  Function Routine
							  h(t)
							  ^
							  |
							  |		^
	s(t)	--->			  |		|				-->y(t)
                   ___________|_____|___________>
                   			  0		0.5			t
This function cause an echo with a 0.5s delay and an amplitude of 1/2 of the source's

***********************************************************************/
void  echo(void)
{

      
      /* mix microphone input with the carrier to shift frequency */
      eMicPhIn  = ((McBSP0_DRR1-130) << 0 )&0xFFFE;      
      //SInMx    = ((long int)(MicPhIn * SCarrier) >> 16);
      if(i<4998){i++;}else{i=0;}
      bf[i]=eMicPhIn;
      j=i+1;
      if(j==5000){j=0;}
      eSOutTemp  = eMicPhIn + bf[j]>>1;
      McBSP0_DXR1     =  eSOutTemp;  
      McBSP0_DXR1    &=  0xFFFE;
      // output the secured voice to master AIC10 device in ISR 
}
/***********************************************************************
**  End of File -- echo.c
***********************************************************************/

⌨️ 快捷键说明

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