summaryrefslogtreecommitdiff
path: root/lib/fchisq65.f90
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2018-02-16 15:17:14 +0000
committerhibby <d@vehibberd.com>2018-02-16 15:17:14 +0000
commit37f727ac0746fd85504aa46c1f023c09b3eff33a (patch)
treec8a7ce04545040a8f161ba279528730bd9a3e6ab /lib/fchisq65.f90
parentd63dd8d081a6fcd0715cd13f26df59fb831769d2 (diff)
New upstream version 1.8.0+repackupstream/1.8.0+repack
Diffstat (limited to 'lib/fchisq65.f90')
-rw-r--r--lib/fchisq65.f9022
1 files changed, 11 insertions, 11 deletions
diff --git a/lib/fchisq65.f90 b/lib/fchisq65.f90
index b91444e5..3c624143 100644
--- a/lib/fchisq65.f90
+++ b/lib/fchisq65.f90
@@ -1,5 +1,7 @@
real function fchisq65(cx,npts,fsample,nflip,a,ccfmax,dtmax)
+ use timer_module, only: timer
+
parameter (NMAX=60*12000) !Samples per 60 s
complex cx(npts)
real a(5)
@@ -17,7 +19,7 @@ real function fchisq65(cx,npts,fsample,nflip,a,ccfmax,dtmax)
nout=ndiv*npts/nsps
dtstep=1.0/(ndiv*baud) !Time per output step
- if(a(1).ne.a1 .or. a(2).ne.a2 .or. a(3).ne.a3) then
+ if(a(1).ne.a1 .or. a(2).ne.a2 .or. a(3).ne.a3) then
a1=a(1)
a2=a(2)
a3=a(3)
@@ -32,36 +34,34 @@ real function fchisq65(cx,npts,fsample,nflip,a,ccfmax,dtmax)
if(mod(i,100).eq.1) then
p2=1.5*x*x - 0.5
dphi=(a(1) + x*a(2) + p2*a(3)) * (twopi/fsample)
- wstep=cmplx(cos(dphi),sin(dphi))
+ wstep=cmplx(cos(dphi),sin(dphi))
endif
w=w*wstep
csx(i)=csx(i-1) + w*cx(i)
enddo
endif
-! Compute 1/2-symbol powers at 1/16-symbol steps.
+! Compute whole-symbol powers at 1/16-symbol steps.
fac=1.e-4
-
do i=1,nout
- j=i*nsps/ndiv
- k=j-nsph
+ j=nsps+(i-1)*nsps/16 !steps by 8 samples (1/16 of a symbol)
+ k=j-nsps
ss(i)=0.
- if(k.ge.1) then
- z=csx(j)-csx(k)
+ if(k.ge.0 .and. j.le.npts) then
+ z=csx(j)-csx(k) ! difference over span of 128 pts
ss(i)=fac*(real(z)**2 + aimag(z)**2)
endif
enddo
ccfmax=0.
call timer('ccf2 ',0)
- call ccf2(ss,nout,nflip,ccf,lagpk)
+ call ccf2(ss,nout,nflip,ccf,xlagpk)
call timer('ccf2 ',1)
if(ccf.gt.ccfmax) then
ccfmax=ccf
- dtmax=lagpk*dtstep
+ dtmax=xlagpk*dtstep
endif
fchisq65=-ccfmax
-
call timer('fchisq65',1)
return