; v:\ece420\54x\dspclib\c_fft_given_iirc.asm ; mdk - 9/2004 removed window and added coef, state, scale for IIR ; dgs - 9/14/2001 ; Use governed by the Creative Commons Attribution License .copy "v:\ece420\54x\dspclib\core.inc" .global _bit_rev_data .global _fft_data .global _coef .global _state .global _scale .global _bit_rev_fft N .set 1024 K_FFT_SIZE .set N K_LOGN .set 10 .sect ".data" .align 1024 sine .copy "v:\ece420\54x\dsplib\twiddle1" .align 1024 cosine .copy "v:\ece420\54x\dsplib\twiddle2" .align 4*N _bit_rev_data .space 16*2*N ; Input to _bit_rev_fft .align 4*N _fft_data .space 16*2*N ; FFT output buffer ; IIR filter .align 4 _coef .word 0 .word 0 .word 0 .word -13421; -21498 _state .space 16*4 _scale .word 19345; 11268 .sect ".text" _bit_rev_fft ENTER_ASM call bit_rev ; Do the bit-reversal. call fft ; Do the FFT LEAVE_ASM RET bit_rev stm #_bit_rev_data, AR3 ; ar3 -> org. input stm #_fft_data, AR7 ; ar7 -> data proc. buf MVMM AR7, AR2 ; ar2 -> b_r_d stm #K_FFT_SIZE-1, BRC rptbd bit_rev_end-1 stm #K_FFT_SIZE, AR0 ;AR0 = 1/2 size of circ buffer mvdd *AR3+, *AR2+ mvdd *AR3-, *AR2+ MAR *AR3+0B bit_rev_end: nop ret ; Copy the actual FFT subroutine. fft_data .set _fft_data ; FFT code needs this. .copy "v:\ece420\54x\dsplib\fft.asm" ; If you need any more assembly subroutines, make sure you name them ; _name, and include a ".global _name" directive at the top. Also, ; don't forget to use ENTER_ASM at the beginning, and LEAVE_ASM ; and RET at the end!