📄 preproc.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 *
* Function Pre_Process() to Preprocessing of input speech *
* - 2nd order high pass filter with cut off frequency at 140 Hz. *
* - Divide input by two. *
**************************************************************************/
.MODULE/SEG=App_PM Preprocess;
/*************************************************************************/
#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 Pre_y2hi,Pre_y2lo,Pre_y1hi,Pre_y1lo,Pre_x0,Pre_x1;
/**************************************************************************
* Initialization of static values *
* $$01/10/2000 only used in encoder *
***************************************************************************/
.ENTRY Init_Pre_Process;
Init_Pre_Process:
MR=0;
DM(Pre_y2hi)=MR1;
DM(Pre_y2lo)=MR0;
DM(Pre_y1hi)=MR1;
DM(Pre_y1lo)=MR0;
DM(Pre_x0)=MR0;
DM(Pre_x1)=MR0;
RTS;
/*************************************************************************
* 2nd order high pass filter with cut off frequency at 140 Hz. *
* Designed with SPPACK efi command -40 dB att, 0.25 ri. *
* $$01/10/2000 only used in encoder *
* $$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 Pre_Process;
Pre_Process:
DO preprocess_loop UNTIL CE;
I4=^a140;
I5=^b140;
MX0=DM(Pre_y1lo);
MX1=DM(Pre_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(Pre_y2lo);
MY1=DM(Pre_y2hi);
DM(Pre_y2lo)=MX0;
DM(Pre_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(Pre_x0);
DM(Pre_x0)=MX0;
SR0=DM(Pre_x1);
DM(Pre_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);
AR=SE;
AR=AR+3;
IF LE JUMP pre_roundit;
SR1=H#7FFF;
SR0=H#FFFF;
AR =H#7FFF;
NONE=PASS MR1;
IF GE JUMP preprocess_next;
SR1=H#8000;
SR0=H#0000;
AR =H#8000;
JUMP preprocess_next;
pre_roundit: SR=LSHIFT MR0 BY 3(LO);
SR=SR OR ASHIFT MR1 BY 3(HI);
AR=SR0+H#8000;
AR=SR1+C;
preprocess_next: DM(Pre_y1hi)=SR1;
SR=LSHIFT SR0 BY -1(LO);
DM(Pre_y1lo)=SR0;
preprocess_loop: DM(I1,M1)=AR;
RTS;
/*************************************************************************/
.ENDMOD;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -