Sync9 function works.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2625 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-01 20:37:05 +00:00
parent 2f43bd3eb4
commit 0d149f83b6
5 changed files with 70 additions and 7 deletions

View File

@ -44,7 +44,7 @@ Receiving
--------- ---------
1. Apply noise blanking with the timf2 method 1. Apply noise blanking with the timf2 method
2. Filter to 1000 Hz bandwidth and downsample (1/8) to 1500 Hz, saving 2. Filter to 1000 Hz bandwidth and downsample (1/8) to 1500 Hz, saving
complex data to array c0(1350000). (FIR? FFT2?) complex data to array c0(1350000). (use FIR? NFFT2/NFFT2A?)
3. Compute symbol-length spectra at half-symbol steps. Use for 3. Compute symbol-length spectra at half-symbol steps. Use for
waterfall display s(22000) and save in ss(184,22000) and waterfall display s(22000) and save in ss(184,22000) and
savg(22000), for detecting sync vectors. savg(22000), for detecting sync vectors.

View File

@ -47,7 +47,7 @@ OBJS3 = jt9sim.o gran.o
jt9sim.exe: $(OBJS3) libm65.a jt9sim.exe: $(OBJS3) libm65.a
$(FC) -o jt9sim.exe $(OBJS3) libm65.a $(FC) -o jt9sim.exe $(OBJS3) libm65.a
OBJS2 = jt9.o symspec.o timf2x.o timer.o OBJS2 = jt9.o symspec.o timf2x.o timer.o sync9.o
jt9.exe: $(OBJS2) libm65.a jt9.exe: $(OBJS2) libm65.a
$(FC) -o jt9.exe $(OBJS2) libm65.a ../libfftw3f_win.a $(FC) -o jt9.exe $(OBJS2) libm65.a ../libfftw3f_win.a

View File

@ -82,7 +82,7 @@ program jt9
if(nhsym.ge.1 .and. nhsym.ne.nhsym0) then if(nhsym.ge.1 .and. nhsym.ne.nhsym0) then
! Emit signal readyForFFT ! Emit signal readyForFFT
call timer('symspec ',0) call timer('symspec ',0)
call symspecx(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s, & call symspecx(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,df3, &
ihsym,nzap,slimit,lstrong) ihsym,nzap,slimit,lstrong)
call timer('symspec ',1) call timer('symspec ',1)
nhsym0=nhsym nhsym0=nhsym
@ -94,6 +94,7 @@ program jt9
nutc=nutc0 nutc=nutc0
nstandalone=1 nstandalone=1
call sync9(ss,df3)
! call decode0(dd,ss,savg,nstandalone,nfsample) ! call decode0(dd,ss,savg,nstandalone,nfsample)
enddo enddo

View File

@ -1,5 +1,5 @@
subroutine symspecx(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,ihsym, & subroutine symspecx(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,df3, &
nzap,slimit,lstrong) ihsym,nzap,slimit,lstrong)
! Input: ! Input:
! k pointer to the most recent new data ! k pointer to the most recent new data
@ -141,9 +141,16 @@ subroutine symspecx(k,ntrperiod,nsps,ndiskdat,nb,nbslider,pxdb,s,ihsym, &
if(ihsym.eq.168) then if(ihsym.eq.168) then
do i=1,iz do i=1,iz
write(71,3001) i*df3,savg(i),10.0*log10(savg(i)) write(71,3001) i,i*df3,savg(i),10.0*log10(savg(i))
3001 format(f12.6,e12.3,f12.3) 3001 format(i8,3f12.3)
enddo enddo
i0=673
do j=1,ihsym
write(72,3002) j,(ss(j,i),i=i0,i0+8)
3002 format(i3,9f8.3)
enddo
endif endif
999 return 999 return

55
libm65/sync9.f90 Normal file
View File

@ -0,0 +1,55 @@
subroutine sync9(ss,df3)
parameter (NSMAX=22000) !Max length of saved spectra
real ss(184,NSMAX)
integer ii(16)
integer isync(85) !Sync vector
data isync/ &
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1,0,0,0,0, &
1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0, &
0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0, &
0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0, &
1,0,0,0,1/
ii=0
k=0
do i=1,85
if(isync(i).eq.1) then
k=k+1
ii(k)=2*i-1
endif
enddo
nz=1000.0/df3
smax=0.
lagmax=10
do n=1,nz
do lag=-lagmax,lagmax
sum=0.
do i=1,16
k=ii(i) + lag
if(k.ge.1) sum=sum + ss(k,n)
enddo
if(sum.gt.smax) then
smax=sum
npk=n
endif
enddo
enddo
print*,'npk:',npk
n=npk
do lag=-lagmax,lagmax
sum=0.
do i=1,16
k=ii(i) + lag
if(k.ge.1) sum=sum + ss(k,n)
enddo
write(*,3000) lag,sum
3000 format(i3,f12.3)
enddo
return
end subroutine sync9