[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

760.0. "Fourier Transform Software" by BARNUM::JORGENSEN () Thu Sep 17 1987 14:14

    
    	Has anyone developed a piece of software that will perform
    	a forier transform on data which can be read from an ascii
    	type input file? Points per period, number of periods is not
    	really that critical. Any info appreciated.
    
    /Kevin
T.RTitleUserPersonal
Name
DateLines
760.1AKQJ10::YARBROUGHWhy is computing so labor intensive?Fri Sep 18 1987 13:501
See also note 144.
760.2FFT routineSDOGUS::DRAKEDave (Diskcrash) Drake 619-292-1818Sat Sep 19 1987 21:2673
    
    
    
    
C	Here is an FFT routine I have used for some time
    
    
c***************************************************
C	Fast Fourier Transform routine from Stearns p266
c	"Digital Signal Analysis" Hayden Books - Samuel D. Stearns
c	ISBN 0-8104-5828-4   1975
    
C	Typed in by D. Drake Dec 26, 1986
c****************************************************
c	fr and fi are the real and imaginary input arrays. N is the
c	length of each array, ex: 1024. K is the log base 2 of N,
c	ex: 10. fr and fi have the FFT on return, again in real and
c	imaginary format. 
c****************************************************
	Subroutine FFT(fr,fi,k)

	real fr(1),fi(1)
	n=2**k
	mr=0
	nn=n-1
	pi=3.1415926535

	DO m=1,nn		!bit reversal
		l=n
1		l=l/2
		if (mr+l.gt.nn) goto  1
		mr=mod(mr,l) + l
		if (mr.le.m) goto 2
		tr=fr(m+1)
		fr(m+1)=fr(mr+1)
		fr(mr+1)=tr
		ti=fi(m+1)
		fi(m+1)=fi(mr+1)
		fi(mr+1)=ti
2	END DO

	l=1

3	if(l.ge.n) return		!return to main routine
	istep=2*l
	el=float(l)

	DO m=1,l

		a=pi*float(1-m)/el
		wr=cos(a)
		wi=sin(a)
	
		DO i=m,n,istep

			j=i+l
			tr=wr*fr(j)-wi*fi(j)
			ti=wr*fi(j)+wi*fr(j)
			fr(j)=fr(i)-tr
			fi(j)=fi(i)-ti
			fr(i)=fr(i)+tr
			fi(i)=fi(i)+ti
		END DO

	END DO

	l=istep

	goto 3
	
	END

    
760.3Off the WebEVMS::HALLYBFish have no concept of fireWed Sep 11 1996 16:133
    A good writeup and pointer to C software can be found at:
    
    http://www.intersrv.com/~dcross/fft.html