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

📄 rfft_winc.asm

📁 2407TI库函数
💻 ASM
字号:
;============================================================================
;
; File Name     : rfft_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 
;                 Real FFT modules
;               
; Date          : 26/4/2001 (dd/mm/yyyy)
;===========================================================================    
; Routine Type  : C Callable        
;
; Description   :
; void FFTR_win(FFTxxxR_handle) 
; This function windows the 2N point real valued data samples stored as N point complex 
; sequence in bit reversed order.( It is used with real FFT modules)
; 
;====================================================================== 
; REAL FFT MODULES
;----------------------------------------------------------------------
;typedef struct {   
;       int *ipcbptr;
;       int *magptr;
;       int peakmag;
;       int peakfrq;
;       int normflag;
;       int size; 
;       int *winptr; 
;       void (*init1)(void);
;       void (*init2)(void);
;       void (*calc)(void *);
;       void (*split)(void *);
;       void (*mag)(void *);
;       void (*win)(void *);
;       }FFTxxxR; 
;
;======================================================================
; Function Local Frame
;======================================================================
;   |_______|
;   |_______|<- Stack Pointer                           (FP+1) <---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) 
;======================================================================

__FFTR_win_frs  .set    00001h          ; Local frame size for this routine 
                .def    _FFTR_win       ; 
                
_FFTR_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,#__FFTR_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, AR4=ipcbptr+1
            MPY     *+,AR4          ; ARP=AR4, AR4=ipcbptr+1, AR3=winptr+1, PREG=(*ipcbptr)*(*winptr)
            LTP     *-,AR3          ; ARP=AR4, AR4=ipcbptr, ACC=(*ipcbptr)*(*winptr), TREG=*(ipcbptr+1)
            MPY     *+,AR4          ; ARP=AR4, AR4=ipcbptr, AR3=winptr+2, PREG=*(winptr+1)*(*(ipcbptr+1))
            SACH    *+,1            ; ARP=AR4, AR4=ipcbptr+1, *(ipcbptr)=(*ipcbptr) X (*winptr)
            PAC                     ; ARP=AR4, AR4=ipcbptr+1, ACC= (*(ipcbptr+1)) X (*(winptr+1))
            SACH    *-,1            ; ARP=AR4, AR4=ipcbptr, *ipcbptr=(*(ipcbptr+1)) X (*(winptr+1))
            MAR     *BR0+,AR5       ; ARP=AR5, AR5=(size/2)-1, 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, AR5=(size/2)-1
                                    
nextsamp2:  LT      *+,AR3          
            MPY     *-,AR4       
            LTP     *-,AR3      
            MPY     *-,AR4  
            SACH    *+,1        
            PAC                 
            SACH    *-,1        
            MAR     *BR0+,AR5   
            BANZ    nextsamp2,*-,AR4
             
            MAR     *,AR1
            SBRK    #(__FFTR_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 + -