hoford@grasp.cis.upenn.edu (John D Hoford) (03/23/90)
Heare is a simple but slow
Discrete Fourier Transform (DFT) for the 48sx,
it takes a {N 1} matrix on the stack
and returns a {N 1} matrix.
To write the inverse you would change the
"-i*2*\pi.." to "+i*2*\pi.." and devide the matrix by N.
The VAL function is to get matrix lookup in a expresion.
If someme one has coded a FFT and can compare the times
mail me the result.
Also please send me any improvements
'DFT'
\<< DUP SIZE 1 GET \-> x N
\<< 0 N 1 -
FOR k
'\GS(n=0,N-1,
VAL(x,n+1)*EXP(-i*2*\pi*n*k/N)
)'
\->NUM NEXT N 1 2 \->LIST
\->ARRY 9 RND
\>>
\>>
'VAL'
\<< -> a b \<< a b GET \>> \>>
John D. Hoford
jh@gynko.circ.upenn.edu