www.pudn.com > 医学算法.rar > fft.c


#include	

/*
	fft - calculate FFT

	Carl Crawford
	Purdue University
	W. Lafayette, IN. 47907
*/

fft(a,b,m,iopt)
	float	*a;	/* real part of data */
	float	*b;	/* imaginary part of data */
	int	m;	/* size of data = 2**m */
	int	iopt;	/* 0=dft, 1=idft */
{
	int	nv2,nm1,n,le,le1,ip;
	float	ua,ub,wa,wb,ta,tb,*ap,*bp;
	float   pi,pile1,tmp;
	register	i,j,l;

	n = 1<>1;
	nm1 = n - 1;
	j = 0;
	for(i=0;i> 1;
		}
		j += l;
	}
	pi = 3.1415926535;
	for(l=1;l<=m;l++){
		le = 1<>1;
		ua = 1.0;	ub = 0.0;
		pile1 = pi / le1;
		wa = cos(pile1);	wb = -sin(pile1);
		for(j=0;j