Waveform filter programs

◆ shifttrace()

subroutine shifttrace ( integer  maxsamp,
integer  nsamp,
double complex, dimension(maxsamp)  spect,
real, dimension(maxsamp)  data,
real  dt,
double precision  timeshift 
)

Definition at line 294 of file suspect.f.

Referenced by suspect().

294 c
295  integer maxsamp, nsamp
296  double complex spect(maxsamp)
297  real data(maxsamp)
298  real dt
299  double precision timeshift
300 c calculation
301  double precision pi
302  parameter(pi=3.14159265358979311599796346854418516d0)
303 c
304  integer npow, powsamp,i
305  complex*16 factor
306  real*8 singback, singto
307  parameter(singback=1.d0, singto=-1.d0)
308 c
309 c transform data
310  npow=0
311  powsamp=2**npow
312  do while (powsamp.lt.nsamp)
313  npow=npow+1
314  powsamp=2**npow
315  enddo
316  powsamp=powsamp*2
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
321  stop
322  endif
323 c
324  do i=1,nsamp
325  spect(i)=dcmplx(data(i))
326  enddo
327  do i=nsamp+1,powsamp
328  spect(i)=(0.d0,0.d0)
329  enddo
330  call tf_dfork(powsamp, spect, singback)
331  factor=(0.d0,1.d0)*(1.d0/(powsamp*dt))*2.d0*pi*timeshift
332  do i=0,powsamp/2-1
333  spect(i+1)=spect(i+1)*exp(i*factor)
334  enddo
335  do i=0,powsamp/2-2
336  spect(powsamp-i)=conjg(spect(i+2))
337  enddo
338  call tf_dfork(powsamp, spect, singto)
339 c
340  do i=1,powsamp
341  data(i)=sngl(real(spect(i)))
342  enddo
343  nsamp=powsamp
344 c
345  return
Here is the caller graph for this function: