home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / source / data.asm < prev    next >
Encoding:
Assembly Source File  |  1991-08-11  |  1.2 KB  |  70 lines

  1.     page    132,63,1,1
  2.     opt    rc
  3.     title    'FFT data areas'
  4.  
  5. ;***************************************************************
  6. ;* DATA.ASM -- Necessary coefficients for FFT calculation      *
  7. ;*                                   *
  8. ;* Copyright (C) 1991 by Alef Null. All rights reserved.       *
  9. ;* Author(s): Jarkko Vuori, OH2LNS                   *
  10. ;* Modification(s):                           *
  11. ;***************************************************************
  12.  
  13.     section FFTData
  14.     xdef    coef,data
  15.     xdef    samples,window
  16.     xdef    acca,accb
  17.  
  18. points    equ    1024
  19. pi      equ     3.141592654
  20. freq    equ     2.0*pi/@cvf(points)
  21.  
  22.  
  23.     org    x:
  24.  
  25. ; SIN coefficients
  26. coef
  27. count   set     0
  28.         dup     points/2
  29.         dc      -@cos(@cvf(count)*freq)
  30. count   set     count+1
  31.         endm
  32.  
  33. ; FFT data
  34. data    ds    points
  35.  
  36.  
  37.     org    y:
  38.  
  39. ; COS coefficients
  40. count   set     0
  41.         dup     points/2
  42.         dc      -@sin(@cvf(count)*freq)
  43. count   set     count+1
  44.     endm
  45.  
  46. ; FFT data
  47.     ds    points
  48.  
  49.  
  50.     org    p:
  51.  
  52. ; input sample buffer
  53. samples ds    points
  54.  
  55. ; transform window (Hamming)
  56. window
  57. count   set     0
  58.     dup    points
  59.     dc    @pow(2,-6)*(0.54-0.46*@cos(2.0*pi*@cvf(count)/@cvf(points)))
  60. count   set     count+1
  61.     endm
  62.  
  63. ; two result accumulators
  64. acca    ds    points/2
  65. accb    ds    points/2
  66.  
  67.     endsec
  68.  
  69.     end
  70.