From dda9f24b9dbd9460c63b85fc9970490639c7408d Mon Sep 17 00:00:00 2001 From: Steven Franke Date: Sat, 17 Sep 2016 22:59:21 +0000 Subject: [PATCH] Decrease execution time of the most time-consuming loop in opdetmsk144.f90. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7095 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/opdetmsk144.f90 | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/lib/opdetmsk144.f90 b/lib/opdetmsk144.f90 index 4cf291ac1..d6e6e567c 100644 --- a/lib/opdetmsk144.f90 +++ b/lib/opdetmsk144.f90 @@ -15,6 +15,7 @@ subroutine opdetmsk144(cbig,n,lines,nmessages,nutc,ntol,t00) complex cb(42) !Complex waveform for sync word complex cfac,cca,ccb complex cc(0:NSPM-1) + complex csum integer s8(8),hardbits(144) integer, dimension(1) :: iloc integer*1 decoded(80) @@ -87,17 +88,27 @@ subroutine opdetmsk144(cbig,n,lines,nmessages,nutc,ntol,t00) bestf=0.0 do ifr=-ntol,ntol ! search for frequency that maximizes sync correlation ferr=ifr +! call timer('opdetavg ',0) call tweak1(cdat,NPTS,-(1500+ferr),cdat2) cr=reshape(cdat2,(/NSPM,NAVG/)) c=sum(cr,2) +! call timer('opdetavg ',1) +! call timer('opdetsync',0) cc=0 do ish=0,NSPM-1 ct=cshift(c,ish) - cc(ish)=sum(ct(1:42)*conjg(cb))+sum(ct(56*6:56*6+41)*conjg(cb)) +! cc(ish)=sum(ct(1:42)*conjg(cb))+sum(ct(56*6:56*6+41)*conjg(cb)) +! cc(ish)=sum(ct(1:42)*conjg(cb)+ ct(56*6:56*6+41)*conjg(cb)) + csum=0 + do j=1,42 + csum=csum+(ct(j)+ct(56*6+j-1))*conjg(cb(j)) + enddo + cc(ish)=csum enddo ccm=abs(cc) xb=maxval(ccm) +! call timer('opdetsync',1) if( xb .gt. xmax ) then xmax=xb bestf=ferr