home *** CD-ROM | disk | FTP | other *** search
- page 132,63,1,1
- opt rc
- title 'FFT data areas'
-
- ;***************************************************************
- ;* DATA.ASM -- Necessary coefficients for FFT calculation *
- ;* *
- ;* Copyright (C) 1991 by Alef Null. All rights reserved. *
- ;* Author(s): Jarkko Vuori, OH2LNS *
- ;* Modification(s): *
- ;***************************************************************
-
- section FFTData
- xdef coef,data
- xdef samples,window
- xdef acca,accb
-
- points equ 1024
- pi equ 3.141592654
- freq equ 2.0*pi/@cvf(points)
-
-
- org x:
-
- ; SIN coefficients
- coef
- count set 0
- dup points/2
- dc -@cos(@cvf(count)*freq)
- count set count+1
- endm
-
- ; FFT data
- data ds points
-
-
- org y:
-
- ; COS coefficients
- count set 0
- dup points/2
- dc -@sin(@cvf(count)*freq)
- count set count+1
- endm
-
- ; FFT data
- ds points
-
-
- org p:
-
- ; input sample buffer
- samples ds points
-
- ; transform window (Hamming)
- window
- count set 0
- dup points
- dc @pow(2,-6)*(0.54-0.46*@cos(2.0*pi*@cvf(count)/@cvf(points)))
- count set count+1
- endm
-
- ; two result accumulators
- acca ds points/2
- accb ds points/2
-
- endsec
-
- end
-