295 integer maxsamp, nsamp
296 double complex spect(maxsamp)
299 double precision timeshift
302 parameter(pi=3.14159265358979311599796346854418516d0)
304 integer npow, powsamp,i
306 real*8 singback, singto
307 parameter(singback=1.d0, singto=-1.d0)
312 do while (powsamp.lt.nsamp)
317 if (powsamp.gt.maxsamp)
then 318 print *,
'ERROR: dataset has ',nsamp,
' samples' 319 print *,
'ERROR: fourier number of samples should be ',powsamp
320 print *,
'ERROR: array size is ',maxsamp
325 spect(i)=dcmplx(
data(i))
330 call tf_dfork(powsamp, spect, singback)
331 factor=(0.d0,1.d0)*(1.d0/(powsamp*dt))*2.d0*pi*timeshift
333 spect(i+1)=spect(i+1)*exp(i*factor)
336 spect(powsamp-i)=conjg(spect(i+2))
338 call tf_dfork(powsamp, spect, singto)
341 data(i)=sngl(
real(spect(i)))