Path: utzoo!attcan!uunet!jarthur!brutus.cs.uiuc.edu!dali!samsung!sol.ctr.columbia.edu!cica!iuvax!rutgers!netnews.upenn.edu!grasp.cis.upenn.edu!hoford From: hoford@grasp.cis.upenn.edu (John D Hoford) Newsgroups: comp.sys.handhelds Subject: DFT for hp48sx Message-ID: <22042@netnews.upenn.edu> Date: 22 Mar 90 17:50:22 GMT Sender: news@netnews.upenn.edu Reply-To: hoford@grasp.cis.upenn.edu.UUCP (John D Hoford) Distribution: all Organization: University of Pennsylvania Lines: 35 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