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

📄 posproc.dsp

📁 基于ADSP的G.729语音编解码程序
💻 DSP
字号:
/*************************************************************************
* $$01/10/2000 checked pre process module data variables and function    *
* $$01/16/2001 modified and printed,Author: Jason.wang (zhigang wang)    *
* $$01/16/2001 Email: wzg119@yeah.net,  BP: 86+02195950-161452           *
* $$01/16/2001 This modlue is not optimized! should be test on Emulator  *
* Post-processing of output speech.                                      *
*   - 2nd order high pass filter with cut off frequency at 100 Hz.       *
*   - Multiplication by two of output speech with saturation.            *
**************************************************************************/
.MODULE/SEG=App_PM          Postprocess;

/************************************************************************/
#include       "ld8a.inc"
#include       "tab_ld8a.inc"

/************************************************************************/
/* y[] values is keep in double precision                               */
/* $$01/10/2000 static varaibles used in decoder frame speech process   */
/************************************************************************/
.VAR/DM/RAM/SEG=App_DMmem Pos_y2hi,Pos_y2lo,Pos_y1hi,Pos_y1lo,Pos_x0,Pos_x1;

/*************************************************************************
* Initialization of static values                                        *
* $$01/10/2000  only used in decoder                                     *
**************************************************************************/
.ENTRY         Init_Post_Process;

Init_Post_Process: 
               MR=0;
			   DM(Pos_y2hi)=MR1;
			   DM(Pos_y2lo)=MR0;
			   DM(Pos_y1hi)=MR1;
			   DM(Pos_y1lo)=MR0;
			   DM(Pos_x0)=MR0;
			   DM(Pos_x1)=MR0;
	           RTS;
/*************************************************************************
* 2nd order high pass filter with cut off frequency at 100 Hz.           *
* Designed with SPPACK efi command -40 dB att, 0.25 ri.                  *
* $$01/10/2000  only used in decoder                                     *
* $$01/11/2000  move dm table to pm table area                           *
* $$01/11/2000 modify pointer and varaibles to adapt table change        *
* Calling Parameters   					  					             *	
*         CNTR: length of signal                                         *
*         I1:   input signal                                             *
* Return Values														     *
*         I1:   output signal                                            *
* Altered Registers: MR,MF,SR,AR,MX0,MX1,MY0,MY1,AY0,AY1,I1,I4,I5        *	
* Computation Time : 18 cycles									         *	
**************************************************************************/
.ENTRY         Post_Process;

Post_Process:  
               DO process_loop UNTIL CE;
				  I4=^a100;
				  I5=^b100;
				  MX0=DM(Pos_y1lo);
				  MX1=DM(Pos_y1hi);
				  AR=PASS 1,MY0=PM(I4,M4);
				  MF=MX0 * MY0(SS);
				  MR=AR * MF(SS);
				  MR=MR+MX1*MY0(SS),SR0=PM(I4,M4);
  				  MY0=DM(Pos_y2lo);
				  MY1=DM(Pos_y2hi);
				  DM(Pos_y2lo)=MX0;
				  DM(Pos_y2hi)=MX1;
				  MF=SR0 * MY0(SS);
				  MR=MR+AR * MF(SS);
				  MR=MR+SR0*MY1(SS),MX0=DM(I1,M0),MY0=PM(I5,M4); 
            	  MR=MR+MX0*MY0(SS),MY0=PM(I5,M4);
				  MX1=DM(Pos_x0);
				  DM(Pos_x0)=MX0;      
			      SR0=DM(Pos_x1);     
				  DM(Pos_x1)=MX1;     
				  MR=MR+MX1*MY0(SS),MY0=PM(I5,M4);
 			      MR=MR+SR0*MY0(SS);
				  IF MV SAT MR;
				  SE=EXP MR1(HI);
				  SE=EXP MR0(LO);
				  AX0=SE;
				  AR=AX0+2;
				  IF LE JUMP roundon;
				  SR1=H#7FFF;
				  SR0=H#FFFF;				  
				  NONE=PASS MR1;
				  IF GE JUMP process_next;
				  SR1=H#8000;
				  SR0=H#0000;
				  JUMP process_next;
roundon:          SR=LSHIFT MR0 BY 2(LO);
				  SR=SR OR ASHIFT MR1 BY 2(HI);
process_next:	  DM(Pos_y1hi)=SR1;
				  SR=LSHIFT SR0 BY -1(LO);
				  DM(Pos_y1lo)=SR0;
                  AR=AR+1;
				  IF LE JUMP roundit;
				  AR=H#8000;
				  NONE=PASS MR1;
				  IF GE AR=-AR;
				  JUMP process_loop;
roundit:          SR=LSHIFT MR0 BY 3(LO);
				  SR=SR OR ASHIFT MR1 BY 3(HI);
				  AR=SR0+H#8000;
				  AR=SR1+C;		      
process_loop:    DM(I1,M1)=AR;
 	             RTS;
/**************************************************************************/
.ENDMOD;

⌨️ 快捷键说明

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