kenwi

colorgan

Mar 28th, 2015
380
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 54.24 KB | None | 0 0
  1. ;*****************************************************************************
  2. ; Colorgan4.s
  3. ; A DSP-based colour organ using digital filters
  4. ; Professor M. Csele, Niagara College, Canada, 2010
  5. ; Revised: 2010/04/24
  6. ;
  7. ; Uses FIR filters - Output Side Algorithm from chapter 6 of Smith
  8. ;
  9. ; Other Files Required : p30F6012.gld, p30f6012.inc
  10. ; Tools Used : MPLAB IDE version 8.xx
  11. ;
  12. ; Hardware:
  13. ; dsPICDEM board standard hardware (with ds30F6012 chip)
  14. ; Line IN provided via AN3/RB3 (via on-board 4KHz analog sampling filter)
  15. ; Line OUT provided via MCP4101 (thru on-board analog filter) - for testing
  16. ; Indicator LEDs on RD4-RD7
  17. ; ZCD input (active high) on RG12
  18. ; Triac/SCR output LOW channel (red) on RG15
  19. ; Triac/SCR output MID channel (yellow) on RG14
  20. ; Triac/SCR output HIGH channel (green) on RG13
  21. ;
  22. ; User Interface (Optional - NOT IMPLEMENTED):
  23. ; Pushbutton "Parameter" on RD0
  24. ; Pushbutton "Increase / +" on RD1
  25. ; Pushbutton "Decrease / -" on RD2
  26. ; Pressing "Parameter" selects next parameter to set
  27. ; Parameter Order: LO Gain, LO Background, MID Gain, MID Back, HI Gain, Hi Back
  28. ; Mode indicated by constant lights on other two channels
  29. ; Gain is set in 10% increments from 10% to 500%
  30. ; Background is set in steps from 0 to 66
  31. ; Parameters are stored in EEPROM and read upon startup
  32. ;
  33. ;*****************************************************************************
  34. .equ __30F6012, 1
  35. .include "p30f6012.inc"
  36.  
  37. ;.............................................................................
  38. ; Configuration bits:
  39. ;.............................................................................
  40.  
  41. config __FOSC, CSW_FSCM_OFF & XT_PLL16 ;16xPLL - 64MHz/16MIPs at 4MHz XTAL
  42. ; - 118MHz/30MPIs at 7.37MHz XTAL
  43. config __FWDT, WDT_OFF ;Turn off Watchdog Timer
  44. config __FBORPOR, PBOR_ON & BORV_42 & PWRT_64 & MCLR_EN ;Set Brown-out Reset voltage and
  45. config __FGS, CODE_PROT_OFF ;Set Code Protection Off
  46.  
  47. ;.............................................................................
  48. ; Global Declarations:
  49. ;.............................................................................
  50. .global __reset ;Label for first line of code.
  51. .global __ICD2RAM ;Allows ICD2 to be used
  52.  
  53. .global __OscillatorFail ;Declare Oscillator Fail trap routine label
  54. .global __AddressError ;Declare Address Error trap routine label
  55. .global __StackError ;Declare Stack Error trap routine label
  56. .global __MathError ;Declare Math Error trap routine label
  57.  
  58.  
  59. ;.............................................................................
  60. ; Storage in Data space (X and Y)
  61. ;.............................................................................
  62. .section .ybss ;Uninitialized Y-Space
  63. .align 2
  64. Samples: .space 512 ;256 samples (16 bits each)
  65.  
  66. .section .xbss ;Uninitialized X-Space
  67. .align 2
  68.  
  69. ;Kernels are in X space (Program memory via PSV)
  70. PeakAverageCounter: .space 2 ;Counter for samples to find peaks
  71. PeakTemp: .space 2 ;Temp peak for the current period
  72. Peak: .space 2 ;Peak amplitude found for last period
  73. Gain: .space 2 ;Current gain (from CVA)
  74. Sample: .space 2 ;Current incoming sample
  75. PeakLo: .space 2 ;Peak filter output for last half-cycle
  76. PeakLoTemp: .space 2 ;Temp peak for current period
  77. PeakMid: .space 2
  78. PeakMidTemp: .space 2
  79. PeakHi: .space 2
  80. PeakHiTemp: .space 2
  81. PhaseCounter: .space 2 ;Counter for AC cycle trigger points
  82.  
  83. ;.............................................................................
  84. ; Program Constants
  85. ;.............................................................................
  86. .equ TIMECONST, #32000 ;Use 32000 samples (4 seconds) as constant to find peak
  87. .equ TARGETPEAK, #0x4000 ;Target peak for samples is 0x4000
  88.  
  89. ;**** Operational Parameters - all determined by trial-and-error ****
  90.  
  91. ;Background light levels (0=Min, 66=Max)
  92. .equ BACKGROUND_LO,#18 ;GREEN
  93. .equ BACKGROUND_MID,#12 ;YELLOW
  94. .equ BACKGROUND_HIGH,#15 ;RED
  95. ;Channel Gain (0=Min, 8=100%, 32=400%)
  96. .equ GAIN_LO,#10 ;Low channel gain
  97. .equ GAIN_MID,#10
  98. .equ GAIN_HI,#10
  99.  
  100. ;**** I/O Bit definitions ****
  101. .equ SS,#9 ;RG9 = Slave Select for MCP
  102. .equ ZCD,#12 ;ZCD input from Optocoupler
  103. .equ TRIAC_LO,#15
  104. .equ TRIAC_MID,#14
  105. .equ TRIAC_HI,#13
  106.  
  107. ;.............................................................................
  108. ; Code Section in Program Memory
  109. ;.............................................................................
  110. .text ;Start of Code section
  111.  
  112. __reset:
  113. mov #__SPLIM_init-#128, W15 ;Initialize the Stack Pointer to base address
  114. mov #__SPLIM_init, W0 ;Initialize the Stack Pointer Limit Register
  115. mov W0, SPLIM
  116. nop
  117. bset CORCON,#IF ;Select Integer mode for DSP Multiplier
  118. bset CORCON,#PSV ;Allow PSV access of frame data in program date
  119. clr PSVPAG ;Map lowest program memory page into Data RAM space
  120.  
  121. ;Setup Ports
  122. mov #0xFF0F,W0 ;RD4-7=LED Outputs (used for level meter - debug)
  123. mov W0,TRISD
  124. mov #0x0000,W0
  125. mov w0,PORTD
  126. mov #0x1EFF,W0 ;PORTG Outputs on RG13-15, RG9 (SS)
  127. mov w0,TRISG
  128. clr PORTG
  129.  
  130. bset PORTG,#SS ;set SPI slave select high
  131. bclr TRISG,#SS ;set tris bit to output
  132.  
  133. ;Setup hardware to allow ADC conversion on AN2-AN7
  134. mov #0B1111111111110011,W0 ;RB3 = analog input
  135. mov W0,ADPCFG
  136. mov #0B0000000011100000,W0 ;Set for Auto Sampling (SSRC=111)
  137. mov W0,ADCON1
  138. mov #0x0003,W0 ;Select RB3/AN3 as CH0 input ..
  139. mov W0,ADCHS
  140. clr ADCSSL
  141. mov #0B0000000100111001,W0 ;Auto Sample, Tad for 30 MIPs max
  142. mov W0,ADCON3
  143. clr ADCON2 ;AVdd,AVss external references on the 6011 chip
  144. bset ADCON1,#ADON ;Turn ADC ON
  145. bset ADCON1,#SAMP ; start sampling ...
  146.  
  147. ;Setup Timer 1 for sampling delay: Tcy = 16MHz (64MHz Clock)
  148. mov #0x8000,w1 ;8KS/s at Tcy=16MHz
  149. mov w1,T1CON ;1:1, Int Clk, ON
  150. mov #2000,W1 ;Load PR1 for delay, 8KS/s Sample Rate @16MHz Internal
  151. mov w1,PR1
  152.  
  153. ;Setup the SPI port 2 for the MCP chip
  154. ;The MCP chip is used as a DAC for analog output when testing filter kernels
  155. mov #0x053B,w0 ;Master mode, 16 bits,no frame, 1:2 prescale
  156. mov w0,SPI2CON
  157. clr SPI2STAT
  158. bset SPI2STAT,#SPIEN ;Enable SPI2
  159.  
  160. ;Startup Splash
  161. bset PORTG,#TRIAC_LO
  162. mov #2000,w5
  163. SplashLo:
  164. call SamplingDelay
  165. dec w5,w5
  166. bra nz,SplashLo
  167. bclr PORTG,#TRIAC_LO
  168. bset PORTG,#TRIAC_MID
  169. mov #2000,w5
  170. SplashMid:
  171. call SamplingDelay
  172. dec w5,w5
  173. bra nz,SplashMid
  174. bclr PORTG,#TRIAC_MID
  175. bset PORTG,#TRIAC_HI
  176. mov #2000,w5
  177. SplashHi:
  178. call SamplingDelay
  179. dec w5,w5
  180. bra nz,SplashHi
  181. bclr PORTG,#TRIAC_HI
  182.  
  183. ;Initialize Peak detector for Constant Volume Algorithm (CVA)
  184. clr Peak
  185. clr PeakTemp
  186. clr PeakLoTemp
  187. clr PeakMidTemp
  188. clr PeakHiTemp
  189. clr PhaseCounter
  190. mov #TIMECONST,w1 ;Preload counter for peak detector
  191. mov w1,PeakAverageCounter
  192.  
  193. ;*****************************************
  194. ;* Main program loop (runs continuously) *
  195. ;*****************************************
  196. MainLoop:
  197.  
  198. inc PhaseCounter
  199. ;Check for ZCD
  200. btss PORTG,#ZCD ;Low for ZCD
  201. goto NotZcd
  202. ;If early in the cycle, omit test for ZCD (ensures peaks only captured once)
  203. mov #10,w0
  204. mov PhaseCounter,w1
  205. cp w1,w0
  206. bra lt,NotZcd
  207. ;Zero-Cross, grab peaks for lights
  208. nop
  209. nop
  210. nop
  211. clr PhaseCounter
  212. bclr PORTG,#TRIAC_LO ;Turn off all channels
  213. bclr PORTG,#TRIAC_MID
  214. bclr PORTG,#TRIAC_HI
  215. mov PeakLoTemp,w0 ;Save peak amplitudes from last half-cycle
  216. mov w0,PeakLo
  217. clr PeakLoTemp
  218. mov PeakMidTemp,w0 ;Save peak amplitudes from last half-cycle
  219. mov w0,PeakMid
  220. clr PeakMidTemp
  221. mov PeakHiTemp,w0 ;Save peak amplitudes from last half-cycle
  222. mov w0,PeakHi
  223. clr PeakHiTemp
  224.  
  225. NotZcd:
  226. call SampleIn ;Read a sample from the ADC (12-bits resolution)
  227. mov #0x800,w1 ;Make into a signed number (16 bit)
  228. sub w0,w1,w0
  229. mov w0,Sample
  230.  
  231. ;Peak Detector: Constant Volume Algorithm (CVA)
  232. btsc Sample,#15 ;Test only positive numbers
  233. goto PeakDone
  234. mov PeakTemp,w1
  235. cp w0,w1 ;Check if sample > old peak found
  236. bra lt,NoNewPeak
  237. mov w0,PeakTemp ;Update new peak reading
  238. NoNewPeak:
  239. dec PeakAverageCounter
  240. cp0 PeakAverageCounter
  241. bra nz,PeakDone
  242. mov #TIMECONST,w1 ;Reload peak detector counter
  243. mov w1,PeakAverageCounter
  244. ;Update peak for the past <time constant> period
  245. mov PeakTemp,w1
  246. mov w1,Peak
  247. ;Clear peak level for the next period
  248. clr PeakTemp
  249.  
  250. ;Compute new gain constant: Gain = Target / Peak
  251. mov #TARGETPEAK,w4
  252. mov Peak,w5
  253. repeat #17 ;Simple Divide (unsigned)
  254. div.u w4,w5 ;W0=W4/w5 (remainder in w1)
  255. mov w0,Gain
  256.  
  257. PeakDone:
  258. ;Constant Volume Algorithm: multiply each sample by a gain constant
  259. mov Sample,w0
  260. mov Gain,w1
  261. mul.uu w0,w1,w4 ;W4:W5=W0*W1 ... Dest must be even
  262. mov w4,w0 ;W0 is output - input times gain
  263.  
  264. ;Store current sample into top of samples array
  265. mov #Samples,W10 ;W10 points to start of Y data space (samples)
  266. mov W0,[W10] ;Store current sample into sample array
  267.  
  268. ;**** FILTER #1: Low Band ****
  269.  
  270. ;Setup W8 (Kernel in program memory - accessed via PSV)
  271. mov #KernelLow,W8 ;Kernel in program memory space - Low Range
  272.  
  273. ;Setup W10 (Samples array) source data pointer
  274. mov #Samples,W10 ;W10 points to start of Y data space (samples)
  275.  
  276. ;Reverse Kernel (required for algorithm) - point to last kernel entry
  277. mov #510,w1 ;Starting position of Kernal pointer is last (255th) entry
  278. add W8,W1,W8
  279.  
  280. ;Convolution Kernel (256 entries)
  281. clr A
  282. repeat #256
  283. mac w5*w6, A, [W8]-=2, W5, [W10]+=2, W6
  284. ;ACCA=ACCA+W5*W6
  285. ;X([W8]-=2) --> W5 X Prefetch
  286. ;Y([W10]+=2) --> W6 Y Prefetch
  287.  
  288. ;Post-scale Accumulator results
  289. ;For 5Vp-p ADC input, output stays in range 0x000 to 0xFFF.
  290. sftac A,#14 ;Shift left >> 16 bits (barrel shift)
  291. sftac A,#2
  292. mov ACCAL,W0 ;Save Filtered output value in w0
  293.  
  294. ;Save peak output, now in W0
  295. mov PeakLoTemp,w1
  296. cp w0,w1 ;Check if new sample > old peak found
  297. bra lt,NoNewLoPeak
  298. mov w0,PeakLoTemp ;Update new peak reading
  299.  
  300. NoNewLoPeak:
  301.  
  302. ;**** FILTER #2: Mid Band ****
  303.  
  304. ;Setup W8 (Kernel in program memory - accessed via PSV)
  305. mov #KernelMid,W8 ;Kernel in program memory space - Mid Range
  306.  
  307. ;Setup W10 (Samples array) source data pointer
  308. mov #Samples,W10 ;W10 points to start of Y data space (samples)
  309.  
  310. ;Reverse Kernel (required for algorithm) - point to last kernel entry
  311. mov #510,w1 ;Starting position of Kernal pointer is last (255th) entry
  312. add W8,W1,W8
  313.  
  314. ;Convolution Kernel (256 entries)
  315. clr A
  316. repeat #256
  317. mac w5*w6, A, [W8]-=2, W5, [W10]+=2, W6
  318. ;ACCA=ACCA+W5*W6
  319. ;X([W8]-=2) --> W5 X Prefetch
  320. ;Y([W10]+=2) --> W6 Y Prefetch
  321.  
  322. ;Post-scale Accumulator results
  323. ;For 5Vp-p ADC input, output stays in range 0x000 to 0xFFF.
  324. sftac A,#14 ;Shift left >> 16 bits (barrel shift)
  325. sftac A,#2
  326. mov ACCAL,W0 ;Save Filtered output value in w0
  327.  
  328. ;Save peak output, now in W0
  329. mov PeakMidTemp,w1
  330. cp w0,w1 ;Check if new sample > old peak found
  331. bra lt,NoNewMidPeak
  332. mov w0,PeakMidTemp ;Update new peak reading
  333.  
  334. NoNewMidPeak:
  335.  
  336. ;**** FILTER #3: High Band ****
  337.  
  338. ;Setup W8 (Kernel in program memory - accessed via PSV)
  339. mov #KernelHigh,W8 ;Kernel in program memory space - High Range
  340.  
  341. ;Setup W10 (Samples array) source data pointer
  342. mov #Samples,W10 ;W10 points to start of Y data space (samples)
  343.  
  344. ;Reverse Kernel (required for algorithm) - point to last kernel entry
  345. mov #510,w1 ;Starting position of Kernal pointer is last (255th) entry
  346. add W8,W1,W8
  347.  
  348. ;Convolution Kernel (256 entries)
  349. clr A
  350. repeat #256
  351. mac w5*w6, A, [W8]-=2, W5, [W10]+=2, W6
  352. ;ACCA=ACCA+W5*W6
  353. ;X([W8]-=2) --> W5 X Prefetch
  354. ;Y([W10]+=2) --> W6 Y Prefetch
  355.  
  356. ;Post-scale Accumulator results
  357. ;For 5Vp-p ADC input, output stays in range 0x000 to 0xFFF.
  358. sftac A,#14 ;Shift left >> 16 bits (barrel shift)
  359. sftac A,#2
  360. mov ACCAL,W0 ;Save Filtered output value in w0
  361.  
  362. ;Save peak output, now in W0
  363. mov PeakHiTemp,w1
  364. cp w0,w1 ;Check if new sample > old peak found
  365. bra lt,NoNewHiPeak
  366. mov w0,PeakHiTemp ;Update new peak reading
  367.  
  368. NoNewHiPeak:
  369.  
  370. ;**** Filters Complete ****
  371.  
  372. ;Update sample array by shifting entries down
  373. mov #Samples,W10 ;W10 points to start of Y data space (samples)
  374. mov #510,W1
  375. add W10,W1,W8 ;Point W8 to second-to-last entry (source)
  376. mov #512,W1
  377. add W10,W1,W10 ;Point W10 to last entry (target)
  378. repeat #256
  379. mov [W8--],[W10--]
  380.  
  381.  
  382. ;**** Output: Trigger Triacs/SCRs driving lamps ****
  383.  
  384. Bypass:
  385.  
  386. ;Trigger Low channel
  387. mov PeakLo,w0
  388. btsc w0,#15 ;Trigger only if positive number
  389. goto SkipLowTrigger
  390.  
  391.  
  392.  
  393. ;GAIN control: Multiply W0*Gain to ACCB, then shift B, Gain: 8 = 100%, 64 = 800%
  394. ;Shift B <<3 for Gain and <<8 to get bits 9-12 scaled into LSBs
  395. mov w0,w4
  396. mov #GAIN_LO,w5
  397. mpy w4*w5,B ;ACCB = Filter * GainLo
  398. sftac B,#11 ;Shift by 3 (for Gain) + 8 (for bits 9-12)
  399. mov ACCBL,w0
  400. mov #0xF,w1 ;Mask off 4 lower bits only
  401. and w0,w1,w0
  402.  
  403. ;Convert peak (4 bit number) into phase angle step
  404. mov #15,w1 ;Reverse step (0x00=Max, 0x0F=Min)
  405. sub w1,w0,w0
  406. mov #Linearize,w5
  407. add w5,w0,w5 ;Calculate address of table entry
  408. add w5,w0,w5
  409. mov [w5],w0 ;w0 now contains trigger point
  410.  
  411. ;If PhaseCounter==Trigger step, turn on triac/scr
  412. mov PhaseCounter,w1
  413. cp w0,w1
  414. bra nz,SkipLowOn
  415. bset PORTG,#TRIAC_LO ;Turn on low channel triac
  416.  
  417. SkipLowOn:
  418. SkipLowTrigger:
  419.  
  420. ;If PhaseCounter==Background, turn on triac/scr
  421. mov #BACKGROUND_LO,w0
  422. mov #66,w1 ;Reverse step (0x00=Max step, 66=Min)
  423. sub w1,w0,w0
  424. mov PhaseCounter,w1
  425. cp w0,w1
  426. bra nz,SkipLowBack
  427. bset PORTG,#TRIAC_LO ;Turn on low channel triac
  428. SkipLowBack:
  429.  
  430. ;Trigger Mid channel
  431. mov PeakMid,w0
  432. btsc w0,#15 ;Trigger only if positive number
  433. goto SkipMidTrigger
  434.  
  435. mov w0,w4
  436. mov #GAIN_MID,w5
  437. mpy w4*w5,B ;ACCB = Filter * GainLo
  438. sftac B,#11 ;Shift by 3 (for Gain) + 8 (for bits 9-12)
  439. mov ACCBL,w0
  440. mov #0xF,w1 ;Mask off 4 lower bits only
  441. and w0,w1,w0
  442.  
  443. ;Convert peak (4 bit number) into phase angle step
  444. mov #15,w1 ;Reverse step (0x00=Max, 0x0F=Min)
  445. sub w1,w0,w0
  446. mov #Linearize,w5
  447. add w5,w0,w5 ;Calculate address of table entry
  448. add w5,w0,w5
  449. mov [w5],w0 ;w0 now contains trigger point
  450.  
  451. ;If PhaseCounter==Trigger step, turn on triac/scr
  452. mov PhaseCounter,w1
  453. cp w0,w1
  454. bra nz,SkipMidOn
  455. bset PORTG,#TRIAC_MID ;Turn on mid channel triac
  456.  
  457. SkipMidOn:
  458. SkipMidTrigger:
  459.  
  460. ;If PhaseCounter==Background, turn on triac/scr
  461. mov #BACKGROUND_MID,w0
  462. mov #66,w1 ;Reverse step (0x00=Max step, 66=Min)
  463. sub w1,w0,w0
  464. mov PhaseCounter,w1
  465. cp w0,w1
  466. bra nz,SkipMidBack
  467. bset PORTG,#TRIAC_MID ;Turn on mid channel triac
  468. SkipMidBack:
  469.  
  470. ;Trigger High channel
  471. mov PeakHi,w0
  472. btsc w0,#15 ;Trigger only if positive number
  473. goto SkipHighTrigger
  474.  
  475. ;GAIN control: Multiply W0*Gain to ACCB, then shift B, Gain: 8 = 100%, 64 = 800%
  476. ;Shift B <<3 for Gain and <<8 to get bits 9-12 scaled into LSBs
  477. mov w0,w4
  478. mov #GAIN_HI,w5
  479. mpy w4*w5,B ;ACCB = Filter * GainLo
  480. sftac B,#11 ;Shift by 3 (for Gain) + 8 (for bits 9-12)
  481. mov ACCBL,w0
  482. mov #0xF,w1 ;Mask off 4 lower bits only
  483. and w0,w1,w0
  484.  
  485. ;Convert peak (4 bit number) into phase angle step
  486. mov #15,w1 ;Reverse step (0x00=Max, 0x0F=Min)
  487. sub w1,w0,w0
  488. mov #Linearize,w5
  489. add w5,w0,w5 ;Calculate address of table entry
  490. add w5,w0,w5
  491. mov [w5],w0 ;w0 now contains trigger point
  492.  
  493. ;If PhaseCounter==Trigger step, turn on triac/scr
  494. mov PhaseCounter,w1
  495. cp w0,w1
  496. bra nz,SkipHighOn
  497. bset PORTG,#TRIAC_HI ;Turn on high channel triac
  498.  
  499. SkipHighOn:
  500. SkipHighTrigger:
  501.  
  502. ;If PhaseCounter==Background, turn on triac/scr
  503. mov #BACKGROUND_HIGH,w0
  504. mov #66,w1 ;Reverse step (0x00=Max step, 66=Min)
  505. sub w1,w0,w0
  506. mov PhaseCounter,w1
  507. cp w0,w1
  508. bra nz,SkipHiBack
  509. bset PORTG,#TRIAC_HI ;Turn on high channel triac
  510. SkipHiBack:
  511.  
  512. ;**** End of Main Loop ****
  513. call SamplingDelay ;Wait for 8KS/s delay to expire
  514. goto MainLoop
  515.  
  516.  
  517. ;****** Sample Incoming Audio Signal to w0 ******
  518. SampleIn:
  519. bset ADCON1,#SAMP ;Start sampling, conversion is auto
  520. WaitForADCDone:
  521. btss IFS0,#ADIF ;conversion done?
  522. goto WaitForADCDone ; if not, wait for it
  523. bclr IFS0,#ADIF ;Reset conversion flag
  524. mov ADCBUF0,w0 ;Read current ADC value
  525. return
  526.  
  527.  
  528. ;****** Playback Sample in w0 via the MCP ******
  529. SampleOut:
  530. bclr IFS1,#SPI2IF ;clear the SPI2 interrupt flag
  531. DummyRead:
  532. mov SPI2BUF,w1 ;dummy read SPI2 buffer
  533. btsc SPI2STAT,#SPIRBF ;if spi buffer is full then
  534. bra DummyRead ; ... keep reading
  535. bclr PORTG,#SS ;start spi write
  536. mov w0,SPI2BUF ;load spi buffer
  537. TxDone:
  538. btss IFS1,#SPI2IF ;if flag is set then Tx is done
  539. bra TxDone ;else wait till it is done
  540. bset PORTG,#SS ;start spi write
  541. return
  542.  
  543. ;***** Wait for timer to expire, start next delay *****
  544. SamplingDelay:
  545. btss IFS0,#T1IF ;Wait for Timer to expire
  546. bra SamplingDelay
  547. bclr IFS0,#T1IF ;Clear 'done' flag
  548. return
  549.  
  550. ;**** TEST CODE: Output filter via the DAC to test performance ****
  551. FilterOut:
  552. mov #0x8000,w1
  553. add w0,w1,w0 ;Make into an unsigned number
  554.  
  555. rrnc w0,w0 ;Shift right 4 bits (lower byte=data)
  556. rrnc w0,w0 ; to convert to an 8-bit sample size
  557. rrnc w0,w0
  558. rrnc w0,w0
  559. rrnc w0,w0
  560. rrnc w0,w0
  561. rrnc w0,w0
  562. rrnc w0,w0
  563.  
  564. mov #0x00FF,w1 ;Set upper byte to zero in 16-bit word
  565. and w0,w1,w0
  566. mov #0x1300,w1 ;Set upper byte to "0x13" for MCP chip control
  567. add w0,w1,w0
  568.  
  569. call SampleOut ;Output w0 via the MCP DAC (8-bits resolution) to test filters
  570. return
  571.  
  572. ;==============================================================================
  573. ; Error traps
  574. ; Example trap routines. In application use retfie instruction to exit trap
  575. ;------------------------------------------------------------------------------
  576. ;Oscillator Fail Error trap routine
  577.  
  578. .text ;Start of Code section
  579. __OscillatorFail:
  580. bclr LATD,#LATD3 ;Turn LED4 on
  581. bclr INTCON1, #OSCFAIL ;Reset oscillator fail trap flag
  582. bra __OscillatorFail ;Loop forever when oscillator failure occurs
  583.  
  584. ;------------------------------------------------------------------------------
  585. ;Address Error trap routine
  586.  
  587. __AddressError:
  588. bclr LATD,#LATD3 ;Turn LED4 on
  589. bclr INTCON1, #ADDRERR ;Reset address error trap flag
  590. retfie
  591. bra __AddressError ;Loop forever when address error occurs
  592.  
  593. ;------------------------------------------------------------------------------
  594. ;Math (Arithmetic) Error trap routine
  595.  
  596. __StackError:
  597. bclr LATD,#LATD3 ;Turn LED4 on
  598. bclr INTCON1, #STKERR ;Reset stack error trap flag
  599. bra __StackError ;Loop forever when stack error occurs
  600.  
  601. ;------------------------------------------------------------------------------
  602. ;Math (Arithmetic) Error trap routine
  603.  
  604. __MathError:
  605. ; bclr LATD,#LATD3 ;Turn LED4 on
  606. bclr INTCON1, #MATHERR ;Reset math error trap flag
  607. ; retfie ;TEST >>>> Just keep going despite error
  608. bra __MathError ;Loop forever when math error occurs
  609.  
  610. ;------------------------------------------------------------------------------
  611.  
  612.  
  613. ;****************************************************************************
  614. ;*** Read-Only data segment (allows PSV) ***
  615. ;*** Used for predefined convolution filter kernels, 256 words each ***
  616. ;****************************************************************************
  617. .section .const, "r"
  618. .align 2
  619.  
  620. ;Linearization curve: step values 0x00-0x0F yield phase trigger points as per
  621. ; in the table below giving equal steps of light increase
  622.  
  623. Linearize:
  624. .hword 0,11,15,19,23,26,29,31,34,37,40,43,46,50,55,66
  625.  
  626. ;*** 90-200Hz Bandpass Filter ... avoids 60Hz noise
  627. KernelLow:
  628. .hword 0xFFB1 ;Coefficient a[0] =
  629. .hword 0xFFC8 ;Coefficient a[1] =
  630. .hword 0xFFDE ;Coefficient a[2] =
  631. .hword 0xFFF2 ;Coefficient a[3] =
  632. .hword 0x0002 ;Coefficient a[4] =
  633. .hword 0x0010 ;Coefficient a[5] =
  634. .hword 0x001A ;Coefficient a[6] =
  635. .hword 0x0021 ;Coefficient a[7] =
  636. .hword 0x0023 ;Coefficient a[8] =
  637. .hword 0x0022 ;Coefficient a[9] =
  638. .hword 0x001D ;Coefficient a[10] =
  639. .hword 0x0015 ;Coefficient a[11] =
  640. .hword 0x0009 ;Coefficient a[12] =
  641. .hword 0xFFFC ;Coefficient a[13] =
  642. .hword 0xFFEB ;Coefficient a[14] =
  643. .hword 0xFFD9 ;Coefficient a[15] =
  644. .hword 0xFFC5 ;Coefficient a[16] =
  645. .hword 0xFFB2 ;Coefficient a[17] =
  646. .hword 0xFF9F ;Coefficient a[18] =
  647. .hword 0xFF8E ;Coefficient a[19] =
  648. .hword 0xFF7F ;Coefficient a[20] =
  649. .hword 0xFF72 ;Coefficient a[21] =
  650. .hword 0xFF69 ;Coefficient a[22] =
  651. .hword 0xFF65 ;Coefficient a[23] =
  652. .hword 0xFF64 ;Coefficient a[24] =
  653. .hword 0xFF69 ;Coefficient a[25] =
  654. .hword 0xFF73 ;Coefficient a[26] =
  655. .hword 0xFF82 ;Coefficient a[27] =
  656. .hword 0xFF96 ;Coefficient a[28] =
  657. .hword 0xFFB0 ;Coefficient a[29] =
  658. .hword 0xFFCE ;Coefficient a[30] =
  659. .hword 0xFFF0 ;Coefficient a[31] =
  660. .hword 0x0015 ;Coefficient a[32] =
  661. .hword 0x003D ;Coefficient a[33] =
  662. .hword 0x0068 ;Coefficient a[34] =
  663. .hword 0x0094 ;Coefficient a[35] =
  664. .hword 0x00C0 ;Coefficient a[36] =
  665. .hword 0x00EB ;Coefficient a[37] =
  666. .hword 0x0115 ;Coefficient a[38] =
  667. .hword 0x013B ;Coefficient a[39] =
  668. .hword 0x015E ;Coefficient a[40] =
  669. .hword 0x017D ;Coefficient a[41] =
  670. .hword 0x0196 ;Coefficient a[42] =
  671. .hword 0x01A8 ;Coefficient a[43] =
  672. .hword 0x01B5 ;Coefficient a[44] =
  673. .hword 0x01BA ;Coefficient a[45] =
  674. .hword 0x01B9 ;Coefficient a[46] =
  675. .hword 0x01B1 ;Coefficient a[47] =
  676. .hword 0x01A1 ;Coefficient a[48] =
  677. .hword 0x018B ;Coefficient a[49] =
  678. .hword 0x0170 ;Coefficient a[50] =
  679. .hword 0x014F ;Coefficient a[51] =
  680. .hword 0x0129 ;Coefficient a[52] =
  681. .hword 0x0100 ;Coefficient a[53] =
  682. .hword 0x00D5 ;Coefficient a[54] =
  683. .hword 0x00A8 ;Coefficient a[55] =
  684. .hword 0x007C ;Coefficient a[56] =
  685. .hword 0x0050 ;Coefficient a[57] =
  686. .hword 0x0027 ;Coefficient a[58] =
  687. .hword 0x0001 ;Coefficient a[59] =
  688. .hword 0xFFE0 ;Coefficient a[60] =
  689. .hword 0xFFC4 ;Coefficient a[61] =
  690. .hword 0xFFAE ;Coefficient a[62] =
  691. .hword 0xFF9F ;Coefficient a[63] =
  692. .hword 0xFF96 ;Coefficient a[64] =
  693. .hword 0xFF95 ;Coefficient a[65] =
  694. .hword 0xFF9C ;Coefficient a[66] =
  695. .hword 0xFFA9 ;Coefficient a[67] =
  696. .hword 0xFFBD ;Coefficient a[68] =
  697. .hword 0xFFD6 ;Coefficient a[69] =
  698. .hword 0xFFF5 ;Coefficient a[70] =
  699. .hword 0x0017 ;Coefficient a[71] =
  700. .hword 0x003C ;Coefficient a[72] =
  701. .hword 0x0062 ;Coefficient a[73] =
  702. .hword 0x0088 ;Coefficient a[74] =
  703. .hword 0x00AC ;Coefficient a[75] =
  704. .hword 0x00CC ;Coefficient a[76] =
  705. .hword 0x00E7 ;Coefficient a[77] =
  706. .hword 0x00FC ;Coefficient a[78] =
  707. .hword 0x0109 ;Coefficient a[79] =
  708. .hword 0x010C ;Coefficient a[80] =
  709. .hword 0x0105 ;Coefficient a[81] =
  710. .hword 0x00F2 ;Coefficient a[82] =
  711. .hword 0x00D4 ;Coefficient a[83] =
  712. .hword 0x00A9 ;Coefficient a[84] =
  713. .hword 0x0072 ;Coefficient a[85] =
  714. .hword 0x002F ;Coefficient a[86] =
  715. .hword 0xFFE1 ;Coefficient a[87] =
  716. .hword 0xFF88 ;Coefficient a[88] =
  717. .hword 0xFF26 ;Coefficient a[89] =
  718. .hword 0xFEBC ;Coefficient a[90] =
  719. .hword 0xFE4C ;Coefficient a[91] =
  720. .hword 0xFDD7 ;Coefficient a[92] =
  721. .hword 0xFD61 ;Coefficient a[93] =
  722. .hword 0xFCEC ;Coefficient a[94] =
  723. .hword 0xFC7A ;Coefficient a[95] =
  724. .hword 0xFC0E ;Coefficient a[96] =
  725. .hword 0xFBAA ;Coefficient a[97] =
  726. .hword 0xFB51 ;Coefficient a[98] =
  727. .hword 0xFB06 ;Coefficient a[99] =
  728. .hword 0xFACA ;Coefficient a[100] =
  729. .hword 0xFA9F ;Coefficient a[101] =
  730. .hword 0xFA88 ;Coefficient a[102] =
  731. .hword 0xFA86 ;Coefficient a[103] =
  732. .hword 0xFA9A ;Coefficient a[104] =
  733. .hword 0xFAC4 ;Coefficient a[105] =
  734. .hword 0xFB05 ;Coefficient a[106] =
  735. .hword 0xFB5C ;Coefficient a[107] =
  736. .hword 0xFBCA ;Coefficient a[108] =
  737. .hword 0xFC4D ;Coefficient a[109] =
  738. .hword 0xFCE3 ;Coefficient a[110] =
  739. .hword 0xFD8B ;Coefficient a[111] =
  740. .hword 0xFE43 ;Coefficient a[112] =
  741. .hword 0xFF07 ;Coefficient a[113] =
  742. .hword 0xFFD5 ;Coefficient a[114] =
  743. .hword 0x00A9 ;Coefficient a[115] =
  744. .hword 0x0180 ;Coefficient a[116] =
  745. .hword 0x0258 ;Coefficient a[117] =
  746. .hword 0x032C ;Coefficient a[118] =
  747. .hword 0x03F9 ;Coefficient a[119] =
  748. .hword 0x04BB ;Coefficient a[120] =
  749. .hword 0x056F ;Coefficient a[121] =
  750. .hword 0x0612 ;Coefficient a[122] =
  751. .hword 0x06A1 ;Coefficient a[123] =
  752. .hword 0x071A ;Coefficient a[124] =
  753. .hword 0x077A ;Coefficient a[125] =
  754. .hword 0x07C0 ;Coefficient a[126] =
  755. .hword 0x07EA ;Coefficient a[127] =
  756. .hword 0x07F8 ;Coefficient a[128] =
  757. .hword 0x07EA ;Coefficient a[129] =
  758. .hword 0x07C0 ;Coefficient a[130] =
  759. .hword 0x077A ;Coefficient a[131] =
  760. .hword 0x071A ;Coefficient a[132] =
  761. .hword 0x06A1 ;Coefficient a[133] =
  762. .hword 0x0612 ;Coefficient a[134] =
  763. .hword 0x056F ;Coefficient a[135] =
  764. .hword 0x04BB ;Coefficient a[136] =
  765. .hword 0x03F9 ;Coefficient a[137] =
  766. .hword 0x032C ;Coefficient a[138] =
  767. .hword 0x0258 ;Coefficient a[139] =
  768. .hword 0x0180 ;Coefficient a[140] =
  769. .hword 0x00A9 ;Coefficient a[141] =
  770. .hword 0xFFD5 ;Coefficient a[142] =
  771. .hword 0xFF07 ;Coefficient a[143] =
  772. .hword 0xFE43 ;Coefficient a[144] =
  773. .hword 0xFD8B ;Coefficient a[145] =
  774. .hword 0xFCE3 ;Coefficient a[146] =
  775. .hword 0xFC4D ;Coefficient a[147] =
  776. .hword 0xFBCA ;Coefficient a[148] =
  777. .hword 0xFB5C ;Coefficient a[149] =
  778. .hword 0xFB05 ;Coefficient a[150] =
  779. .hword 0xFAC4 ;Coefficient a[151] =
  780. .hword 0xFA9A ;Coefficient a[152] =
  781. .hword 0xFA86 ;Coefficient a[153] =
  782. .hword 0xFA88 ;Coefficient a[154] =
  783. .hword 0xFA9F ;Coefficient a[155] =
  784. .hword 0xFACA ;Coefficient a[156] =
  785. .hword 0xFB06 ;Coefficient a[157] =
  786. .hword 0xFB51 ;Coefficient a[158] =
  787. .hword 0xFBAA ;Coefficient a[159] =
  788. .hword 0xFC0E ;Coefficient a[160] =
  789. .hword 0xFC7A ;Coefficient a[161] =
  790. .hword 0xFCEC ;Coefficient a[162] =
  791. .hword 0xFD61 ;Coefficient a[163] =
  792. .hword 0xFDD7 ;Coefficient a[164] =
  793. .hword 0xFE4C ;Coefficient a[165] =
  794. .hword 0xFEBC ;Coefficient a[166] =
  795. .hword 0xFF26 ;Coefficient a[167] =
  796. .hword 0xFF88 ;Coefficient a[168] =
  797. .hword 0xFFE1 ;Coefficient a[169] =
  798. .hword 0x002F ;Coefficient a[170] =
  799. .hword 0x0072 ;Coefficient a[171] =
  800. .hword 0x00A9 ;Coefficient a[172] =
  801. .hword 0x00D4 ;Coefficient a[173] =
  802. .hword 0x00F2 ;Coefficient a[174] =
  803. .hword 0x0105 ;Coefficient a[175] =
  804. .hword 0x010C ;Coefficient a[176] =
  805. .hword 0x0109 ;Coefficient a[177] =
  806. .hword 0x00FC ;Coefficient a[178] =
  807. .hword 0x00E7 ;Coefficient a[179] =
  808. .hword 0x00CC ;Coefficient a[180] =
  809. .hword 0x00AC ;Coefficient a[181] =
  810. .hword 0x0088 ;Coefficient a[182] =
  811. .hword 0x0062 ;Coefficient a[183] =
  812. .hword 0x003C ;Coefficient a[184] =
  813. .hword 0x0017 ;Coefficient a[185] =
  814. .hword 0xFFF5 ;Coefficient a[186] =
  815. .hword 0xFFD6 ;Coefficient a[187] =
  816. .hword 0xFFBD ;Coefficient a[188] =
  817. .hword 0xFFA9 ;Coefficient a[189] =
  818. .hword 0xFF9C ;Coefficient a[190] =
  819. .hword 0xFF95 ;Coefficient a[191] =
  820. .hword 0xFF96 ;Coefficient a[192] =
  821. .hword 0xFF9F ;Coefficient a[193] =
  822. .hword 0xFFAE ;Coefficient a[194] =
  823. .hword 0xFFC4 ;Coefficient a[195] =
  824. .hword 0xFFE0 ;Coefficient a[196] =
  825. .hword 0x0001 ;Coefficient a[197] =
  826. .hword 0x0027 ;Coefficient a[198] =
  827. .hword 0x0050 ;Coefficient a[199] =
  828. .hword 0x007C ;Coefficient a[200] =
  829. .hword 0x00A8 ;Coefficient a[201] =
  830. .hword 0x00D5 ;Coefficient a[202] =
  831. .hword 0x0100 ;Coefficient a[203] =
  832. .hword 0x0129 ;Coefficient a[204] =
  833. .hword 0x014F ;Coefficient a[205] =
  834. .hword 0x0170 ;Coefficient a[206] =
  835. .hword 0x018B ;Coefficient a[207] =
  836. .hword 0x01A1 ;Coefficient a[208] =
  837. .hword 0x01B1 ;Coefficient a[209] =
  838. .hword 0x01B9 ;Coefficient a[210] =
  839. .hword 0x01BA ;Coefficient a[211] =
  840. .hword 0x01B5 ;Coefficient a[212] =
  841. .hword 0x01A8 ;Coefficient a[213] =
  842. .hword 0x0196 ;Coefficient a[214] =
  843. .hword 0x017D ;Coefficient a[215] =
  844. .hword 0x015E ;Coefficient a[216] =
  845. .hword 0x013B ;Coefficient a[217] =
  846. .hword 0x0115 ;Coefficient a[218] =
  847. .hword 0x00EB ;Coefficient a[219] =
  848. .hword 0x00C0 ;Coefficient a[220] =
  849. .hword 0x0094 ;Coefficient a[221] =
  850. .hword 0x0068 ;Coefficient a[222] =
  851. .hword 0x003D ;Coefficient a[223] =
  852. .hword 0x0015 ;Coefficient a[224] =
  853. .hword 0xFFF0 ;Coefficient a[225] =
  854. .hword 0xFFCE ;Coefficient a[226] =
  855. .hword 0xFFB0 ;Coefficient a[227] =
  856. .hword 0xFF96 ;Coefficient a[228] =
  857. .hword 0xFF82 ;Coefficient a[229] =
  858. .hword 0xFF73 ;Coefficient a[230] =
  859. .hword 0xFF69 ;Coefficient a[231] =
  860. .hword 0xFF64 ;Coefficient a[232] =
  861. .hword 0xFF65 ;Coefficient a[233] =
  862. .hword 0xFF69 ;Coefficient a[234] =
  863. .hword 0xFF72 ;Coefficient a[235] =
  864. .hword 0xFF7F ;Coefficient a[236] =
  865. .hword 0xFF8E ;Coefficient a[237] =
  866. .hword 0xFF9F ;Coefficient a[238] =
  867. .hword 0xFFB2 ;Coefficient a[239] =
  868. .hword 0xFFC5 ;Coefficient a[240] =
  869. .hword 0xFFD9 ;Coefficient a[241] =
  870. .hword 0xFFEB ;Coefficient a[242] =
  871. .hword 0xFFFC ;Coefficient a[243] =
  872. .hword 0x0009 ;Coefficient a[244] =
  873. .hword 0x0015 ;Coefficient a[245] =
  874. .hword 0x001D ;Coefficient a[246] =
  875. .hword 0x0022 ;Coefficient a[247] =
  876. .hword 0x0023 ;Coefficient a[248] =
  877. .hword 0x0021 ;Coefficient a[249] =
  878. .hword 0x001A ;Coefficient a[250] =
  879. .hword 0x0010 ;Coefficient a[251] =
  880. .hword 0x0002 ;Coefficient a[252] =
  881. .hword 0xFFF2 ;Coefficient a[253] =
  882. .hword 0xFFDE ;Coefficient a[254] =
  883. .hword 0xFFC8 ;Coefficient a[255] =
  884. .hword 0xFFB1 ;Coefficient a[256] =
  885.  
  886. ;*** Mid Kernel 250-400Hz
  887. KernelMid:
  888. .hword 0x0026 ;Coefficient a[0] =
  889. .hword 0x004E ;Coefficient a[1] =
  890. .hword 0x0078 ;Coefficient a[2] =
  891. .hword 0x00A0 ;Coefficient a[3] =
  892. .hword 0x00C2 ;Coefficient a[4] =
  893. .hword 0x00D9 ;Coefficient a[5] =
  894. .hword 0x00E1 ;Coefficient a[6] =
  895. .hword 0x00D7 ;Coefficient a[7] =
  896. .hword 0x00BB ;Coefficient a[8] =
  897. .hword 0x008C ;Coefficient a[9] =
  898. .hword 0x004E ;Coefficient a[10] =
  899. .hword 0x0005 ;Coefficient a[11] =
  900. .hword 0xFFB8 ;Coefficient a[12] =
  901. .hword 0xFF6A ;Coefficient a[13] =
  902. .hword 0xFF23 ;Coefficient a[14] =
  903. .hword 0xFEE8 ;Coefficient a[15] =
  904. .hword 0xFEC0 ;Coefficient a[16] =
  905. .hword 0xFEAE ;Coefficient a[17] =
  906. .hword 0xFEB3 ;Coefficient a[18] =
  907. .hword 0xFED0 ;Coefficient a[19] =
  908. .hword 0xFF01 ;Coefficient a[20] =
  909. .hword 0xFF43 ;Coefficient a[21] =
  910. .hword 0xFF90 ;Coefficient a[22] =
  911. .hword 0xFFE1 ;Coefficient a[23] =
  912. .hword 0x0030 ;Coefficient a[24] =
  913. .hword 0x0077 ;Coefficient a[25] =
  914. .hword 0x00AF ;Coefficient a[26] =
  915. .hword 0x00D6 ;Coefficient a[27] =
  916. .hword 0x00E9 ;Coefficient a[28] =
  917. .hword 0x00E9 ;Coefficient a[29] =
  918. .hword 0x00D6 ;Coefficient a[30] =
  919. .hword 0x00B5 ;Coefficient a[31] =
  920. .hword 0x008B ;Coefficient a[32] =
  921. .hword 0x005E ;Coefficient a[33] =
  922. .hword 0x0034 ;Coefficient a[34] =
  923. .hword 0x0011 ;Coefficient a[35] =
  924. .hword 0xFFFB ;Coefficient a[36] =
  925. .hword 0xFFF2 ;Coefficient a[37] =
  926. .hword 0xFFF9 ;Coefficient a[38] =
  927. .hword 0x000B ;Coefficient a[39] =
  928. .hword 0x0028 ;Coefficient a[40] =
  929. .hword 0x004A ;Coefficient a[41] =
  930. .hword 0x006A ;Coefficient a[42] =
  931. .hword 0x0084 ;Coefficient a[43] =
  932. .hword 0x0090 ;Coefficient a[44] =
  933. .hword 0x008A ;Coefficient a[45] =
  934. .hword 0x0070 ;Coefficient a[46] =
  935. .hword 0x0042 ;Coefficient a[47] =
  936. .hword 0x0000 ;Coefficient a[48] =
  937. .hword 0xFFAF ;Coefficient a[49] =
  938. .hword 0xFF56 ;Coefficient a[50] =
  939. .hword 0xFEFB ;Coefficient a[51] =
  940. .hword 0xFEA9 ;Coefficient a[52] =
  941. .hword 0xFE67 ;Coefficient a[53] =
  942. .hword 0xFE3E ;Coefficient a[54] =
  943. .hword 0xFE32 ;Coefficient a[55] =
  944. .hword 0xFE49 ;Coefficient a[56] =
  945. .hword 0xFE82 ;Coefficient a[57] =
  946. .hword 0xFEDB ;Coefficient a[58] =
  947. .hword 0xFF4F ;Coefficient a[59] =
  948. .hword 0xFFD5 ;Coefficient a[60] =
  949. .hword 0x0062 ;Coefficient a[61] =
  950. .hword 0x00EE ;Coefficient a[62] =
  951. .hword 0x016B ;Coefficient a[63] =
  952. .hword 0x01D0 ;Coefficient a[64] =
  953. .hword 0x0215 ;Coefficient a[65] =
  954. .hword 0x0234 ;Coefficient a[66] =
  955. .hword 0x022C ;Coefficient a[67] =
  956. .hword 0x01FD ;Coefficient a[68] =
  957. .hword 0x01AC ;Coefficient a[69] =
  958. .hword 0x0142 ;Coefficient a[70] =
  959. .hword 0x00C8 ;Coefficient a[71] =
  960. .hword 0x004A ;Coefficient a[72] =
  961. .hword 0xFFD4 ;Coefficient a[73] =
  962. .hword 0xFF6F ;Coefficient a[74] =
  963. .hword 0xFF22 ;Coefficient a[75] =
  964. .hword 0xFEF4 ;Coefficient a[76] =
  965. .hword 0xFEE6 ;Coefficient a[77] =
  966. .hword 0xFEF6 ;Coefficient a[78] =
  967. .hword 0xFF1F ;Coefficient a[79] =
  968. .hword 0xFF58 ;Coefficient a[80] =
  969. .hword 0xFF97 ;Coefficient a[81] =
  970. .hword 0xFFD0 ;Coefficient a[82] =
  971. .hword 0xFFFA ;Coefficient a[83] =
  972. .hword 0x000A ;Coefficient a[84] =
  973. .hword 0xFFFE ;Coefficient a[85] =
  974. .hword 0xFFD2 ;Coefficient a[86] =
  975. .hword 0xFF87 ;Coefficient a[87] =
  976. .hword 0xFF26 ;Coefficient a[88] =
  977. .hword 0xFEB9 ;Coefficient a[89] =
  978. .hword 0xFE4D ;Coefficient a[90] =
  979. .hword 0xFDF1 ;Coefficient a[91] =
  980. .hword 0xFDB6 ;Coefficient a[92] =
  981. .hword 0xFDA8 ;Coefficient a[93] =
  982. .hword 0xFDD3 ;Coefficient a[94] =
  983. .hword 0xFE3C ;Coefficient a[95] =
  984. .hword 0xFEE4 ;Coefficient a[96] =
  985. .hword 0xFFC6 ;Coefficient a[97] =
  986. .hword 0x00D2 ;Coefficient a[98] =
  987. .hword 0x01FA ;Coefficient a[99] =
  988. .hword 0x0326 ;Coefficient a[100] =
  989. .hword 0x043D ;Coefficient a[101] =
  990. .hword 0x0524 ;Coefficient a[102] =
  991. .hword 0x05C2 ;Coefficient a[103] =
  992. .hword 0x0604 ;Coefficient a[104] =
  993. .hword 0x05DB ;Coefficient a[105] =
  994. .hword 0x0540 ;Coefficient a[106] =
  995. .hword 0x0436 ;Coefficient a[107] =
  996. .hword 0x02C7 ;Coefficient a[108] =
  997. .hword 0x0108 ;Coefficient a[109] =
  998. .hword 0xFF16 ;Coefficient a[110] =
  999. .hword 0xFD11 ;Coefficient a[111] =
  1000. .hword 0xFB20 ;Coefficient a[112] =
  1001. .hword 0xF969 ;Coefficient a[113] =
  1002. .hword 0xF80F ;Coefficient a[114] =
  1003. .hword 0xF72F ;Coefficient a[115] =
  1004. .hword 0xF6E0 ;Coefficient a[116] =
  1005. .hword 0xF72E ;Coefficient a[117] =
  1006. .hword 0xF819 ;Coefficient a[118] =
  1007. .hword 0xF996 ;Coefficient a[119] =
  1008. .hword 0xFB8E ;Coefficient a[120] =
  1009. .hword 0xFDE0 ;Coefficient a[121] =
  1010. .hword 0x0064 ;Coefficient a[122] =
  1011. .hword 0x02F0 ;Coefficient a[123] =
  1012. .hword 0x0554 ;Coefficient a[124] =
  1013. .hword 0x0764 ;Coefficient a[125] =
  1014. .hword 0x08FC ;Coefficient a[126] =
  1015. .hword 0x09FD ;Coefficient a[127] =
  1016. .hword 0x0A55 ;Coefficient a[128] =
  1017. .hword 0x09FD ;Coefficient a[129] =
  1018. .hword 0x08FC ;Coefficient a[130] =
  1019. .hword 0x0764 ;Coefficient a[131] =
  1020. .hword 0x0554 ;Coefficient a[132] =
  1021. .hword 0x02F0 ;Coefficient a[133] =
  1022. .hword 0x0064 ;Coefficient a[134] =
  1023. .hword 0xFDE0 ;Coefficient a[135] =
  1024. .hword 0xFB8E ;Coefficient a[136] =
  1025. .hword 0xF996 ;Coefficient a[137] =
  1026. .hword 0xF819 ;Coefficient a[138] =
  1027. .hword 0xF72E ;Coefficient a[139] =
  1028. .hword 0xF6E0 ;Coefficient a[140] =
  1029. .hword 0xF72F ;Coefficient a[141] =
  1030. .hword 0xF80F ;Coefficient a[142] =
  1031. .hword 0xF969 ;Coefficient a[143] =
  1032. .hword 0xFB20 ;Coefficient a[144] =
  1033. .hword 0xFD11 ;Coefficient a[145] =
  1034. .hword 0xFF16 ;Coefficient a[146] =
  1035. .hword 0x0108 ;Coefficient a[147] =
  1036. .hword 0x02C7 ;Coefficient a[148] =
  1037. .hword 0x0436 ;Coefficient a[149] =
  1038. .hword 0x0540 ;Coefficient a[150] =
  1039. .hword 0x05DB ;Coefficient a[151] =
  1040. .hword 0x0604 ;Coefficient a[152] =
  1041. .hword 0x05C2 ;Coefficient a[153] =
  1042. .hword 0x0524 ;Coefficient a[154] =
  1043. .hword 0x043D ;Coefficient a[155] =
  1044. .hword 0x0326 ;Coefficient a[156] =
  1045. .hword 0x01FA ;Coefficient a[157] =
  1046. .hword 0x00D2 ;Coefficient a[158] =
  1047. .hword 0xFFC6 ;Coefficient a[159] =
  1048. .hword 0xFEE4 ;Coefficient a[160] =
  1049. .hword 0xFE3C ;Coefficient a[161] =
  1050. .hword 0xFDD3 ;Coefficient a[162] =
  1051. .hword 0xFDA8 ;Coefficient a[163] =
  1052. .hword 0xFDB6 ;Coefficient a[164] =
  1053. .hword 0xFDF1 ;Coefficient a[165] =
  1054. .hword 0xFE4D ;Coefficient a[166] =
  1055. .hword 0xFEB9 ;Coefficient a[167] =
  1056. .hword 0xFF26 ;Coefficient a[168] =
  1057. .hword 0xFF87 ;Coefficient a[169] =
  1058. .hword 0xFFD2 ;Coefficient a[170] =
  1059. .hword 0xFFFE ;Coefficient a[171] =
  1060. .hword 0x000A ;Coefficient a[172] =
  1061. .hword 0xFFFA ;Coefficient a[173] =
  1062. .hword 0xFFD0 ;Coefficient a[174] =
  1063. .hword 0xFF97 ;Coefficient a[175] =
  1064. .hword 0xFF58 ;Coefficient a[176] =
  1065. .hword 0xFF1F ;Coefficient a[177] =
  1066. .hword 0xFEF6 ;Coefficient a[178] =
  1067. .hword 0xFEE6 ;Coefficient a[179] =
  1068. .hword 0xFEF4 ;Coefficient a[180] =
  1069. .hword 0xFF22 ;Coefficient a[181] =
  1070. .hword 0xFF6F ;Coefficient a[182] =
  1071. .hword 0xFFD4 ;Coefficient a[183] =
  1072. .hword 0x004A ;Coefficient a[184] =
  1073. .hword 0x00C8 ;Coefficient a[185] =
  1074. .hword 0x0142 ;Coefficient a[186] =
  1075. .hword 0x01AC ;Coefficient a[187] =
  1076. .hword 0x01FD ;Coefficient a[188] =
  1077. .hword 0x022C ;Coefficient a[189] =
  1078. .hword 0x0234 ;Coefficient a[190] =
  1079. .hword 0x0215 ;Coefficient a[191] =
  1080. .hword 0x01D0 ;Coefficient a[192] =
  1081. .hword 0x016B ;Coefficient a[193] =
  1082. .hword 0x00EE ;Coefficient a[194] =
  1083. .hword 0x0062 ;Coefficient a[195] =
  1084. .hword 0xFFD5 ;Coefficient a[196] =
  1085. .hword 0xFF4F ;Coefficient a[197] =
  1086. .hword 0xFEDB ;Coefficient a[198] =
  1087. .hword 0xFE82 ;Coefficient a[199] =
  1088. .hword 0xFE49 ;Coefficient a[200] =
  1089. .hword 0xFE32 ;Coefficient a[201] =
  1090. .hword 0xFE3E ;Coefficient a[202] =
  1091. .hword 0xFE67 ;Coefficient a[203] =
  1092. .hword 0xFEA9 ;Coefficient a[204] =
  1093. .hword 0xFEFB ;Coefficient a[205] =
  1094. .hword 0xFF56 ;Coefficient a[206] =
  1095. .hword 0xFFAF ;Coefficient a[207] =
  1096. .hword 0x0000 ;Coefficient a[208] =
  1097. .hword 0x0042 ;Coefficient a[209] =
  1098. .hword 0x0070 ;Coefficient a[210] =
  1099. .hword 0x008A ;Coefficient a[211] =
  1100. .hword 0x0090 ;Coefficient a[212] =
  1101. .hword 0x0084 ;Coefficient a[213] =
  1102. .hword 0x006A ;Coefficient a[214] =
  1103. .hword 0x004A ;Coefficient a[215] =
  1104. .hword 0x0028 ;Coefficient a[216] =
  1105. .hword 0x000B ;Coefficient a[217] =
  1106. .hword 0xFFF9 ;Coefficient a[218] =
  1107. .hword 0xFFF2 ;Coefficient a[219] =
  1108. .hword 0xFFFB ;Coefficient a[220] =
  1109. .hword 0x0011 ;Coefficient a[221] =
  1110. .hword 0x0034 ;Coefficient a[222] =
  1111. .hword 0x005E ;Coefficient a[223] =
  1112. .hword 0x008B ;Coefficient a[224] =
  1113. .hword 0x00B5 ;Coefficient a[225] =
  1114. .hword 0x00D6 ;Coefficient a[226] =
  1115. .hword 0x00E9 ;Coefficient a[227] =
  1116. .hword 0x00E9 ;Coefficient a[228] =
  1117. .hword 0x00D6 ;Coefficient a[229] =
  1118. .hword 0x00AF ;Coefficient a[230] =
  1119. .hword 0x0077 ;Coefficient a[231] =
  1120. .hword 0x0030 ;Coefficient a[232] =
  1121. .hword 0xFFE1 ;Coefficient a[233] =
  1122. .hword 0xFF90 ;Coefficient a[234] =
  1123. .hword 0xFF43 ;Coefficient a[235] =
  1124. .hword 0xFF01 ;Coefficient a[236] =
  1125. .hword 0xFED0 ;Coefficient a[237] =
  1126. .hword 0xFEB3 ;Coefficient a[238] =
  1127. .hword 0xFEAE ;Coefficient a[239] =
  1128. .hword 0xFEC0 ;Coefficient a[240] =
  1129. .hword 0xFEE8 ;Coefficient a[241] =
  1130. .hword 0xFF23 ;Coefficient a[242] =
  1131. .hword 0xFF6A ;Coefficient a[243] =
  1132. .hword 0xFFB8 ;Coefficient a[244] =
  1133. .hword 0x0005 ;Coefficient a[245] =
  1134. .hword 0x004E ;Coefficient a[246] =
  1135. .hword 0x008C ;Coefficient a[247] =
  1136. .hword 0x00BB ;Coefficient a[248] =
  1137. .hword 0x00D7 ;Coefficient a[249] =
  1138. .hword 0x00E1 ;Coefficient a[250] =
  1139. .hword 0x00D9 ;Coefficient a[251] =
  1140. .hword 0x00C2 ;Coefficient a[252] =
  1141. .hword 0x00A0 ;Coefficient a[253] =
  1142. .hword 0x0078 ;Coefficient a[254] =
  1143. .hword 0x004E ;Coefficient a[255] =
  1144. .hword 0x0026 ;Coefficient a[256] =
  1145.  
  1146. ;*** High Kernel 500 - 2000Hz
  1147. KernelHigh:
  1148. .hword 0x0129 ;Coefficient a[0] =
  1149. .hword 0x007D ;Coefficient a[1] =
  1150. .hword 0xFFE4 ;Coefficient a[2] =
  1151. .hword 0x0069 ;Coefficient a[3] =
  1152. .hword 0x00B2 ;Coefficient a[4] =
  1153. .hword 0xFFC4 ;Coefficient a[5] =
  1154. .hword 0xFF0E ;Coefficient a[6] =
  1155. .hword 0xFF9E ;Coefficient a[7] =
  1156. .hword 0x0000 ;Coefficient a[8] =
  1157. .hword 0xFF3D ;Coefficient a[9] =
  1158. .hword 0xFED7 ;Coefficient a[10] =
  1159. .hword 0xFFC7 ;Coefficient a[11] =
  1160. .hword 0x0075 ;Coefficient a[12] =
  1161. .hword 0xFFE8 ;Coefficient a[13] =
  1162. .hword 0xFFB0 ;Coefficient a[14] =
  1163. .hword 0x00B4 ;Coefficient a[15] =
  1164. .hword 0x0146 ;Coefficient a[16] =
  1165. .hword 0x0076 ;Coefficient a[17] =
  1166. .hword 0xFFF8 ;Coefficient a[18] =
  1167. .hword 0x00B0 ;Coefficient a[19] =
  1168. .hword 0x00E4 ;Coefficient a[20] =
  1169. .hword 0xFFBB ;Coefficient a[21] =
  1170. .hword 0xFF0F ;Coefficient a[22] =
  1171. .hword 0xFFC3 ;Coefficient a[23] =
  1172. .hword 0x0000 ;Coefficient a[24] =
  1173. .hword 0xFEFC ;Coefficient a[25] =
  1174. .hword 0xFEA5 ;Coefficient a[26] =
  1175. .hword 0xFFC4 ;Coefficient a[27] =
  1176. .hword 0x005B ;Coefficient a[28] =
  1177. .hword 0xFFA0 ;Coefficient a[29] =
  1178. .hword 0xFF8F ;Coefficient a[30] =
  1179. .hword 0x00DA ;Coefficient a[31] =
  1180. .hword 0x0161 ;Coefficient a[32] =
  1181. .hword 0x0068 ;Coefficient a[33] =
  1182. .hword 0x0012 ;Coefficient a[34] =
  1183. .hword 0x010A ;Coefficient a[35] =
  1184. .hword 0x011D ;Coefficient a[36] =
  1185. .hword 0xFFB3 ;Coefficient a[37] =
  1186. .hword 0xFF1A ;Coefficient a[38] =
  1187. .hword 0xFFF8 ;Coefficient a[39] =
  1188. .hword 0x0000 ;Coefficient a[40] =
  1189. .hword 0xFEAD ;Coefficient a[41] =
  1190. .hword 0xFE6D ;Coefficient a[42] =
  1191. .hword 0xFFC4 ;Coefficient a[43] =
  1192. .hword 0x0034 ;Coefficient a[44] =
  1193. .hword 0xFF40 ;Coefficient a[45] =
  1194. .hword 0xFF66 ;Coefficient a[46] =
  1195. .hword 0x0106 ;Coefficient a[47] =
  1196. .hword 0x0179 ;Coefficient a[48] =
  1197. .hword 0x0050 ;Coefficient a[49] =
  1198. .hword 0x0037 ;Coefficient a[50] =
  1199. .hword 0x017E ;Coefficient a[51] =
  1200. .hword 0x0164 ;Coefficient a[52] =
  1201. .hword 0xFFAA ;Coefficient a[53] =
  1202. .hword 0xFF33 ;Coefficient a[54] =
  1203. .hword 0x0044 ;Coefficient a[55] =
  1204. .hword 0x0000 ;Coefficient a[56] =
  1205. .hword 0xFE49 ;Coefficient a[57] =
  1206. .hword 0xFE2B ;Coefficient a[58] =
  1207. .hword 0xFFC5 ;Coefficient a[59] =
  1208. .hword 0xFFF9 ;Coefficient a[60] =
  1209. .hword 0xFEBB ;Coefficient a[61] =
  1210. .hword 0xFF2F ;Coefficient a[62] =
  1211. .hword 0x013E ;Coefficient a[63] =
  1212. .hword 0x018C ;Coefficient a[64] =
  1213. .hword 0x0029 ;Coefficient a[65] =
  1214. .hword 0x006D ;Coefficient a[66] =
  1215. .hword 0x0220 ;Coefficient a[67] =
  1216. .hword 0x01C2 ;Coefficient a[68] =
  1217. .hword 0xFFA0 ;Coefficient a[69] =
  1218. .hword 0xFF62 ;Coefficient a[70] =
  1219. .hword 0x00B9 ;Coefficient a[71] =
  1220. .hword 0x0000 ;Coefficient a[72] =
  1221. .hword 0xFDBC ;Coefficient a[73] =
  1222. .hword 0xFDD7 ;Coefficient a[74] =
  1223. .hword 0xFFC9 ;Coefficient a[75] =
  1224. .hword 0xFF9A ;Coefficient a[76] =
  1225. .hword 0xFDEF ;Coefficient a[77] =
  1226. .hword 0xFEDF ;Coefficient a[78] =
  1227. .hword 0x018C ;Coefficient a[79] =
  1228. .hword 0x019C ;Coefficient a[80] =
  1229. .hword 0xFFE6 ;Coefficient a[81] =
  1230. .hword 0x00C3 ;Coefficient a[82] =
  1231. .hword 0x031C ;Coefficient a[83] =
  1232. .hword 0x024F ;Coefficient a[84] =
  1233. .hword 0xFF93 ;Coefficient a[85] =
  1234. .hword 0xFFBC ;Coefficient a[86] =
  1235. .hword 0x0182 ;Coefficient a[87] =
  1236. .hword 0x0000 ;Coefficient a[88] =
  1237. .hword 0xFCD7 ;Coefficient a[89] =
  1238. .hword 0xFD55 ;Coefficient a[90] =
  1239. .hword 0xFFD4 ;Coefficient a[91] =
  1240. .hword 0xFEE9 ;Coefficient a[92] =
  1241. .hword 0xFC83 ;Coefficient a[93] =
  1242. .hword 0xFE50 ;Coefficient a[94] =
  1243. .hword 0x0212 ;Coefficient a[95] =
  1244. .hword 0x01A8 ;Coefficient a[96] =
  1245. .hword 0xFF5E ;Coefficient a[97] =
  1246. .hword 0x016C ;Coefficient a[98] =
  1247. .hword 0x0507 ;Coefficient a[99] =
  1248. .hword 0x0361 ;Coefficient a[100] =
  1249. .hword 0xFF7B ;Coefficient a[101] =
  1250. .hword 0x0087 ;Coefficient a[102] =
  1251. .hword 0x0336 ;Coefficient a[103] =
  1252. .hword 0x0000 ;Coefficient a[104] =
  1253. .hword 0xFADF ;Coefficient a[105] =
  1254. .hword 0xFC3C ;Coefficient a[106] =
  1255. .hword 0xFFF2 ;Coefficient a[107] =
  1256. .hword 0xFD30 ;Coefficient a[108] =
  1257. .hword 0xF8E7 ;Coefficient a[109] =
  1258. .hword 0xFCDF ;Coefficient a[110] =
  1259. .hword 0x0373 ;Coefficient a[111] =
  1260. .hword 0x01AF ;Coefficient a[112] =
  1261. .hword 0xFDBD ;Coefficient a[113] =
  1262. .hword 0x037E ;Coefficient a[114] =
  1263. .hword 0x0B4E ;Coefficient a[115] =
  1264. .hword 0x0709 ;Coefficient a[116] =
  1265. .hword 0xFF2A ;Coefficient a[117] =
  1266. .hword 0x03D3 ;Coefficient a[118] =
  1267. .hword 0x0AAF ;Coefficient a[119] =
  1268. .hword 0x0000 ;Coefficient a[120] =
  1269. .hword 0xF073 ;Coefficient a[121] =
  1270. .hword 0xF5BD ;Coefficient a[122] =
  1271. .hword 0x00D0 ;Coefficient a[123] =
  1272. .hword 0xEE1D ;Coefficient a[124] =
  1273. .hword 0xD03F ;Coefficient a[125] =
  1274. .hword 0xE53D ;Coefficient a[126] =
  1275. .hword 0x2F16 ;Coefficient a[127] =
  1276. .hword 0x5A12 ;Coefficient a[128] =
  1277. .hword 0x2F16 ;Coefficient a[129] =
  1278. .hword 0xE53D ;Coefficient a[130] =
  1279. .hword 0xD03F ;Coefficient a[131] =
  1280. .hword 0xEE1D ;Coefficient a[132] =
  1281. .hword 0x00D0 ;Coefficient a[133] =
  1282. .hword 0xF5BD ;Coefficient a[134] =
  1283. .hword 0xF073 ;Coefficient a[135] =
  1284. .hword 0x0000 ;Coefficient a[136] =
  1285. .hword 0x0AAF ;Coefficient a[137] =
  1286. .hword 0x03D3 ;Coefficient a[138] =
  1287. .hword 0xFF2A ;Coefficient a[139] =
  1288. .hword 0x0709 ;Coefficient a[140] =
  1289. .hword 0x0B4E ;Coefficient a[141] =
  1290. .hword 0x037E ;Coefficient a[142] =
  1291. .hword 0xFDBD ;Coefficient a[143] =
  1292. .hword 0x01AF ;Coefficient a[144] =
  1293. .hword 0x0373 ;Coefficient a[145] =
  1294. .hword 0xFCDF ;Coefficient a[146] =
  1295. .hword 0xF8E7 ;Coefficient a[147] =
  1296. .hword 0xFD30 ;Coefficient a[148] =
  1297. .hword 0xFFF2 ;Coefficient a[149] =
  1298. .hword 0xFC3C ;Coefficient a[150] =
  1299. .hword 0xFADF ;Coefficient a[151] =
  1300. .hword 0x0000 ;Coefficient a[152] =
  1301. .hword 0x0336 ;Coefficient a[153] =
  1302. .hword 0x0087 ;Coefficient a[154] =
  1303. .hword 0xFF7B ;Coefficient a[155] =
  1304. .hword 0x0361 ;Coefficient a[156] =
  1305. .hword 0x0507 ;Coefficient a[157] =
  1306. .hword 0x016C ;Coefficient a[158] =
  1307. .hword 0xFF5E ;Coefficient a[159] =
  1308. .hword 0x01A8 ;Coefficient a[160] =
  1309. .hword 0x0212 ;Coefficient a[161] =
  1310. .hword 0xFE50 ;Coefficient a[162] =
  1311. .hword 0xFC83 ;Coefficient a[163] =
  1312. .hword 0xFEE9 ;Coefficient a[164] =
  1313. .hword 0xFFD4 ;Coefficient a[165] =
  1314. .hword 0xFD55 ;Coefficient a[166] =
  1315. .hword 0xFCD7 ;Coefficient a[167] =
  1316. .hword 0x0000 ;Coefficient a[168] =
  1317. .hword 0x0182 ;Coefficient a[169] =
  1318. .hword 0xFFBC ;Coefficient a[170] =
  1319. .hword 0xFF93 ;Coefficient a[171] =
  1320. .hword 0x024F ;Coefficient a[172] =
  1321. .hword 0x031C ;Coefficient a[173] =
  1322. .hword 0x00C3 ;Coefficient a[174] =
  1323. .hword 0xFFE6 ;Coefficient a[175] =
  1324. .hword 0x019C ;Coefficient a[176] =
  1325. .hword 0x018C ;Coefficient a[177] =
  1326. .hword 0xFEDF ;Coefficient a[178] =
  1327. .hword 0xFDEF ;Coefficient a[179] =
  1328. .hword 0xFF9A ;Coefficient a[180] =
  1329. .hword 0xFFC9 ;Coefficient a[181] =
  1330. .hword 0xFDD7 ;Coefficient a[182] =
  1331. .hword 0xFDBC ;Coefficient a[183] =
  1332. .hword 0x0000 ;Coefficient a[184] =
  1333. .hword 0x00B9 ;Coefficient a[185] =
  1334. .hword 0xFF62 ;Coefficient a[186] =
  1335. .hword 0xFFA0 ;Coefficient a[187] =
  1336. .hword 0x01C2 ;Coefficient a[188] =
  1337. .hword 0x0220 ;Coefficient a[189] =
  1338. .hword 0x006D ;Coefficient a[190] =
  1339. .hword 0x0029 ;Coefficient a[191] =
  1340. .hword 0x018C ;Coefficient a[192] =
  1341. .hword 0x013E ;Coefficient a[193] =
  1342. .hword 0xFF2F ;Coefficient a[194] =
  1343. .hword 0xFEBB ;Coefficient a[195] =
  1344. .hword 0xFFF9 ;Coefficient a[196] =
  1345. .hword 0xFFC5 ;Coefficient a[197] =
  1346. .hword 0xFE2B ;Coefficient a[198] =
  1347. .hword 0xFE49 ;Coefficient a[199] =
  1348. .hword 0x0000 ;Coefficient a[200] =
  1349. .hword 0x0044 ;Coefficient a[201] =
  1350. .hword 0xFF33 ;Coefficient a[202] =
  1351. .hword 0xFFAA ;Coefficient a[203] =
  1352. .hword 0x0164 ;Coefficient a[204] =
  1353. .hword 0x017E ;Coefficient a[205] =
  1354. .hword 0x0037 ;Coefficient a[206] =
  1355. .hword 0x0050 ;Coefficient a[207] =
  1356. .hword 0x0179 ;Coefficient a[208] =
  1357. .hword 0x0106 ;Coefficient a[209] =
  1358. .hword 0xFF66 ;Coefficient a[210] =
  1359. .hword 0xFF40 ;Coefficient a[211] =
  1360. .hword 0x0034 ;Coefficient a[212] =
  1361. .hword 0xFFC4 ;Coefficient a[213] =
  1362. .hword 0xFE6D ;Coefficient a[214] =
  1363. .hword 0xFEAD ;Coefficient a[215] =
  1364. .hword 0x0000 ;Coefficient a[216] =
  1365. .hword 0xFFF8 ;Coefficient a[217] =
  1366. .hword 0xFF1A ;Coefficient a[218] =
  1367. .hword 0xFFB3 ;Coefficient a[219] =
  1368. .hword 0x011D ;Coefficient a[220] =
  1369. .hword 0x010A ;Coefficient a[221] =
  1370. .hword 0x0012 ;Coefficient a[222] =
  1371. .hword 0x0068 ;Coefficient a[223] =
  1372. .hword 0x0161 ;Coefficient a[224] =
  1373. .hword 0x00DA ;Coefficient a[225] =
  1374. .hword 0xFF8F ;Coefficient a[226] =
  1375. .hword 0xFFA0 ;Coefficient a[227] =
  1376. .hword 0x005B ;Coefficient a[228] =
  1377. .hword 0xFFC4 ;Coefficient a[229] =
  1378. .hword 0xFEA5 ;Coefficient a[230] =
  1379. .hword 0xFEFC ;Coefficient a[231] =
  1380. .hword 0x0000 ;Coefficient a[232] =
  1381. .hword 0xFFC3 ;Coefficient a[233] =
  1382. .hword 0xFF0F ;Coefficient a[234] =
  1383. .hword 0xFFBB ;Coefficient a[235] =
  1384. .hword 0x00E4 ;Coefficient a[236] =
  1385. .hword 0x00B0 ;Coefficient a[237] =
  1386. .hword 0xFFF8 ;Coefficient a[238] =
  1387. .hword 0x0076 ;Coefficient a[239] =
  1388. .hword 0x0146 ;Coefficient a[240] =
  1389. .hword 0x00B4 ;Coefficient a[241] =
  1390. .hword 0xFFB0 ;Coefficient a[242] =
  1391. .hword 0xFFE8 ;Coefficient a[243] =
  1392. .hword 0x0075 ;Coefficient a[244] =
  1393. .hword 0xFFC7 ;Coefficient a[245] =
  1394. .hword 0xFED7 ;Coefficient a[246] =
  1395. .hword 0xFF3D ;Coefficient a[247] =
  1396. .hword 0x0000 ;Coefficient a[248] =
  1397. .hword 0xFF9E ;Coefficient a[249] =
  1398. .hword 0xFF0E ;Coefficient a[250] =
  1399. .hword 0xFFC4 ;Coefficient a[251] =
  1400. .hword 0x00B2 ;Coefficient a[252] =
  1401. .hword 0x0069 ;Coefficient a[253] =
  1402. .hword 0xFFE4 ;Coefficient a[254] =
  1403. .hword 0x007D ;Coefficient a[255] =
  1404. .hword 0x0129 ;Coefficient a[256] =
  1405.  
  1406. ;Filter coefficents calculated from http://www.dsptutor.freeuk.com/index.htm
  1407. ;Coefficients already Normalized to 1.0, multiplied by 16-bits (65535)
  1408.  
  1409.  
  1410. ;--------End of All Code Sections--------------------------------------------
  1411. .end ;End of program code in this file
Advertisement
Add Comment
Please, Sign In to add comment