📄 cfft_winc.asm
字号:
;============================================================================
;
; File Name : cfft_winc.asm
;
; Originator : Digital Control Systems Group
; Texas Instruments
;
; Description : This file contains source code to window the input data sequence in the case of
; complex FFT modules
;
; Date : 26/4/2001 (dd/mm/yyyy)
;===========================================================================
; Routine Type : C Callable
;
; Description :
; void FFTC_win(FFTxxxC_handle)
; This function windows N-point real data sequence stored in bit-reversed order
; in alternate memory location.(used with Complex FFT modules)
;
;======================================================================
; COMPLEX FFT MODULES
;----------------------------------------------------------------------
;typedef struct {
; int *ipcbptr;
; int *magptr;
; int peakmag;
; int peakfrq;
; int normflag;
; int size;
; int *winptr;
; void (*init)(void);
; void (*izero)(void *);
; void (*calc)(void *);
; void (*mag)(void *);
; void (*win)(void *);
; }FFTxxxC;
;======================================================================
; Function Local Frame
;======================================================================
; |_______|
; |_______|<- Stack Pointer (FP+3) <---AR1
; |_______|<- Reg to Reg Tfr (FP) <---AR0
; |_______|<- Context Save AR6 (FP-1)
; |_______|<- Old FP (AR0) (FP-2)
; |_______|<- Return Address of the Caller (FP-3)
; |_______|<- Module Handle (FP-4)
;======================================================================
__FFTC_win_frs .set 00001h ; Local frame size for this routine
.def _FFTC_win ;
_FFTC_win:
POPD *+ ; Store the Return Address in stack
SAR AR0,*+ ; Store the Caller's Frame Pointer
SAR AR6,*+ ; Context Save of AR6
SAR AR1,*
LAR AR6,*
LAR AR0,#__FFTC_win_frs
LAR AR0,*0+,AR2 ; Create Local frame
SETC SXM
SPM #0
LAR AR2,#0FFFCh ; ARP=AR2, AR2=-4
MAR *0+ ; ARP=AR2, AR2->FFT128C_handle
LAR AR2,* ; ARP=AR2, AR2=FFTxxxC_handle->ipcbptr
LAR AR4,* ; ARP=AR2, AR2->ipcbptr, AR4=ipcbptr
ADRK #6 ; ARP=AR2, AR2->winptr
LAR AR3,*- ; ARP=AR2, AR2->size, AR3=winptr
LAR AR0,* ; ARP=AR2, AR2->size, AR0=size
LACL *,AR6 ; ARP=AR6, AR6=FP, ACCL=size
SFR ; ARP=AR6, AR6=FP, ACCL=size/2
SUB #1 ; ARP=AR6, AR6=FP, ACCL=size/2-1
SACL * ; ARP=AR6, AR6=FP, (FP)=(size/2)-1
LAR AR5,*,AR4 ; ARP=AR4, AR4=ipcbptr, AR5=(size/2)-1
nextsamp1: LT *,AR3 ; ARP=AR3, AR3=winptr, TREG=*ipcbptr
MPY *+,AR4 ; ARP=AR4, AR4=ipcbptr, AR3=winptr+1, PREG=(*ipcbptr)*(*winptr)
PAC ; ARP=AR4, AR4=ipcbptr, ACC=(*ipcbptr)*(*winptr)
SACH *BR0+,1,AR5 ; ARP=AR5, AR5=(size/2)-1, *ipcbptr=(*ipcbptr)*(*winptr)
; AR4=br(ipcbptr+size)
BANZ nextsamp1,*-,AR4
MAR *, AR3 ; ARP=AR3, AR3=winptr+(size/2)
MAR *-,AR6 ; ARP=AR6, AR6=FP, AR3=AR3-1
LAR AR5,*,AR4 ; ARP=AR4, AR4=ipcbptr+size/2, AR5=(size/2)-1
nextsamp2: LT *,AR3
MPY *-,AR4
PAC
SACH *BR0+,1,AR5
BANZ nextsamp2,*-,AR4
MAR *,AR1
SBRK #(__FFTC_win_frs+1) ; Clear the local frame
LAR AR6,*-
LAR AR0,*- ; Retrive Caller's frame pointer
PSHD * ; Push the return address to TOS
RET
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -