beautypg.com

Motorola DSP96002 User Manual

Page 631

background image

B-112

DSP96002 USER’S MANUAL

MOTOROLA

page 132,60,1,1

;

; Implements the Walsh-Hadamard Transform

;

iord equ 4 ;order of transform=log2(npoints)

n equ 1<

org x:$1000

data

dc 0.0000000E+00

dc 2.000000

dc 3.000000

dc 8.000000

dc 9.000000

dc 12.00000

dc 15.00000

dc 19.00000

dc 20.00000

dc 22.00000

dc 23.00000

dc 24.00000

dc 25.00000

dc 26.00000

dc 27.00000

dc 28.00000

org p:$100

start

move #data,r0 ;point to upper leg

move #data+n/2,r4 ;point to lower leg

do #n/4,_firststage ;do first stage. split into X and Y

move x:(r0)+,d0.s ;get upper leg of bfly 1

move x:(r4)+,d1.s ;get lower leg of bfly 1

faddsub.s d0,d1 x:(r0)-,d2.s ;get upper leg of bfly 2

move x:(r4)+,d3.s ;get lower leg of bfly 2

faddsub.s d2,d3 d1.s,x:(r0) ;save sum 1

move d0.s,y:(r0)+ ;save dif 1

move d3.s,x:(r0) ;save sum 2