2012-10-03 14:39:37 -04:00
|
|
|
subroutine peakdf9(c0,npts8,nsps8,istart,foffset,idfpk)
|
2012-10-03 13:47:55 -04:00
|
|
|
|
|
|
|
complex c0(0:npts8-1)
|
|
|
|
complex zsum
|
2012-10-22 15:18:24 -04:00
|
|
|
include 'jt9sync.f90'
|
2012-10-03 13:47:55 -04:00
|
|
|
|
|
|
|
twopi=8.0*atan(1.0)
|
|
|
|
df=1500.0/nsps8
|
|
|
|
smax=0.
|
2012-10-03 14:39:37 -04:00
|
|
|
do idf=-5,5
|
2012-10-03 13:47:55 -04:00
|
|
|
f0=foffset + 0.1*df*idf
|
|
|
|
dphi=twopi*f0/1500.0
|
|
|
|
sum=0.
|
|
|
|
do j=1,16
|
|
|
|
i1=(ii(j)-1)*nsps8 + istart
|
|
|
|
phi=0.
|
|
|
|
zsum=0.
|
|
|
|
do i=i1,i1+nsps8-1
|
2012-10-03 14:39:37 -04:00
|
|
|
if(i.lt.0 .or. i.gt.npts8-1) cycle
|
2012-10-03 13:47:55 -04:00
|
|
|
phi=phi + dphi
|
|
|
|
zsum=zsum + c0(i) * cmplx(cos(phi),-sin(phi))
|
|
|
|
enddo
|
|
|
|
sum=sum + real(zsum)**2 + aimag(zsum)**2
|
|
|
|
enddo
|
|
|
|
if(sum.gt.smax) then
|
|
|
|
idfpk=idf
|
|
|
|
smax=sum
|
|
|
|
endif
|
|
|
|
enddo
|
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine peakdf9
|