diff --git a/lib/superfox/sfox_clo.f90 b/lib/superfox/sfox_clo.f90 index ade15f95b..e40580b58 100644 --- a/lib/superfox/sfox_clo.f90 +++ b/lib/superfox/sfox_clo.f90 @@ -3,24 +3,35 @@ subroutine sfox_clo(fsample,syncwidth,clo) ! Generate complex LO for the SuperFox sync signal use sfox_mod - complex clo(NMAX) !Complex Local Oscillator + complex clo(NSYNC) !Complex Local Oscillator + complex w + + w=1.0 + call sweep(1500.0,syncwidth,fsample,w,clo,nsync) + clo=conjg(clo) + + return +end subroutine sfox_clo + +subroutine sweep(f0,syncwidth,fsample,w,c,iz) + + complex c(iz) complex w,wstep twopi=8.0*atan(1.0) - tsync=NS*NSPS/fsample - w=1.0 - a0=1500.0+ syncwidth/2.0 !Frequency at midpoint of LO waveform - a2=2.0*syncwidth/tsync !Frequency drift rate - x0=0.5*(nsync+1) - s=2.0/nsync - do i=1,nsync - if(i.eq.nsync/2+1) a2=-a2 !Reverse sign of drift at midpoint + ttot=iz/fsample + a0=f0 + syncwidth/2.0 !Frequency at midpoint of LO waveform + a2=2.0*syncwidth/ttot !Frequency drift rate + x0=0.5*(iz+1) + s=2.0/iz + do i=1,iz + if(i.eq.iz/2+1) a2=-a2 !Reverse sign of drift at midpoint x=s*(i-x0) dphi=(a0 + x*a2)*(twopi/fsample) wstep=cmplx(cos(dphi),sin(dphi)) w=w*wstep - clo(i)=conjg(w) + c(i)=w enddo return -end subroutine sfox_clo +end subroutine sweep diff --git a/lib/superfox/sfoxtest.f90 b/lib/superfox/sfoxtest.f90 index 984d12847..9ffe4f660 100644 --- a/lib/superfox/sfoxtest.f90 +++ b/lib/superfox/sfoxtest.f90 @@ -215,7 +215,6 @@ program sfoxtest ntot=ntot+nharderr nworst=max(nworst,nharderr) -! call rs_decode_sf(rxdat,iera,nera,nfixed) !Call the BM decoder ntrials=1000 call timer('ftrsd3 ',0) call ftrsd3(s3,chansym0,rxdat,rxprob,rxdat2,rxprob2,ntrials, &