Update repo
This commit is contained in:
1 parent
749dab5721
commit
ce65a0f59a
14950 files changed
+4408250
-1
No files matched your search
@@ -0,0 +1,154 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/CFFT32_brev.asm
|
||||
;;!
|
||||
;;! \brief Bit Reversal routine for the complex 32-bit FFT
|
||||
;;!
|
||||
;;! \date Jan 11, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
.if __TI_EABI__
|
||||
.asg CFFT32_brev, _CFFT32_brev
|
||||
.endif
|
||||
|
||||
.def _CFFT32_brev
|
||||
;; Module Structure
|
||||
;; typedef struct { <--------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
|
||||
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;;}CFFT32;
|
||||
;;
|
||||
;;==============================================================================
|
||||
;; \fn void CFFT32_brev(int32_t *src, int32_t *dst, uint16_t size)
|
||||
;; \brief Bit Reversal routine for the complex 32-bit FFT
|
||||
;;
|
||||
;; This function bit reverses the N-point real sequence stored in
|
||||
;; alternate memory locations, that is,
|
||||
;; src(0) = x(0) | src(1) = 0
|
||||
;; src(2) = x(1) | src(3) = 0
|
||||
;; ... | ...
|
||||
;; src(2N-2) = x(N-1) | src(2N-1) = 0
|
||||
;; If src=dst, then in-place bit reversal is performed.
|
||||
;; The destination array should be aligned to 2N long words, where N is the size
|
||||
;; of the complex FFT.
|
||||
;;
|
||||
;; \param src (XAR4) pointer to the source array or buffer
|
||||
;; \param dst (XAR5) pointer to the destination array or buffer
|
||||
;; \param size( AL) size of the buffer (must be a power of 2)
|
||||
;;==============================================================================
|
||||
;;
|
||||
_CFFT32_brev:
|
||||
; XAR4->src, XAR5->dst, AL=size
|
||||
MOVL XAR0,XAR4 ; XAR0->src
|
||||
NOP *,ARP5
|
||||
|
||||
CMPR 0 ; TC=1, if src==dst
|
||||
BF off_place,NTC ; If not equal, jump to off place bit rev
|
||||
|
||||
; IN-PLACE BIT-REVERSAL
|
||||
in_place:
|
||||
MOVZ AR7,AL ; AR0=size
|
||||
SUBB XAR7,#1 ; XAR7=size-1
|
||||
LSL ACC,#1 ; ACC=2*size
|
||||
MOVZ AR6,AL ; AR0=2*size
|
||||
|
||||
next_data1:
|
||||
MOVL XT,*XAR4 ; XT=*src
|
||||
MOVL P,*XAR5 ; P=*dst
|
||||
MOVL XAR0,XAR4 ; XAR0=src
|
||||
CMPR 2 ; check src<dst
|
||||
BF noswap,TC ; if src<dst, do not swap *src & *dst
|
||||
|
||||
MOVL *XAR4,P ; *src=*dst
|
||||
MOVL *XAR5,XT ; *dst=*src
|
||||
|
||||
noswap:
|
||||
ADDB XAR4,#4 ; XAR4=src+2
|
||||
MOVZ AR0,AR6 ; AR0=2*size
|
||||
NOP *BR0++ ; dst=br(dst+2*size)
|
||||
BANZ next_data1,AR7-- ; ARP=AR3, AR3->src+2, AR7=AR7-1
|
||||
LRETR
|
||||
|
||||
; OFF-PLACE BIT-REVERSAL
|
||||
off_place:
|
||||
MOVZ AR7,AL ; AR0=size
|
||||
SUBB XAR7,#1 ; XAR7=size-1
|
||||
LSL ACC,#1 ; ACC=2*size
|
||||
MOVZ AR0,AL ; AR0=2*size
|
||||
|
||||
next_data2:
|
||||
MOVL ACC,*XAR4++ ; XAR4=src+1, ACCL=*src
|
||||
ADDB XAR4,#2 ; XAR4=src+2
|
||||
NOP *,ARP5 ; ARP=XAR5
|
||||
MOVL *BR0++,ACC ; XAR5=br(dst+size)
|
||||
BANZ next_data2,AR7--
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,143 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/CFFT32_mag.asm
|
||||
;;!
|
||||
;;! \brief Magnitude function for the complex FFT
|
||||
;;!
|
||||
;;! \date Nov 2, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
.if __TI_EABI__
|
||||
.asg CFFT32_mag, _CFFT32_mag
|
||||
.endif
|
||||
|
||||
.def _CFFT32_mag
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <--------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
|
||||
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;;}CFFT32;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void CFFT32_mag(CFFT32_Handle)
|
||||
;; This function computes the magnitude square of complex FFT outputs. Allows in-place
|
||||
;; and off-place storage of the magnitude square results.
|
||||
;;
|
||||
|
||||
_CFFT32_mag:
|
||||
SETC SXM
|
||||
|
||||
MOVL XAR7,*XAR4 ; XAR5=ipcbptr
|
||||
MOVL XAR6,*+XAR4[6] ; XAR6=magptr
|
||||
|
||||
MOVZ AR0,*+XAR4[4] ; AR7=size
|
||||
SUBB XAR0,#1 ; AR0=size-1
|
||||
|
||||
MAG_LP:
|
||||
ZAPA ; ACC=0, P=0
|
||||
QMACL P,*XAR7,*XAR7++ ; Q15*Q15=Q30
|
||||
QMACL P,*XAR7,*XAR7++ ; Q15*Q15+Q30=Q30
|
||||
ADDL ACC,P
|
||||
MOVL *XAR6++,ACC ; Store in Q30
|
||||
BANZ MAG_LP,AR0--
|
||||
|
||||
; Find maximum magnitude
|
||||
ADDB XAR4,#4 ; XAR4->size
|
||||
MOVB ACC,#0
|
||||
MOVL *+XAR4[6],ACC ; peakmag=0
|
||||
MOVZ AR0,*XAR4 ; AR0=size
|
||||
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
|
||||
|
||||
MOV ACC,#0
|
||||
SUBB XAR0,#1 ; AR0=size-1
|
||||
|
||||
;Find the maximum value among the FFT Magnitudes
|
||||
RPT AR0
|
||||
|| MAXL ACC,*XAR5++
|
||||
|
||||
MOVL *+XAR4[6],ACC ; update peak magnitude
|
||||
MOVB XAR7,#0 ; XAR7=0
|
||||
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
|
||||
;Find the spectral bin corresponding to maximum magnitude.
|
||||
NEXT_BIN:
|
||||
MAXL ACC,*XAR5++
|
||||
NOP *XAR7++
|
||||
SBF NEXT_BIN,NEQ
|
||||
|
||||
NOP *--XAR7
|
||||
ADDB XAR4,#8 ; XAR4->peakfrq
|
||||
MOV *XAR4,AR7 ; update peak magnitude
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,253 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/CFFT32_win.asm
|
||||
;;!
|
||||
;;! \brief Complex FFT Windowing Function
|
||||
;;!
|
||||
;;! \date Jan 11, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
.if __TI_EABI__
|
||||
.asg CFFT32_win, _CFFT32_win
|
||||
.asg CFFT32_win_dual, _CFFT32_win_dual
|
||||
.endif
|
||||
|
||||
.def _CFFT32_win
|
||||
.def _CFFT32_win_dual
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <--------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
|
||||
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;;}CFFT32;
|
||||
;;
|
||||
ARG_IPCBPTR .set 0
|
||||
ARG_TFPTR .set 0
|
||||
ARG_SIZE .set 2
|
||||
ARG_NRSTAGE .set 3
|
||||
ARG_MAGPTR .set 4
|
||||
ARG_WINPTR .set 6
|
||||
ARG_PEAKMAG .set 8
|
||||
ARG_PEAKFREQ .set 9
|
||||
ARG_RATIO .set 10
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn CFFT32_win
|
||||
;;! \brief Complex FFT Windowing Function
|
||||
;;! \param CFFT32_handle pointer to an CFFT32 object
|
||||
;;
|
||||
;; This function applies a window to an N-point real data (imaginary portion
|
||||
;; zeroed out) sequence that has already been stored in bit-reversed format in the
|
||||
;; location pointed to by "ipcbptr". It is to be used with the complex FFT module
|
||||
;;
|
||||
;; For an N-pt complex FFT, the stored windows are of size N/2 (they are symmetrical).
|
||||
;; This routine will apply the window in two steps
|
||||
;;
|
||||
;; Step 1: Forward walk through win
|
||||
;; Loop for i = 0 to N/2 - 1 {
|
||||
;; p -> ipcbptr, q -> win
|
||||
;; a = *p (Q31) , b = *q (Q31)
|
||||
;; n = sizeof(ipcbptr) = 2(32-bit wide)*N
|
||||
;; temp = ((a x b) >> 32)
|
||||
;; = ((A * 2^31 x B * 2^31) x 2^-32) where A and B are the unscaled decimal values
|
||||
;; = A x B x 2^30 (Q30)
|
||||
;; temp = temp << 1 (Q31)
|
||||
;; *p = temp
|
||||
;; p = p rcadd n (this is the bit reversed address)
|
||||
;; q = q + 1
|
||||
;; }
|
||||
;;
|
||||
;; Step 2: Backward walk through win
|
||||
;; Loop for i = N/2 to N - 1 {
|
||||
;; p -> ipcbptr(from the last step), q -> win(N/2)
|
||||
;; a = *p (Q31) , b = *q (Q31)
|
||||
;; temp = (A x B x 2^30) << 1 (Q31)
|
||||
;; *p = temp
|
||||
;; p = p rcadd n (this is the bit reversed address)
|
||||
;; q = q - 1
|
||||
;; }
|
||||
;;=============================================================================
|
||||
;;
|
||||
_CFFT32_win:
|
||||
MOVL XAR5,*XAR4++ ; XAR5 = ipcbptr
|
||||
MOVL XAR6,*+XAR4[ARG_WINPTR] ; XAR6 = winptr
|
||||
MOV ACC,*+XAR4[ARG_SIZE]<<15 ; AH = size/2
|
||||
MOVH AR0,ACC<<2 ; AR0 = 2(complex)*size
|
||||
MOVZ AR7,AH ; AR7 = (size/2)
|
||||
SUBB XAR7,#1 ; AR7 = (size/2)-1
|
||||
MOVL XAR4,XAR7 ; AR4 = (size/2)-1
|
||||
|
||||
nextsamp1:
|
||||
MOVL XT,*XAR6++ ; XT = win[i] | i++
|
||||
QMPYL ACC,XT,*XAR5 ; ACC = (signed XT * signed [*XAR5]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *BR0++,ACC ; *XAR5 = ACC | AR5L = AR5L rcadd AR0
|
||||
BANZ nextsamp1,AR7--
|
||||
; At the end of this loop, XAR6 points to the
|
||||
; N/2 th element of the real input
|
||||
nextsamp2:
|
||||
MOVL XT,*--XAR6 ; XT = win[i] | i--
|
||||
QMPYL ACC,XT,*XAR5 ; ACC = (signed XT * signed [*XAR5]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *BR0++,ACC ; *XAR5 = ACC | AR5L = AR5L rcadd AR0
|
||||
BANZ nextsamp2,AR4--
|
||||
LRETR
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn _CFFT32_win_dual
|
||||
;;! \brief Complex FFT Windowing Function (both real and imaginary parts)
|
||||
;;! \param CFFT32_handle pointer to an CFFT32 object
|
||||
;;
|
||||
;; This function applies a window to an N-point complex data sequence
|
||||
;; that has already been stored in bit-reversed format in the location pointed
|
||||
;; to by "ipcbptr". It is to be used with the complex FFT module
|
||||
;;
|
||||
;; For an N-pt complex FFT, the stored windows are of size N/2 (they are symmetrical).
|
||||
;; This routine will apply the window in two steps
|
||||
;;
|
||||
;; Step 1: Forward walk through win
|
||||
;; Loop for i = 0 to N/2 - 1 {
|
||||
;; p -> ipcbptr, q -> win
|
||||
;; a = *p (Q31) , b = *q (Q31)
|
||||
;; c = *(p+1) (Q31), d = *q(Q31)
|
||||
;; n = sizeof(ipcbptr) = 2(32-bit wide)*N
|
||||
;; temp1 = ((a x b) >> 32)
|
||||
;; = ((A * 2^31 x B * 2^31) x 2^-32) where A and B are the unscaled decimal values
|
||||
;; = A x B x 2^30 (Q30)
|
||||
;; temp2 = ((c x d) >> 32)
|
||||
;; = ((C * 2^31 x D * 2^31) x 2^-32) where C and D are the unscaled decimal values
|
||||
;; = C x D x 2^30 (Q30)
|
||||
;; temp1 = temp1 << 1 (Q31)
|
||||
;; temp2 = temp2 << 1 (Q31)
|
||||
;; *p = temp1 , *(p+1) = temp2
|
||||
;; p = p rcadd n (this is the bit reversed address)
|
||||
;; q = q + 1
|
||||
;; }
|
||||
;;
|
||||
;; Step 2: Backward walk through win
|
||||
;; Loop for i = N/2 to N - 1 {
|
||||
;; p -> ipcbptr(from the last step), q -> win(N/2)
|
||||
;; a = *p (Q31) , b = *q (Q31)
|
||||
;; c = *(p+1) (Q31), d = *q(Q31)
|
||||
;; temp1 = (A x B x 2^30) << 1 (Q31)
|
||||
;; temp2 = (C x D x 2^30) << 1 (Q31)
|
||||
;; *p = temp1 , *(p+1) = temp2
|
||||
;; p = p rcadd n (this is the bit reversed address)
|
||||
;; q = q - 1
|
||||
;; }
|
||||
;;=============================================================================
|
||||
;;
|
||||
_CFFT32_win_dual:
|
||||
MOVL XAR5,*XAR4++ ; XAR5 = ipcbptr
|
||||
MOVL XAR6,*+XAR4[ARG_WINPTR] ; XAR6 = winptr
|
||||
MOV ACC,*+XAR4[ARG_SIZE]<<15 ; AH = size'/2
|
||||
MOVH AR0,ACC<<2 ; AR0 = 2(complex)*size'
|
||||
MOVZ AR7,AH ; AR7 = (size'/2)
|
||||
SUBB XAR7,#1 ; AR7 = (size'/2)-1
|
||||
MOVL XAR4,XAR7 ; AR4 = (size'/2)-1
|
||||
|
||||
nextsample1:
|
||||
MOVL XT,*+XAR6[0] ; XT = win[i]
|
||||
QMPYL ACC,XT,*XAR5 ; ACC = (signed XT * signed [*XAR5.real]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *XAR5, ACC ; *XAR5.real = ACC
|
||||
|
||||
MOVL XT,*XAR6++ ; XT = win[i] | i++
|
||||
QMPYL ACC,XT,*+XAR5[2] ; ACC = (signed XT * signed [*XAR5.imag]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *+XAR5[2], ACC ; *XAR5.imag = ACC
|
||||
NOP *BR0++ ; AR5L = AR5L rcadd AR0
|
||||
BANZ nextsample1,AR7--
|
||||
; At the end of this loop, XAR6 points to the
|
||||
; N/2 th element of the real input
|
||||
nextsample2:
|
||||
MOVL XT,*--XAR6 ; XT = win[i]
|
||||
QMPYL ACC,XT,*XAR5 ; ACC = (signed XT * signed [*XAR5.real]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *XAR5, ACC ; *XAR5.real = ACC
|
||||
|
||||
MOVL XT,*+XAR6[0] ; XT = win[i] | i--
|
||||
QMPYL ACC,XT,*+XAR5[2] ; ACC = (signed XT * signed [*XAR5.imag]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *+XAR5[2], ACC ; *XAR5.imag = ACC
|
||||
NOP *BR0++ ; AR5L = AR5L rcadd AR0
|
||||
BANZ nextsample2,AR4--
|
||||
LRETR
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
|
||||
@@ -0,0 +1,794 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/FFT32_calc.asm
|
||||
;;!
|
||||
;;! \brief Complex FFT (radix-2 DIT) Calculation Function
|
||||
;;!
|
||||
;;! \date Feb 26, 2002
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
.include "sel_q.asm"
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
.if __TI_EABI__
|
||||
.asg FFT32_calc, _FFT32_calc
|
||||
.endif
|
||||
|
||||
.def _FFT32_calc
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <--------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
|
||||
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;;}CFFT32;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void FFT32_calc(FFT32_handle)
|
||||
;; This function implements complex FFT using radix-2 DIT algo
|
||||
;;
|
||||
COS45K_LSW .set 799Bh
|
||||
COS45K_MSW .set 5A82h
|
||||
;===============================================================================
|
||||
; FFT - Computation Routine (FFT128R_calc)
|
||||
;===============================================================================
|
||||
; * This routine takes the 128 point complex data sequence, in bit reversed form
|
||||
; * It implements Decimation in time FFT algorithm
|
||||
; * Performs inplace computation
|
||||
; * Output in-order data "IPCB"----> Xr(0),Xi(0),Xr(1),Xi(1)...Xr(127)&Xi(127)
|
||||
;===============================================================================
|
||||
;----------------------------------------------------
|
||||
; MACRO 'ZEROI'
|
||||
; Number of WORDS/Number of Cycles 12
|
||||
; USAGE: Called if the TWIDDLE FACTOR: 1
|
||||
;
|
||||
; P=PR+jPI, Q=QR+jQI, W=WR-jWI
|
||||
; P'=P+W*Q and Q'=P-W*Q
|
||||
;
|
||||
; POINTERS AT ENTRY
|
||||
; AR6->(PR,PI,PR+1,PI+1,PR+2,PI+2,....)
|
||||
; AR2->(QR,QI,QR+1,QI+1,QR+2,QR+2,....)
|
||||
; COMPUTATION PERFORMED: INPLACE COMPUTATION
|
||||
; AR6 -> PR'=(PR+QR)/2
|
||||
; AR2 -> QR'=(PR-QR)/2
|
||||
; AR6+1 -> PI'=(PI+QI)/2
|
||||
; AR2+1 -> QI'=(PI-QI)/2
|
||||
; PR and PR', PI and PI', QR and QR', QI and QI' are
|
||||
; stored in the same locations
|
||||
; POINTERS AT EXIT
|
||||
; AR6->(PR+1,PI+1,....)
|
||||
; AR2->(QR+1,QI+1,....)
|
||||
;------------------------------------------------------
|
||||
; (Content of REG after exec.)
|
||||
ZEROI .macro ; AR6 AR2
|
||||
MOVL ACC,*XAR6 ; ACC:=PR PR QR
|
||||
SFR ACC,#1 ; ACC:=PR/2 PR QR
|
||||
MOVL P,*XAR2 ; P=QR PR QR
|
||||
ADDL ACC,P<<PM ; ACC=PR+QR/2 PR QR
|
||||
MOVL *XAR6++,ACC ; PR':=(PR+QR)/2 PI QR
|
||||
SUBL ACC,P ; ACC:=(PR-QR)/2 PI QR
|
||||
MOVL *XAR2++,ACC ; QR':=(PR-QR)/2 PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC:=PI PI QI
|
||||
SFR ACC,#1 ; ACC:=PI/2 PI QI
|
||||
MOVL P,*XAR2 ; P=QI PI QI
|
||||
ADDL ACC,P<<PM ; ACC:=(PI+QI)/2 PI QI
|
||||
MOVL *XAR6++,ACC ; PI':=(PI+QI)/2 PR+1 QI
|
||||
SUBL ACC,P ; ACC:=(PI-QI)/2 PR+1 QI
|
||||
MOVL *XAR2++,ACC ; QR':=(PI-QI)/2 PR+1 QR+1
|
||||
.endm
|
||||
|
||||
;----------------------------------------------------
|
||||
; MACRO 'PBY2I'
|
||||
; Number of WORDS/Number of Cycles 12
|
||||
; USAGE: Called if the TWIDDLE FACTOR: -j
|
||||
;
|
||||
; P=PR+jPI, Q=QR+jQI, W=WR-jWI
|
||||
; P'=P+W*Q and Q'=P-W*Q
|
||||
;
|
||||
; POINTERS AT ENTRY
|
||||
; AR6->(PR,PI,PR+1,PI+1,PR+2,PI+2,....)
|
||||
; AR2->(QR,QI,QR+1,QI+1,QR+2,QR+2,....)
|
||||
; COMPUTATION PERFORMED: INPLACE COMPUTATION
|
||||
; AR6 -> PR'=(PR+QI)/2
|
||||
; AR2 -> QR'=(PR-QI)/2
|
||||
; AR6+1 -> PI'=(PI-QR)/2
|
||||
; AR2+1 -> QI'=(PI+QR)/2
|
||||
; PR and PR', PI and PI', QR and QR', QI and QI' are
|
||||
; stored in the same locations
|
||||
; POINTERS AT EXIT
|
||||
; AR6->(PR+1,PI+1,....)
|
||||
; AR2->(QR+1,QI+1,....)
|
||||
;------------------------------------------------------
|
||||
; (Content of REG after exec.)
|
||||
PBY2I .macro ; AR6 AR2
|
||||
MOVL XAR5,*XAR2++ ; XAR5=QR PR QI
|
||||
MOVL ACC,*XAR6 ; ACC:=PR PR QI
|
||||
SFR ACC,#1 ; ACC:=PR/2 PR QI
|
||||
MOVL P,*XAR2 ; P:=QI PR QI
|
||||
ADDL ACC,P<<PM ; ACC:=(PR+QI)/2 PR QI
|
||||
MOVL *XAR6++,ACC ; PR':=(PR+QI)/2 PI QI
|
||||
SUBL ACC,P ; ACC:=(PR-QI)/2 PI QI
|
||||
MOVL *--XAR2,ACC ; QR':=(PR-QI)/2 PI QR
|
||||
ADDB XAR2,#2 ; PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC:=PI PI QI
|
||||
SFR ACC,#1 ; ACC:=PI/2 PI QI
|
||||
MOVL P,XAR5 ; P=QR PI QI
|
||||
SUBL ACC,P<<PM ; ACC=(PI-QR)/2 PI QI
|
||||
MOVL *XAR6++,ACC ; ACC:=(PI-QR)/2 PR+1 QI
|
||||
ADDL ACC,P ; ACC:=(PI+QR)/2 PR+1 QI
|
||||
MOVL *XAR2++,ACC ; QI':=(PI+QR)/2 PR+1 QR+1
|
||||
|
||||
.endm
|
||||
|
||||
;----------------------------------------------------
|
||||
; MACRO 'PBY4I' SPM set to 1bit right shift, XT=w
|
||||
; Number of WORDS/Number of Cycles 16
|
||||
; USAGE: Called if the TWIDDLE FACTOR: COS(45)-jSIN(45)=0.707-j0.707
|
||||
;
|
||||
; P=PR+jPI, Q=QR+jQI, W=WR-jWI
|
||||
; P'=P+W*Q and Q'=P-W*Q
|
||||
;
|
||||
; POINTERS AT ENTRY
|
||||
; TREG=W=|SIN(45)|=|COS(45)|=05a82h
|
||||
; AR6->(PR,PI,PR+1,PI+1,PR+2,PI+2,....)
|
||||
; AR2->(QR,QI,QR+1,QI+1,QR+2,QR+2,....)
|
||||
; CALCULATION PERFORMED: INPLACE COMPUTATION
|
||||
; AR6 -> PR'=(PR+QI*W+QR*W)/2
|
||||
; AR2 -> QR'=(PR-QI*W-QR*W)/2
|
||||
; AR6+1 -> PI'=(PI+QI*W-QR*W)/2
|
||||
; AR2+1 -> QI'=(PI-QI*W+QR*W)/2
|
||||
; PR and PR', PI and PI', QR and QR', QI and QI' are
|
||||
; stored in the same locations
|
||||
; POINTERS AT EXIT
|
||||
; AR6->(PR+1,PI+1,....)
|
||||
; AR2->(QR+1,QI+1,....)
|
||||
;------------------------------------------------------
|
||||
; (Content of REG after exec.)
|
||||
PBY4I .macro ; PREG AR6 AR2
|
||||
; - PR QR
|
||||
MOVL ACC,*XAR6 ; ACC=PR - PR QR
|
||||
SFR ACC,#1 ; ACC=PR/2 - PR QR
|
||||
QMPYL P,XT,*XAR2 ; PREG=W*QR/2 W*QR/2 PR QR
|
||||
SUBL ACC,P ; ACC=(PR-W*QR)/2 W*QR/2 PR QR
|
||||
MOVL XAR5,P ; XAR5=W*QR/2
|
||||
QMPYL P,XT,*+XAR2[2] ; ACC=(PR-W*QR)/2 W*QI/2 PR QR
|
||||
SUBL ACC,P ; ACC=(PR-W*QI-W*QR)/2 W*QI/2 PR QR
|
||||
MOVL *XAR2++,ACC ; QR'=(PR-W*QI-W*QR)/2 W*QI/2 PR QI
|
||||
NEG ACC ; ACC=-(PR-W*QI-W*QR)/2 W*QI/2 PR QI
|
||||
ADDL *XAR6++,ACC ; PR'=(PR+W*QI+W*QR)/2 W*QI/2 PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=PI W*QI/2 PI QI
|
||||
SFR ACC,#1 ; ACC=PI/2 W*QI/2 PI QI
|
||||
SUBL ACC,P ; ACC=(PI-W*QI)/2 W*QI/2 PI QI
|
||||
ADDL ACC,XAR5 ; ACC=(PI-W*QI+W*QR)/2 W*QR/2 PI QI
|
||||
MOVL *XAR2++,ACC ; QI'=(PI-W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
NEG ACC ; ACC=-(PI-W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
ADDL *XAR6++,ACC ; PI'=(PI+W*QI-W*QR)/2 W*QR/2 PR+1 QR+1
|
||||
.endm
|
||||
|
||||
|
||||
;----------------------------------------------------
|
||||
; MACRO 'P3BY4I' SPM set to 1bit right shift, XT=w
|
||||
; Number of WORDS/Number of Cycles 16
|
||||
; USAGE: Called if the TWIDDLE FACTOR: COS(90+45)-jSIN(90+45)=-0.707-j0.707
|
||||
;
|
||||
; P=PR+jPI, Q=QR+jQI, W=WR-jWI
|
||||
; P'=P+W*Q and Q'=P-W*Q
|
||||
;
|
||||
; POINTERS AT ENTRY
|
||||
; TREG=W=|SIN(135)|=|COS(135)|=05a82h
|
||||
; AR6->(PR,PI,PR+1,PI+1,PR+2,PI+2,....)
|
||||
; AR2->(QR,QI,QR+1,QI+1,QR+2,QR+2,....)
|
||||
; CALCULATION PERFORMED: INPLACE COMPUTATION
|
||||
; AR6 -> PR'=(PR+QI*W-QR*W)/2
|
||||
; AR2 -> QR'=(PR-QI*W+QR*W)/2
|
||||
; AR6+1 -> PI'=(PI-QI*W-QR*W)/2
|
||||
; AR2+1 -> QI'=(PI+QI*W+QR*W)/2
|
||||
; PR and PR', PI and PI', QR and QR', QI and QI' are
|
||||
; stored in the same locations
|
||||
; POINTERS AT EXIT
|
||||
; AR6->(PR+1,PI+1,....)
|
||||
; AR2->(QR+1,QI+1,....)
|
||||
;------------------------------------------------------
|
||||
; (Content of REG after exec.)
|
||||
P3BY4I .macro ; AR5 PREG AR6 AR2
|
||||
; - PR QR
|
||||
MOVL ACC,*XAR6 ; ACC=PR - PR QR
|
||||
SFR ACC,#1 ; ACC=PR/2 - PR QR
|
||||
QMPYL P,XT,*XAR2 ; PREG=W*QR/2 W*QR/2 PR QR
|
||||
ADDL ACC,P ; ACC=(PR+W*QR)/2 W*QR/2 PR QR
|
||||
MOVL XAR5,P ; XAR5=W*QR/2 W*QR/2 PR QR
|
||||
QMPYL P,XT,*+XAR2[2] ; ACC=(PR+W*QR)/2 W*QI/2 PR QR
|
||||
SUBL ACC,P ; ACC=(PR-W*QI+W*QR)/2 W*QI/2 PR QR
|
||||
MOVL *XAR2++,ACC ; QR'=(PR-W*QI+W*QR)/2 W*QI/2 PR QI
|
||||
NEG ACC ; ACC=-(PR-W*QI+W*QR)/2 W*QI/2 PR QI
|
||||
ADDL *XAR6++,ACC ; PR'=(PR+W*QI-W*QR)/2 W*QI/2 PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=PI W*QI/2 PI QI
|
||||
SFR ACC,#1 ; ACC=PI/2 W*QI/2 PI QI
|
||||
ADDL ACC,P ; ACC=(PR+W*QI)/2 W*QI/2 PI QI
|
||||
ADDL ACC,XAR5 ; ACC=(PI+W*QI+W*QR)/2 W*QR/2 PI QI
|
||||
NOP *,ARP2
|
||||
MOVL *0++,ACC ; QI'=(PI+W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
NEG ACC ; ACC=-(PI+W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
ADDL *XAR6,ACC ; PI'=(PI-W*QI-W*QR)/2 W*QR/2 PI QR+1
|
||||
NOP *0++ ; W*QR/2 PR+1 QR+1
|
||||
.endm
|
||||
|
||||
|
||||
;----------------------------------------------------
|
||||
; MACRO 'BFLY' SPM set to 1bit right shift
|
||||
; Number of WORDS/Number of Cycles 21
|
||||
; USAGE: General Butterfly RADIX 2 -> TWIDDLE FACTOR W=WR-jWI
|
||||
;
|
||||
; P=PR+jPI, Q=QR+jQI, W=WR-jWI
|
||||
; P'=P+W*Q and Q'=P-W*Q
|
||||
;
|
||||
; REGISTER USED: XAR0,XAR2,XAR3,XAR4,XAR5,XAR6,ACC,XT,P
|
||||
;
|
||||
; POINTERS AT ENTRY
|
||||
; AR6->(PR,PI,PR+1,PI+1,PR+2,PI+2,....)
|
||||
; AR2->(QR,QI,QR+1,QI+1,QR+2,QR+2,....)
|
||||
; AR3-> Real Part of Twiddle Factor: WR(COSx)
|
||||
; AR4-> Imaginary Part of Twiddle Factor: WI(SINx)
|
||||
; AR5-> Temporary Variable
|
||||
; CALCULATION PERFORMED: INPLACE COMPUTATION
|
||||
; AR6 -> PR'=(PR+QR*WR+QI*WI)/2
|
||||
; AR2 -> QR'=(PR-QR*WR-QI*WI)/2
|
||||
; AR6+1 -> PI'=(PI+QI*WR-QR*WI)/2
|
||||
; AR2+1 -> QI'=(PI-QI*WR+QR*WI)/2
|
||||
; PR and PR', PI and PI', QR and QR', QI and QI' are
|
||||
; stored in the same locations
|
||||
; POINTERS AT EXIT
|
||||
; AR6->(PR+1,PI+1,....)
|
||||
; AR2->(QR+1,QI+1,....)
|
||||
; AR3-> Real Part of Next Twiddle Factor
|
||||
; AR4-> Imaginary Part ofNext Twiddle Factor
|
||||
;------------------------------------------------------
|
||||
|
||||
BFLY .macro p ; XT AR6 AR2 AR3 AR4
|
||||
; - PR QR WR WI
|
||||
MOVL XT,*XAR3 ; XT=WR WR PR QR WR WI
|
||||
NOP *0++ ; WR PR QR WR+n WI
|
||||
QMPYL P,XT,*XAR2++ ; P=QR*WR WR PR QI WR+n WI
|
||||
QMPYL ACC,XT,*,ARP4 ; ACC=QI*WR WR PR QI WR+n WI
|
||||
MOVL *-SP[TEMP],P ; TEMP=QR*WR WR PR QI WR+n WI
|
||||
|
||||
MOVL XT,*0++ ; XT=WI WR PR QI WR+n WI+n
|
||||
QMPYL P,XT,*--XAR2 ; P=WI*QR WR PR QR WR+n WI+n
|
||||
SUBL ACC,P ; ACC=(QI*WR-QR*WI) WR PR QR WR+n WI+n
|
||||
|
||||
.if(TF_QFMAT==Q30)
|
||||
LSL ACC,#1 ; ACC=(QI*WR-QR*WI) (Q30)
|
||||
.endif
|
||||
|
||||
MOVL XAR5,ACC ; XAR5=(QI*WR-QR*WI) (Q30)
|
||||
|
||||
QMPYL ACC,XT,*+XAR2[2] ; ACC=WI*QI WR PR QR WR+n WI+n
|
||||
ADDL ACC,*-SP[TEMP] ; ACC=(QR*WR+QI*WI) WR PR QR WR+n WI+n
|
||||
|
||||
.if(TF_QFMAT==Q30)
|
||||
LSL ACC,#1 ; ACC=(QR*WR+QI*WI) in Q30
|
||||
.endif
|
||||
|
||||
MOVL P,*XAR6 ; P=PR WR PR QR WR+n WI+n
|
||||
ADDL ACC,P<<PM ; ACC=(PR+QR*WR+QI*WI)/2 WR PR QR WR+n WI+n
|
||||
MOVL *XAR6++,ACC ; PR'=(PR+QR*WR+QI*WI)/2 WR PI QR WR+n WI+n
|
||||
|
||||
SUBL P,ACC ; P=(PR-QR*WR-QI*WI)/2 WR PI QR WR+n WI+n
|
||||
MOVL *XAR2++,P ; QR'=(PR-QR*WR-QI*WI)/2 WR PI QI WR+n WI+n
|
||||
|
||||
MOVL ACC,XAR5 ; ACC=(QI*WR-QR*WI)/2 WR PI QI WR+n WI+n
|
||||
MOVL P,*XAR6 ; P=PI WR PI QI WR+n WI+n
|
||||
ADDL ACC,P<<PM ; ACC=(PI+QI*WR-QR*WI)/2 WR PI QI WR+n WI+n
|
||||
MOVL *XAR6++,ACC ; (PI+QI*WR-QR*WI)/2 WR PR+1 QI WR+n WI+n
|
||||
|
||||
SUBL P,ACC ; P=(PI-QI*WR+QR*WI)/2 WR PR+1 QI WR+n WI+n
|
||||
MOVL *XAR2++,P ; QI'=(PI-QI*WR+QR*WI)/2 WR PR+1 QR+1 WR+n WI+n
|
||||
.endm
|
||||
|
||||
|
||||
;----------------------------------------------------
|
||||
; MACRO 'COMBO' SPM set to 1bit right shift
|
||||
; Number of WORDS/Number of Cycles 33
|
||||
; USAGE: RADIX 4 USED AT THE FIRST STAGE
|
||||
;
|
||||
; REGISTER USED: XAR0,XAR1,XAR2,XAR3,XAR4,XAR5,XAR6,ACC,XT,P
|
||||
;
|
||||
; POINTERS AT ENTRY
|
||||
; AR6->(R1,I1)
|
||||
; AR2->(R2,I2)
|
||||
; AR3->(R3,I3)
|
||||
; AR4->(R4,I4)
|
||||
; AR5-> Temporary Variable
|
||||
; CALCULATION PERFORMED: INPLACE COMPUTATION
|
||||
; AR6 -> R1'=(R1+R2+R3+R4)/4
|
||||
; AR2 -> R2'=(R1-R2+I3-I4)/4
|
||||
; AR3 -> R3'=(R1+R2-R3-R4)/4
|
||||
; AR4 -> R4'=(R1-R2-I3+I4)/4
|
||||
; AR6+1 -> I1'=(I1+I2+I3+I4)/4
|
||||
; AR2+1 -> I2'=(I1-I2-R3+R4)/4
|
||||
; AR3+1 -> I3'=(I1+I2-I3-I4)/4
|
||||
; AR4+1 -> I4'=(I1-I2+R3-R4)/4
|
||||
; POINTERS AT EXIT
|
||||
; AR6->(R5,I5)
|
||||
; AR2->(R6,I6)
|
||||
; AR3->(R7,I7)
|
||||
; AR4->(R8,I8)
|
||||
;---------------------------------------------------
|
||||
; (Content of REG after exec.)
|
||||
COMBO .macro ; AR6 AR2 AR3 AR4
|
||||
MOVL ACC,*XAR3 ; ACC=R3 R1 R2 R3 R4
|
||||
SFR ACC,#1 ; ACC=R3/2
|
||||
MOVL P,*XAR4 ; P=R4
|
||||
SUBL ACC,P<<PM ; ACC=(R3-R4)/2
|
||||
MOVL XT,ACC ; T=(R3-R4)/2
|
||||
ADDL ACC,P ; ACC=(R3+R4)/2
|
||||
MOVL XAR1,ACC ; XAR1=(R3+R4)/2
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=R1
|
||||
SFR ACC,#1 ; ACC=R1/2
|
||||
MOVL P,*XAR2 ; P=R2
|
||||
SUBL ACC,P<<PM ; ACC=R1-R2/2
|
||||
MOVL *-SP[TEMP],ACC ; temp=(R1-R2)/2
|
||||
ADDL ACC,*XAR2 ; ACC=(R1+R2)/2
|
||||
|
||||
SFR ACC,#1 ; ACC=(R1+R2)/4
|
||||
MOVL P,XAR1 ; P=(R3+R4)/2
|
||||
ADDL ACC,P<<PM ; ACC=(R1+R2+R3+R4)/4
|
||||
MOVL *XAR6++,ACC ; R1'=(R1+R2+R3+R4)/4
|
||||
SUBL ACC,P ; ACC=(R1+R2-R3-R4)/4
|
||||
MOVL *XAR3++,ACC ; R3'=(R1+R2-R3-R4)/4
|
||||
|
||||
MOVL ACC,*XAR3 ; ACC=I3
|
||||
SFR ACC,#1 ; ACC=I3/2
|
||||
MOVL P,*+XAR4[2] ; P=I4
|
||||
SUBL ACC,P<<PM ; ACC=(I3-I4)/2
|
||||
MOVL XAR1,ACC ; XAR1=(I3-I4)/2
|
||||
ADDL ACC,P ; ACC=(I3+I4)/2
|
||||
MOVL XAR5,ACC ; XAR5=(I3+I4)/2
|
||||
|
||||
MOVL ACC,*-SP[TEMP] ; ACC=(R1-R2)/2
|
||||
SFR ACC,#1 ; ACC=(R1-R2)/4
|
||||
MOVL P,XAR1 ; P=(I3-I4)/2
|
||||
ADDL ACC,P<<PM ; ACC=(R1-R2+I3-I4)/4
|
||||
MOVL *XAR2++,ACC ; R2'=(R1-R2+I3-I4)/4
|
||||
SUBL ACC,P ; ACC=(R1-R2-I3+I4)/4
|
||||
MOVL *XAR4++,ACC ; R4'=(R1-R2-I3+I4)/4
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=I1
|
||||
SFR ACC,#1 ; ACC=I1/2
|
||||
MOVL P,*XAR2 ; P=I2
|
||||
SUBL ACC,P<<PM ; ACC=(I1-I2)/2
|
||||
MOVL *-SP[TEMP],ACC ; temp=(I1-I2)/2
|
||||
ADDL ACC,P ; ACC=(I1+I2)/2
|
||||
|
||||
SFR ACC,#1 ; ACC=(I1+I2)/4
|
||||
MOVL P,XAR5 ; P=(I3+I4)/2
|
||||
ADDL ACC,P<<PM ; ACC=(I1+I2+I3+I4)/4
|
||||
MOVL *XAR6,ACC ; I1'=(I1+I2+I3+I4)/4
|
||||
NOP *0++
|
||||
SUBL ACC,P ; ACC=(I1+I2-I3-I4)/4
|
||||
MOVL *XAR3,ACC ; I3'=(I1+I2-I3-I4)/4
|
||||
NOP *0++
|
||||
|
||||
|
||||
MOVL ACC,*-SP[TEMP] ; ACC=(I1-I2)/2
|
||||
SFR ACC,#1 ; ACC=(I1-I2)/4
|
||||
MOVL P,XT ; P=(R3-R4)/2
|
||||
ADDL ACC,P<<PM ; ACC=ACC=(I1-I2+R3-R4)/4
|
||||
MOVL *XAR4,ACC ; I4'=(I1-I2+R3-R4)/4
|
||||
NOP *0++
|
||||
SUBL ACC,P ; ACC=(I1-I2-R3+R4)/4
|
||||
MOVL *XAR2,ACC ; I2'=(I1-I2-R3+R4)/4
|
||||
NOP *0++
|
||||
.endm
|
||||
|
||||
|
||||
;====================================================================
|
||||
; Function Local Frame
|
||||
;====================================================================
|
||||
; |_______|
|
||||
; |_______|<- Stack Pointer (SP) <---SP
|
||||
; |_______|<- GLCB (SP-1)
|
||||
; |_______|<- BLC (Butterfly loop counter) (SP-2)
|
||||
; |_______|<- GLC (Group loop counter) (SP-3)
|
||||
; |_______|<- SLC (Stage loop counter) (SP-4)
|
||||
; |_______|<- TOST (Twiddle offset, for decimation) (SP-5)
|
||||
; |_______|<- DOST (Data offset) (SP-6)
|
||||
; |_______|<- TEMP (SP-7) & (SP-8)
|
||||
;===================================================================
|
||||
FFT_LOCAL_FRAME .set 10
|
||||
GLCB .set 1
|
||||
BLC .set 2
|
||||
GLC .set 3
|
||||
SLC .set 4
|
||||
TOST .set 5
|
||||
DOST .set 6
|
||||
TEMP .set 8
|
||||
WRWIOST .set 9
|
||||
|
||||
|
||||
_FFT32_calc:
|
||||
PUSH XAR1 ; Context Save
|
||||
PUSH XAR2
|
||||
PUSH XAR3
|
||||
ADDB SP,#FFT_LOCAL_FRAME ; Create Local Frame
|
||||
|
||||
SETC SXM
|
||||
SPM -1 ; SPM set to 1bit right shift
|
||||
|
||||
MOVL XAR7,XAR4 ; XAR7->FFT_handle
|
||||
MOVL XAR2,*XAR7 ; XAR2=ipcbptr
|
||||
MOVL XAR3,XAR2 ; XAR3=ipcbptr
|
||||
MOVL XAR4,XAR2 ; XAR4=ipcbptr
|
||||
|
||||
MOVL XAR6,XAR2 ; XAR6=ipcbptr
|
||||
ADDB XAR2,#4 ; XAR2=ipcbptr+4
|
||||
ADDB XAR3,#8 ; XAR3=ipcbptr+8
|
||||
ADDB XAR4,#12 ; XAR4=ipcbptr+12
|
||||
MOVB XAR0,#14 ; XAR0=14
|
||||
|
||||
;-----------------------------------------------------------------
|
||||
; Stage 1 & 2 - Using the RADIX 4 COMBO Macro
|
||||
;-----------------------------------------------------------------
|
||||
;; +--------------------------------------+
|
||||
;; InPtr OutPtr | Stages 1 & 2 |
|
||||
;; +-----+--------------------------------+
|
||||
;; XAR6-> XAR6-> R(1) | R1' = (R1 + R2) + (R3 + R4) |
|
||||
;; I(1) | I1' = (I1 + I2) + (I3 + I4) |
|
||||
;; R(2) | R2' = (R1 - R2) + (I3 - I4) |
|
||||
;; I(2) | I2' = (I1 - I2) - (R3 - R4) |
|
||||
;; R(3) | R3' = (R1 + R2) - (R3 + R4) |
|
||||
;; I(3) | I3' = (I1 + I2) - (I3 + I4) |
|
||||
;; R(4) | R4' = (R1 - R2) - (I3 - I4) |
|
||||
;; I(4) | I4' = (I1 - I2) + (R3 - R4) |
|
||||
;; +-----+--------------------------------+
|
||||
;; XAR6->R1, XAR2->R2, XAR3->R3, XAR4->R4
|
||||
;;
|
||||
;;------------------------------------------------------------------------
|
||||
MOVL *-SP[2],XAR7 ; (SP-2)=FFT_handle
|
||||
MOV ACC,*+XAR7[4]<<14
|
||||
SUB ACC,#1<<14
|
||||
MOV AR7,AH ; Loop (N/4 - 1) times
|
||||
|
||||
STAGE1_2_LP:
|
||||
MOVL ACC,*XAR3 ; ACC=R3 R1 R2 R3 R4
|
||||
SFR ACC,#1 ; ACC=R3/2
|
||||
MOVL P,*XAR4 ; P=R4
|
||||
SUBL ACC,P<<PM ; ACC=(R3-R4)/2
|
||||
MOVL XT,ACC ; T=(R3-R4)/2
|
||||
ADDL ACC,P ; ACC=(R3+R4)/2
|
||||
MOVL XAR1,ACC ; XAR1=(R3+R4)/2
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=R1
|
||||
SFR ACC,#1 ; ACC=R1/2
|
||||
MOVL P,*XAR2 ; P=R2
|
||||
SUBL ACC,P<<PM ; ACC=R1-R2/2
|
||||
MOVL *-SP[TEMP],ACC ; temp=(R1-R2)/2
|
||||
ADDL ACC,*XAR2 ; ACC=(R1+R2)/2
|
||||
|
||||
SFR ACC,#1 ; ACC=(R1+R2)/4
|
||||
MOVL P,XAR1 ; P=(R3+R4)/2
|
||||
ADDL ACC,P<<PM ; ACC=(R1+R2+R3+R4)/4
|
||||
MOVL *XAR6++,ACC ; R1'=(R1+R2+R3+R4)/4
|
||||
SUBL ACC,P ; ACC=(R1+R2-R3-R4)/4
|
||||
MOVL *XAR3++,ACC ; R3'=(R1+R2-R3-R4)/4
|
||||
|
||||
MOVL ACC,*XAR3 ; ACC=I3
|
||||
SFR ACC,#1 ; ACC=I3/2
|
||||
MOVL P,*+XAR4[2] ; P=I4
|
||||
SUBL ACC,P<<PM ; ACC=(I3-I4)/2
|
||||
MOVL XAR1,ACC ; XAR1=(I3-I4)/2
|
||||
ADDL ACC,P ; ACC=(I3+I4)/2
|
||||
MOVL XAR5,ACC ; XAR5=(I3+I4)/2
|
||||
|
||||
MOVL ACC,*-SP[TEMP] ; ACC=(R1-R2)/2
|
||||
SFR ACC,#1 ; ACC=(R1-R2)/4
|
||||
MOVL P,XAR1 ; P=(I3-I4)/2
|
||||
ADDL ACC,P<<PM ; ACC=(R1-R2+I3-I4)/4
|
||||
MOVL *XAR2++,ACC ; R2'=(R1-R2+I3-I4)/4
|
||||
SUBL ACC,P ; ACC=(R1-R2-I3+I4)/4
|
||||
MOVL *XAR4++,ACC ; R4'=(R1-R2-I3+I4)/4
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=I1
|
||||
SFR ACC,#1 ; ACC=I1/2
|
||||
MOVL P,*XAR2 ; P=I2
|
||||
SUBL ACC,P<<PM ; ACC=(I1-I2)/2
|
||||
MOVL *-SP[TEMP],ACC ; temp=(I1-I2)/2
|
||||
ADDL ACC,P ; ACC=(I1+I2)/2
|
||||
|
||||
SFR ACC,#1 ; ACC=(I1+I2)/4
|
||||
MOVL P,XAR5 ; P=(I3+I4)/2
|
||||
ADDL ACC,P<<PM ; ACC=(I1+I2+I3+I4)/4
|
||||
MOVL *XAR6,ACC ; I1'=(I1+I2+I3+I4)/4
|
||||
NOP *0++
|
||||
SUBL ACC,P ; ACC=(I1+I2-I3-I4)/4
|
||||
MOVL *XAR3,ACC ; I3'=(I1+I2-I3-I4)/4
|
||||
NOP *0++
|
||||
|
||||
|
||||
MOVL ACC,*-SP[TEMP] ; ACC=(I1-I2)/2
|
||||
SFR ACC,#1 ; ACC=(I1-I2)/4
|
||||
MOVL P,XT ; P=(R3-R4)/2
|
||||
ADDL ACC,P<<PM ; ACC=ACC=(I1-I2+R3-R4)/4
|
||||
MOVL *XAR4,ACC ; I4'=(I1-I2+R3-R4)/4
|
||||
NOP *0++
|
||||
SUBL ACC,P ; ACC=(I1-I2-R3+R4)/4
|
||||
MOVL *XAR2,ACC ; I2'=(I1-I2-R3+R4)/4
|
||||
NOP *0++
|
||||
BANZ STAGE1_2_LP,AR7--
|
||||
|
||||
;------------------------------------------------------------------
|
||||
; Stage 3 - Using ZEROI, PBY4I,PBY2I,P3BY4I Macros
|
||||
;------------------------------------------------------------------
|
||||
MOVL XAR7,*-SP[2] ; XAR7=FFT_handle
|
||||
MOVL XAR6,*XAR7 ; XAR6=ipcbptr
|
||||
MOVL XAR2,*XAR7 ; XAR2=ipcbptr
|
||||
ADDB XAR2,#16 ; XAR2=ipcbptr+16
|
||||
MOVB XAR0,#18
|
||||
|
||||
MOV AL,#COS45K_LSW
|
||||
MOV AH,#COS45K_MSW
|
||||
MOVL XT,ACC ; XT=COS(45) in Q31 format
|
||||
|
||||
MOV ACC,*+XAR7[4]<<13
|
||||
SUB ACC,#1<<13
|
||||
MOV AR1,AH ; Loop (N/8 - 1) times
|
||||
|
||||
STAGE3_LP:
|
||||
;;----------------------------------------------------------------
|
||||
;; ZEROI
|
||||
;;----------------------------------------------------------------
|
||||
MOVL ACC,*XAR6 ; ACC:=PR PR QR
|
||||
SFR ACC,#1 ; ACC:=PR/2 PR QR
|
||||
MOVL P,*XAR2 ; P=QR PR QR
|
||||
ADDL ACC,P<<PM ; ACC=PR+QR/2 PR QR
|
||||
MOVL *XAR6++,ACC ; PR':=(PR+QR)/2 PI QR
|
||||
SUBL ACC,P ; ACC:=(PR-QR)/2 PI QR
|
||||
MOVL *XAR2++,ACC ; QR':=(PR-QR)/2 PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC:=PI PI QI
|
||||
SFR ACC,#1 ; ACC:=PI/2 PI QI
|
||||
MOVL P,*XAR2 ; P=QI PI QI
|
||||
ADDL ACC,P<<PM ; ACC:=(PI+QI)/2 PI QI
|
||||
MOVL *XAR6++,ACC ; PI':=(PI+QI)/2 PR+1 QI
|
||||
SUBL ACC,P ; ACC:=(PI-QI)/2 PR+1 QI
|
||||
MOVL *XAR2++,ACC ; QR':=(PI-QI)/2 PR+1 QR+1
|
||||
|
||||
;-------------------------------------------------------------------
|
||||
; PBY4I
|
||||
;-------------------------------------------------------------------
|
||||
MOVL ACC,*XAR6 ; ACC=PR - PR QR
|
||||
SFR ACC,#1 ; ACC=PR/2 - PR QR
|
||||
QMPYL P,XT,*XAR2 ; PREG=W*QR/2 W*QR/2 PR QR
|
||||
SUBL ACC,P ; ACC=(PR-W*QR)/2 W*QR/2 PR QR
|
||||
MOVL XAR5,P ; XAR5=W*QR/2
|
||||
QMPYL P,XT,*+XAR2[2] ; ACC=(PR-W*QR)/2 W*QI/2 PR QR
|
||||
SUBL ACC,P ; ACC=(PR-W*QI-W*QR)/2 W*QI/2 PR QR
|
||||
MOVL *XAR2++,ACC ; QR'=(PR-W*QI-W*QR)/2 W*QI/2 PR QI
|
||||
NEG ACC ; ACC=-(PR-W*QI-W*QR)/2 W*QI/2 PR QI
|
||||
ADDL *XAR6++,ACC ; PR'=(PR+W*QI+W*QR)/2 W*QI/2 PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=PI W*QI/2 PI QI
|
||||
SFR ACC,#1 ; ACC=PI/2 W*QI/2 PI QI
|
||||
SUBL ACC,P ; ACC=(PI-W*QI)/2 W*QI/2 PI QI
|
||||
ADDL ACC,XAR5 ; ACC=(PI-W*QI+W*QR)/2 W*QR/2 PI QI
|
||||
MOVL *XAR2++,ACC ; QI'=(PI-W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
NEG ACC ; ACC=-(PI-W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
ADDL *XAR6++,ACC ; PI'=(PI+W*QI-W*QR)/2 W*QR/2 PR+1 QR+1
|
||||
|
||||
;------------------------------------------------------------------
|
||||
; PBY2I
|
||||
;------------------------------------------------------------------
|
||||
MOVL XAR5,*XAR2++ ; XAR5=QR PR QI
|
||||
MOVL ACC,*XAR6 ; ACC:=PR PR QI
|
||||
SFR ACC,#1 ; ACC:=PR/2 PR QI
|
||||
MOVL P,*XAR2 ; P:=QI PR QI
|
||||
ADDL ACC,P<<PM ; ACC:=(PR+QI)/2 PR QI
|
||||
MOVL *XAR6++,ACC ; PR':=(PR+QI)/2 PI QI
|
||||
SUBL ACC,P ; ACC:=(PR-QI)/2 PI QI
|
||||
MOVL *--XAR2,ACC ; QR':=(PR-QI)/2 PI QR
|
||||
ADDB XAR2,#2 ; PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC:=PI PI QI
|
||||
SFR ACC,#1 ; ACC:=PI/2 PI QI
|
||||
MOVL P,XAR5 ; P=QR PI QI
|
||||
SUBL ACC,P<<PM ; ACC=(PI-QR)/2 PI QI
|
||||
MOVL *XAR6++,ACC ; ACC:=(PI-QR)/2 PR+1 QI
|
||||
ADDL ACC,P ; ACC:=(PI+QR)/2 PR+1 QI
|
||||
MOVL *XAR2++,ACC ; QI':=(PI+QR)/2 PR+1 QR+1
|
||||
|
||||
;--------------------------------------------------------------------
|
||||
; P3BY4I ; AR7 at end, Use *0+ modify
|
||||
;--------------------------------------------------------------------
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=PR - PR QR
|
||||
SFR ACC,#1 ; ACC=PR/2 - PR QR
|
||||
QMPYL P,XT,*XAR2 ; PREG=W*QR/2 W*QR/2 PR QR
|
||||
ADDL ACC,P ; ACC=(PR+W*QR)/2 W*QR/2 PR QR
|
||||
MOVL XAR5,P ; XAR5=W*QR/2 W*QR/2 PR QR
|
||||
QMPYL P,XT,*+XAR2[2] ; ACC=(PR+W*QR)/2 W*QI/2 PR QR
|
||||
SUBL ACC,P ; ACC=(PR-W*QI+W*QR)/2 W*QI/2 PR QR
|
||||
MOVL *XAR2++,ACC ; QR'=(PR-W*QI+W*QR)/2 W*QI/2 PR QI
|
||||
NEG ACC ; ACC=-(PR-W*QI+W*QR)/2 W*QI/2 PR QI
|
||||
ADDL *XAR6++,ACC ; PR'=(PR+W*QI-W*QR)/2 W*QI/2 PI QI
|
||||
|
||||
MOVL ACC,*XAR6 ; ACC=PI W*QI/2 PI QI
|
||||
SFR ACC,#1 ; ACC=PI/2 W*QI/2 PI QI
|
||||
ADDL ACC,P ; ACC=(PR+W*QI)/2 W*QI/2 PI QI
|
||||
ADDL ACC,XAR5 ; ACC=(PI+W*QI+W*QR)/2 W*QR/2 PI QI
|
||||
NOP *,ARP2
|
||||
MOVL *0++,ACC ; QI'=(PI+W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
NEG ACC ; ACC=-(PI+W*QI+W*QR)/2 W*QR/2 PI QR+1
|
||||
ADDL *XAR6,ACC ; PI'=(PI-W*QI-W*QR)/2 W*QR/2 PI QR+1
|
||||
NOP *0++ ; W*QR/2 PR+1 QR+1
|
||||
|
||||
BANZ STAGE3_LP,AR1--
|
||||
|
||||
;--------------------------------------------------------
|
||||
; Stage 4 to LOG2(N) - Using BFLY Macro
|
||||
;--------------------------------------------------------
|
||||
; Initialization
|
||||
; 1. Initialize the Butterfly loop(BLC), Group loop(GLC) & Stage loop counter(SLC)
|
||||
; 2. Initialize the Data offset(DOST) and twiddle factor offset (TOST)
|
||||
MOV ACC,*+XAR7[4]<<12 ; AH=(N/16)
|
||||
MOV *-SP[GLCB],AH ; GLCB=N/16
|
||||
MOV *-SP[GLC],AH ; GLC=N/16
|
||||
MOVB *-SP[BLC],#8,UNC; BLC=8
|
||||
|
||||
; Twiddle factor offset
|
||||
LSL ACC,#1
|
||||
MOV T,AH ; T=N/8
|
||||
ADDB XAR7,#13
|
||||
MPY ACC,T,*XAR7 ; ACC=ratio*N/8
|
||||
SUBB XAR7,#13
|
||||
MOV *-SP[TOST],AL ; TOST=ratio*N/8
|
||||
|
||||
MOV ACC,*+XAR7[5] ; ACC=nrstage
|
||||
SUB ACC,#3 ; ACC=nrstage-3
|
||||
MOV *-SP[SLC],AL ; SLC=nrState-3
|
||||
MOVB *-SP[DOST],#32,UNC ; DOST=32
|
||||
|
||||
MOV ACC,*+XAR7[4]<<15 ; AH=N/2
|
||||
ADDB XAR7,#13
|
||||
MOV T,*XAR7 ; T=ratio
|
||||
SUBB XAR7,#13
|
||||
MPY ACC,T,AH ; ACC=ratio*N/2
|
||||
ADDL ACC,*+XAR7[2] ;
|
||||
MOVL *-SP[WRWIOST],ACC ; WRWIOST=tfptr+ratio*N/2 ----> COS(Angle)
|
||||
|
||||
|
||||
SLP: ; Stage loop
|
||||
MOVL XAR6,*XAR7 ; XAR6=ipcbptr -----> P
|
||||
MOVL ACC,*XAR7 ; ACC=ipcbptr
|
||||
ADD ACC,*-SP[DOST] ; ACC=ipcbptr+DOST
|
||||
MOVL XAR2,ACC ; XAR2->ipcbptr+DOST -----> Q
|
||||
|
||||
MOVZ AR0,*-SP[TOST] ; AR0=TOST
|
||||
|
||||
|
||||
GLP: ; Group loop
|
||||
MOVL XAR3,*-SP[WRWIOST]
|
||||
MOVL XAR4,*+XAR7[2] ; XAR4=tfptr ---> SIN(Angle)
|
||||
|
||||
MOVZ AR1,*-SP[BLC] ; AR1=BLC
|
||||
SUBB XAR1,#1
|
||||
BLP:
|
||||
;-------------------------------------------------------------
|
||||
; Butterfly loop
|
||||
; BFLY 7
|
||||
;-------------------------------------------------------------
|
||||
BFLY 7
|
||||
BANZ BLP,AR1-- ; Butterfly loop
|
||||
|
||||
; Operations performed between the group
|
||||
; 1. Manipulating the P & Q pointer to point to the next group
|
||||
; 2. Reinitializing the WI and WR twiddle factor pointer
|
||||
; 3. Decrementing the Group Count by 1, till all the group in the stage is computed
|
||||
; 4. Reinitializing the Butterfly loop index for next group
|
||||
; ARP=AR2
|
||||
MOVU ACC,*-SP[DOST] ; ACC=DOST
|
||||
ADDL XAR6,ACC
|
||||
ADDL XAR2,ACC
|
||||
DEC *-SP[GLC]
|
||||
BF GLP,NEQ ; Group Loop
|
||||
|
||||
; Operation Performed, between the stage
|
||||
; 1. Multiply the data offset by 2
|
||||
; 2. Divide the Group count by 2
|
||||
; 3. Divide the Twiddle offset by 2
|
||||
; 4. Multiply the butterfly count by 2
|
||||
; 5. Decrementing the stage count by 1, till all the stage gets over
|
||||
; 6. Reinitializing the P & Q data pointer to the first group of next stage
|
||||
MOV ACC,*-SP[DOST]<<1
|
||||
MOV *-SP[DOST],AL ; DOST=DOST*2
|
||||
|
||||
MOV ACC,*-SP[BLC]<<1
|
||||
MOV *-SP[BLC],AL ; BLC=BLC*2
|
||||
|
||||
MOV ACC,*-SP[TOST]<<15
|
||||
MOV *-SP[TOST],AH ; TOST=TOST/2
|
||||
|
||||
MOV ACC,*-SP[GLCB]<<15
|
||||
MOV *-SP[GLCB],AH ; GLCB=GLCB/2
|
||||
MOV *-SP[GLC],AH ; GLC=GLCB/2
|
||||
|
||||
DEC *-SP[SLC]
|
||||
BF SLP,NEQ ; Stage loop
|
||||
|
||||
SPM 0 ; SPM set to 0
|
||||
|
||||
SUBB SP,#FFT_LOCAL_FRAME ; Clear local frame
|
||||
POP XAR3 ; Context Restore
|
||||
POP XAR2
|
||||
POP XAR1
|
||||
LRETR
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,735 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/FFT32_init.asm
|
||||
;;!
|
||||
;;! \brief This file holds the twiddle factors for the FFT and its initialization
|
||||
;;! function
|
||||
;;!
|
||||
;;! \date Jan 11, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
.include "sel_q.asm"
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg FFT32_init, _FFT32_init
|
||||
.endif
|
||||
|
||||
|
||||
; Module definition for external reference
|
||||
.def _FFT32_init
|
||||
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <--------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
|
||||
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;;}CFFT32;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void FFT32_init(void *)
|
||||
;; This function sets the twiddle factor pointer "tfptr" element of the object
|
||||
;; to point to the twiddle factor table in memory
|
||||
;;
|
||||
_FFT32_init:
|
||||
; Twiddle factor Initialization
|
||||
MOVL XAR5,#TF_4096P_CFFT ;
|
||||
MOVL *+XAR4[2],XAR5 ; tfptr->TF_1024P_CFFT
|
||||
LRETR
|
||||
|
||||
|
||||
.sect "FFTtf"
|
||||
|
||||
.if(TF_QFMAT==Q31)
|
||||
TF_4096P_CFFT:
|
||||
.long 0,3294197,6588387,9882561,13176712,16470832,19764913,23058947,26352928,29646846
|
||||
.long 32940695,36234466,39528151,42821744,46115236,49408620,52701887,55995030,59288042,62580914
|
||||
.long 65873638,69166208,72458615,75750851,79042909,82334782,85626460,88917937,92209205,95500255
|
||||
.long 98791081,102081675,105372028,108662134,111951983,115241570,118530885,121819921,125108670,128397125
|
||||
.long 131685278,134973122,138260647,141547847,144834714,148121241,151407418,154693240,157978697,161263783
|
||||
.long 164548489,167832808,171116733,174400254,177683365,180966058,184248325,187530159,190811551,194092495
|
||||
.long 197372981,200653003,203932553,207211624,210490206,213768293,217045878,220322951,223599506,226875535
|
||||
.long 230151030,233425984,236700388,239974235,243247518,246520228,249792358,253063900,256334847,259605191
|
||||
.long 262874923,266144038,269412525,272680379,275947592,279214155,282480061,285745302,289009871,292273760
|
||||
.long 295536961,298799466,302061269,305322361,308582734,311842381,315101295,318359466,321616889,324873555
|
||||
.long 328129457,331384586,334638936,337892498,341145265,344397230,347648383,350898719,354148230,357396906
|
||||
.long 360644742,363891730,367137861,370383128,373627523,376871039,380113669,383355404,386596237,389836160
|
||||
.long 393075166,396313247,399550396,402786604,406021865,409256170,412489512,415721883,418953276,422183684
|
||||
.long 425413098,428641511,431868915,435095303,438320667,441545000,444768294,447990541,451211734,454431865
|
||||
.long 457650927,460868912,464085813,467301622,470516330,473729932,476942419,480153784,483364019,486573117
|
||||
.long 489781069,492987869,496193509,499397982,502601279,505803394,509004318,512204045,515402566,518599875
|
||||
.long 521795963,524990824,528184449,531376831,534567963,537757837,540946445,544133781,547319836,550504604
|
||||
.long 553688076,556870245,560051104,563230645,566408860,569585743,572761285,575935480,579108320,582279796
|
||||
.long 585449903,588618632,591785976,594951927,598116479,601279623,604441352,607601658,610760536,613917975
|
||||
.long 617073971,620228514,623381598,626533215,629683357,632832018,635979190,639124865,642269036,645411696
|
||||
.long 648552838,651692453,654830535,657967075,661102068,664235505,667367379,670497682,673626408,676753549
|
||||
.long 679879097,683003045,686125387,689246113,692365218,695482694,698598533,701712728,704825272,707936158
|
||||
.long 711045377,714152924,717258790,720362968,723465451,726566232,729665303,732762657,735858287,738952186
|
||||
.long 742044345,745134758,748223418,751310318,754395449,757478806,760560380,763640164,766718151,769794334
|
||||
.long 772868706,775941259,779011986,782080880,785147934,788213141,791276492,794337982,797397602,800455346
|
||||
.long 803511207,806565177,809617249,812667415,815715670,818762005,821806413,824848888,827889422,830928007
|
||||
.long 833964638,836999305,840032004,843062726,846091463,849118210,852142959,855165703,858186435,861205147
|
||||
.long 864221832,867236484,870249095,873259659,876268167,879274614,882278992,885281293,888281512,891279640
|
||||
.long 894275671,897269597,900261413,903251110,906238681,909224120,912207419,915188572,918167572,921144411
|
||||
.long 924119082,927091579,930061894,933030021,935995952,938959681,941921200,944880503,947837582,950792431
|
||||
.long 953745043,956695411,959643527,962589385,965532978,968474300,971413342,974350098,977284562,980216726
|
||||
.long 983146583,986074127,988999351,991922248,994842810,997761031,1000676905,1003590424,1006501581,1009410370
|
||||
.long 1012316784,1015220816,1018122458,1021021705,1023918550,1026812985,1029705004,1032594600,1035481766,1038366495
|
||||
.long 1041248781,1044128617,1047005996,1049880912,1052753357,1055623324,1058490808,1061355801,1064218296,1067078288
|
||||
.long 1069935768,1072790730,1075643169,1078493076,1081340445,1084185270,1087027544,1089867259,1092704411,1095538991
|
||||
.long 1098370993,1101200410,1104027237,1106851465,1109673089,1112492101,1115308496,1118122267,1120933406,1123741908
|
||||
.long 1126547765,1129350972,1132151521,1134949406,1137744621,1140537158,1143327011,1146114174,1148898640,1151680403
|
||||
.long 1154459456,1157235792,1160009405,1162780288,1165548435,1168313840,1171076495,1173836395,1176593533,1179347902
|
||||
.long 1182099496,1184848308,1187594332,1190337562,1193077991,1195815612,1198550419,1201282407,1204011567,1206737894
|
||||
.long 1209461382,1212182024,1214899813,1217614743,1220326809,1223036002,1225742318,1228445750,1231146291,1233843935
|
||||
.long 1236538675,1239230506,1241919421,1244605414,1247288478,1249968606,1252645794,1255320034,1257991320,1260659646
|
||||
.long 1263325005,1265987392,1268646800,1271303222,1273956653,1276607086,1279254516,1281898935,1284540337,1287178717
|
||||
.long 1289814068,1292446384,1295075659,1297701886,1300325060,1302945174,1305562222,1308176198,1310787095,1313394909
|
||||
.long 1315999631,1318601257,1321199781,1323795195,1326387494,1328976672,1331562723,1334145641,1336725419,1339302052
|
||||
.long 1341875533,1344445857,1347013017,1349577007,1352137822,1354695455,1357249901,1359801152,1362349204,1364894050
|
||||
.long 1367435685,1369974101,1372509294,1375041258,1377569986,1380095472,1382617710,1385136696,1387652422,1390164882
|
||||
.long 1392674072,1395179984,1397682613,1400181954,1402678000,1405170745,1407660183,1410146309,1412629117,1415108601
|
||||
.long 1417584755,1420057574,1422527051,1424993180,1427455956,1429915374,1432371426,1434824109,1437273414,1439719338
|
||||
.long 1442161874,1444601017,1447036760,1449469098,1451898025,1454323536,1456745625,1459164286,1461579514,1463991302
|
||||
.long 1466399645,1468804538,1471205974,1473603949,1475998456,1478389489,1480777044,1483161115,1485541696,1487918781
|
||||
.long 1490292364,1492662441,1495029006,1497392053,1499751576,1502107570,1504460029,1506808949,1509154322,1511496145
|
||||
.long 1513834411,1516169114,1518500250,1520827813,1523151797,1525472197,1527789007,1530102222,1532411837,1534717846
|
||||
.long 1537020244,1539319024,1541614183,1543905714,1546193612,1548477872,1550758488,1553035455,1555308768,1557578421
|
||||
.long 1559844408,1562106725,1564365367,1566620327,1568871601,1571119183,1573363068,1575603251,1577839726,1580072489
|
||||
.long 1582301533,1584526854,1586748447,1588966306,1591180426,1593390801,1595597428,1597800299,1599999411,1602194758
|
||||
.long 1604386335,1606574136,1608758157,1610938393,1613114838,1615287487,1617456335,1619621377,1621782608,1623940023
|
||||
.long 1626093616,1628243383,1630389319,1632531418,1634669676,1636804087,1638934646,1641061349,1643184191,1645303166
|
||||
.long 1647418269,1649529496,1651636841,1653740300,1655839867,1657935539,1660027308,1662115172,1664199124,1666279161
|
||||
.long 1668355276,1670427466,1672495725,1674560049,1676620432,1678676870,1680729357,1682777890,1684822463,1686863072
|
||||
.long 1688899711,1690932376,1692961062,1694985765,1697006479,1699023199,1701035922,1703044642,1705049355,1707050055
|
||||
.long 1709046739,1711039401,1713028037,1715012642,1716993211,1718969740,1720942225,1722910659,1724875040,1726835361
|
||||
.long 1728791620,1730743810,1732691928,1734635968,1736575927,1738511799,1740443581,1742371267,1744294853,1746214334
|
||||
.long 1748129707,1750040966,1751948107,1753851126,1755750017,1757644777,1759535401,1761421885,1763304224,1765182414
|
||||
.long 1767056450,1768926328,1770792044,1772653593,1774510970,1776364172,1778213194,1780058032,1781898681,1783735137
|
||||
.long 1785567396,1787395453,1789219305,1791038946,1792854372,1794665580,1796472565,1798275323,1800073849,1801868139
|
||||
.long 1803658189,1805443995,1807225553,1809002858,1810775906,1812544694,1814309216,1816069469,1817825449,1819577151
|
||||
.long 1821324572,1823067707,1824806552,1826541103,1828271356,1829997307,1831718951,1833436286,1835149306,1836858008
|
||||
.long 1838562388,1840262441,1841958164,1843649553,1845336604,1847019312,1848697674,1850371686,1852041343,1853706643
|
||||
.long 1855367581,1857024153,1858676355,1860324183,1861967634,1863606704,1865241388,1866871683,1868497586,1870119091
|
||||
.long 1871736196,1873348897,1874957189,1876561070,1878160535,1879755580,1881346202,1882932397,1884514161,1886091491
|
||||
.long 1887664383,1889232832,1890796837,1892356392,1893911494,1895462140,1897008325,1898550047,1900087301,1901620084
|
||||
.long 1903148392,1904672222,1906191570,1907706433,1909216806,1910722688,1912224073,1913720958,1915213340,1916701216
|
||||
.long 1918184581,1919663432,1921137767,1922607581,1924072871,1925533633,1926989864,1928441561,1929888720,1931331338
|
||||
.long 1932769411,1934202936,1935631910,1937056329,1938476190,1939891490,1941302225,1942708392,1944109987,1945507008
|
||||
.long 1946899451,1948287312,1949670589,1951049279,1952423377,1953792881,1955157788,1956518093,1957873796,1959224890
|
||||
.long 1960571375,1961913246,1963250501,1964583136,1965911148,1967234535,1968553292,1969867417,1971176906,1972481757
|
||||
.long 1973781967,1975077532,1976368450,1977654717,1978936331,1980213288,1981485585,1982753220,1984016189,1985274489
|
||||
.long 1986528118,1987777073,1989021350,1990260946,1991495860,1992726087,1993951625,1995172471,1996388622,1997600076
|
||||
.long 1998806829,2000008879,2001206222,2002398857,2003586779,2004769987,2005948478,2007122248,2008291295,2009455617
|
||||
.long 2010615210,2011770073,2012920201,2014065592,2015206245,2016342155,2017473321,2018599739,2019721407,2020838323
|
||||
.long 2021950484,2023057887,2024160529,2025258408,2026351522,2027439867,2028523442,2029602243,2030676269,2031745516
|
||||
.long 2032809982,2033869665,2034924562,2035974670,2037019988,2038060512,2039096241,2040127172,2041153301,2042174628
|
||||
.long 2043191150,2044202863,2045209767,2046211857,2047209133,2048201592,2049189231,2050172048,2051150040,2052123207
|
||||
.long 2053091544,2054055050,2055013723,2055967560,2056916560,2057860719,2058800036,2059734508,2060664133,2061588910
|
||||
.long 2062508835,2063423908,2064334124,2065239484,2066139983,2067035621,2067926394,2068812302,2069693342,2070569511
|
||||
.long 2071440808,2072307231,2073168777,2074025446,2074877233,2075724139,2076566160,2077403294,2078235540,2079062896
|
||||
.long 2079885360,2080702930,2081515603,2082323379,2083126254,2083924228,2084717298,2085505463,2086288720,2087067068
|
||||
.long 2087840505,2088609029,2089372638,2090131331,2090885105,2091633960,2092377892,2093116901,2093850985,2094580142
|
||||
.long 2095304370,2096023667,2096738032,2097447464,2098151960,2098851519,2099546139,2100235819,2100920556,2101600350
|
||||
.long 2102275199,2102945101,2103610054,2104270057,2104925109,2105575208,2106220352,2106860540,2107495770,2108126041
|
||||
.long 2108751352,2109371700,2109987085,2110597505,2111202959,2111803444,2112398960,2112989506,2113575080,2114155680
|
||||
.long 2114731305,2115301954,2115867626,2116428319,2116984031,2117534762,2118080511,2118621275,2119157054,2119687847
|
||||
.long 2120213651,2120734467,2121250292,2121761126,2122266967,2122767814,2123263666,2123754522,2124240380,2124721240
|
||||
.long 2125197100,2125667960,2126133817,2126594672,2127050522,2127501367,2127947206,2128388038,2128823862,2129254676
|
||||
.long 2129680480,2130101272,2130517052,2130927819,2131333572,2131734309,2132130030,2132520734,2132906420,2133287087
|
||||
.long 2133662734,2134033361,2134398966,2134759548,2135115107,2135465642,2135811153,2136151637,2136487095,2136817525
|
||||
.long 2137142927,2137463301,2137778644,2138088958,2138394240,2138694490,2138989708,2139279892,2139565043,2139845159
|
||||
.long 2140120240,2140390284,2140655293,2140915264,2141170197,2141420092,2141664948,2141904764,2142139541,2142369276
|
||||
.long 2142593971,2142813624,2143028234,2143237802,2143442326,2143641807,2143836244,2144025635,2144209982,2144389283
|
||||
.long 2144563539,2144732748,2144896910,2145056025,2145210092,2145359112,2145503083,2145642006,2145775880,2145904705
|
||||
.long 2146028480,2146147205,2146260881,2146369505,2146473080,2146571603,2146665076,2146753497,2146836866,2146915184
|
||||
.long 2146988450,2147056664,2147119825,2147177934,2147230991,2147278995,2147321946,2147359845,2147392690,2147420483
|
||||
.long 2147443222,2147460908,2147473542,2147481121,2147483647,2147481121,2147473542,2147460908,2147443222,2147420483
|
||||
.long 2147392690,2147359845,2147321946,2147278995,2147230991,2147177934,2147119825,2147056664,2146988450,2146915184
|
||||
.long 2146836866,2146753497,2146665076,2146571603,2146473080,2146369505,2146260881,2146147205,2146028480,2145904705
|
||||
.long 2145775880,2145642006,2145503083,2145359112,2145210092,2145056025,2144896910,2144732748,2144563539,2144389283
|
||||
.long 2144209982,2144025635,2143836244,2143641807,2143442326,2143237802,2143028234,2142813624,2142593971,2142369276
|
||||
.long 2142139541,2141904764,2141664948,2141420092,2141170197,2140915264,2140655293,2140390284,2140120240,2139845159
|
||||
.long 2139565043,2139279892,2138989708,2138694490,2138394240,2138088958,2137778644,2137463301,2137142927,2136817525
|
||||
.long 2136487095,2136151637,2135811153,2135465642,2135115107,2134759548,2134398966,2134033361,2133662734,2133287087
|
||||
.long 2132906420,2132520734,2132130030,2131734309,2131333572,2130927819,2130517052,2130101272,2129680480,2129254676
|
||||
.long 2128823862,2128388038,2127947206,2127501367,2127050522,2126594672,2126133817,2125667960,2125197100,2124721240
|
||||
.long 2124240380,2123754522,2123263666,2122767814,2122266967,2121761126,2121250292,2120734467,2120213651,2119687847
|
||||
.long 2119157054,2118621275,2118080511,2117534762,2116984031,2116428319,2115867626,2115301954,2114731305,2114155680
|
||||
.long 2113575080,2112989506,2112398960,2111803444,2111202959,2110597505,2109987085,2109371700,2108751352,2108126041
|
||||
.long 2107495770,2106860540,2106220352,2105575208,2104925109,2104270057,2103610054,2102945101,2102275199,2101600350
|
||||
.long 2100920556,2100235819,2099546139,2098851519,2098151960,2097447464,2096738032,2096023667,2095304370,2094580142
|
||||
.long 2093850985,2093116901,2092377892,2091633960,2090885105,2090131331,2089372638,2088609029,2087840505,2087067068
|
||||
.long 2086288720,2085505463,2084717298,2083924228,2083126254,2082323379,2081515603,2080702930,2079885360,2079062896
|
||||
.long 2078235540,2077403294,2076566160,2075724139,2074877233,2074025446,2073168777,2072307231,2071440808,2070569511
|
||||
.long 2069693342,2068812302,2067926394,2067035621,2066139983,2065239484,2064334124,2063423908,2062508835,2061588910
|
||||
.long 2060664133,2059734508,2058800036,2057860719,2056916560,2055967560,2055013723,2054055050,2053091544,2052123207
|
||||
.long 2051150040,2050172048,2049189231,2048201592,2047209133,2046211857,2045209767,2044202863,2043191150,2042174628
|
||||
.long 2041153301,2040127172,2039096241,2038060512,2037019988,2035974670,2034924562,2033869665,2032809982,2031745516
|
||||
.long 2030676269,2029602243,2028523442,2027439867,2026351522,2025258408,2024160529,2023057887,2021950484,2020838323
|
||||
.long 2019721407,2018599739,2017473321,2016342155,2015206245,2014065592,2012920201,2011770073,2010615210,2009455617
|
||||
.long 2008291295,2007122248,2005948478,2004769987,2003586779,2002398857,2001206222,2000008879,1998806829,1997600076
|
||||
.long 1996388622,1995172471,1993951625,1992726087,1991495860,1990260946,1989021350,1987777073,1986528118,1985274489
|
||||
.long 1984016189,1982753220,1981485585,1980213288,1978936331,1977654717,1976368450,1975077532,1973781967,1972481757
|
||||
.long 1971176906,1969867417,1968553292,1967234535,1965911148,1964583136,1963250501,1961913246,1960571375,1959224890
|
||||
.long 1957873796,1956518093,1955157788,1953792881,1952423377,1951049279,1949670589,1948287312,1946899451,1945507008
|
||||
.long 1944109987,1942708392,1941302225,1939891490,1938476190,1937056329,1935631910,1934202936,1932769411,1931331338
|
||||
.long 1929888720,1928441561,1926989864,1925533633,1924072871,1922607581,1921137767,1919663432,1918184581,1916701216
|
||||
.long 1915213340,1913720958,1912224073,1910722688,1909216806,1907706433,1906191570,1904672222,1903148392,1901620084
|
||||
.long 1900087301,1898550047,1897008325,1895462140,1893911494,1892356392,1890796837,1889232832,1887664383,1886091491
|
||||
.long 1884514161,1882932397,1881346202,1879755580,1878160535,1876561070,1874957189,1873348897,1871736196,1870119091
|
||||
.long 1868497586,1866871683,1865241388,1863606704,1861967634,1860324183,1858676355,1857024153,1855367581,1853706643
|
||||
.long 1852041343,1850371686,1848697674,1847019312,1845336604,1843649553,1841958164,1840262441,1838562388,1836858008
|
||||
.long 1835149306,1833436286,1831718951,1829997307,1828271356,1826541103,1824806552,1823067707,1821324572,1819577151
|
||||
.long 1817825449,1816069469,1814309216,1812544694,1810775906,1809002858,1807225553,1805443995,1803658189,1801868139
|
||||
.long 1800073849,1798275323,1796472565,1794665580,1792854372,1791038946,1789219305,1787395453,1785567396,1783735137
|
||||
.long 1781898681,1780058032,1778213194,1776364172,1774510970,1772653593,1770792044,1768926328,1767056450,1765182414
|
||||
.long 1763304224,1761421885,1759535401,1757644777,1755750017,1753851126,1751948107,1750040966,1748129707,1746214334
|
||||
.long 1744294853,1742371267,1740443581,1738511799,1736575927,1734635968,1732691928,1730743810,1728791620,1726835361
|
||||
.long 1724875040,1722910659,1720942225,1718969740,1716993211,1715012642,1713028037,1711039401,1709046739,1707050055
|
||||
.long 1705049355,1703044642,1701035922,1699023199,1697006479,1694985765,1692961062,1690932376,1688899711,1686863072
|
||||
.long 1684822463,1682777890,1680729357,1678676870,1676620432,1674560049,1672495725,1670427466,1668355276,1666279161
|
||||
.long 1664199124,1662115172,1660027308,1657935539,1655839867,1653740300,1651636841,1649529496,1647418269,1645303166
|
||||
.long 1643184191,1641061349,1638934646,1636804087,1634669676,1632531418,1630389319,1628243383,1626093616,1623940023
|
||||
.long 1621782608,1619621377,1617456335,1615287487,1613114838,1610938393,1608758157,1606574136,1604386335,1602194758
|
||||
.long 1599999411,1597800299,1595597428,1593390801,1591180426,1588966306,1586748447,1584526854,1582301533,1580072489
|
||||
.long 1577839726,1575603251,1573363068,1571119183,1568871601,1566620327,1564365367,1562106725,1559844408,1557578421
|
||||
.long 1555308768,1553035455,1550758488,1548477872,1546193612,1543905714,1541614183,1539319024,1537020244,1534717846
|
||||
.long 1532411837,1530102222,1527789007,1525472197,1523151797,1520827813,1518500250,1516169114,1513834411,1511496145
|
||||
.long 1509154322,1506808949,1504460029,1502107570,1499751576,1497392053,1495029006,1492662441,1490292364,1487918781
|
||||
.long 1485541696,1483161115,1480777044,1478389489,1475998456,1473603949,1471205974,1468804538,1466399645,1463991302
|
||||
.long 1461579514,1459164286,1456745625,1454323536,1451898025,1449469098,1447036760,1444601017,1442161874,1439719338
|
||||
.long 1437273414,1434824109,1432371426,1429915374,1427455956,1424993180,1422527051,1420057574,1417584755,1415108601
|
||||
.long 1412629117,1410146309,1407660183,1405170745,1402678000,1400181954,1397682613,1395179984,1392674072,1390164882
|
||||
.long 1387652422,1385136696,1382617710,1380095472,1377569986,1375041258,1372509294,1369974101,1367435685,1364894050
|
||||
.long 1362349204,1359801152,1357249901,1354695455,1352137822,1349577007,1347013017,1344445857,1341875533,1339302052
|
||||
.long 1336725419,1334145641,1331562723,1328976672,1326387494,1323795195,1321199781,1318601257,1315999631,1313394909
|
||||
.long 1310787095,1308176198,1305562222,1302945174,1300325060,1297701886,1295075659,1292446384,1289814068,1287178717
|
||||
.long 1284540337,1281898935,1279254516,1276607086,1273956653,1271303222,1268646800,1265987392,1263325005,1260659646
|
||||
.long 1257991320,1255320034,1252645794,1249968606,1247288478,1244605414,1241919421,1239230506,1236538675,1233843935
|
||||
.long 1231146291,1228445750,1225742318,1223036002,1220326809,1217614743,1214899813,1212182024,1209461382,1206737894
|
||||
.long 1204011567,1201282407,1198550419,1195815612,1193077991,1190337562,1187594332,1184848308,1182099496,1179347902
|
||||
.long 1176593533,1173836395,1171076495,1168313840,1165548435,1162780288,1160009405,1157235792,1154459456,1151680403
|
||||
.long 1148898640,1146114174,1143327011,1140537158,1137744621,1134949406,1132151521,1129350972,1126547765,1123741908
|
||||
.long 1120933406,1118122267,1115308496,1112492101,1109673089,1106851465,1104027237,1101200410,1098370993,1095538991
|
||||
.long 1092704411,1089867259,1087027544,1084185270,1081340445,1078493076,1075643169,1072790730,1069935768,1067078288
|
||||
.long 1064218296,1061355801,1058490808,1055623324,1052753357,1049880912,1047005996,1044128617,1041248781,1038366495
|
||||
.long 1035481766,1032594600,1029705004,1026812985,1023918550,1021021705,1018122458,1015220816,1012316784,1009410370
|
||||
.long 1006501581,1003590424,1000676905,997761031,994842810,991922248,988999351,986074127,983146583,980216726
|
||||
.long 977284562,974350098,971413342,968474300,965532978,962589385,959643527,956695411,953745043,950792431
|
||||
.long 947837582,944880503,941921200,938959681,935995952,933030021,930061894,927091579,924119082,921144411
|
||||
.long 918167572,915188572,912207419,909224120,906238681,903251110,900261413,897269597,894275671,891279640
|
||||
.long 888281512,885281293,882278992,879274614,876268167,873259659,870249095,867236484,864221832,861205147
|
||||
.long 858186435,855165703,852142959,849118210,846091463,843062726,840032004,836999305,833964638,830928007
|
||||
.long 827889422,824848888,821806413,818762005,815715670,812667415,809617249,806565177,803511207,800455346
|
||||
.long 797397602,794337982,791276492,788213141,785147934,782080880,779011986,775941259,772868706,769794334
|
||||
.long 766718151,763640164,760560380,757478806,754395449,751310318,748223418,745134758,742044345,738952186
|
||||
.long 735858287,732762657,729665303,726566232,723465451,720362968,717258790,714152924,711045377,707936158
|
||||
.long 704825272,701712728,698598533,695482694,692365218,689246113,686125387,683003045,679879097,676753549
|
||||
.long 673626408,670497682,667367379,664235505,661102068,657967075,654830535,651692453,648552838,645411696
|
||||
.long 642269036,639124865,635979190,632832018,629683357,626533215,623381598,620228514,617073971,613917975
|
||||
.long 610760536,607601658,604441352,601279623,598116479,594951927,591785976,588618632,585449903,582279796
|
||||
.long 579108320,575935480,572761285,569585743,566408860,563230645,560051104,556870245,553688076,550504604
|
||||
.long 547319836,544133781,540946445,537757837,534567963,531376831,528184449,524990824,521795963,518599875
|
||||
.long 515402566,512204045,509004318,505803394,502601279,499397982,496193509,492987869,489781069,486573117
|
||||
.long 483364019,480153784,476942419,473729932,470516330,467301622,464085813,460868912,457650927,454431865
|
||||
.long 451211734,447990541,444768294,441545000,438320667,435095303,431868915,428641511,425413098,422183684
|
||||
.long 418953276,415721883,412489512,409256170,406021865,402786604,399550396,396313247,393075166,389836160
|
||||
.long 386596237,383355404,380113669,376871039,373627523,370383128,367137861,363891730,360644742,357396906
|
||||
.long 354148230,350898719,347648383,344397230,341145265,337892498,334638936,331384586,328129457,324873555
|
||||
.long 321616889,318359466,315101295,311842381,308582734,305322361,302061269,298799466,295536961,292273760
|
||||
.long 289009871,285745302,282480061,279214155,275947592,272680379,269412525,266144038,262874923,259605191
|
||||
.long 256334847,253063900,249792358,246520228,243247518,239974235,236700388,233425984,230151030,226875535
|
||||
.long 223599506,220322951,217045878,213768293,210490206,207211624,203932553,200653003,197372981,194092495
|
||||
.long 190811551,187530159,184248325,180966058,177683365,174400254,171116733,167832808,164548489,161263783
|
||||
.long 157978697,154693240,151407418,148121241,144834714,141547847,138260647,134973122,131685278,128397125
|
||||
.long 125108670,121819921,118530885,115241570,111951983,108662134,105372028,102081675,98791081,95500255
|
||||
.long 92209205,88917937,85626460,82334782,79042909,75750851,72458615,69166208,65873638,62580914
|
||||
.long 59288042,55995030,52701887,49408620,46115236,42821744,39528151,36234466,32940695,29646846
|
||||
.long 26352928,23058947,19764913,16470832,13176712,9882561,6588387,3294197,0,-3294197
|
||||
.long -6588387,-9882561,-13176712,-16470832,-19764913,-23058947,-26352928,-29646846,-32940695,-36234466
|
||||
.long -39528151,-42821744,-46115236,-49408620,-52701887,-55995030,-59288042,-62580914,-65873638,-69166208
|
||||
.long -72458615,-75750851,-79042909,-82334782,-85626460,-88917937,-92209205,-95500255,-98791081,-102081675
|
||||
.long -105372028,-108662134,-111951983,-115241570,-118530885,-121819921,-125108670,-128397125,-131685278,-134973122
|
||||
.long -138260647,-141547847,-144834714,-148121241,-151407418,-154693240,-157978697,-161263783,-164548489,-167832808
|
||||
.long -171116733,-174400254,-177683365,-180966058,-184248325,-187530159,-190811551,-194092495,-197372981,-200653003
|
||||
.long -203932553,-207211624,-210490206,-213768293,-217045878,-220322951,-223599506,-226875535,-230151030,-233425984
|
||||
.long -236700388,-239974235,-243247518,-246520228,-249792358,-253063900,-256334847,-259605191,-262874923,-266144038
|
||||
.long -269412525,-272680379,-275947592,-279214155,-282480061,-285745302,-289009871,-292273760,-295536961,-298799466
|
||||
.long -302061269,-305322361,-308582734,-311842381,-315101295,-318359466,-321616889,-324873555,-328129457,-331384586
|
||||
.long -334638936,-337892498,-341145265,-344397230,-347648383,-350898719,-354148230,-357396906,-360644742,-363891730
|
||||
.long -367137861,-370383128,-373627523,-376871039,-380113669,-383355404,-386596237,-389836160,-393075166,-396313247
|
||||
.long -399550396,-402786604,-406021865,-409256170,-412489512,-415721883,-418953276,-422183684,-425413098,-428641511
|
||||
.long -431868915,-435095303,-438320667,-441545000,-444768294,-447990541,-451211734,-454431865,-457650927,-460868912
|
||||
.long -464085813,-467301622,-470516330,-473729932,-476942419,-480153784,-483364019,-486573117,-489781069,-492987869
|
||||
.long -496193509,-499397982,-502601279,-505803394,-509004318,-512204045,-515402566,-518599875,-521795963,-524990824
|
||||
.long -528184449,-531376831,-534567963,-537757837,-540946445,-544133781,-547319836,-550504604,-553688076,-556870245
|
||||
.long -560051104,-563230645,-566408860,-569585743,-572761285,-575935480,-579108320,-582279796,-585449903,-588618632
|
||||
.long -591785976,-594951927,-598116479,-601279623,-604441352,-607601658,-610760536,-613917975,-617073971,-620228514
|
||||
.long -623381598,-626533215,-629683357,-632832018,-635979190,-639124865,-642269036,-645411696,-648552838,-651692453
|
||||
.long -654830535,-657967075,-661102068,-664235505,-667367379,-670497682,-673626408,-676753549,-679879097,-683003045
|
||||
.long -686125387,-689246113,-692365218,-695482694,-698598533,-701712728,-704825272,-707936158,-711045377,-714152924
|
||||
.long -717258790,-720362968,-723465451,-726566232,-729665303,-732762657,-735858287,-738952186,-742044345,-745134758
|
||||
.long -748223418,-751310318,-754395449,-757478806,-760560380,-763640164,-766718151,-769794334,-772868706,-775941259
|
||||
.long -779011986,-782080880,-785147934,-788213141,-791276492,-794337982,-797397602,-800455346,-803511207,-806565177
|
||||
.long -809617249,-812667415,-815715670,-818762005,-821806413,-824848888,-827889422,-830928007,-833964638,-836999305
|
||||
.long -840032004,-843062726,-846091463,-849118210,-852142959,-855165703,-858186435,-861205147,-864221832,-867236484
|
||||
.long -870249095,-873259659,-876268167,-879274614,-882278992,-885281293,-888281512,-891279640,-894275671,-897269597
|
||||
.long -900261413,-903251110,-906238681,-909224120,-912207419,-915188572,-918167572,-921144411,-924119082,-927091579
|
||||
.long -930061894,-933030021,-935995952,-938959681,-941921200,-944880503,-947837582,-950792431,-953745043,-956695411
|
||||
.long -959643527,-962589385,-965532978,-968474300,-971413342,-974350098,-977284562,-980216726,-983146583,-986074127
|
||||
.long -988999351,-991922248,-994842810,-997761031,-1000676905,-1003590424,-1006501581,-1009410370,-1012316784,-1015220816
|
||||
.long -1018122458,-1021021705,-1023918550,-1026812985,-1029705004,-1032594600,-1035481766,-1038366495,-1041248781,-1044128617
|
||||
.long -1047005996,-1049880912,-1052753357,-1055623324,-1058490808,-1061355801,-1064218296,-1067078288,-1069935768,-1072790730
|
||||
.long -1075643169,-1078493076,-1081340445,-1084185270,-1087027544,-1089867259,-1092704411,-1095538991,-1098370993,-1101200410
|
||||
.long -1104027237,-1106851465,-1109673089,-1112492101,-1115308496,-1118122267,-1120933406,-1123741908,-1126547765,-1129350972
|
||||
.long -1132151521,-1134949406,-1137744621,-1140537158,-1143327011,-1146114174,-1148898640,-1151680403,-1154459456,-1157235792
|
||||
.long -1160009405,-1162780288,-1165548435,-1168313840,-1171076495,-1173836395,-1176593533,-1179347902,-1182099496,-1184848308
|
||||
.long -1187594332,-1190337562,-1193077991,-1195815612,-1198550419,-1201282407,-1204011567,-1206737894,-1209461382,-1212182024
|
||||
.long -1214899813,-1217614743,-1220326809,-1223036002,-1225742318,-1228445750,-1231146291,-1233843935,-1236538675,-1239230506
|
||||
.long -1241919421,-1244605414,-1247288478,-1249968606,-1252645794,-1255320034,-1257991320,-1260659646,-1263325005,-1265987392
|
||||
.long -1268646800,-1271303222,-1273956653,-1276607086,-1279254516,-1281898935,-1284540337,-1287178717,-1289814068,-1292446384
|
||||
.long -1295075659,-1297701886,-1300325060,-1302945174,-1305562222,-1308176198,-1310787095,-1313394909,-1315999631,-1318601257
|
||||
.long -1321199781,-1323795195,-1326387494,-1328976672,-1331562723,-1334145641,-1336725419,-1339302052,-1341875533,-1344445857
|
||||
.long -1347013017,-1349577007,-1352137822,-1354695455,-1357249901,-1359801152,-1362349204,-1364894050,-1367435685,-1369974101
|
||||
.long -1372509294,-1375041258,-1377569986,-1380095472,-1382617710,-1385136696,-1387652422,-1390164882,-1392674072,-1395179984
|
||||
.long -1397682613,-1400181954,-1402678000,-1405170745,-1407660183,-1410146309,-1412629117,-1415108601,-1417584755,-1420057574
|
||||
.long -1422527051,-1424993180,-1427455956,-1429915374,-1432371426,-1434824109,-1437273414,-1439719338,-1442161874,-1444601017
|
||||
.long -1447036760,-1449469098,-1451898025,-1454323536,-1456745625,-1459164286,-1461579514,-1463991302,-1466399645,-1468804538
|
||||
.long -1471205974,-1473603949,-1475998456,-1478389489,-1480777044,-1483161115,-1485541696,-1487918781,-1490292364,-1492662441
|
||||
.long -1495029006,-1497392053,-1499751576,-1502107570,-1504460029,-1506808949,-1509154322,-1511496145,-1513834411,-1516169114
|
||||
.long -1518500250,-1520827813,-1523151797,-1525472197,-1527789007,-1530102222,-1532411837,-1534717846,-1537020244,-1539319024
|
||||
.long -1541614183,-1543905714,-1546193612,-1548477872,-1550758488,-1553035455,-1555308768,-1557578421,-1559844408,-1562106725
|
||||
.long -1564365367,-1566620327,-1568871601,-1571119183,-1573363068,-1575603251,-1577839726,-1580072489,-1582301533,-1584526854
|
||||
.long -1586748447,-1588966306,-1591180426,-1593390801,-1595597428,-1597800299,-1599999411,-1602194758,-1604386335,-1606574136
|
||||
.long -1608758157,-1610938393,-1613114838,-1615287487,-1617456335,-1619621377,-1621782608,-1623940023,-1626093616,-1628243383
|
||||
.long -1630389319,-1632531418,-1634669676,-1636804087,-1638934646,-1641061349,-1643184191,-1645303166,-1647418269,-1649529496
|
||||
.long -1651636841,-1653740300,-1655839867,-1657935539,-1660027308,-1662115172,-1664199124,-1666279161,-1668355276,-1670427466
|
||||
.long -1672495725,-1674560049,-1676620432,-1678676870,-1680729357,-1682777890,-1684822463,-1686863072,-1688899711,-1690932376
|
||||
.long -1692961062,-1694985765,-1697006479,-1699023199,-1701035922,-1703044642,-1705049355,-1707050055,-1709046739,-1711039401
|
||||
.long -1713028037,-1715012642,-1716993211,-1718969740,-1720942225,-1722910659,-1724875040,-1726835361,-1728791620,-1730743810
|
||||
.long -1732691928,-1734635968,-1736575927,-1738511799,-1740443581,-1742371267,-1744294853,-1746214334,-1748129707,-1750040966
|
||||
.long -1751948107,-1753851126,-1755750017,-1757644777,-1759535401,-1761421885,-1763304224,-1765182414,-1767056450,-1768926328
|
||||
.long -1770792044,-1772653593,-1774510970,-1776364172,-1778213194,-1780058032,-1781898681,-1783735137,-1785567396,-1787395453
|
||||
.long -1789219305,-1791038946,-1792854372,-1794665580,-1796472565,-1798275323,-1800073849,-1801868139,-1803658189,-1805443995
|
||||
.long -1807225553,-1809002858,-1810775906,-1812544694,-1814309216,-1816069469,-1817825449,-1819577151,-1821324572,-1823067707
|
||||
.long -1824806552,-1826541103,-1828271356,-1829997307,-1831718951,-1833436286,-1835149306,-1836858008,-1838562388,-1840262441
|
||||
.long -1841958164,-1843649553,-1845336604,-1847019312,-1848697674,-1850371686,-1852041343,-1853706643,-1855367581,-1857024153
|
||||
.long -1858676355,-1860324183,-1861967634,-1863606704,-1865241388,-1866871683,-1868497586,-1870119091,-1871736196,-1873348897
|
||||
.long -1874957189,-1876561070,-1878160535,-1879755580,-1881346202,-1882932397,-1884514161,-1886091491,-1887664383,-1889232832
|
||||
.long -1890796837,-1892356392,-1893911494,-1895462140,-1897008325,-1898550047,-1900087301,-1901620084,-1903148392,-1904672222
|
||||
.long -1906191570,-1907706433,-1909216806,-1910722688,-1912224073,-1913720958,-1915213340,-1916701216,-1918184581,-1919663432
|
||||
.long -1921137767,-1922607581,-1924072871,-1925533633,-1926989864,-1928441561,-1929888720,-1931331338,-1932769411,-1934202936
|
||||
.long -1935631910,-1937056329,-1938476190,-1939891490,-1941302225,-1942708392,-1944109987,-1945507008,-1946899451,-1948287312
|
||||
.long -1949670589,-1951049279,-1952423377,-1953792881,-1955157788,-1956518093,-1957873796,-1959224890,-1960571375,-1961913246
|
||||
.long -1963250501,-1964583136,-1965911148,-1967234535,-1968553292,-1969867417,-1971176906,-1972481757,-1973781967,-1975077532
|
||||
.long -1976368450,-1977654717,-1978936331,-1980213288,-1981485585,-1982753220,-1984016189,-1985274489,-1986528118,-1987777073
|
||||
.long -1989021350,-1990260946,-1991495860,-1992726087,-1993951625,-1995172471,-1996388622,-1997600076,-1998806829,-2000008879
|
||||
.long -2001206222,-2002398857,-2003586779,-2004769987,-2005948478,-2007122248,-2008291295,-2009455617,-2010615210,-2011770073
|
||||
.long -2012920201,-2014065592,-2015206245,-2016342155,-2017473321,-2018599739,-2019721407,-2020838323,-2021950484,-2023057887
|
||||
.long -2024160529,-2025258408,-2026351522,-2027439867,-2028523442,-2029602243,-2030676269,-2031745516,-2032809982,-2033869665
|
||||
.long -2034924562,-2035974670,-2037019988,-2038060512,-2039096241,-2040127172,-2041153301,-2042174628,-2043191150,-2044202863
|
||||
.long -2045209767,-2046211857,-2047209133,-2048201592,-2049189231,-2050172048,-2051150040,-2052123207,-2053091544,-2054055050
|
||||
.long -2055013723,-2055967560,-2056916560,-2057860719,-2058800036,-2059734508,-2060664133,-2061588910,-2062508835,-2063423908
|
||||
.long -2064334124,-2065239484,-2066139983,-2067035621,-2067926394,-2068812302,-2069693342,-2070569511,-2071440808,-2072307231
|
||||
.long -2073168777,-2074025446,-2074877233,-2075724139,-2076566160,-2077403294,-2078235540,-2079062896,-2079885360,-2080702930
|
||||
.long -2081515603,-2082323379,-2083126254,-2083924228,-2084717298,-2085505463,-2086288720,-2087067068,-2087840505,-2088609029
|
||||
.long -2089372638,-2090131331,-2090885105,-2091633960,-2092377892,-2093116901,-2093850985,-2094580142,-2095304370,-2096023667
|
||||
.long -2096738032,-2097447464,-2098151960,-2098851519,-2099546139,-2100235819,-2100920556,-2101600350,-2102275199,-2102945101
|
||||
.long -2103610054,-2104270057,-2104925109,-2105575208,-2106220352,-2106860540,-2107495770,-2108126041,-2108751352,-2109371700
|
||||
.long -2109987085,-2110597505,-2111202959,-2111803444,-2112398960,-2112989506,-2113575080,-2114155680,-2114731305,-2115301954
|
||||
.long -2115867626,-2116428319,-2116984031,-2117534762,-2118080511,-2118621275,-2119157054,-2119687847,-2120213651,-2120734467
|
||||
.long -2121250292,-2121761126,-2122266967,-2122767814,-2123263666,-2123754522,-2124240380,-2124721240,-2125197100,-2125667960
|
||||
.long -2126133817,-2126594672,-2127050522,-2127501367,-2127947206,-2128388038,-2128823862,-2129254676,-2129680480,-2130101272
|
||||
.long -2130517052,-2130927819,-2131333572,-2131734309,-2132130030,-2132520734,-2132906420,-2133287087,-2133662734,-2134033361
|
||||
.long -2134398966,-2134759548,-2135115107,-2135465642,-2135811153,-2136151637,-2136487095,-2136817525,-2137142927,-2137463301
|
||||
.long -2137778644,-2138088958,-2138394240,-2138694490,-2138989708,-2139279892,-2139565043,-2139845159,-2140120240,-2140390284
|
||||
.long -2140655293,-2140915264,-2141170197,-2141420092,-2141664948,-2141904764,-2142139541,-2142369276,-2142593971,-2142813624
|
||||
.long -2143028234,-2143237802,-2143442326,-2143641807,-2143836244,-2144025635,-2144209982,-2144389283,-2144563539,-2144732748
|
||||
.long -2144896910,-2145056025,-2145210092,-2145359112,-2145503083,-2145642006,-2145775880,-2145904705,-2146028480,-2146147205
|
||||
.long -2146260881,-2146369505,-2146473080,-2146571603,-2146665076,-2146753497,-2146836866,-2146915184,-2146988450,-2147056664
|
||||
.long -2147119825,-2147177934,-2147230991,-2147278995,-2147321946,-2147359845,-2147392690,-2147420483,-2147443222,-2147460908
|
||||
.long -2147473542,-2147481121
|
||||
|
||||
.endif
|
||||
|
||||
.if(TF_QFMAT==Q30)
|
||||
TF_4096P_CFFT
|
||||
.long 0,1647099,3294193,4941281,6588356,8235416,9882456,11529474,13176464,14823423
|
||||
.long 16470347,18117233,19764076,21410872,23057618,24704310,26350943,27997515,29644021,31290457
|
||||
.long 32936819,34583104,36229307,37875426,39521455,41167391,42813230,44458968,46104602,47750128
|
||||
.long 49395541,51040837,52686014,54331067,55975992,57620785,59265442,60909960,62554335,64198563
|
||||
.long 65842639,67486561,69130324,70773924,72417357,74060620,75703709,77346620,78989349,80631892
|
||||
.long 82274245,83916404,85558366,87200127,88841683,90483029,92124163,93765079,95405776,97046247
|
||||
.long 98686491,100326502,101966277,103605812,105245103,106884147,108522939,110161476,111799753,113437768
|
||||
.long 115075515,116712992,118350194,119987118,121623759,123260114,124896179,126531950,128167423,129802595
|
||||
.long 131437462,133072019,134706263,136340190,137973796,139607077,141240030,142872651,144504935,146136880
|
||||
.long 147768480,149399733,151030634,152661180,154291367,155921191,157550647,159179733,160808445,162436778
|
||||
.long 164064728,165692293,167319468,168946249,170572633,172198615,173824192,175449360,177074115,178698453
|
||||
.long 180322371,181945865,183568930,185191564,186813762,188435520,190056834,191677702,193298119,194918080
|
||||
.long 196537583,198156624,199775198,201393302,203010932,204628085,206244756,207860942,209476638,211091842
|
||||
.long 212706549,214320755,215934457,217547651,219160334,220772500,222384147,223995270,225605867,227215933
|
||||
.long 228825464,230434456,232042906,233650811,235258165,236864966,238471210,240076892,241682010,243286558
|
||||
.long 244890535,246493935,248096755,249698991,251300640,252901697,254502159,256102022,257701283,259299937
|
||||
.long 260897982,262495412,264092224,265688415,267283981,268878918,270473223,272066891,273659918,275252302
|
||||
.long 276844038,278435122,280025552,281615322,283204430,284792871,286380643,287967740,289554160,291139898
|
||||
.long 292724951,294309316,295892988,297475964,299058239,300639811,302220676,303800829,305380268,306958988
|
||||
.long 308536985,310114257,311690799,313266607,314841679,316416009,317989595,319562433,321134518,322705848
|
||||
.long 324276419,325846226,327415267,328983538,330551034,332117752,333683689,335248841,336813204,338376774
|
||||
.long 339939549,341501523,343062693,344623057,346182609,347741347,349299266,350856364,352412636,353968079
|
||||
.long 355522689,357076462,358629395,360181484,361732726,363283116,364832652,366381329,367929144,369476093
|
||||
.long 371022173,372567379,374111709,375655159,377197725,378739403,380280190,381820082,383359076,384897167
|
||||
.long 386434353,387970630,389505993,391040440,392573967,394106570,395638246,397168991,398698801,400227673
|
||||
.long 401755603,403282588,404808624,406333708,407857835,409381002,410903207,412424444,413944711,415464004
|
||||
.long 416982319,418499653,420016002,421531363,423045732,424559105,426071480,427582852,429093217,430602573
|
||||
.long 432110916,433618242,435124548,436629829,438134084,439637307,441139496,442640647,444140756,445639820
|
||||
.long 447137835,448634799,450130706,451625555,453119340,454612060,456103710,457594286,459083786,460572205
|
||||
.long 462059541,463545789,465030947,466515010,467997976,469479840,470960600,472440251,473918791,475396216
|
||||
.long 476872522,478347705,479821764,481294693,482766489,484237150,485706671,487175049,488642281,490108363
|
||||
.long 491573292,493037064,494499676,495961124,497421405,498880516,500338453,501795212,503250791,504705185
|
||||
.long 506158392,507610408,509061229,510510853,511959275,513406493,514852502,516297300,517740883,519183248
|
||||
.long 520624391,522064309,523502998,524940456,526376678,527811662,529245404,530677900,532109148,533539144
|
||||
.long 534967884,536395365,537821584,539246538,540670223,542092635,543513772,544933630,546352205,547769495
|
||||
.long 549185496,550600205,552013618,553425732,554836544,556246051,557654248,559061133,560466703,561870954
|
||||
.long 563273883,564675486,566075761,567474703,568872310,570268579,571663506,573057087,574449320,575840202
|
||||
.long 577229728,578617896,580004702,581390144,582774218,584156920,585538248,586918198,588296766,589673951
|
||||
.long 591049748,592424154,593797166,595168781,596538995,597907806,599275210,600641203,602005783,603368947
|
||||
.long 604730691,606091012,607449906,608807372,610163404,611518001,612871159,614222875,615573145,616921967
|
||||
.long 618269338,619615253,620959711,622302707,623644239,624984303,626322897,627660017,628995660,630329823
|
||||
.long 631662503,632993696,634323400,635651611,636978327,638303543,639627258,640949467,642270169,643589359
|
||||
.long 644907034,646223192,647537830,648850943,650162530,651472587,652781111,654088099,655393548,656697454
|
||||
.long 657999816,659300629,660599890,661897597,663193747,664488336,665781362,667072820,668362709,669651026
|
||||
.long 670937767,672222928,673506508,674788504,676068911,677347728,678624950,679900576,681174602,682447025
|
||||
.long 683717842,684987051,686254647,687520629,688784993,690047736,691308855,692568348,693826211,695082441
|
||||
.long 696337036,697589992,698841307,700090977,701339000,702585372,703830092,705073155,706314559,707554301
|
||||
.long 708792378,710028787,711263525,712496590,713727978,714957687,716185713,717412054,718636707,719859669
|
||||
.long 721080937,722300508,723518380,724734549,725949013,727161768,728372813,729582143,730789757,731995651
|
||||
.long 733199822,734402269,735602987,736801974,737999228,739194745,740388522,741580558,742770848,743959390
|
||||
.long 745146182,746331221,747514503,748696026,749875788,751053785,752230015,753404474,754577161,755748072
|
||||
.long 756917205,758084557,759250125,760413906,761575898,762736098,763894504,765051111,766205919,767358923
|
||||
.long 768510122,769659512,770807092,771952857,773096806,774238936,775379244,776517728,777654384,778789210
|
||||
.long 779922204,781053363,782182683,783310163,784435800,785559591,786681534,787801625,788919863,790036244
|
||||
.long 791150767,792263427,793374223,794483153,795590213,796695401,797798714,798900150,799999706,801097379
|
||||
.long 802193167,803287068,804379079,805469196,806557419,807643743,808728167,809810688,810891304,811970011
|
||||
.long 813046808,814121692,815194659,816265709,817334838,818402043,819467323,820530675,821592095,822651583
|
||||
.long 823709135,824764748,825818421,826870150,827919934,828967769,830013654,831057586,832099562,833139580
|
||||
.long 834177638,835213733,836247863,837280024,838310216,839338435,840364679,841388945,842411232,843431536
|
||||
.long 844449856,845466188,846480531,847492882,848503239,849511600,850517961,851522321,852524677,853525028
|
||||
.long 854523370,855519701,856514019,857506321,858496606,859484870,860471112,861455330,862437520,863417681
|
||||
.long 864395810,865371905,866345964,867317984,868287963,869255900,870221790,871185633,872147426,873107167
|
||||
.long 874064853,875020483,875974054,876925563,877875009,878822389,879767701,880710943,881652112,882591207
|
||||
.long 883528225,884463164,885396022,886326796,887255485,888182086,889106597,890029016,890949341,891867569
|
||||
.long 892783698,893697727,894609652,895519473,896427186,897332790,898236282,899137661,900036924,900934069
|
||||
.long 901829095,902721998,903612776,904501429,905387953,906272347,907154608,908034735,908912725,909788576
|
||||
.long 910662286,911533853,912403276,913270551,914135678,914998653,915859476,916718143,917574653,918429004
|
||||
.long 919281194,920131221,920979082,921824777,922668302,923509656,924348837,925185843,926020672,926853322
|
||||
.long 927683790,928512076,929338177,930162092,930983817,931803352,932620694,933435842,934248793,935059546
|
||||
.long 935868098,936674448,937478595,938280535,939080267,939877790,940673101,941466198,942257081,943045745
|
||||
.long 943832191,944616416,945398418,946178196,946955747,947731070,948504163,949275023,950043650,950810042
|
||||
.long 951574196,952336111,953095785,953853216,954608403,955361344,956112036,956860479,957606670,958350608
|
||||
.long 959092290,959831716,960568883,961303790,962036435,962766816,963494932,964220780,964944360,965665669
|
||||
.long 966384706,967101468,967815955,968528165,969238095,969945745,970651112,971354196,972054994,972753504
|
||||
.long 973449725,974143656,974835295,975524639,976211688,976896441,977578894,978259047,978936898,979612445
|
||||
.long 980285688,980956623,981625251,982291568,982955574,983617267,984276646,984933708,985588453,986240879
|
||||
.long 986890984,987538766,988184225,988827359,989468165,990106644,990742793,991376610,992008094,992637245
|
||||
.long 993264059,993888536,994510675,995130473,995747930,996363043,996975812,997586236,998194311,998800038
|
||||
.long 999403415,1000004439,1000603111,1001199428,1001793390,1002384994,1002974239,1003561124,1004145648,1004727809
|
||||
.long 1005307605,1005885036,1006460100,1007032796,1007603122,1008171077,1008736660,1009299870,1009860704,1010419162
|
||||
.long 1010975242,1011528943,1012080264,1012629204,1013175761,1013719934,1014261721,1014801122,1015338134,1015872758
|
||||
.long 1016404991,1016934832,1017462281,1017987335,1018509994,1019030256,1019548121,1020063586,1020576651,1021087314
|
||||
.long 1021595575,1022101432,1022604883,1023105929,1023604567,1024100796,1024594615,1025086024,1025575020,1026061603
|
||||
.long 1026545772,1027027525,1027506862,1027983780,1028458280,1028930359,1029400018,1029867254,1030332067,1030794455
|
||||
.long 1031254418,1031711954,1032167062,1032619742,1033069992,1033517810,1033963197,1034406151,1034846671,1035284755
|
||||
.long 1035720404,1036153615,1036584389,1037012723,1037438617,1037862069,1038283080,1038701647,1039117770,1039531448
|
||||
.long 1039942680,1040351465,1040757802,1041161689,1041563127,1041962114,1042358649,1042752731,1043144360,1043533534
|
||||
.long 1043920252,1044304514,1044686319,1045065665,1045442553,1045816980,1046188946,1046558451,1046925492,1047290071
|
||||
.long 1047652185,1048011834,1048369016,1048723732,1049075980,1049425759,1049773069,1050117909,1050460278,1050800175
|
||||
.long 1051137599,1051472550,1051805027,1052135029,1052462555,1052787604,1053110176,1053430270,1053747885,1054063021
|
||||
.long 1054375676,1054685850,1054993543,1055298753,1055601479,1055901722,1056199480,1056494753,1056787540,1057077840
|
||||
.long 1057365653,1057650977,1057933813,1058214159,1058492016,1058767381,1059040255,1059310638,1059578527,1059843923
|
||||
.long 1060106826,1060367233,1060625146,1060880563,1061133483,1061383907,1061631833,1061877261,1062120190,1062360620
|
||||
.long 1062598550,1062833980,1063066909,1063297336,1063525261,1063750684,1063973603,1064194019,1064411931,1064627338
|
||||
.long 1064840240,1065050636,1065258526,1065463909,1065666786,1065867154,1066065015,1066260367,1066453210,1066643544
|
||||
.long 1066831367,1067016680,1067199483,1067379774,1067557554,1067732821,1067905576,1068075818,1068243547,1068408763
|
||||
.long 1068571464,1068731650,1068889322,1069044479,1069197120,1069347245,1069494854,1069639946,1069782521,1069922579
|
||||
.long 1070060120,1070195142,1070327646,1070457632,1070585099,1070710046,1070832474,1070952382,1071069770,1071184638
|
||||
.long 1071296985,1071406812,1071514117,1071618901,1071721163,1071820903,1071918122,1072012818,1072104991,1072194642
|
||||
.long 1072281769,1072366374,1072448455,1072528012,1072605046,1072679556,1072751542,1072821003,1072887940,1072952352
|
||||
.long 1073014240,1073073603,1073130440,1073184753,1073236540,1073285802,1073332538,1073376748,1073418433,1073457592
|
||||
.long 1073494225,1073528332,1073559913,1073588967,1073615496,1073639498,1073660973,1073679922,1073696345,1073710241
|
||||
.long 1073721611,1073730454,1073736771,1073740561,1073741824,1073740561,1073736771,1073730454,1073721611,1073710241
|
||||
.long 1073696345,1073679922,1073660973,1073639498,1073615496,1073588967,1073559913,1073528332,1073494225,1073457592
|
||||
.long 1073418433,1073376748,1073332538,1073285802,1073236540,1073184753,1073130440,1073073603,1073014240,1072952352
|
||||
.long 1072887940,1072821003,1072751542,1072679556,1072605046,1072528012,1072448455,1072366374,1072281769,1072194642
|
||||
.long 1072104991,1072012818,1071918122,1071820903,1071721163,1071618901,1071514117,1071406812,1071296985,1071184638
|
||||
.long 1071069770,1070952382,1070832474,1070710046,1070585099,1070457632,1070327646,1070195142,1070060120,1069922579
|
||||
.long 1069782521,1069639946,1069494854,1069347245,1069197120,1069044479,1068889322,1068731650,1068571464,1068408763
|
||||
.long 1068243547,1068075818,1067905576,1067732821,1067557554,1067379774,1067199483,1067016680,1066831367,1066643544
|
||||
.long 1066453210,1066260367,1066065015,1065867154,1065666786,1065463909,1065258526,1065050636,1064840240,1064627338
|
||||
.long 1064411931,1064194019,1063973603,1063750684,1063525261,1063297336,1063066909,1062833980,1062598550,1062360620
|
||||
.long 1062120190,1061877261,1061631833,1061383907,1061133483,1060880563,1060625146,1060367233,1060106826,1059843923
|
||||
.long 1059578527,1059310638,1059040255,1058767381,1058492016,1058214159,1057933813,1057650977,1057365653,1057077840
|
||||
.long 1056787540,1056494753,1056199480,1055901722,1055601479,1055298753,1054993543,1054685850,1054375676,1054063021
|
||||
.long 1053747885,1053430270,1053110176,1052787604,1052462555,1052135029,1051805027,1051472550,1051137599,1050800175
|
||||
.long 1050460278,1050117909,1049773069,1049425759,1049075980,1048723732,1048369016,1048011834,1047652185,1047290071
|
||||
.long 1046925492,1046558451,1046188946,1045816980,1045442553,1045065665,1044686319,1044304514,1043920252,1043533534
|
||||
.long 1043144360,1042752731,1042358649,1041962114,1041563127,1041161689,1040757802,1040351465,1039942680,1039531448
|
||||
.long 1039117770,1038701647,1038283080,1037862069,1037438617,1037012723,1036584389,1036153615,1035720404,1035284755
|
||||
.long 1034846671,1034406151,1033963197,1033517810,1033069992,1032619742,1032167062,1031711954,1031254418,1030794455
|
||||
.long 1030332067,1029867254,1029400018,1028930359,1028458280,1027983780,1027506862,1027027525,1026545772,1026061603
|
||||
.long 1025575020,1025086024,1024594615,1024100796,1023604567,1023105929,1022604883,1022101432,1021595575,1021087314
|
||||
.long 1020576651,1020063586,1019548121,1019030256,1018509994,1017987335,1017462281,1016934832,1016404991,1015872758
|
||||
.long 1015338134,1014801122,1014261721,1013719934,1013175761,1012629204,1012080264,1011528943,1010975242,1010419162
|
||||
.long 1009860704,1009299870,1008736660,1008171077,1007603122,1007032796,1006460100,1005885036,1005307605,1004727809
|
||||
.long 1004145648,1003561124,1002974239,1002384994,1001793390,1001199428,1000603111,1000004439,999403415,998800038
|
||||
.long 998194311,997586236,996975812,996363043,995747930,995130473,994510675,993888536,993264059,992637245
|
||||
.long 992008094,991376610,990742793,990106644,989468165,988827359,988184225,987538766,986890984,986240879
|
||||
.long 985588453,984933708,984276646,983617267,982955574,982291568,981625251,980956623,980285688,979612445
|
||||
.long 978936898,978259047,977578894,976896441,976211688,975524639,974835295,974143656,973449725,972753504
|
||||
.long 972054994,971354196,970651112,969945745,969238095,968528165,967815955,967101468,966384706,965665669
|
||||
.long 964944360,964220780,963494932,962766816,962036435,961303790,960568883,959831716,959092290,958350608
|
||||
.long 957606670,956860479,956112036,955361344,954608403,953853216,953095785,952336111,951574196,950810042
|
||||
.long 950043650,949275023,948504163,947731070,946955747,946178196,945398418,944616416,943832191,943045745
|
||||
.long 942257081,941466198,940673101,939877790,939080267,938280535,937478595,936674448,935868098,935059546
|
||||
.long 934248793,933435842,932620694,931803352,930983817,930162092,929338177,928512076,927683790,926853322
|
||||
.long 926020672,925185843,924348837,923509656,922668302,921824777,920979082,920131221,919281194,918429004
|
||||
.long 917574653,916718143,915859476,914998653,914135678,913270551,912403276,911533853,910662286,909788576
|
||||
.long 908912725,908034735,907154608,906272347,905387953,904501429,903612776,902721998,901829095,900934069
|
||||
.long 900036924,899137661,898236282,897332790,896427186,895519473,894609652,893697727,892783698,891867569
|
||||
.long 890949341,890029016,889106597,888182086,887255485,886326796,885396022,884463164,883528225,882591207
|
||||
.long 881652112,880710943,879767701,878822389,877875009,876925563,875974054,875020483,874064853,873107167
|
||||
.long 872147426,871185633,870221790,869255900,868287963,867317984,866345964,865371905,864395810,863417681
|
||||
.long 862437520,861455330,860471112,859484870,858496606,857506321,856514019,855519701,854523370,853525028
|
||||
.long 852524677,851522321,850517961,849511600,848503239,847492882,846480531,845466188,844449856,843431536
|
||||
.long 842411232,841388945,840364679,839338435,838310216,837280024,836247863,835213733,834177638,833139580
|
||||
.long 832099562,831057586,830013654,828967769,827919934,826870150,825818421,824764748,823709135,822651583
|
||||
.long 821592095,820530675,819467323,818402043,817334838,816265709,815194659,814121692,813046808,811970011
|
||||
.long 810891304,809810688,808728167,807643743,806557419,805469196,804379079,803287068,802193167,801097379
|
||||
.long 799999706,798900150,797798714,796695401,795590213,794483153,793374223,792263427,791150767,790036244
|
||||
.long 788919863,787801625,786681534,785559591,784435800,783310163,782182683,781053363,779922204,778789210
|
||||
.long 777654384,776517728,775379244,774238936,773096806,771952857,770807092,769659512,768510122,767358923
|
||||
.long 766205919,765051111,763894504,762736098,761575898,760413906,759250125,758084557,756917205,755748072
|
||||
.long 754577161,753404474,752230015,751053785,749875788,748696026,747514503,746331221,745146182,743959390
|
||||
.long 742770848,741580558,740388522,739194745,737999228,736801974,735602987,734402269,733199822,731995651
|
||||
.long 730789757,729582143,728372813,727161768,725949013,724734549,723518380,722300508,721080937,719859669
|
||||
.long 718636707,717412054,716185713,714957687,713727978,712496590,711263525,710028787,708792378,707554301
|
||||
.long 706314559,705073155,703830092,702585372,701339000,700090977,698841307,697589992,696337036,695082441
|
||||
.long 693826211,692568348,691308855,690047736,688784993,687520629,686254647,684987051,683717842,682447025
|
||||
.long 681174602,679900576,678624950,677347728,676068911,674788504,673506508,672222928,670937767,669651026
|
||||
.long 668362709,667072820,665781362,664488336,663193747,661897597,660599890,659300629,657999816,656697454
|
||||
.long 655393548,654088099,652781111,651472587,650162530,648850943,647537830,646223192,644907034,643589359
|
||||
.long 642270169,640949467,639627258,638303543,636978327,635651611,634323400,632993696,631662503,630329823
|
||||
.long 628995660,627660017,626322897,624984303,623644239,622302707,620959711,619615253,618269338,616921967
|
||||
.long 615573145,614222875,612871159,611518001,610163404,608807372,607449906,606091012,604730691,603368947
|
||||
.long 602005783,600641203,599275210,597907806,596538995,595168781,593797166,592424154,591049748,589673951
|
||||
.long 588296766,586918198,585538248,584156920,582774218,581390144,580004702,578617896,577229728,575840202
|
||||
.long 574449320,573057087,571663506,570268579,568872310,567474703,566075761,564675486,563273883,561870954
|
||||
.long 560466703,559061133,557654248,556246051,554836544,553425732,552013618,550600205,549185496,547769495
|
||||
.long 546352205,544933630,543513772,542092635,540670223,539246538,537821584,536395365,534967884,533539144
|
||||
.long 532109148,530677900,529245404,527811662,526376678,524940456,523502998,522064309,520624391,519183248
|
||||
.long 517740883,516297300,514852502,513406493,511959275,510510853,509061229,507610408,506158392,504705185
|
||||
.long 503250791,501795212,500338453,498880516,497421405,495961124,494499676,493037064,491573292,490108363
|
||||
.long 488642281,487175049,485706671,484237150,482766489,481294693,479821764,478347705,476872522,475396216
|
||||
.long 473918791,472440251,470960600,469479840,467997976,466515010,465030947,463545789,462059541,460572205
|
||||
.long 459083786,457594286,456103710,454612060,453119340,451625555,450130706,448634799,447137835,445639820
|
||||
.long 444140756,442640647,441139496,439637307,438134084,436629829,435124548,433618242,432110916,430602573
|
||||
.long 429093217,427582852,426071480,424559105,423045732,421531363,420016002,418499653,416982319,415464004
|
||||
.long 413944711,412424444,410903207,409381002,407857835,406333708,404808624,403282588,401755603,400227673
|
||||
.long 398698801,397168991,395638246,394106570,392573967,391040440,389505993,387970630,386434353,384897167
|
||||
.long 383359076,381820082,380280190,378739403,377197725,375655159,374111709,372567379,371022173,369476093
|
||||
.long 367929144,366381329,364832652,363283116,361732726,360181484,358629395,357076462,355522689,353968079
|
||||
.long 352412636,350856364,349299266,347741347,346182609,344623057,343062693,341501523,339939549,338376774
|
||||
.long 336813204,335248841,333683689,332117752,330551034,328983538,327415267,325846226,324276419,322705848
|
||||
.long 321134518,319562433,317989595,316416009,314841679,313266607,311690799,310114257,308536985,306958988
|
||||
.long 305380268,303800829,302220676,300639811,299058239,297475964,295892988,294309316,292724951,291139898
|
||||
.long 289554160,287967740,286380643,284792871,283204430,281615322,280025552,278435122,276844038,275252302
|
||||
.long 273659918,272066891,270473223,268878918,267283981,265688415,264092224,262495412,260897982,259299937
|
||||
.long 257701283,256102022,254502159,252901697,251300640,249698991,248096755,246493935,244890535,243286558
|
||||
.long 241682010,240076892,238471210,236864966,235258165,233650811,232042906,230434456,228825464,227215933
|
||||
.long 225605867,223995270,222384147,220772500,219160334,217547651,215934457,214320755,212706549,211091842
|
||||
.long 209476638,207860942,206244756,204628085,203010932,201393302,199775198,198156624,196537583,194918080
|
||||
.long 193298119,191677702,190056834,188435520,186813762,185191564,183568930,181945865,180322371,178698453
|
||||
.long 177074115,175449360,173824192,172198615,170572633,168946249,167319468,165692293,164064728,162436778
|
||||
.long 160808445,159179733,157550647,155921191,154291367,152661180,151030634,149399733,147768480,146136880
|
||||
.long 144504935,142872651,141240030,139607077,137973796,136340190,134706263,133072019,131437462,129802595
|
||||
.long 128167423,126531950,124896179,123260114,121623759,119987118,118350194,116712992,115075515,113437768
|
||||
.long 111799753,110161476,108522939,106884147,105245103,103605812,101966277,100326502,98686491,97046247
|
||||
.long 95405776,93765079,92124163,90483029,88841683,87200127,85558366,83916404,82274245,80631892
|
||||
.long 78989349,77346620,75703709,74060620,72417357,70773924,69130324,67486561,65842639,64198563
|
||||
.long 62554335,60909960,59265442,57620785,55975992,54331067,52686014,51040837,49395541,47750128
|
||||
.long 46104602,44458968,42813230,41167391,39521455,37875426,36229307,34583104,32936819,31290457
|
||||
.long 29644021,27997515,26350943,24704310,23057618,21410872,19764076,18117233,16470347,14823423
|
||||
.long 13176464,11529474,9882456,8235416,6588356,4941281,3294193,1647099,0,-1647099
|
||||
.long -3294193,-4941281,-6588356,-8235416,-9882456,-11529474,-13176464,-14823423,-16470347,-18117233
|
||||
.long -19764076,-21410872,-23057618,-24704310,-26350943,-27997515,-29644021,-31290457,-32936819,-34583104
|
||||
.long -36229307,-37875426,-39521455,-41167391,-42813230,-44458968,-46104602,-47750128,-49395541,-51040837
|
||||
.long -52686014,-54331067,-55975992,-57620785,-59265442,-60909960,-62554335,-64198563,-65842639,-67486561
|
||||
.long -69130324,-70773924,-72417357,-74060620,-75703709,-77346620,-78989349,-80631892,-82274245,-83916404
|
||||
.long -85558366,-87200127,-88841683,-90483029,-92124163,-93765079,-95405776,-97046247,-98686491,-100326502
|
||||
.long -101966277,-103605812,-105245103,-106884147,-108522939,-110161476,-111799753,-113437768,-115075515,-116712992
|
||||
.long -118350194,-119987118,-121623759,-123260114,-124896179,-126531950,-128167423,-129802595,-131437462,-133072019
|
||||
.long -134706263,-136340190,-137973796,-139607077,-141240030,-142872651,-144504935,-146136880,-147768480,-149399733
|
||||
.long -151030634,-152661180,-154291367,-155921191,-157550647,-159179733,-160808445,-162436778,-164064728,-165692293
|
||||
.long -167319468,-168946249,-170572633,-172198615,-173824192,-175449360,-177074115,-178698453,-180322371,-181945865
|
||||
.long -183568930,-185191564,-186813762,-188435520,-190056834,-191677702,-193298119,-194918080,-196537583,-198156624
|
||||
.long -199775198,-201393302,-203010932,-204628085,-206244756,-207860942,-209476638,-211091842,-212706549,-214320755
|
||||
.long -215934457,-217547651,-219160334,-220772500,-222384147,-223995270,-225605867,-227215933,-228825464,-230434456
|
||||
.long -232042906,-233650811,-235258165,-236864966,-238471210,-240076892,-241682010,-243286558,-244890535,-246493935
|
||||
.long -248096755,-249698991,-251300640,-252901697,-254502159,-256102022,-257701283,-259299937,-260897982,-262495412
|
||||
.long -264092224,-265688415,-267283981,-268878918,-270473223,-272066891,-273659918,-275252302,-276844038,-278435122
|
||||
.long -280025552,-281615322,-283204430,-284792871,-286380643,-287967740,-289554160,-291139898,-292724951,-294309316
|
||||
.long -295892988,-297475964,-299058239,-300639811,-302220676,-303800829,-305380268,-306958988,-308536985,-310114257
|
||||
.long -311690799,-313266607,-314841679,-316416009,-317989595,-319562433,-321134518,-322705848,-324276419,-325846226
|
||||
.long -327415267,-328983538,-330551034,-332117752,-333683689,-335248841,-336813204,-338376774,-339939549,-341501523
|
||||
.long -343062693,-344623057,-346182609,-347741347,-349299266,-350856364,-352412636,-353968079,-355522689,-357076462
|
||||
.long -358629395,-360181484,-361732726,-363283116,-364832652,-366381329,-367929144,-369476093,-371022173,-372567379
|
||||
.long -374111709,-375655159,-377197725,-378739403,-380280190,-381820082,-383359076,-384897167,-386434353,-387970630
|
||||
.long -389505993,-391040440,-392573967,-394106570,-395638246,-397168991,-398698801,-400227673,-401755603,-403282588
|
||||
.long -404808624,-406333708,-407857835,-409381002,-410903207,-412424444,-413944711,-415464004,-416982319,-418499653
|
||||
.long -420016002,-421531363,-423045732,-424559105,-426071480,-427582852,-429093217,-430602573,-432110916,-433618242
|
||||
.long -435124548,-436629829,-438134084,-439637307,-441139496,-442640647,-444140756,-445639820,-447137835,-448634799
|
||||
.long -450130706,-451625555,-453119340,-454612060,-456103710,-457594286,-459083786,-460572205,-462059541,-463545789
|
||||
.long -465030947,-466515010,-467997976,-469479840,-470960600,-472440251,-473918791,-475396216,-476872522,-478347705
|
||||
.long -479821764,-481294693,-482766489,-484237150,-485706671,-487175049,-488642281,-490108363,-491573292,-493037064
|
||||
.long -494499676,-495961124,-497421405,-498880516,-500338453,-501795212,-503250791,-504705185,-506158392,-507610408
|
||||
.long -509061229,-510510853,-511959275,-513406493,-514852502,-516297300,-517740883,-519183248,-520624391,-522064309
|
||||
.long -523502998,-524940456,-526376678,-527811662,-529245404,-530677900,-532109148,-533539144,-534967884,-536395365
|
||||
.long -537821584,-539246538,-540670223,-542092635,-543513772,-544933630,-546352205,-547769495,-549185496,-550600205
|
||||
.long -552013618,-553425732,-554836544,-556246051,-557654248,-559061133,-560466703,-561870954,-563273883,-564675486
|
||||
.long -566075761,-567474703,-568872310,-570268579,-571663506,-573057087,-574449320,-575840202,-577229728,-578617896
|
||||
.long -580004702,-581390144,-582774218,-584156920,-585538248,-586918198,-588296766,-589673951,-591049748,-592424154
|
||||
.long -593797166,-595168781,-596538995,-597907806,-599275210,-600641203,-602005783,-603368947,-604730691,-606091012
|
||||
.long -607449906,-608807372,-610163404,-611518001,-612871159,-614222875,-615573145,-616921967,-618269338,-619615253
|
||||
.long -620959711,-622302707,-623644239,-624984303,-626322897,-627660017,-628995660,-630329823,-631662503,-632993696
|
||||
.long -634323400,-635651611,-636978327,-638303543,-639627258,-640949467,-642270169,-643589359,-644907034,-646223192
|
||||
.long -647537830,-648850943,-650162530,-651472587,-652781111,-654088099,-655393548,-656697454,-657999816,-659300629
|
||||
.long -660599890,-661897597,-663193747,-664488336,-665781362,-667072820,-668362709,-669651026,-670937767,-672222928
|
||||
.long -673506508,-674788504,-676068911,-677347728,-678624950,-679900576,-681174602,-682447025,-683717842,-684987051
|
||||
.long -686254647,-687520629,-688784993,-690047736,-691308855,-692568348,-693826211,-695082441,-696337036,-697589992
|
||||
.long -698841307,-700090977,-701339000,-702585372,-703830092,-705073155,-706314559,-707554301,-708792378,-710028787
|
||||
.long -711263525,-712496590,-713727978,-714957687,-716185713,-717412054,-718636707,-719859669,-721080937,-722300508
|
||||
.long -723518380,-724734549,-725949013,-727161768,-728372813,-729582143,-730789757,-731995651,-733199822,-734402269
|
||||
.long -735602987,-736801974,-737999228,-739194745,-740388522,-741580558,-742770848,-743959390,-745146182,-746331221
|
||||
.long -747514503,-748696026,-749875788,-751053785,-752230015,-753404474,-754577161,-755748072,-756917205,-758084557
|
||||
.long -759250125,-760413906,-761575898,-762736098,-763894504,-765051111,-766205919,-767358923,-768510122,-769659512
|
||||
.long -770807092,-771952857,-773096806,-774238936,-775379244,-776517728,-777654384,-778789210,-779922204,-781053363
|
||||
.long -782182683,-783310163,-784435800,-785559591,-786681534,-787801625,-788919863,-790036244,-791150767,-792263427
|
||||
.long -793374223,-794483153,-795590213,-796695401,-797798714,-798900150,-799999706,-801097379,-802193167,-803287068
|
||||
.long -804379079,-805469196,-806557419,-807643743,-808728167,-809810688,-810891304,-811970011,-813046808,-814121692
|
||||
.long -815194659,-816265709,-817334838,-818402043,-819467323,-820530675,-821592095,-822651583,-823709135,-824764748
|
||||
.long -825818421,-826870150,-827919934,-828967769,-830013654,-831057586,-832099562,-833139580,-834177638,-835213733
|
||||
.long -836247863,-837280024,-838310216,-839338435,-840364679,-841388945,-842411232,-843431536,-844449856,-845466188
|
||||
.long -846480531,-847492882,-848503239,-849511600,-850517961,-851522321,-852524677,-853525028,-854523370,-855519701
|
||||
.long -856514019,-857506321,-858496606,-859484870,-860471112,-861455330,-862437520,-863417681,-864395810,-865371905
|
||||
.long -866345964,-867317984,-868287963,-869255900,-870221790,-871185633,-872147426,-873107167,-874064853,-875020483
|
||||
.long -875974054,-876925563,-877875009,-878822389,-879767701,-880710943,-881652112,-882591207,-883528225,-884463164
|
||||
.long -885396022,-886326796,-887255485,-888182086,-889106597,-890029016,-890949341,-891867569,-892783698,-893697727
|
||||
.long -894609652,-895519473,-896427186,-897332790,-898236282,-899137661,-900036924,-900934069,-901829095,-902721998
|
||||
.long -903612776,-904501429,-905387953,-906272347,-907154608,-908034735,-908912725,-909788576,-910662286,-911533853
|
||||
.long -912403276,-913270551,-914135678,-914998653,-915859476,-916718143,-917574653,-918429004,-919281194,-920131221
|
||||
.long -920979082,-921824777,-922668302,-923509656,-924348837,-925185843,-926020672,-926853322,-927683790,-928512076
|
||||
.long -929338177,-930162092,-930983817,-931803352,-932620694,-933435842,-934248793,-935059546,-935868098,-936674448
|
||||
.long -937478595,-938280535,-939080267,-939877790,-940673101,-941466198,-942257081,-943045745,-943832191,-944616416
|
||||
.long -945398418,-946178196,-946955747,-947731070,-948504163,-949275023,-950043650,-950810042,-951574196,-952336111
|
||||
.long -953095785,-953853216,-954608403,-955361344,-956112036,-956860479,-957606670,-958350608,-959092290,-959831716
|
||||
.long -960568883,-961303790,-962036435,-962766816,-963494932,-964220780,-964944360,-965665669,-966384706,-967101468
|
||||
.long -967815955,-968528165,-969238095,-969945745,-970651112,-971354196,-972054994,-972753504,-973449725,-974143656
|
||||
.long -974835295,-975524639,-976211688,-976896441,-977578894,-978259047,-978936898,-979612445,-980285688,-980956623
|
||||
.long -981625251,-982291568,-982955574,-983617267,-984276646,-984933708,-985588453,-986240879,-986890984,-987538766
|
||||
.long -988184225,-988827359,-989468165,-990106644,-990742793,-991376610,-992008094,-992637245,-993264059,-993888536
|
||||
.long -994510675,-995130473,-995747930,-996363043,-996975812,-997586236,-998194311,-998800038,-999403415,-1000004439
|
||||
.long -1000603111,-1001199428,-1001793390,-1002384994,-1002974239,-1003561124,-1004145648,-1004727809,-1005307605,-1005885036
|
||||
.long -1006460100,-1007032796,-1007603122,-1008171077,-1008736660,-1009299870,-1009860704,-1010419162,-1010975242,-1011528943
|
||||
.long -1012080264,-1012629204,-1013175761,-1013719934,-1014261721,-1014801122,-1015338134,-1015872758,-1016404991,-1016934832
|
||||
.long -1017462281,-1017987335,-1018509994,-1019030256,-1019548121,-1020063586,-1020576651,-1021087314,-1021595575,-1022101432
|
||||
.long -1022604883,-1023105929,-1023604567,-1024100796,-1024594615,-1025086024,-1025575020,-1026061603,-1026545772,-1027027525
|
||||
.long -1027506862,-1027983780,-1028458280,-1028930359,-1029400018,-1029867254,-1030332067,-1030794455,-1031254418,-1031711954
|
||||
.long -1032167062,-1032619742,-1033069992,-1033517810,-1033963197,-1034406151,-1034846671,-1035284755,-1035720404,-1036153615
|
||||
.long -1036584389,-1037012723,-1037438617,-1037862069,-1038283080,-1038701647,-1039117770,-1039531448,-1039942680,-1040351465
|
||||
.long -1040757802,-1041161689,-1041563127,-1041962114,-1042358649,-1042752731,-1043144360,-1043533534,-1043920252,-1044304514
|
||||
.long -1044686319,-1045065665,-1045442553,-1045816980,-1046188946,-1046558451,-1046925492,-1047290071,-1047652185,-1048011834
|
||||
.long -1048369016,-1048723732,-1049075980,-1049425759,-1049773069,-1050117909,-1050460278,-1050800175,-1051137599,-1051472550
|
||||
.long -1051805027,-1052135029,-1052462555,-1052787604,-1053110176,-1053430270,-1053747885,-1054063021,-1054375676,-1054685850
|
||||
.long -1054993543,-1055298753,-1055601479,-1055901722,-1056199480,-1056494753,-1056787540,-1057077840,-1057365653,-1057650977
|
||||
.long -1057933813,-1058214159,-1058492016,-1058767381,-1059040255,-1059310638,-1059578527,-1059843923,-1060106826,-1060367233
|
||||
.long -1060625146,-1060880563,-1061133483,-1061383907,-1061631833,-1061877261,-1062120190,-1062360620,-1062598550,-1062833980
|
||||
.long -1063066909,-1063297336,-1063525261,-1063750684,-1063973603,-1064194019,-1064411931,-1064627338,-1064840240,-1065050636
|
||||
.long -1065258526,-1065463909,-1065666786,-1065867154,-1066065015,-1066260367,-1066453210,-1066643544,-1066831367,-1067016680
|
||||
.long -1067199483,-1067379774,-1067557554,-1067732821,-1067905576,-1068075818,-1068243547,-1068408763,-1068571464,-1068731650
|
||||
.long -1068889322,-1069044479,-1069197120,-1069347245,-1069494854,-1069639946,-1069782521,-1069922579,-1070060120,-1070195142
|
||||
.long -1070327646,-1070457632,-1070585099,-1070710046,-1070832474,-1070952382,-1071069770,-1071184638,-1071296985,-1071406812
|
||||
.long -1071514117,-1071618901,-1071721163,-1071820903,-1071918122,-1072012818,-1072104991,-1072194642,-1072281769,-1072366374
|
||||
.long -1072448455,-1072528012,-1072605046,-1072679556,-1072751542,-1072821003,-1072887940,-1072952352,-1073014240,-1073073603
|
||||
.long -1073130440,-1073184753,-1073236540,-1073285802,-1073332538,-1073376748,-1073418433,-1073457592,-1073494225,-1073528332
|
||||
.long -1073559913,-1073588967,-1073615496,-1073639498,-1073660973,-1073679922,-1073696345,-1073710241,-1073721611,-1073730454
|
||||
.long -1073736771,-1073740561
|
||||
|
||||
.endif
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,121 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/FFT32_izero.asm
|
||||
;;!
|
||||
;;! \brief Zero out the imaginary part of the complex input to the FFT
|
||||
;;!
|
||||
;;! \date Jan 11, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
.if __TI_EABI__
|
||||
.asg FFT32_izero, _FFT32_izero
|
||||
.endif
|
||||
|
||||
|
||||
.def _FFT32_izero
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <--------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*izero)(void *); /* +16 Pointer to the zero-out imaginary () */
|
||||
;; void (*calc)(void *); /* +18 Pointer to the calculation () */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;;}CFFT32;
|
||||
;;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void FFT32_izero(CFFT32_handle)
|
||||
;; This function zeros the imaginary part of the complex input, in the case of
|
||||
;; Complex FFT modules.
|
||||
;;
|
||||
|
||||
|
||||
_FFT32_izero:
|
||||
; Fill the imaginary part of the samples with ZERO
|
||||
MOVL XAR5,*XAR4 ; XAR5=ipcbptr
|
||||
MOV ACC,*+XAR4[4] ; ACC=size
|
||||
SUBB ACC,#1 ; AL=size-1
|
||||
|
||||
MOVL XAR6,XAR5 ; XAR6=ipcbptr
|
||||
|
||||
ADDB XAR5,#2 ; XAR5=ipcbptr+2
|
||||
ADDB XAR6,#3 ; XAR5=ipcbptr+3
|
||||
MOVB XAR0,#4 ; XAR0=0
|
||||
|
||||
NOP *,ARP5
|
||||
RPT AL
|
||||
|| MOV *0++,#0 ; Clear MSW of imaginary part
|
||||
|
||||
NOP *,ARP6
|
||||
RPT AL
|
||||
|| MOV *0++,#0 ; Clear LSW of imaginart part
|
||||
|
||||
LRETR
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,153 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/RFFT32_brev.asm
|
||||
;;!
|
||||
;;! \brief Bit Reversal routine for the real 32-bit FFT
|
||||
;;!
|
||||
;;! \date Feb 26, 2002
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
.if __TI_EABI__
|
||||
.asg RFFT32_brev, _RFFT32_brev
|
||||
.endif
|
||||
|
||||
|
||||
.def _RFFT32_brev
|
||||
;; Module Structure
|
||||
;; typedef struct { <------------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*calc)(void *); /* +16 Pointer to the calculation () */
|
||||
;; void (*split)(void *); /* +18 Pointer to the split(0 */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;; }RFFT32;
|
||||
;;==============================================================================
|
||||
;; \fn void RFFT32_brev(int32_t *src, int32_t *dst, uint16_t size)
|
||||
;; \brief Bit Reversal routine for the complex 32-bit FFT
|
||||
;;
|
||||
;; This function bit reverses a 2N-point real sequence (x(n)) stored in
|
||||
;; consecutive memory locations, that is,
|
||||
;; src(0) = x(0) | src(1) = x(1)
|
||||
;; src(2) = x(2) | src(3) = y(3)
|
||||
;; ... | ...
|
||||
;; src(2N-2) = x(2N-2) | src(2N-1) = y(2N-1)
|
||||
;; If src = dst, then in-place bit reversal is performed.
|
||||
;; The destination array should be aligned to 2N long words, where 2N is the size
|
||||
;; of the Real FFT (Remember, a 2N-pt real FFT is done with an N-pt complex FFT
|
||||
;; followed by some post processing to get the spectrum of x(n))
|
||||
;;
|
||||
;; \param src (XAR4) pointer to the source array or buffer
|
||||
;; \param dst (XAR5) pointer to the destination array or buffer
|
||||
;; \param size( AL) size of the buffer (must be a power of 2)
|
||||
;;==============================================================================
|
||||
;;
|
||||
_RFFT32_brev:
|
||||
MOVL XAR0,XAR4 ; XAR0->src
|
||||
NOP *,ARP5
|
||||
|
||||
MOV AH,AL ; AH=size
|
||||
LSR AH,#1 ; AH=size/2
|
||||
MOVZ AR7,AH ; XAR7=size/2
|
||||
SUBB XAR7,#1 ; XAR7=(size/2)-1
|
||||
|
||||
CMPR 0 ; TC=1, if src==dst
|
||||
BF off_place,NTC ; If not equal, jump to off place bit rev
|
||||
|
||||
next_data1:
|
||||
MOVL XT,*XAR4 ; XT=*src
|
||||
MOVL P,*XAR5 ; P=*dst
|
||||
MOVL XAR0,XAR4 ; XAR0=src
|
||||
CMPR 2 ; check src<dst
|
||||
BF noswap,TC ; if src<dst, do not swap *src & *dst
|
||||
|
||||
MOVL *XAR4,P ; *src=*dst
|
||||
MOVL *XAR5,XT ; *dst=*src
|
||||
MOVL XT,*+XAR4[2] ; XT=*(src+1)
|
||||
MOVL P,*+XAR5[2] ; P=*(dst+1)
|
||||
MOVL *+XAR4[2],P ; *(src+1)=*(dst+1)
|
||||
MOVL *+XAR5[2],XT ; *(dst+1)=*(src+1)
|
||||
|
||||
noswap:
|
||||
ADDB XAR4,#4 ; XAR4=src+2
|
||||
MOVZ AR0,AL ; AR0=2*size
|
||||
NOP *BR0++ ; ; dst=br(dst+2*size)
|
||||
BANZ next_data1,AR7--
|
||||
LRETR
|
||||
|
||||
off_place:
|
||||
MOVZ AR0,AL ; AR0=2*size
|
||||
|
||||
next_data2:
|
||||
MOVL XT,*XAR4++ ; XT=*src
|
||||
MOVL P,*XAR4++ ; P=*(src+1)
|
||||
MOVL *XAR5,XT ; *dst=*src
|
||||
MOVL *+XAR5[2],P ; *(dst+1)=*(src+1)
|
||||
NOP *BR0++
|
||||
BANZ next_data2,AR7--
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,117 @@
|
||||
;;;#############################################################################
|
||||
;;! \file source/RFFT32_brev_RT.asm
|
||||
;;!
|
||||
;;! \brief Real-Time storage of acquired data samples in bit reversed order
|
||||
;;!
|
||||
;;! \date Jan 11, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
.if __TI_EABI__
|
||||
.asg RFFT32_brev_RT, _RFFT32_brev_RT
|
||||
.endif
|
||||
|
||||
.def _RFFT32_brev_RT
|
||||
;;==============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void RFFT32_brev_RT(RFFT32_Handle)
|
||||
;; This function acquires N samples in bit-reversed order to cater to the complex
|
||||
;; FFT computation. The buffer should be aligned to 2N words
|
||||
;;==============================================================================
|
||||
;; typedef struct{<------------ XAR4
|
||||
;; int16_t acqflag; // + 0 Acquisition flag
|
||||
;; int16_t count; // + 1 Integer counter
|
||||
;; int32_t input; // + 2 Input data
|
||||
;; int32_t *tempptr; // + 4 Temporary Pointer
|
||||
;; int32_t *buffptr; // + 6 Pointer to the destination buffer
|
||||
;; int16_t size; // + 7 Number of samples
|
||||
;; void (*update)(void *); // + 8 Pointer to the update function
|
||||
;; }RFFT32_brev_RT_ACQ;
|
||||
;;==============================================================================
|
||||
;;
|
||||
|
||||
_RFFT32_brev_RT:
|
||||
MOV ACC,*XAR4++ ; ACC=acqflag
|
||||
SBF noacq,EQ
|
||||
|
||||
MOV ACC,*XAR4++ ; ACC=count
|
||||
SBF acqover,EQ ; if count=0, acquisition is complete
|
||||
|
||||
DEC *--XAR4 ; count=count-1
|
||||
MOV ACC,*+XAR4[7]<<1 ; ACC=2*size
|
||||
MOVL XAR0,ACC ; AR0=2*size
|
||||
|
||||
MOVL XAR5,*+XAR4[3] ; XAR5=tempptr
|
||||
MOVL ACC,*+XAR4[1] ; ACC=input
|
||||
MOVL *XAR5,ACC ; *tempptr=input
|
||||
NOP *BR0++
|
||||
MOVL *+XAR4[3],XAR5
|
||||
noacq:
|
||||
LRETR
|
||||
|
||||
acqover:
|
||||
MOV ACC,*+XAR4[6]
|
||||
MOV *--XAR4,ACC ; count=size
|
||||
MOV *--XAR4,#0 ; acqflag=0
|
||||
|
||||
MOVL XAR5,*+XAR4[6] ; XAR5=buffptr
|
||||
MOVL *+XAR4[4],XAR5 ; tempptr=buffptr
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,142 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/RFFT32_mag.asm
|
||||
;;!
|
||||
;;! \brief Magnitude function for the real FFT
|
||||
;;!
|
||||
;;! \date Nov 2, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
.if __TI_EABI__
|
||||
.asg RFFT32_mag, _RFFT32_mag
|
||||
.endif
|
||||
|
||||
.def _RFFT32_mag
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <------------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*calc)(void *); /* +16 Pointer to the calculation () */
|
||||
;; void (*split)(void *); /* +18 Pointer to the split(0 */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;; }RFFT32;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void RFFT32_mag(RFFT32_Handle)
|
||||
;; This function computes the magnitude square of the Real FFT output. Allows in-place
|
||||
;; and off-place storage of the magnitude square results. The spectrum goes from
|
||||
;; DC to Nyquist frequency; the mag spectrum is symmetric about the Nyquist frequency
|
||||
;;
|
||||
|
||||
_RFFT32_mag:
|
||||
SETC SXM
|
||||
|
||||
MOVL XAR7,*XAR4 ; XAR5=ipcbptr
|
||||
MOVL XAR6,*+XAR4[6] ; XAR6=magptr
|
||||
|
||||
MOVZ AR0,*+XAR4[4] ; AR0=size
|
||||
|
||||
MAG_LP:
|
||||
ZAPA ; ACC=0, P=0
|
||||
QMACL P,*XAR7,*XAR7++ ; Q15*Q15=Q30
|
||||
QMACL P,*XAR7,*XAR7++ ; Q15*Q15+Q30=Q30
|
||||
ADDL ACC,P
|
||||
MOVL *XAR6++,ACC ; Store in Q30
|
||||
BANZ MAG_LP,AR0--
|
||||
|
||||
; Find maximum magnitude
|
||||
ADDB XAR4,#4 ; XAR4->size
|
||||
MOVB ACC,#0
|
||||
MOVL *+XAR4[6],ACC ; peakmag=0
|
||||
MOVZ AR0,*XAR4 ; AR0=size
|
||||
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
|
||||
|
||||
MOV ACC,#0
|
||||
|
||||
;Find the maximum value among the FFT Magnitudes
|
||||
RPT AR0
|
||||
|| MAXL ACC,*XAR5++
|
||||
|
||||
MOVL *+XAR4[6],ACC ; update peak magnitude
|
||||
MOVB XAR7,#0 ; XAR7=0
|
||||
MOVL XAR5,*+XAR4[2] ; XAR5=magptr
|
||||
;Find the spectral bin corresponding to maximum magnitude.
|
||||
NEXT_BIN:
|
||||
MAXL ACC,*XAR5++
|
||||
NOP *XAR7++
|
||||
SBF NEXT_BIN,NEQ
|
||||
|
||||
NOP *--XAR7
|
||||
ADDB XAR4,#8 ; XAR4->peakfrq
|
||||
MOV *XAR4,AR7 ; update peak magnitude
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,264 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/RFFT32_split.asm
|
||||
;;!
|
||||
;;! \brief Split function for the Real FFT
|
||||
;;!
|
||||
;;! \date Feb 26, 2002
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
.include "sel_q.asm"
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
.if __TI_EABI__
|
||||
.asg RFFT32_split, _RFFT32_split
|
||||
.endif
|
||||
|
||||
|
||||
.def _RFFT32_split
|
||||
;; Module Structure
|
||||
;; typedef struct { <------------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*calc)(void *); /* +16 Pointer to the calculation () */
|
||||
;; void (*split)(void *); /* +18 Pointer to the split(0 */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;; }RFFT32;
|
||||
;;==============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void RFFT32_split(RFFT32_Handle handle)
|
||||
;;
|
||||
;; This function performs split operation to obtain 65 spectral bins of
|
||||
;; 128-point real valued sequence from the 64-point complex FFT output
|
||||
;===============================================================================
|
||||
; Computation Buffer for k=1:(N/2)-1) & N=64
|
||||
;==============================================================================
|
||||
;
|
||||
; Non Bitrev I/P COMPLEX FFT(N) O/P E/O SEPERATION Final FFT output
|
||||
; ___________ ______________ ____________ ___________
|
||||
; |__g(0)____| |__R(0)______| |___RP(0)__| =R(0) |__GR(0)__| = {RP(0)+IP(0)}/2
|
||||
; |__g(1)____| |__I(0)______| |___IP(0)__| =I(0) |__GI(0)__| = 0
|
||||
; |__g(2)____| |__R(k)______| |___RP(k)__| |_________|
|
||||
; |__g(3)____| |__I(k)______| |___IM(k)__| |_________|
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |__R(N/2)____| |_RP(N/2___| =R(N/2) |_GR(N/2)_| =RP(N/2)/2
|
||||
; |__________| |__R(N/2)____| |_IP(N/2)__| =I(N/2) |_GI(N/2)_| =-IP(N/2)/2
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |____________| |__________| |_________|
|
||||
; |__________| |___R(N-k)___| |___RM(k)__| |_GR(N-1)_|
|
||||
; |_g(2*N-1)_| |___I(N-k)___| |___IP(k)__| |_GI(N-1)_|
|
||||
; |__GR(N)__|={RP(0)-IP(0)}/2
|
||||
; |__GI(N)__|=0
|
||||
;
|
||||
;===========================================================================
|
||||
; Note: IM(0)=RM(0)=0
|
||||
; RM(N/2)=IM(N/2)=0
|
||||
;===========================================================================
|
||||
; EVEN/ODD FFT SEPERATION
|
||||
;===========================================================================
|
||||
; RP(K) = [R(K) + R(N-k)]/2
|
||||
; RM(K) = [R(K) - R(N-K)]/2
|
||||
; IP(K) = [I(K) + I(N-K)]/2
|
||||
; IM(K) = [I(K) - I(N-K)]/2 K=1:N/2
|
||||
;=========================================================================
|
||||
; EVEN/ODD FFT MERGE
|
||||
;=========================================================================
|
||||
; GR(K)={RP(K) - WI(K)*RM(K) + WR(K)*IP(K)}/2
|
||||
; GI(K)={IM(K) - WI(K)*IP(K) - WR(K)*RM(K)}/2
|
||||
; GR(N-K)={RP(K) + WI(K)*RM(K) - WR(K)*IP(K)}/2
|
||||
; GI(N-K)={-IM(K) - WI(K)*IP(K) - WR(K)*RM(K)}/2
|
||||
;
|
||||
; WR(k) <-- Cosine table (AR5)
|
||||
; WI(K) <-- Sine table (AR2)
|
||||
;======================================================================
|
||||
|
||||
_RFFT32_split:
|
||||
PUSH XAR1 ; Context Save
|
||||
PUSH XAR2
|
||||
PUSH XAR3
|
||||
|
||||
SETC SXM
|
||||
SPM -1
|
||||
|
||||
MOV ACC,*+XAR4[4]<<2; ACC=4*size
|
||||
MOVL XAR2,*XAR4 ; XAR2=ipcbptr ----->R(0)
|
||||
ADDL ACC,*XAR4 ; XAR3=ipcbptr+4*size
|
||||
MOVL XAR3,ACC ; XAR3 ------>GR(N)
|
||||
|
||||
MOVL XAR5,*+XAR4[2] ; XAR5=tfptr -----> WI
|
||||
MOVL XAR6,*+XAR4[2] ; XAR6=tfptr
|
||||
|
||||
MOV T,*XAR4 ; T=size
|
||||
|
||||
MOV ACC,*+XAR4[4]<<15 ; AH=size/2
|
||||
MOVZ AR7,AH ; XAR7=size/2
|
||||
SUBB XAR7,#2 ; XAR7=(size/2)-2
|
||||
ADDB XAR4,#13
|
||||
MOV T,*XAR4 ; T=ratio
|
||||
MOVZ AR0,*XAR4 ; AR0=ratio
|
||||
SUBB XAR4,#13
|
||||
MPY ACC,T,AH ; ACC=ratio*size/2
|
||||
ADDL ACC,*+XAR4[2] ;
|
||||
MOVL XAR6,ACC ; WRWIOST=tfptr+ratio*N/2 ----> COS(Angle)
|
||||
|
||||
NOP *,ARP5 ; XAR5 ----> WI SIN(Angle)--->increment
|
||||
NOP *0++
|
||||
NOP *,ARP6
|
||||
NOP *0-- ; XAR6 ----> WR COS(Angle)--->decrement
|
||||
|
||||
MOV TL,#0
|
||||
MOV T,#0
|
||||
; DC and Nyquist Bins
|
||||
ZAPA ; ACC=0,P=0
|
||||
MOVL ACC,*XAR2 ; ACC=RP(0), where RP(0)=R(0)
|
||||
SFR ACC,#1 ; ACC=RP(0)/2
|
||||
MOVL P,*+XAR2[2] ; P=IP(0), where IP(0)=I(0)
|
||||
SUBL ACC,P<<PM ; ACC={RP(0)-IP(0)}/2 in Q31
|
||||
MOVL *XAR3++,ACC ; GR(N)={RP(0)-IP(0)}/2 in Q31
|
||||
MOVL *XAR3++,XT ; GI(N)=0
|
||||
SUBB XAR3,#8 ; XAR3->R(N-K)
|
||||
|
||||
ADDL ACC,P ; ACC={RP(0)+IP(0)}/2 in Q31
|
||||
MOVL *XAR2++,ACC ; GR(0)={RP(0)+IP(0)}/2
|
||||
MOVL *XAR2++,XT ; XAR2->R(k), GI(0)=IM(0)-RM(0), Where IM(0)=RM(0)=0
|
||||
|
||||
; Rest of bins
|
||||
nextbin: ; XAR2->R(k), Where k=1:N/2-1
|
||||
MOVL ACC,*XAR2 ; ACC=R(k)
|
||||
SFR ACC,#1 ; ACC=R(k)/2
|
||||
MOVL P,*XAR3 ; P=R(N-k)
|
||||
SUBL ACC,P<<PM ; ACC={R(k)-R(N-k)}/2
|
||||
|
||||
MOVL *XAR3,ACC ; R(k)=RM(k)={R(k)-R(N-k)}/2
|
||||
ADDL ACC,P ; ACC={R(k)+R(N-k)}/2
|
||||
MOVL *XAR2,ACC ; R(N-k)=RP(k)={R(k)+R(N-k)}/2
|
||||
|
||||
MOVL ACC,*+XAR2[2] ; ACC=I(k)
|
||||
SFR ACC,#1 ; ACC=I(k)/2
|
||||
MOVL P,*+XAR3[2] ; P=I(N-k)
|
||||
SUBL ACC,P<<PM ; ACC={I(k)-I(N-k)}/2
|
||||
|
||||
MOVL *+XAR2[2],ACC ; I(k)=IM(k)={I(k)-I(N-k)}/2
|
||||
ADDL ACC,P ; ACC={I(k)+I(N-k)}/2
|
||||
MOVL *+XAR3[2],ACC ; I(N-k)=IP(k)={I(k)+I(N-k)}/2
|
||||
|
||||
MOVL XT,*XAR5 ; XT=WI(k)
|
||||
NOP *0++
|
||||
QMPYL ACC,XT,*+XAR3[2]; ACC=WI(k)*IP(k)
|
||||
QMPYL P,XT,*XAR3 ; P=WI(k)*RM(k)
|
||||
MOVL XAR1,ACC ; XAR1=WI(k)*IP(k)
|
||||
|
||||
MOVL XT,*XAR6 ; XT=WR(k)
|
||||
NOP *0--
|
||||
QMPYL ACC,XT,*+XAR3[2]; P=WR(k)*IP(k)
|
||||
SUBL ACC,P ; ACC=WR(k)*IP(k)-WI(k)*RM(k)
|
||||
|
||||
.if(TF_QFMAT==Q30)
|
||||
LSL ACC,#1
|
||||
.endif
|
||||
|
||||
MOVL P,*XAR2 ; P=RP(k)
|
||||
ADDL ACC,P<<PM ; ACC=RP(k)+WR(k)*IP(k)-WI(k)*RM(k) in Q30
|
||||
MOVL *XAR2++,ACC ; GR(k)={RP(k)+WR(k)*IP(k)-WI(k)*RM(k)}/2 in Q31
|
||||
NEG ACC ;
|
||||
ADDL ACC,P ; ACC=GR(N-k)=RP(k)-WR(k)*IP(k)+WI(k)*RM(k) in Q30
|
||||
QMPYL P,XT,*XAR3 ; P=WR(k)*RM(k)
|
||||
MOVL *XAR3,ACC ; ACC=GR(N-k)={RP(k)-WR(k)*IP(k)+WI(k)*RM(k)}/2 in Q31
|
||||
|
||||
MOVL ACC,XAR1 ; ACC=WI(k)*IP(k)
|
||||
NEG ACC ; ACC=-WI(k)*IP(k)
|
||||
SUBL ACC,P ; ACC=-WI(k)*IP(k)-WR(k)*RM(k)
|
||||
|
||||
.if(TF_QFMAT==Q30)
|
||||
LSL ACC,#1 ; ACC=(QI*WR-QR*WI) (Q30)
|
||||
.endif
|
||||
|
||||
MOVL P,*XAR2 ; P=IM(k)
|
||||
ADDL ACC,P<<PM ; ACC=IM(K)-WI(k)*IP(k)-WR(k)*RM(k) in Q30
|
||||
MOVL *XAR2++,ACC ; GI(k)={IM(k)-WI(k)*IP(k)-WR(k)*RM(k)}/2 in Q31
|
||||
SUBL ACC,P ; ACC=-IM(K)-WI(k)*IP(k)-WR(k)*RM(k) in Q30
|
||||
MOVL *+XAR3[2],ACC ; GI(N-k)={-IM(k)-WI(k)*IP(k)-WR(k)*RM(k)}/2 in Q31
|
||||
SUBB XAR3,#4
|
||||
BANZ nextbin,AR7--
|
||||
|
||||
MOVL ACC,*XAR2 ; ACC=R(N/2)
|
||||
SFR ACC,#1 ; ACC=R(N/2)/2
|
||||
MOVL *XAR2,ACC ; GR(N/2)=R(N/2)/2
|
||||
|
||||
MOVL ACC,*+XAR2[2] ; ACC=I(N/2)
|
||||
NEG ACC ; ACC=-I(N/2)
|
||||
SFR ACC,#1 ; ACC=-I(N/2)/2
|
||||
MOVL *+XAR2[2],ACC ; GI(N/2)=-I(N/2)/2
|
||||
|
||||
SPM 0
|
||||
POP XAR3 ; Context Restore
|
||||
POP XAR2
|
||||
POP XAR1
|
||||
LRETR
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,192 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/RFFT32_win.asm
|
||||
;;!
|
||||
;;! \brief Real FFT Windowing Function
|
||||
;;!
|
||||
;;! \date Apr 26, 2001
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
.if __TI_EABI__
|
||||
.asg RFFT32_win, _RFFT32_win
|
||||
.endif
|
||||
|
||||
|
||||
.def _RFFT32_win
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <------------- XAR4
|
||||
;; int32_t *ipcbptr; /* +0 Pointer to input buffer */
|
||||
;; int32_t *tfptr /* +2 Pointer to twiddle factors */
|
||||
;; int16_t size; /* +4 Size of the FFT */
|
||||
;; int16_t nrstage; /* +5 Number of FFT stages (log2(size)) */
|
||||
;; int16_t *magptr; /* +6 Pointer to the magnitude buffer */
|
||||
;; int16_t *winptr; /* +8 Pointer to the sampling window */
|
||||
;; int16_t peakmag; /* +10 Peak magnitude value */
|
||||
;; int16_t peakfrq; /* +11 Peak Frequency */
|
||||
;; int16_t ratio; /* +12 Twiddles Skip factor */
|
||||
;; void (*init)(void); /* +14 Pointer to the initialization () */
|
||||
;; void (*calc)(void *); /* +16 Pointer to the calculation () */
|
||||
;; void (*split)(void *); /* +18 Pointer to the split(0 */
|
||||
;; void (*mag)(void *); /* +20 Pointer to the magnitude () */
|
||||
;; void (*win)(void *); /* +22 Pointer to the windowing () */
|
||||
;; }RFFT32;
|
||||
ARG_IPCBPTR .set 0
|
||||
ARG_TFPTR .set 0
|
||||
ARG_SIZE .set 2
|
||||
ARG_NRSTAGE .set 3
|
||||
ARG_MAGPTR .set 4
|
||||
ARG_WINPTR .set 6
|
||||
ARG_PEAKMAG .set 8
|
||||
ARG_PEAKFREQ .set 9
|
||||
ARG_RATIO .set 10
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn RFFT32_win
|
||||
;;! \brief Real FFT Windowing Function
|
||||
;;! \param RFFT32_Handle pointer to an RFFT32 object
|
||||
;;
|
||||
;; This function windows a 2N-point real valued data sequence stored as an
|
||||
;; N point complex sequence in bit-reversed format in the location pointed
|
||||
;; to by "ipcbptr". It is to be used with the real FFT module
|
||||
;;
|
||||
;; A 2N-pt real FFT is carried out by first doing an N point complex FFT followed
|
||||
;; by post processing (unwrapping) to get the correct answer. The windows are of
|
||||
;; size N/2 (they are symmetrical).
|
||||
;;
|
||||
;; This routine will apply the window in two steps
|
||||
;;
|
||||
;; Step 1: Forward walk through win
|
||||
;; Loop for i = 0 to N/2 - 1 {
|
||||
;; p -> ipcbptr, q -> win
|
||||
;; a = *p (Q31) , b = *q (Q31)
|
||||
;; c = *(p+1) (Q31), d = *(q+1)(Q31)
|
||||
;; n = sizeof(ipcbptr) = 2(32-bit wide)*N
|
||||
;; temp1 = ((a x b) >> 32)
|
||||
;; = ((A * 2^31 x B * 2^31) x 2^-32) where A and B are the unscaled decimal values
|
||||
;; = A x B x 2^30 (Q30)
|
||||
;; temp2 = ((c x d) >> 32)
|
||||
;; = ((C * 2^31 x D * 2^31) x 2^-32) where C and D are the unscaled decimal values
|
||||
;; = C x D x 2^30 (Q30)
|
||||
;; temp1 = temp1 << 1 (Q31)
|
||||
;; temp2 = temp2 << 1 (Q31)
|
||||
;; *p = temp1 , *(p+1) = temp2
|
||||
;; p = p rcadd n (this is the bit reversed address)
|
||||
;; q = q + 1
|
||||
;; }
|
||||
;;
|
||||
;; Step 2: Backward walk through win
|
||||
;; Loop for i = N/2 to N - 1 {
|
||||
;; p -> ipcbptr(from the last step), q -> win(N/2)
|
||||
;; a = *p (Q31) , b = *q (Q31)
|
||||
;; c = *(p+1) (Q31), d = *(q+1)(Q31)
|
||||
;; temp1 = (A x B x 2^30) << 1 (Q31)
|
||||
;; temp2 = (C x D x 2^30) << 1 (Q31)
|
||||
;; *p = temp1 , *(p+1) = temp2
|
||||
;; p = p rcadd n (this is the bit reversed address)
|
||||
;; q = q - 1
|
||||
;; }
|
||||
;;=============================================================================
|
||||
;;
|
||||
_RFFT32_win:
|
||||
; size -> size of RFFT i.e. 2N-point
|
||||
; size'-> size of CFFT used to get the RFFT i.e. N-point
|
||||
; The structure element "size" should be the size of the CFFT i.e. N
|
||||
MOVL XAR5,*XAR4++ ; XAR5 = ipcbptr
|
||||
MOVL XAR6,*+XAR4[ARG_WINPTR] ; XAR6 = winptr
|
||||
MOV ACC,*+XAR4[ARG_SIZE]<<15 ; AH = size'/2
|
||||
MOVH AR0,ACC<<2 ; AR0 = 2(complex)*size'
|
||||
MOVZ AR7,AH ; AR7 = (size'/2)
|
||||
SUBB XAR7,#1 ; AR7 = (size'/2)-1
|
||||
MOVL XAR4,XAR7 ; AR4 = (size'/2)-1
|
||||
|
||||
nextsamp1:
|
||||
MOVL XT,*XAR6++ ; XT = win[i] | i++
|
||||
QMPYL ACC,XT,*XAR5 ; ACC = (signed XT * signed [*XAR5.real]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *XAR5, ACC ; *XAR5.real = ACC
|
||||
|
||||
MOVL XT,*XAR6++ ; XT = win[i] | i++
|
||||
QMPYL ACC,XT,*+XAR5[2] ; ACC = (signed XT * signed [*XAR5.imag]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *+XAR5[2], ACC ; *XAR5.imag = ACC
|
||||
NOP *BR0++ ; AR5L = AR5L rcadd AR0
|
||||
BANZ nextsamp1,AR7--
|
||||
; At the end of this loop, XAR6 points to the
|
||||
; N/2 th element of the real input
|
||||
nextsamp2:
|
||||
MOVL XT,*--XAR6 ; XT = win[i] | i--
|
||||
QMPYL ACC,XT,*XAR5 ; ACC = (signed XT * signed [*XAR5.real]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *XAR5, ACC ; *XAR5.real = ACC
|
||||
|
||||
MOVL XT,*--XAR6 ; XT = win[i] | i--
|
||||
QMPYL ACC,XT,*+XAR5[2] ; ACC = (signed XT * signed [*XAR5.imag]) >> 32
|
||||
; ARP = 5 (i.e. XAR5)
|
||||
LSL ACC,#1 ; ACC = ACC * 2
|
||||
MOVL *+XAR5[2], ACC ; *XAR5.imag = ACC
|
||||
NOP *BR0++ ; AR5L = AR5L rcadd AR0
|
||||
BANZ nextsamp2,AR4--
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,236 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/fir16.asm
|
||||
;;!
|
||||
;;! \brief 16-bit FIR filter
|
||||
;;!
|
||||
;;! \date May 11, 2010
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg FIR16_init, _FIR16_init
|
||||
.asg FIR16_calc, _FIR16_calc
|
||||
.endif
|
||||
|
||||
.def _FIR16_init
|
||||
.def _FIR16_calc
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void FIR16_calc(FIR16_handle)
|
||||
;;
|
||||
;; This routine implements the non-recursive difference equation of an
|
||||
;; all-zero filter(FIR), of order N. All the coefficients of all-zero
|
||||
;; filter are assumed to be less than 1 in magnitude.
|
||||
;;=============================================================================
|
||||
;;
|
||||
;; Algorithm: Y = sat(X0*C0 + X1*C1 + X2*C2 + ... Xn*Cn) >> 15
|
||||
;; Xn = Xn-1
|
||||
;; .
|
||||
;; .
|
||||
;; X2 = X1
|
||||
;; X1 = X0
|
||||
;;
|
||||
;; X0 = input, Q15
|
||||
;; X1,..,Xn = Data, Q15
|
||||
;; C0,..,Cn = Coef, Q15
|
||||
;; Y = output, Q15
|
||||
;; n = N - 1 (N = number of taps, must always be an even number)
|
||||
;;
|
||||
;; This program uses the Dual-MAC capability of the C28x. The data
|
||||
;; and coef structures must be organized into 32-bit words as follows:
|
||||
;;
|
||||
;; 31 16 15 0
|
||||
;; +------------+------------+
|
||||
;; *Data -> | N-2 | Index | 0 lowest address
|
||||
;; | SatMax | 2
|
||||
;; | SatMin | 4
|
||||
;; | unused | (N/2)-1 | 6
|
||||
;; +------------+------------+
|
||||
;; | . | . | 0
|
||||
;; | . | . | 2
|
||||
;; tail-> | . | X(1) | 4
|
||||
;; head-> | X((n+1)/2) | X(0) | 6<- index value before
|
||||
;; | X(n) | X((n-1)/2) | 8 executing FIR
|
||||
;; | X(n-1) | . | .
|
||||
;; | . | . | .
|
||||
;; +------------+------------+
|
||||
;;
|
||||
;; 31 16 15 0
|
||||
;; +------------+------------+
|
||||
;; *Coef -> | C(n) | C((n-1)/2) | 0 lowest address
|
||||
;; | C(n-1) | . | 2
|
||||
;; | . | . | 4
|
||||
;; | . | C(2) | .
|
||||
;; | . | C(1) | .
|
||||
;; | C((n+1)/2) | C(0) | .
|
||||
;; +------------+------------+
|
||||
;;
|
||||
;; * For maximum performance, locate Data & Coef
|
||||
;; structures in seperate RAM blocks.
|
||||
;; * The Data & Coef pointers must always point to the lowest
|
||||
;; address of the array and always aligned to even address
|
||||
;;
|
||||
;; Before calling FIR, need to initialize following data parameters:
|
||||
;;
|
||||
;; Index = 0
|
||||
;; N = Number of filter taps (must always be even)
|
||||
;; N-2 = Size of data buffer (must always be an even number)
|
||||
;; (N/2)-1 = number of times to repeat Dual MAC operation
|
||||
;; SatMax = 0x00FFFFFF (corresponds to SPM of -6)
|
||||
;; SatMin = 0xFF000000 (corresponds to SPM of -6)
|
||||
;;
|
||||
;; Note: Don't forget to clear all data values
|
||||
;==============================================================================
|
||||
;; Function Input: This function accepts the handle of the below structure
|
||||
;;
|
||||
;; typedef struct { <------------ XAR4
|
||||
;; int32_t *coeff_ptr; /* +0 Pointer to Filter coefficient */
|
||||
;; int32_t * dbuffer_ptr; /* +2 Delay buffer ptr */
|
||||
;; int16_t cbindex; /* +4 Circular Buffer Index */
|
||||
;; int16_t order; /* +5 Order of the Filter */
|
||||
;; int16_t input; /* +6 Latest Input sample */
|
||||
;; int16_t output; /* +7 Filter Output */
|
||||
;; void (*init)(void *); /* +8 Ptr to Init funtion */
|
||||
;; void (*calc)(void *); /* +10 Ptr to calc fn */
|
||||
;; }FIR16;
|
||||
;;
|
||||
_FIR16_init:
|
||||
MOV *+XAR4[6],#0 ; XAR4->ouput, input=0
|
||||
MOV *+XAR4[7],#0 ; output=0
|
||||
|
||||
MOVL XAR6,*+XAR4[2] ; XAR6=dbuffer_ptr
|
||||
MOV AL,*+XAR4[5] ; AL=order
|
||||
MOV AH,AL ; AH=order
|
||||
TBIT AL,#0
|
||||
ADDB AL,#1 ; AL=order+1
|
||||
MOV AL,AH,TC ; AL=order, if odd
|
||||
|
||||
MOV AH,AL
|
||||
SUBB AH,#1
|
||||
MOV *+XAR4[4],AH ; cbindex = order, even
|
||||
; = order-1, odd
|
||||
|
||||
RPT AL
|
||||
|| MOV *XAR6++,#0
|
||||
|
||||
LRETR
|
||||
|
||||
ConstTable:
|
||||
PosSatVal: .long 0x00FFFFFF ; Corresponds to >> 6
|
||||
NegSatVal: .long 0xFF000000 ; Corresponds to >> 6
|
||||
|
||||
;;FILTER_ORDER .set 43
|
||||
;;RPT_COUNT .set (FILTER_ORDER/2)
|
||||
|
||||
_FIR16_calc:
|
||||
PUSH XAR1 ; Context Save
|
||||
|
||||
SETC SXM,OVM ; AR4=FIR16_handle->coeff_ptr
|
||||
SPM -6 ; Create guard band of >> 6
|
||||
|
||||
MOVL XAR7,*XAR4 ; XAR4->coeff_ptr, XAR7=coeff_ptr
|
||||
MOVZ AR1,*+XAR4[4] ; XAR4->coeff_ptr, AR1=cbindex
|
||||
|
||||
MOVL XAR6,*+XAR4[2] ; XAR4->coeff_ptr, XAR6=dbuffer_ptr
|
||||
MOVL ACC,*XAR6 ; ACC = -:X
|
||||
MOV AH,@AL ; ACC = X:X
|
||||
MOV AL,*+XAR4[6] ; ACC = X:Input
|
||||
|
||||
MOVL *XAR6%++,ACC ; Store in data array and inc circ address
|
||||
MOVL *+XAR4[2],XAR6 ; XAR4->coeff_ptr, update the dbuffer pointer
|
||||
|
||||
MOV ACC,*+XAR4[5]<<15 ; AR0=cbindex
|
||||
MOVZ AR0,AH ; AR0=order/2
|
||||
|
||||
ZAPA ; Zero the ACC, P registers and OVC counter
|
||||
;; <<VC140828 - debug only
|
||||
;;.asg 0, N
|
||||
;;.loop
|
||||
;;DMAC ACC:P,*XAR6%++,*XAR7++ ; XT = *+XAR6[AR1%++], Temp = *XAR7++
|
||||
;; ; ACC = (XT.MSW*Temp.MSW) << PM (>> -6)
|
||||
;; ; P = (XT.LSW*Temp.LSW) << PM (>> -6)
|
||||
;;.eval N + 1, N ; increment N
|
||||
;;.break N = (RPT_COUNT+1)
|
||||
;;.endloop
|
||||
;; VC140828>>
|
||||
|
||||
RPT AR0
|
||||
|| DMAC ACC:P,*XAR6%++,*XAR7++
|
||||
|
||||
ADDL ACC,P ; Add the two sums with shift
|
||||
|
||||
MOVW DP,#PosSatVal
|
||||
MINL ACC,@PosSatVal ; Saturate result
|
||||
|
||||
MOVW DP,#NegSatVal
|
||||
MAXL ACC,@NegSatVal
|
||||
|
||||
MOVH *+XAR4[7],ACC<<7 ; Store saturated result (Q15)
|
||||
|
||||
SPM 0
|
||||
|
||||
POP XAR1
|
||||
CLRC OVM
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,219 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/fir16_alt.asm
|
||||
;;!
|
||||
;;! \brief Alternate 16-bit FIR filter
|
||||
;;!
|
||||
;;! \date Aug 11, 2014
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg FIR16_alt_calc, _FIR16_alt_calc
|
||||
.asg FIR16_alt_init, _FIR16_alt_init
|
||||
.endif
|
||||
|
||||
.def _FIR16_alt_init
|
||||
.def _FIR16_alt_calc
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <------------ XAR4
|
||||
;; int32_t *coeff_ptr; /* +0 Pointer to Filter coefficient */
|
||||
;; int32_t * dbuffer_ptr; /* +2 Delay buffer ptr */
|
||||
;; int16_t cbindex; /* +4 Circular Buffer Index */
|
||||
;; int16_t order; /* +5 Order of the Filter */
|
||||
;; int16_t input; /* +6 Latest Input sample */
|
||||
;; int16_t output; /* +7 Filter Output */
|
||||
;; void (*init)(void *); /* +8 Ptr to Init funtion */
|
||||
;; void (*calc)(void *); /* +10 Ptr to calc fn */
|
||||
;; }FIR16;
|
||||
;;
|
||||
ARG_COEFF_PTR .set 0
|
||||
ARG_DBUFFER_PTR .set 2
|
||||
ARG_CBINDEX .set 4
|
||||
ARG_ORDER .set 5
|
||||
ARG_INPUT .set 6
|
||||
ARG_OUTPUT .set 7
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn FIR_alt_init
|
||||
;;! \brief Initialization function for the alternate FIR function
|
||||
;;! \param FIR16_handle pointer to an FIR16 object
|
||||
;;
|
||||
;; This routine will zero out the dbuffer and, if necessary, alter
|
||||
;; "order" to make it even if its odd
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;
|
||||
_FIR16_alt_init:
|
||||
MOV *+XAR4[ARG_INPUT],#0 ; input=0
|
||||
MOV *+XAR4[ARG_OUTPUT],#0 ; output=0
|
||||
|
||||
MOVL XAR6,*+XAR4[ARG_DBUFFER_PTR] ; XAR6=dbuffer_ptr
|
||||
MOV AL,*+XAR4[ARG_ORDER] ; AL=order
|
||||
MOV AH,AL ; AH=order
|
||||
TBIT AL,#0 ; if(AL(0) == 1) TC = 1 else TC = 0
|
||||
ADDB AL,#1 ; AL=order+1
|
||||
MOV AL,AH,TC ; if(TC == 1(odd)) AL = order (AH)
|
||||
; else (even) AL = order + 1 (AL)
|
||||
; make the order odd so that nTaps is even
|
||||
MOV AH,AL ; AH = new_order(always odd)
|
||||
SUBB AH,#1 ; AH = new_order - 1 (always even)
|
||||
MOV *+XAR4[ARG_ORDER],AH ; order = new_order - 1 (always even)
|
||||
|
||||
RPT AL ; repeat AL(order(TC=1)/order+1(TC=0)) + 1 times
|
||||
|| MOV *XAR6++,#0 ; clear out the dbuffer elements
|
||||
|
||||
LRETR
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn FIR_alt_calc
|
||||
;;! \brief Alternate FIR function
|
||||
;;! \param FIR16_handle pointer to an FIR16 object
|
||||
;;
|
||||
;; This routine will use the LP addressing mode for circular buffer addressing
|
||||
;; i.e *+XAR6[AR1%++] instead of *AR6%++, allowing for greater than 256 tap filters
|
||||
;;
|
||||
;; \note The filter coefficients need to be stored in the following order for the
|
||||
;; filter to work correctly i.e. (filter size is L = Order + 1)
|
||||
;;
|
||||
;; Index LSW MSW
|
||||
;; +---------+---------+
|
||||
;; 0 | h(L/2-1)| h(L-1) |
|
||||
;; 2 | h(L/2-2)| h(L-2) |
|
||||
;; 4 | h(L/2-3)| h(L-3) |
|
||||
;; 6 | h(L/2-4)| h(L-4) |
|
||||
;; ... | ... | ... |
|
||||
;; L/2-3 | h(2) | h(L/2+2)|
|
||||
;; L/2-2 | h(1) | h(L/2+1)|
|
||||
;; L/2-1 | h(0) | h(L/2) |
|
||||
;; +---------+---------+
|
||||
;;
|
||||
;; Register usage:
|
||||
;; AR0 : repeat block counter (order)
|
||||
;; AR1H/AR1L : buffer size-1/index pointer
|
||||
;; XAR7 : coefficient pointer
|
||||
;; XAR6 : delay line pointer (circular buffer)
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;
|
||||
|
||||
ConstTable:
|
||||
PosSatVal: .long 0x00FFFFFF ; Corresponds to >> 6
|
||||
NegSatVal: .long 0xFF000000 ; Corresponds to >> 6
|
||||
|
||||
FILTER_SIZE .set 44
|
||||
|
||||
_FIR16_alt_calc:
|
||||
PUSH XAR1 ; Context Save
|
||||
SETC SXM, OVM ; Turn on sign extension and
|
||||
; overflow mode to saturate
|
||||
SPM -6 ; guard band of 6 bits for the
|
||||
; product (P) register
|
||||
MOVL XAR7, *+XAR4[ARG_COEFF_PTR] ; XAR7 = coeff_ptr
|
||||
MOVL XAR6, *+XAR4[ARG_DBUFFER_PTR] ; XAR6 = dbuffer_ptr
|
||||
MOV AH, *+XAR4[ARG_ORDER] ; ACC = [order : 0]
|
||||
MOV AL, *+XAR4[ARG_CBINDEX] ; ACC = [order : cbindex]
|
||||
MOVL XAR1, ACC ; XAR1 = [order : cbindex]
|
||||
LSR AH, #1 ; AH = order/2
|
||||
MOV AR0, AH ; AR0 = order/2 (for RPT)
|
||||
MOV ACC, *+XAR6[AR1] ; ACC = [ - : X ] X is whats in the delay line
|
||||
MOV AH, AL ; ACC = [ X : X] - is being shifted out
|
||||
MOV AL, *+XAR4[ARG_INPUT] ; ACC = [ X : input]
|
||||
|
||||
.lp_amode
|
||||
SETC AMODE ; C2xLP addressing mode to allow
|
||||
; *+XAR6[AR1%++]
|
||||
MOVL *+XAR6[AR1%++], ACC ; *XAR6[AR1] = [ X : input], AR1+=2
|
||||
ZAPA
|
||||
;; <<VC140828 - debug only
|
||||
;; .asg 0, N
|
||||
;; .loop
|
||||
;; DMAC ACC:P,*+XAR6[AR1%++],*XAR7++ ; XT = *+XAR6[AR1%++], Temp = *XAR7++
|
||||
;; ; ACC = (XT.MSW*Temp.MSW) << PM (>> -6)
|
||||
;; ; P = (XT.LSW*Temp.LSW) << PM (>> -6)
|
||||
;; .eval N + 1, N ; increment N
|
||||
;; .break N = (FILTER_SIZE/2)
|
||||
;; .endloop
|
||||
;; VC140828>>
|
||||
RPT AR0 ; Repeat order/2 + 1 times
|
||||
|| DMAC ACC:P,*+XAR6[AR1%++],*XAR7++ ; XT = *+XAR6[AR1%++], Temp = *XAR7++
|
||||
; ACC = (XT.MSW*Temp.MSW) << PM (>> -6)
|
||||
; P = (XT.LSW*Temp.LSW) << PM (>> -6)
|
||||
|
||||
.c28_amode
|
||||
CLRC AMODE ; Back to C28x addressing mode
|
||||
ADDL ACC, P ; ACC += P
|
||||
MOVW DP,#PosSatVal
|
||||
MINL ACC,@PosSatVal ; Saturate result
|
||||
|
||||
MOVW DP,#NegSatVal
|
||||
MAXL ACC,@NegSatVal
|
||||
|
||||
MOVH *+XAR4[ARG_OUTPUT],ACC<<7 ; Store saturated result (Q15)
|
||||
; output = ACC << 7
|
||||
MOV *+XAR4[ARG_CBINDEX], AR1 ; Store AR1(index for the next sample)
|
||||
SPM 0
|
||||
POP XAR1 ; Restore
|
||||
CLRC SXM, OVM ; Clear sign extension and saturate mode
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,196 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/fir32.asm
|
||||
;;!
|
||||
;;! \brief 32-bit FIR filter
|
||||
;;!
|
||||
;;! \date Jan 11, 2011
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg FIR32_init, _FIR32_init
|
||||
.asg FIR32_calc, _FIR32_calc
|
||||
.endif
|
||||
|
||||
.def _FIR32_init
|
||||
.def _FIR32_calc
|
||||
;;
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void FIR16_calc(FIR16_handle)
|
||||
;;
|
||||
;; This routine implements the non-recursive difference equation of an
|
||||
;; all-zero filter(FIR), of order N. All the coefficients of all-zero
|
||||
;; filter are assumed to be less than 1 in magnitude.
|
||||
;;=============================================================================
|
||||
;;
|
||||
;; Difference Equation :
|
||||
;;
|
||||
;; y(n)=H(0)*x(n)+H(1)*x(n-1)+H(2)*x(n-2)+....+H(N)*x(n-N)
|
||||
;;
|
||||
;; where
|
||||
;; y(n)=output sample of the filter at index n
|
||||
;; x(n)=input sample of the filter at index n
|
||||
;;
|
||||
;; Transfer Function :
|
||||
;;
|
||||
;; Y(z) -1 -2 -N+1 -N
|
||||
;; ----- = h(0) + h(1) z + h(2) z + ... +h(N-1) z + h(N) z
|
||||
;; X(z)
|
||||
;;
|
||||
;; Network Diagram :
|
||||
;
|
||||
;; dbuffer[0] dbuffer[1] dbuffer[2] dbuffer[N}
|
||||
;; Input -1 x(n-1) -1 x(n-2) x(n-N)
|
||||
;; x(n) >------o----z---->-o----z---->-o--- - ->- - o
|
||||
;; | | | |
|
||||
;; | | | |
|
||||
;; | | | |
|
||||
;; v H(0) v H(1) v H(2) v H(N)
|
||||
;; | | | |
|
||||
;; | | | | output
|
||||
;; |---->-----(+)---->----(+)-- - -> - (+)-----> y(n)
|
||||
;;
|
||||
;; Symbols Used :
|
||||
;; H(0),H(1),H(2),...,H(N) : filter coefficients
|
||||
;; x(n-1),x(n-2),...,x(n-N) : filter states
|
||||
;; x(n) : filter input
|
||||
;; y(n) : filter output
|
||||
;;=============================================================================
|
||||
;; Function Input: This function accepts the handle of the below structure
|
||||
;;
|
||||
;; typedef struct { <------------ XAR4
|
||||
;; int32_t *coeff_ptr; /* +0 Pointer to Filter coefficient */
|
||||
;; int32_t * dbuffer_ptr; /* +2 Delay buffer ptr */
|
||||
;; int16_t cbindex; /* +4 Circular Buffer Index */
|
||||
;; int16_t order; /* +5 Order of the Filter */
|
||||
;; int16_t input; /* +6 Latest Input sample */
|
||||
;; int16_t output; /* +7 Filter Output */
|
||||
;; void (*init)(void *); /* +8 Ptr to Init funtion */
|
||||
;; void (*calc)(void *); /* +10 Ptr to calc fn */
|
||||
;; }FIR32;
|
||||
;;
|
||||
|
||||
_FIR32_init:
|
||||
ADDB XAR4,#2
|
||||
MOV *+XAR4[4],#0 ; XAR4->ouput, input=0
|
||||
MOV *+XAR4[6],#0 ; output=0
|
||||
|
||||
MOVL XAR6,*XAR4 ; XAR6=dbuffer_ptr
|
||||
MOV ACC,*+XAR4[3] << 1 ; AL=2*order
|
||||
MOV AH,AL ; AH=2*order
|
||||
ADDB AL,#1 ; AL=2*order+1
|
||||
MOV *+XAR4[2],AH ; cbindex = 2*order (will wrap around if offset > 2*order)
|
||||
|
||||
RPT AL
|
||||
|| MOV *XAR6++,#0
|
||||
|
||||
LRETR
|
||||
|
||||
ConstTable:
|
||||
PosSatVal: .long 0x00FFFFFF ; Corresponds to >> 6
|
||||
NegSatVal: .long 0xFF000000 ; Corresponds to >> 6
|
||||
|
||||
FILTER_SIZE .set 44
|
||||
|
||||
_FIR32_calc:
|
||||
PUSH XAR1 ; Context Save
|
||||
|
||||
SETC SXM,OVM ; AR4=FIR16_handle->coeff_ptr
|
||||
SPM 0 ; Create guard band of >> 6
|
||||
|
||||
MOVL XAR7,*XAR4 ; XAR4->coeff_ptr, XAR7=coeff_ptr
|
||||
MOVZ AR1,*+XAR4[4] ; XAR4->coeff_ptr, AR1=cbindex
|
||||
|
||||
MOVL XAR6,*+XAR4[2] ; XAR4->coeff_ptr, XAR6=dbuffer_ptr
|
||||
MOVL ACC,*+XAR4[6] ; ACC = X:Input
|
||||
|
||||
MOVL *XAR6%++,ACC ; Store in data array and inc circ address
|
||||
MOVL *+XAR4[2],XAR6 ; XAR4->coeff_ptr, update the dbuffer pointer
|
||||
|
||||
MOV ACC,*+XAR4[5] ; AR0=order
|
||||
MOVZ AR0,AL ; AR0=order
|
||||
|
||||
ZAPA ; Zero the ACC, P registers and OVC counter
|
||||
;; <<VC140828 - debug only
|
||||
;;.asg 0, N
|
||||
;;.loop
|
||||
;;QMACL P,*+XAR6[AR1%++],*XAR7++ ; ACC = ACC + P << PM = ACC + P << 0
|
||||
;; ; P = (signed[*+XAR6[AR1%++]] * signed[*XAR7++]) >> 32
|
||||
;;.eval N + 1, N ; increment N
|
||||
;;.break N = FILTER_SIZE
|
||||
;;.endloop
|
||||
;; VC140828>>
|
||||
RPT AR0
|
||||
|| QMACL P,*XAR6%++,*XAR7++
|
||||
|
||||
ADDL ACC,P ; Add the two sums with shift
|
||||
|
||||
ADDB XAR4,#1
|
||||
MOVL *+XAR4[7],ACC ; Store saturated result (Q30)
|
||||
|
||||
SPM 0
|
||||
|
||||
POP XAR1
|
||||
CLRC OVM
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,210 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/fir32_alt.asm
|
||||
;;!
|
||||
;;! \brief Alternate 32-bit FIR filter
|
||||
;;!
|
||||
;;! \date Aug 29, 2014
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg FIR32_alt_init, _FIR32_alt_init
|
||||
.asg FIR32_alt_calc, _FIR32_alt_calc
|
||||
.endif
|
||||
|
||||
.def _FIR32_alt_init
|
||||
.def _FIR32_alt_calc
|
||||
|
||||
;; Module Structure
|
||||
;; typedef struct { <------------ XAR4
|
||||
;; long *coeff_ptr; /* +0 Pointer to Filter coefficient */
|
||||
;; long * dbuffer_ptr; /* +2 Delay buffer ptr */
|
||||
;; int cbindex; /* +4 Circular Buffer Index */
|
||||
;; int order; /* +5 Order of the Filter */
|
||||
;; int input; /* +6 Latest Input sample */
|
||||
;; int output; /* +7 Filter Output */
|
||||
;; void (*init)(void *); /* +8 Ptr to Init funtion */
|
||||
;; void (*calc)(void *); /* +10 Ptr to calc fn */
|
||||
;; }FIR32;
|
||||
;;
|
||||
ARG_DBUFFER_PTR .set 0
|
||||
ARG_CBINDEX .set 2
|
||||
ARG_ORDER .set 3
|
||||
ARG_INPUT .set 4
|
||||
ARG_OUTPUT .set 6
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn FIR_alt_init
|
||||
;;! \brief Initialization function for the alternate FIR function
|
||||
;;! \param FIR32_handle pointer to an FIR32 object
|
||||
;;
|
||||
;; This routine will zero out the dbuffer
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;
|
||||
_FIR32_alt_init:
|
||||
ADDB XAR4, #2 ; XAR4 -> dbuffer_ptr
|
||||
MOV *+XAR4[ARG_INPUT],#0 ; input=0
|
||||
MOV *+XAR4[ARG_OUTPUT],#0 ; output=0
|
||||
|
||||
MOVL XAR6,*+XAR4[ARG_DBUFFER_PTR] ; XAR6=dbuffer_ptr
|
||||
ZAPA ; ACC = P = 0
|
||||
MOV ACC,*+XAR4[ARG_ORDER] << 1 ; AL= order * 2
|
||||
ADDB AL, #1 ; AL = order * 2 + 1
|
||||
|
||||
RPT AL ; repeat order * 2 + 2 times
|
||||
|| MOV *XAR6++,#0 ; clear out the dbuffer elements
|
||||
|
||||
LRETR
|
||||
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;! \fn FIR_alt_calc
|
||||
;;! \brief Alternate FIR function
|
||||
;;! \param FIR32_handle pointer to an FIR32 object
|
||||
;;
|
||||
;; This routine will use the LP addressing mode for circular buffer addressing
|
||||
;; i.e *+XAR6[AR1%++] instead of *AR6%++, allowing for greater than 256 tap filters
|
||||
;; Transfer Function :
|
||||
;;
|
||||
;; \note The filter coefficients need to be stored in the following order for the
|
||||
;; filter to work correctly i.e. (filter size is L = Order + 1)
|
||||
;;
|
||||
;; Index
|
||||
;; +---------+
|
||||
;; 0 | h(L-1) |
|
||||
;; 2 | h(L-2) |
|
||||
;; 4 | h(L-3) |
|
||||
;; 6 | h(L-4) |
|
||||
;; ... | ... |
|
||||
;; L-3 | h(2) |
|
||||
;; L-2 | h(1) |
|
||||
;; L-1 | h(0) |
|
||||
;; +---------+
|
||||
;;
|
||||
;; Register usage:
|
||||
;; AR0 : repeat block counter (order)
|
||||
;; AR1H/AR1L : buffer size-1/index pointer
|
||||
;; XAR7 : coefficient pointer
|
||||
;; XAR6 : delay line pointer (circular buffer)
|
||||
;;
|
||||
;;=============================================================================
|
||||
;;
|
||||
|
||||
ConstTable:
|
||||
PosSatVal: .long 0x00FFFFFF ; Corresponds to >> 6
|
||||
NegSatVal: .long 0xFF000000 ; Corresponds to >> 6
|
||||
|
||||
FILTER_SIZE .set 44
|
||||
|
||||
_FIR32_alt_calc:
|
||||
PUSH XAR1 ; Context Save
|
||||
SETC SXM, OVM ; Turn on sign extension and
|
||||
; overflow mode to saturate
|
||||
SPM 0 ; no scaling for the product (P) register
|
||||
; changing this to SPM 1, will shift P left by 1
|
||||
; during the accumulation giving a Q31 result
|
||||
MOVL XAR7, *XAR4++ ; XAR7 = coeff_ptr, XAR4 -> dbuffer_ptr
|
||||
MOVL XAR6, *+XAR4[ARG_DBUFFER_PTR] ; XAR6 = dbuffer_ptr
|
||||
MOV AH, *+XAR4[ARG_ORDER] ; ACC = [order : 0]
|
||||
MOV AR0, AH ; AR0 = order (for RPT)
|
||||
LSL AH, #1 ; = [order*2: 0] (<< 1 to get the 32-bit size)
|
||||
MOV AL, *+XAR4[ARG_CBINDEX] ; ACC = [order+1*2 : cbindex]
|
||||
MOVL XAR1, ACC ; XAR1 = [order+1*2 : cbindex]
|
||||
MOVL ACC, *+XAR4[ARG_INPUT] ; ACC = input
|
||||
|
||||
.lp_amode
|
||||
SETC AMODE ; C2xLP addressing mode to allow
|
||||
; *+XAR6[AR1%++]
|
||||
MOVL *+XAR6[AR1%++], ACC ; *XAR6[AR1] = input, AR1+=2
|
||||
ZAPA
|
||||
;; <<VC140828 - debug only
|
||||
;;.asg 0, N
|
||||
;;.loop
|
||||
;;QMACL P,*+XAR6[AR1%++],*XAR7++ ; ACC = ACC + P << PM = ACC + P << 0
|
||||
;; ; P = (signed[*+XAR6[AR1%++]] * signed[*XAR7++]) >> 32
|
||||
;;.eval N + 1, N ; increment N
|
||||
;;.break N = FILTER_SIZE
|
||||
;;.endloop
|
||||
;; VC140828>>
|
||||
|
||||
RPT AR0 ; Repeat order/2 + 1 times
|
||||
|| QMACL P,*+XAR6[AR1%++],*XAR7++ ; ACC = ACC + P << PM = ACC + P << 0
|
||||
; P = (signed[*+XAR6[AR1%++]] * signed[*XAR7++]) >> 32
|
||||
; Let A = input(decimal) B = coeff(decimal)
|
||||
; C = A << 31 (Q31) D = B << 31 (Q31)
|
||||
; P = (C * D) >> 32
|
||||
; = (A*2^31 * B^2^31) * 2^-32
|
||||
; = (A * B) * 2^30 -> Q30
|
||||
; ACC = ACC + P << 0 (Q30)
|
||||
|
||||
.c28_amode
|
||||
CLRC AMODE ; Back to C28x addressing mode
|
||||
ADDL ACC, P ; ACC += P
|
||||
|
||||
MOVL *+XAR4[ARG_OUTPUT],ACC ; Store saturated result (Q30)
|
||||
MOV *+XAR4[ARG_CBINDEX], AR1 ; Store AR1(index for the next sample)
|
||||
SPM 0
|
||||
POP XAR1 ; Restore
|
||||
CLRC SXM, OVM ; Clear sign extension and saturate mode
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,166 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/iir5biq16.asm
|
||||
;;!
|
||||
;;! \brief 16-bit IIR filter
|
||||
;;!
|
||||
;;! \date Jan 11, 2011
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg IIR5BIQ16_init, _IIR5BIQ16_init
|
||||
.asg IIR5BIQ16_calc, _IIR5BIQ16_calc
|
||||
.endif
|
||||
|
||||
.def _IIR5BIQ16_init
|
||||
.def _IIR5BIQ16_calc
|
||||
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void IIR5BIQ16_calc(IIR5BIQ16_handle)
|
||||
;;
|
||||
;; This routine implements the IIR filter using cascade biquad structure
|
||||
;;=============================================================================
|
||||
;;typedef struct { <------------ XAR4
|
||||
;; void (*init)(void *); /* + 0 Ptr to Init funtion */
|
||||
;; void (*calc)(void *); /* + 2 Ptr to calc fn */
|
||||
;; int16_t *coeff_ptr; /* + 4 Pointer to Filter coefficient */
|
||||
;; int16_t *dbuffer_ptr; /* + 5 Delay buffer ptr */
|
||||
;; uint16_t nbiq; /* + 6 No of biquad */
|
||||
;; int16_t input; /* + 7 Latest Input sample */
|
||||
;; int16_t isf; /* + 8 Input Scale Factor */
|
||||
;; uint16_t qfmat; /* + 9 Coefficients Q Format */
|
||||
;; int16_t output; /* +10 Filter Output */
|
||||
;;}IIR5BIQ16;
|
||||
;;=============================================================================
|
||||
|
||||
_IIR5BIQ16_init:
|
||||
ADDB XAR4,#6 ; XAR4->dbuffer_ptr
|
||||
MOVL XAR6,*+XAR4[0] ; XAR6=dbuffer_ptr
|
||||
MOV ACC,*+XAR4[2]<<1 ; ACC=2*nbiq
|
||||
SUB ACC,#1 ; ACC=(2*nbiq)-1
|
||||
MOVZ AR0,AL ; AR0=(2*nbiq)-1
|
||||
ADDL ACC,*XAR4 ; ACC=dbuffer_ptr + (2*nbiq) - 1
|
||||
MOVL *XAR4,ACC ; XAR4->dbuffer_ptr,
|
||||
; dbuffer_ptr=dbuffer_ptr + (2*nbiq) - 1
|
||||
|
||||
MOV *+XAR4[3],#0 ; input=0
|
||||
MOVB ACC,#16
|
||||
SUB ACC,*+XAR4[5]
|
||||
MOV *+XAR4[5],AL ; qfmat=16-qfmat
|
||||
MOV *+XAR4[6],#0 ; output=0
|
||||
|
||||
RPT AR0
|
||||
|| MOV *XAR6++,#0
|
||||
|
||||
LRETR
|
||||
|
||||
|
||||
_IIR5BIQ16_calc:
|
||||
SETC SXM,OVM
|
||||
ZAPA ; Zero the ACC, P registers and OVC counter
|
||||
|
||||
ADDB XAR4,#4 ; XAR4->coeff_ptr
|
||||
MOVL XAR7,*XAR4++ ; XAR4->dbuffer_ptr, XAR7=coeff_ptr->a21
|
||||
MOVL XAR6,*XAR4++ ; XAR4->order, XAR6=dbuffer_ptr->d1(n-2)
|
||||
MOVZ AR0,*XAR4++ ; XAR4->input, AR0=nbiq
|
||||
|
||||
MOV T,*XAR4++ ; XAR4->isf, T=input
|
||||
MPY ACC,T,*XAR4++ ; XAR4->qfmat, ACC=input*isf
|
||||
ADDB XAR6,#1
|
||||
SUBB XAR0,#1 ; AR0=nbiq-1
|
||||
|
||||
; kth Biquad Computation, where k=1:nbiq
|
||||
biqd:
|
||||
MOV T,*--XAR6 ; T=dk(n-2)
|
||||
MPY P,T,*XAR7++ ; P= dk(n-2)*a2k
|
||||
MOV T,*--XAR6 ; T=dk(n-1)
|
||||
MPYA P,T,*XAR7++ ; ACC=input*isf + dk(n-2)*a2k
|
||||
; P=dk(n-1)*a1k
|
||||
|
||||
MOV T,*+XAR6[1] ; T=dk(n-2)
|
||||
MPYA P,T,*XAR7++ ; ACC=input*isf + dk(n-2)*a2k + dk(n-1)*a1k
|
||||
; P=dk(n-2)*b2k
|
||||
|
||||
MOV T,*XAR4 ; T=qfmat
|
||||
LSLL ACC,T ; ACC=input*isf + dk(n-2)*a2k + dk(n-1)*a1k (Q15)
|
||||
|
||||
MOVZ AR5,AH ; AR5=dk(n)=input*isf + dk(n-2)*a2k + dk(n-1)*a1k (Q15)
|
||||
|
||||
MOV ACC,#0 ; ACC=0
|
||||
MOVAD T,*XAR6 ; T=dk(n-1), dk(n-2)=dk(n-1), ACC=dk(n-2)*b2k
|
||||
MPY P,T,*XAR7++ ; P=dk(n-1)*b1k,
|
||||
MOV T,AR5 ; T=dk(n)
|
||||
MPYA P,T,*XAR7++ ; ACC=dk(n-1)*b1k + dk(n-2)*b2k, P=dk(n)*b0k
|
||||
ADDL ACC,P
|
||||
MOV *XAR6,T ; dk(n-1)=dk(n)
|
||||
BANZ biqd,AR0--
|
||||
|
||||
MOV T,*XAR4++ ; T=qfmat, XAR4->output
|
||||
LSLL ACC,T
|
||||
ROR ACC
|
||||
MOV *XAR4,AH ; output=Filtered Output in Q14 format
|
||||
CLRC OVM
|
||||
LRETR ; !!!Do not shift it left to store in Q15 format
|
||||
; If you do so, and if the output is >1, then it will
|
||||
; become negative..instead of the most desirable Saturation
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,169 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/iir5biq32.asm
|
||||
;;!
|
||||
;;! \brief 32-bit IIR filter
|
||||
;;!
|
||||
;;! \date Jan 11, 2011
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; includes
|
||||
;;*****************************************************************************
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; globals
|
||||
;;*****************************************************************************
|
||||
; Module definition for external reference
|
||||
|
||||
.if __TI_EABI__
|
||||
.asg IIR5BIQ32_init, _IIR5BIQ32_init
|
||||
.asg IIR5BIQ32_calc, _IIR5BIQ32_calc
|
||||
.endif
|
||||
|
||||
.def _IIR5BIQ32_init
|
||||
.def _IIR5BIQ32_calc
|
||||
;;=============================================================================
|
||||
;; Routine Type : C Callable
|
||||
;; Description :
|
||||
;; void IIR5BIQ32_calc(IIR5BIQ32_handle)
|
||||
;;
|
||||
;; This routine implements the IIR filter using cascade biquad structure
|
||||
;;=============================================================================
|
||||
;;typedef struct {<------------ XAR4
|
||||
;; void (*init)(void *); /* + 0 Ptr to Init funtion */
|
||||
;; void (*calc)(void *); /* + 2 Ptr to calc fn */
|
||||
;; int32_t *coeff_ptr; /* + 4 Pointer to Filter coefficient */
|
||||
;; int32_t *dbuffer_ptr; /* + 6 Delay buffer ptr */
|
||||
;; uint16_t nbiq; /* + 8 No of biquad */
|
||||
;; int32_t input; /* + 9 Latest Input sample */
|
||||
;; int32_t isf; /* +10 Input Scale Factor */
|
||||
;; int32_t output32; /* +12 Filter Output */
|
||||
;; int16_t output16 /* +13 Filter Output */
|
||||
;; uint16_t qfmat; /* +14 Coefficients Q Format */
|
||||
;; }IIR5BIQ32;
|
||||
;;=============================================================================
|
||||
|
||||
_IIR5BIQ32_init:
|
||||
ADDB XAR4,#6 ; XAR4->dbuffer_ptr
|
||||
MOVL XAR6,*+XAR4[0] ; XAR6=dbuffer_ptr
|
||||
MOV ACC,*+XAR4[2]<<2 ; ACC=4*nbiq
|
||||
SUB ACC,#1 ; ACC=(4*nbiq)-1
|
||||
MOVZ AR0,AL ; AR0=(4*nbiq)-1
|
||||
ADDL ACC,*XAR4 ; ACC=dbuffer_ptr + (4*nbiq) - 1
|
||||
MOVL *XAR4++,ACC ; XAR4->nbiq,
|
||||
; dbuffer_ptr=dbuffer_ptr + (4*nbiq) - 1
|
||||
|
||||
ADDB XAR4,#2
|
||||
MOV *+XAR4[1],#0 ; input=0
|
||||
MOVB ACC,#32
|
||||
SUB ACC,*+XAR4[7]
|
||||
MOV *+XAR4[7],AL ; qfmat=32-qfmat
|
||||
MOV *+XAR4[6],#0 ; output16=0
|
||||
MOV *+XAR4[5],#0 ; output32=0
|
||||
MOV *+XAR4[4],#0 ; output32=0
|
||||
|
||||
RPT AR0
|
||||
|| MOV *XAR6++,#0
|
||||
|
||||
LRETR
|
||||
|
||||
|
||||
_IIR5BIQ32_calc:
|
||||
SETC SXM,OVM
|
||||
ZAPA ; Zero the ACC, P registers and OVC counter
|
||||
|
||||
ADDB XAR4,#4 ; AR4->coeff_ptr
|
||||
MOVL XAR7,*XAR4++ ; XAR4->dbuffer_ptr, XAR7=coeff_ptr->a21
|
||||
MOVL XAR6,*XAR4++ ; XAR4->order, XAR6=dbuffer_ptr->d1(n-2)
|
||||
MOVZ AR0,*XAR4++ ; XAR4->input, AR0=nbiq
|
||||
|
||||
;MOVX TL,*XAR4++ ; XAR4->isf, T=input
|
||||
ADDB XAR4,#1
|
||||
MOVL XT,*XAR4++ ; XAR4->isf, T=input
|
||||
|
||||
QMPYL ACC,XT,*XAR4++ ; XAR4->output32, ACC=input*isf
|
||||
ADDB XAR6,#2
|
||||
SUBB XAR0,#1 ; AR0=nbiq-1
|
||||
|
||||
; kth Biquad Computation where k=1:nbiq
|
||||
biqd:
|
||||
MOVL XT,*--XAR6 ; T=dk(n-2)
|
||||
QMPYL P,XT,*XAR7++ ; P= dk(n-2)*a2k
|
||||
MOVL XT,*--XAR6 ; T=dk(n-1)
|
||||
QMPYAL P,XT,*XAR7++ ; ACC=input*isf + dk(n-2)*a2k, P=dk(n-1)*a1k
|
||||
|
||||
MOVL XT,*+XAR6[2] ; T=dk(n-2)
|
||||
QMPYAL P,XT,*XAR7++ ; ACC=input*isf + dk(n-2)*a2k + dk(n-1)*a1k
|
||||
; P=dk(n-2)*b2k
|
||||
|
||||
MOV T,*+XAR4[3] ; T=qfmat
|
||||
LSLL ACC,T ; ACC=input*isf + dk(n-2)*a2k + dk(n-1)*a1k (Q31)
|
||||
|
||||
MOVDL XT,*XAR6 ; XT=dk(n-1), dk(n-2)=dk(n-1)
|
||||
MOVL *XAR6,ACC ; dk(n-1)=dk(n)
|
||||
QMPYL ACC,XT,*XAR7++ ; ACC=dk(n-1)*b1k
|
||||
|
||||
MOVL XT,*XAR6 ; XT=dk(n)
|
||||
QMPYAL P,XT,*XAR7++ ; ACC=dk(n-1)*b1k + dk(n-2)*b2k, P=dk(n)*b0k
|
||||
ADDL ACC,P
|
||||
|
||||
BANZ biqd,AR0--
|
||||
|
||||
MOV T,*+XAR4[3] ; T=qfmat, XAR4->output32
|
||||
LSLL ACC,T
|
||||
ROR ACC
|
||||
MOVL *XAR4++,ACC ; output32=Filtered Output in Q30 format
|
||||
MOV *XAR4,AH ; output16=Filtered Output in Q14 format
|
||||
CLRC OVM
|
||||
LRETR
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
@@ -0,0 +1,67 @@
|
||||
;;#############################################################################
|
||||
;;! \file source/sel_q.asm
|
||||
;;!
|
||||
;;! \brief Selects the Q format for the twiddle factors
|
||||
;;!
|
||||
;;! \date Feb 25, 2002
|
||||
;;!
|
||||
;;
|
||||
;;#############################################################################
|
||||
;;!
|
||||
;;! Copyright: Copyright (C) 2023 Texas Instruments Incorporated -
|
||||
;;! All rights reserved not granted herein.
|
||||
;;! Limited License.
|
||||
;;!
|
||||
;;! Texas Instruments Incorporated grants a world-wide, royalty-free,
|
||||
;;! non-exclusive license under copyrights and patents it now or hereafter
|
||||
;;! owns or controls to make, have made, use, import, offer to sell and sell
|
||||
;;! ("Utilize") this software subject to the terms herein. With respect to the
|
||||
;;! foregoing patent license, such license is granted solely to the extent that
|
||||
;;! any such patent is necessary to Utilize the software alone. The patent
|
||||
;;! license shall not apply to any combinations which include this software,
|
||||
;;! other than combinations with devices manufactured by or for TI
|
||||
;;! ("TI Devices").
|
||||
;;! No hardware patent is licensed hereunder.
|
||||
;;!
|
||||
;;! Redistributions must preserve existing copyright notices and reproduce this
|
||||
;;! license (including the above copyright notice and the disclaimer and
|
||||
;;! (if applicable) source code license limitations below) in the documentation
|
||||
;;! and/or other materials provided with the distribution.
|
||||
;;!
|
||||
;;! Redistribution and use in binary form, without modification, are permitted
|
||||
;;! provided that the following conditions are met:
|
||||
;;!
|
||||
;;! * No reverse engineering, decompilation, or disassembly of this software is
|
||||
;;! permitted with respect to any software provided in binary form.
|
||||
;;! * Any redistribution and use are licensed by TI for use only
|
||||
;;! with TI Devices.
|
||||
;;! * Nothing shall obligate TI to provide you with source code for the
|
||||
;;! software licensed and provided to you in object code.
|
||||
;;!
|
||||
;;! If software source code is provided to you, modification and redistribution
|
||||
;;! of the source code are permitted provided that the following conditions
|
||||
;;! are met:
|
||||
;;!
|
||||
;;! * any redistribution and use of the source code, including any resulting
|
||||
;;! derivative works, are licensed by TI for use only with TI Devices.
|
||||
;;! * any redistribution and use of any object code compiled from the source
|
||||
;;! code and any resulting derivative works, are licensed by TI for use
|
||||
;;! only with TI Devices.
|
||||
;;!
|
||||
;;! Neither the name of Texas Instruments Incorporated nor the names of its
|
||||
;;! suppliers may be used to endorse or promote products derived from this
|
||||
;;! software without specific prior written permission.
|
||||
;;#############################################################################
|
||||
;;
|
||||
;;*****************************************************************************
|
||||
;; defines
|
||||
;;*****************************************************************************
|
||||
Q30 .set 30
|
||||
Q31 .set 31
|
||||
|
||||
; Select Twiddle factor Q format
|
||||
TF_QFMAT .set Q30
|
||||
|
||||
;;#############################################################################
|
||||
;; End of File
|
||||
;;#############################################################################
|
||||
Reference in new issue
Block a user