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

📄 clida.s55

📁 This R2.9 revision of the CLID detector provides the TYPE 1 (on-hook, between first and second ring,
💻 S55
📖 第 1 页 / 共 2 页
字号:
*-------------------------------------------------------------------------*
*                                                                         *
*   THIS IS AN UNPUBLISHED WORK CONTAINING CONFIDENTIAL AND PROPRIETARY   *
*   INFORMATION.  IF PUBLICATION OCCURS, THE FOLLOWING NOTICE APPLIES:    *
*      "COPYRIGHT 2001 MIKET DSP SOLUTIONS, ALL RIGHTS RESERVED"          *
*                                                                         *
*-------------------------------------------------------------------------*/

	.include "clidi.h55"

*--------------------- local defs ----------------------------------------*/

_CORR   			.set 	(22*170+2*17)

en2log	.macro acc, tx
    acc = acc + #1;
    acc = mant (acc), tx = -exp(acc) || nop
    acc = acc << #-21;
    acc = acc + (tx*#512);
    .endm

*--------------------- public vars ---------------------------------------*/
*--------------------- local vars ----------------------------------------*/
*--------------------- local functions -----------------------------------*/
*-------------------------------------------------------------------------*/
	.global	__en2log
__en2log
*-------------------------------------------------------------------------*/
;S32 ac0   /* but it is positive */
    ac0 = ac0 + #1;
    ac0 = mant (ac0), t0 = -exp(ac0);
    ac0 = ac0 << #-21;
    ac0 = ac0 + (t0*#512);
    t0 = ac0;
    return

*-------------------------------------------------------------------------*/
	.global	_clid_move_data_in
;	.sym _clid_move_data_in, _clid_move_data_in, 32, 2, 0
_clid_move_data_in
*-------------------------------------------------------------------------*/
;CLID_tDb *pDb,		xar0
;CLID_tSc *pSc,		xar1
;S16 *psIn			xar2
	t0 = *ar0(#(CLID_tDb.Cfg.sNormShift))
	
	ac0 = *ar0(#(CLID_tDb.sCurrBitLen));
	*ar1(#(CLID_tSc.sCurrBitLen)) = ac0;

	ac0 = *ar0(#(CLID_tDb.sBits));
	*ar1(#(CLID_tSc.sBits)) = ac0;

	ac0 = *ar0(#(CLID_tDb.sAlignment));
	*ar1(#(CLID_tSc.sAlignment)) = ac0;

	xar3 = mar(*ar0(#(CLID_tDb.asBpSav)))
	xar4 = mar(*ar1(#(CLID_tSc.asBp)))
	repeat (#(CLID_BPF_SSZ-1))
		*ar4+ = *ar3+;
		
	brc0 = #(ICLID_FR_SZ-1);
	localrepeat {
		ac0 = *ar2+ << t0;
		*ar4+ = ac0;
	}
	
	xar3 = mar(*ar0(#(CLID_tDb.asLpISav)));
	xar4 = mar(*ar1(#(CLID_tSc.asLpI)));
	repeat (#(CLID_LPF_SSZ-1));
		*ar4+ = *ar3+;
		
	xar3 = mar(*ar0(#(CLID_tDb.asLpQSav)));
	xar4 = mar(*ar1(#(CLID_tSc.asLpQ)));
	repeat (#(CLID_LPF_SSZ-1));
		*ar4+ = *ar3+;

	xar3 = mar(*ar0(#(CLID_tDb.asMfISav)));
	xar4 = mar(*ar1(#(CLID_tSc.asMfI)));
	repeat (#(CLID_MF_SSZ-1));
		*ar4+ = *ar3+;

	xar3 = mar(*ar0(#(CLID_tDb.asMfQSav)));
	xar4 = mar(*ar1(#(CLID_tSc.asMfQ)));
	repeat (#(CLID_MF_SSZ-1));
		*ar4+ = *ar3+;
		
	xar3 = mar(*ar0(#(CLID_tDb.asOutSav)));
	xar4 = mar(*ar1(#(CLID_tSc.asOut)));
	repeat (#(CLID_OUT_SSZ-1));
		*ar4+ = *ar3+;
		
	return;
;
*-------------------------------------------------------------------------*/
	.global _clid_bp_filter
;	.sym _clid_bp_filter, _clid_bp_filter, 32, 2, 0
_clid_bp_filter
*-------------------------------------------------------------------------*/
;CLID_tDb *pDb,				xar0
;CLID_tSc *pSc				xar1
;
	pshboth(xar5);
	.arms_off
	bit(ST2, #ST2_ARMS) = #0;
	
	xcdp = mar(*ar1(#(CLID_tSc.asBp)));
	xar2 = mar(*ar1(#(CLID_tSc.asLpI + CLID_LPF_SSZ)));
	xar3 = mar(*ar1(#(CLID_tSc.asLpQ + CLID_LPF_SSZ)));
	xar4 = #_CLID_asBpfI;
	xar5 = #_CLID_asBpfQ;

	t0 = #(2-CLID_BPF_SZ);	
	t1 = #(1-CLID_BPF_SZ);	
	brc0 = #(ICLID_FR_SZ-1);
	localrepeat {
		ac0 =  *ar4+ * coef(*cdp+),
		ac1 =  *ar5+ * coef(*cdp+);
		|| repeat (#(CLID_BPF_SZ-3))
			ac0 = ac0 + (*ar4+ * coef(*cdp+)),
			ac1 = ac1 + (*ar5+ * coef(*cdp+));
		ac0 = ac0 + (*(ar4+t1) * coef(*(cdp+t0))),
		ac1 = ac1 + (*(ar5+t1) * coef(*(cdp+t0)));
		*ar2+ = HI(rnd(ac0<<1));
		*ar3+ = HI(rnd(ac1<<1));
	}
	bit(ST2, #ST2_ARMS) = #1;
    .arms_on
	xar5 = popboth();
    return;

*-------------------------------------------------------------------------*/
	.global _clid_convert_baseband
;	.sym _clid_convert_baseband, _clid_convert_baseband, 32, 2, 0
_clid_convert_baseband
*-------------------------------------------------------------------------*/
;CLID_tDb *pDb,			xar0
;CLID_tSc *pSc			xar1
;
	
	tc1  = bit(*ar0(#(CLID_tDb.sEven)),#0);

	xar2 = mar(*ar1(#(CLID_tSc.asLpI + CLID_LPF_SSZ)));
	xar3 = mar(*ar1(#(CLID_tSc.asLpQ + CLID_LPF_SSZ)));
	xcdp = #_CLID_as1700;

	if (tc1) execute (AD_unit)
		xcdp = #(_CLID_as1700 + 40);
		
	t0 = #20;
	brc0 = #(ICLID_FR_SZ-1);
	localrepeat {
		ac0 = *ar3 * coef(*(cdp+t0)),
		ac1 = *ar2 * coef(*(cdp+t0));
		
		ac0 = ac0 - (*ar2 * coef(*cdp)),
		ac1 = ac1 + (*ar3 * coef(*cdp));
		
		*ar2+ = HI(rnd(ac0 << #1));
		*ar3+ = HI(rnd(ac1 << #1));
		mar (*+cdp(#(-19)));
	}
	*ar0(#(CLID_tDb.sEven)) = *ar0(#(CLID_tDb.sEven)) ^ #1;
	return;	


*-------------------------------------------------------------------------*/
	.global _clid_resample_6k
;	.sym _clid_resample_6k, _clid_resample_6k, 32, 2, 0
_clid_resample_6k
*-------------------------------------------------------------------------*/
;CLID_tDb *pDb,			xar0
;CLID_tSc *pSc			xar1
;
	pshboth(xar5);
	.arms_off
	bit(ST2, #ST2_ARMS) = #0;
	xar2 = mar(*ar1(#(CLID_tSc.asLpI)));				psFromI
	xar3 = mar(*ar1(#(CLID_tSc.asLpQ)));				psFromQ
	xar4 = mar(*ar1(#(CLID_tSc.asMfI+CLID_MF_SSZ)));	psToI
	xar5 = mar(*ar1(#(CLID_tSc.asMfQ+CLID_MF_SSZ)));	psToQ
	xcdp = #(_CLID_asLpf24 + 2);
	
	t0 = #3;
	t1 = #(2-CLID_LPF_SZ);
	brc0 = #(ICLID_FR_SZ/4-1);
	blockrepeat {
		ac0 = *ar2+ * coef(*(cdp+t0)),
		ac1 = *ar3+ * coef(*(cdp+t0));
		|| repeat (#(CLID_LPF_SZ-3))
			ac0 = ac0 + (*ar2+ * coef(*(cdp+t0))),
			ac1 = ac1 + (*ar3+ * coef(*(cdp+t0)));
		ac0 = ac0 + (*(ar2+t1) * coef(*(cdp+t0))),
		ac1 = ac1 + (*(ar3+t1) * coef(*(cdp+t0)));
		*ar4+ = HI(rnd(ac0<<#1));
		*ar5+ = HI(rnd(ac1<<#1));
		mar(*+cdp(#(-1-3*CLID_LPF_SZ)));
		
		ac0 = *ar2+ * coef(*(cdp+t0)),
		ac1 = *ar3+ * coef(*(cdp+t0));
		|| repeat (#(CLID_LPF_SZ-3))
			ac0 = ac0 + (*ar2+ * coef(*(cdp+t0))),
			ac1 = ac1 + (*ar3+ * coef(*(cdp+t0)));
		ac0 = ac0 + (*(ar2+t1) * coef(*(cdp+t0))),
		ac1 = ac1 + (*(ar3+t1) * coef(*(cdp+t0)));
		*ar4+ = HI(rnd(ac0<<#1));
		*ar5+ = HI(rnd(ac1<<#1));
		mar(*+cdp(#(-1-3*CLID_LPF_SZ)));

		ac0 = *ar2+ * coef(*(cdp+t0)),
		ac1 = *ar3+ * coef(*(cdp+t0));
		|| repeat (#(CLID_LPF_SZ-3))
			ac0 = ac0 + (*ar2+ * coef(*(cdp+t0))),
			ac1 = ac1 + (*ar3+ * coef(*(cdp+t0)));
		ac0 = ac0 + (*(ar2+t1) * coef(*(cdp+t0))),
		ac1 = ac1 + (*(ar3+t1) * coef(*(cdp+t0)));
		*ar4+ = HI(rnd(ac0<<#1));
		*ar5+ = HI(rnd(ac1<<#1));
		mar(*+cdp(#(2-3*CLID_LPF_SZ)));
		mar(*ar2+) || mar (*ar3+);
	}
	.arms_on
	bit(ST2, #ST2_ARMS) = #1;
	xar5 = popboth();
	return;

*-------------------------------------------------------------------------*/
	.global _clid_matched_filter
;	.sym _clid_matched_filter, _clid_matched_filter, 32, 2, 0
_clid_matched_filter
*-------------------------------------------------------------------------*/
;CLID_tDb *pDb	= xar0
;CLID_tSc *pSc	= xar1
;
	.arms_off
	push(t2)
	bit(ST2, #ST2_ARMS) = #0;
	xar2 = mar(*ar1(#(CLID_tSc.asMfI)));				psFromI
	xar3 = mar(*ar1(#(CLID_tSc.asMfQ)));				psFromQ
	xar4 = mar(*ar1(#(CLID_tSc.asOut+CLID_OUT_SSZ)));	psTo
	
	t0   = #(2 - CLID_MF_SZ);
	t1   = #(1 - CLID_MF_SZ);
	brc0 = #(CLID6_FR_SZ - 1)
	blockrepeat {
		xcdp = #_CLID_asMfI;
		ac0 = *ar2+ * coef(*cdp+),
		ac1 = *ar3+ * coef(*cdp+);
		|| repeat (#(CLID_MF_SZ-3))
			ac0 = ac0 + (*ar2+ * coef(*cdp+)),
			ac1 = ac1 + (*ar3+ * coef(*cdp+));
		ac0 = ac0 + (*(ar2+t1) * coef(*cdp+)),
		ac1 = ac1 + (*(ar3+t1) * coef(*cdp+));
		
		xcdp = #_CLID_asMfQ;
		ac2 = *ar2+ * coef(*cdp+),
		ac3 = *ar3+ * coef(*cdp+);
		|| repeat (#(CLID_MF_SZ-3))
			ac2 = ac2 + (*ar2+ * coef(*cdp+)),
			ac3 = ac3 + (*ar3+ * coef(*cdp+));
		ac2 = ac2 + (*(ar2+t0) * coef(*cdp+)),
		ac3 = ac3 + (*(ar3+t0) * coef(*cdp+));
		
		ac1 = ac1 * ac2;
		ac0 = ac0 * ac3;
		ac1 = ac1 - ac0;
	.if 0
    	*ar4+ = LO(ac1 << #-7);
    .else
		ac0 = |ac1|;
		ac0 = ac0 + #1;
	    ac0 = mant (ac0), t2 = -exp(ac0);
    	ac0 = ac0 << #-21;
    	t2 = t2 + #30;
    	ac0 = ac0 + (t2*#512);
    	if (ac1 < #0) execute(D_unit)
    		|| ac0 = -ac0;
    	if (ac1 == #0) execute(D_unit)
    		|| ac0 = #0;
    	ac0 = ac0 + *ar1(#(CLID_tSc.sAlignment));
    	*ar4+ = ac0;
	.endif    	
	}
	mar (*ar4-);
	ac0 = #0;
	|| repeat (#(CLID6_FR_SZ-1))
		ac0 = ac0 + *ar4-;
	ac0 = ac0 + #(1<<8);
	ac0 = ac0 << #-9;	
	*ar1(#(CLID_tSc.sAverage)) = ac0;
	.arms_on
	bit(ST2, #ST2_ARMS) = #1;
	t2 = pop();
	return;

*-------------------------------------------------------------------------*/
	.global _clid_match_byte
;	.sym _clid_match_byte, _clid_match_byte, 32, 2, 0
_clid_match_byte
*-------------------------------------------------------------------------*/
; S16 *psIn		= xar0
; U16 *puByte 	= xar1 (where to put uByte)
;
	xar3 = #_CLID_asShape;
	t0 = #(1-5);
	ac0 = #0; 				; quality
	ac2 = #0; 				; uByte;
	ac3 = #1;				; mask
	brc0 = #(10-1);
	xar2 = mar(*ar0(#(-2)));
	localrepeat {			; loop for bits
		ac1 = *ar2+ * *ar3+;
		|| repeat (#(5-3))
			ac1 = ac1 + (*ar2+ * *ar3+);
		ac1 = ac1 + (*ar2+ * *(ar3+t0));
	
		tc1 = bit(*ar0, #15);
		if ( tc1) execute (D_unit)
			|| ac0 = ac0 - ac1;
		if (!tc1) execute (D_unit)
			|| ac0 = ac0 + ac1;
		if (!tc1) execute (D_unit)
			|| ac2 = ac2 | ac3;
		ac3 = ac3 << #1;
		mar(ar0 + #5);
	}
	*ar1 = ac2;
	ac0 = ac0 << #(-8)
	t0 = ac0;
	return;	(t0)

⌨️ 快捷键说明

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