home *** CD-ROM | disk | FTP | other *** search
/ Ham Radio 2000 #1 / Ham Radio 2000.iso / ham2000 / hf / dsp / dsp4src / bandpass.asm < prev    next >
Encoding:
Assembly Source File  |  1993-04-19  |  1.1 KB  |  64 lines

  1. ;***************************************************************
  2. ;* BANDPASS.ASM -- 800 Hz audio bandpass filter            *
  3. ;*                                   *
  4. ;* Provides extremely narrow FIR bandpass filter.           *
  5. ;*                                   *
  6. ;* Copyright (C) 1992 by Alef Null. All rights reserved.       *
  7. ;* Author(s): Jarkko Vuori, OH2LNS                   *
  8. ;* Modification(s):                           *
  9. ;***************************************************************
  10.  
  11.  
  12.     nolist
  13.     include 'leonid'
  14.     list
  15.  
  16.  
  17. buflen    equ    600
  18.  
  19.  
  20.     org    p:user_code
  21.  
  22.     move            #buffer+2,r7
  23.     move            #buflen*4-1,m7
  24.  
  25.     move            #buffer,r2
  26.     move            #4-1,n2
  27.     move            #buflen*4-1,m2
  28.  
  29.     ctrlcd    1,r2,buflen,LINEI,0.0,0.0,LINEO|HEADP,0.0,0.0
  30.     opencd    8
  31.  
  32. ; wait for one complete block
  33. loop    waitblk r2,buflen,1
  34.  
  35. ; then filter the left channel
  36.     move            #buflen*4-1,m0
  37.     move            #-4,n0
  38.     move            #coeffs,r4
  39.  
  40.     move            r2,r0
  41.     clr    a
  42.     move            x:(r0)+n0,x0  y:(r4)+,y0
  43.     rep    #taps-1
  44.     mac    x0,y0,a     x:(r0)+n0,x0  y:(r4)+,y0
  45.     macr    x0,y0,a     (r2)+
  46.     move            a,y:(r2)+n2
  47.  
  48.     jmp    <loop
  49.  
  50.  
  51.     org    x:user_data
  52.  
  53. buffer    dsm    buflen*4
  54.  
  55.  
  56.     org    y:user_data
  57.  
  58.     include 'coeff.asm'
  59.  
  60.     dsm    buflen*4
  61.  
  62.  
  63.     end
  64.