Compute ccfred, the "red curve".

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2655 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2012-10-10 20:40:46 +00:00
parent d397ed7bdf
commit a0759bf0ff
4 changed files with 59 additions and 36 deletions

View File

@ -11,6 +11,7 @@ program jt9
parameter (NSMAX=22000) !Max length of saved spectra parameter (NSMAX=22000) !Max length of saved spectra
integer*4 ihdr(11) integer*4 ihdr(11)
real*4 s(NSMAX) real*4 s(NSMAX)
real*4 ccfred(NSMAX)
logical*1 lstrong(0:1023) logical*1 lstrong(0:1023)
integer*1 i1SoftSymbols(207) integer*1 i1SoftSymbols(207)
character*22 msg character*22 msg
@ -90,25 +91,28 @@ program jt9
10 continue 10 continue
! Fix up the data in c0()
twopi=8.0*atan(1.0)
phi=0.
dphi=twopi*500.0/1500.0
do i=1,npts8
phi=phi+dphi
if(phi.gt.twopi) phi=phi-twopi
if(phi.lt.-twopi) phi=phi+twopi
c0(i)=cmplx(aimag(c0(i)),real(c0(i)))*cmplx(cos(phi),sin(phi))
enddo
! Now do the decoding ! Now do the decoding
nutc=nutc0 nutc=nutc0
nstandalone=1 nstandalone=1
call sync9(ss,tstep,f0a,df3,fpk) !Find sig, get rough freq
ntol=500
nfqso=1500
! Get sync, approx freq
call sync9(ss,tstep,f0a,df3,ntol,nfqso,sync,fpk,ccfred)
fpk0=fpk
iz=1000.0/df3
do i=1,iz
freq=1000.0 + (i-1)*df3
write(72,3001) freq,ccfred(i)
3001 format(2f10.3)
enddo
flush(72)
call spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols) call spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols)
call decode9(i1SoftSymbols,msg) call decode9(i1SoftSymbols,msg)
write(*,1010) nutc,xdt,1000.0+fpk,msg write(*,1010) nutc,xdt,1000.0+fpk,msg,sync,fpk0
1010 format(i4.4,f6.1,f7.1,2x,a22) 1010 format(i4.4,f6.1,f7.1,2x,a22,2f9.1)
enddo enddo
go to 999 go to 999

View File

@ -19,6 +19,17 @@ subroutine spec9(c0,npts8,nsps,f0a,fpk,xdt,i1SoftSymbols)
data ig/0,1,3,2,7,6,4,5/ !Gray code removal data ig/0,1,3,2,7,6,4,5/ !Gray code removal
save save
! Fix up the data in c0()
twopi=8.0*atan(1.0)
phi=0.
dphi=twopi*500.0/1500.0
do i=0,npts8-1
phi=phi+dphi
if(phi.gt.twopi) phi=phi-twopi
if(phi.lt.-twopi) phi=phi+twopi
c0(i)=cmplx(aimag(c0(i)),real(c0(i)))*cmplx(cos(phi),sin(phi))
enddo
nsps8=nsps/8 nsps8=nsps/8
foffset=fpk-f0a foffset=fpk-f0a
istart=1520 istart=1520

View File

@ -1,7 +1,8 @@
subroutine sync9(ss,tstep,f0a,df3,fpk) subroutine sync9(ss,tstep,f0a,df3,ntol,nfqso,sync,fpk,ccfred)
parameter (NSMAX=22000) !Max length of saved spectra parameter (NSMAX=22000) !Max length of saved spectra
real ss(184,NSMAX) real ss(184,NSMAX)
real ccfred(NSMAX)
integer ii0(16) integer ii0(16)
integer ii(16) !Locations of sync half-symbols integer ii(16) !Locations of sync half-symbols
@ -14,38 +15,45 @@ subroutine sync9(ss,tstep,f0a,df3,fpk)
0,0,1,0,0,0,0,0,1,0,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,1/ 1,0,0,0,1/
nz=1000.0/df3 ia=1
ib=min(1000,nint(1000.0/df3))
smax=0. if(ntol.lt.1000) then
ia=nint((nfqso-1000-ntol)/df3)
ib=nint((nfqso-1000+ntol)/df3)
if(ia.lt.1) ia=1
if(ib.gt.NSMAX) ib=NSMAX
endif
print*,ia,ib,df3*ia+1000,df3*ib+1000
sbest=0.
lagmax=2.5/tstep + 0.9999 lagmax=2.5/tstep + 0.9999
do n=1,nz ccfred=0.
do i=ia,ib
smax=0.
do lag=-lagmax,lagmax do lag=-lagmax,lagmax
sum=0. sum=0.
do i=1,16 do j=1,16
k=ii(i) + lag k=ii(j) + lag
if(k.ge.1) sum=sum + ss(k,n) if(k.ge.1) sum=sum + ss(k,i)
enddo enddo
if(sum.gt.smax) then if(sum.gt.smax) then
smax=sum smax=sum
npk=n ipk=i
lagpk=lag lagpk=lag
endif endif
enddo enddo
if(smax.gt.sbest) then
sbest=smax
ipkbest=ipk
lagpkbest=lagpk
endif
ccfred(i)=smax
enddo enddo
fpk=f0a + (npk-1)*df3 fpk=f0a + (ipkbest-1)*df3
sync=sbest
! This loop for tests only:
! do lag=-lagmax,lagmax
! sum=0.
! do i=1,16
! k=ii(i) + lag
! if(k.ge.1) sum=sum + ss(k,npk)
! enddo
! write(71,3001) lag,sum
!3001 format(i8,f12.3)
! enddo
! flush(71)
return return
end subroutine sync9 end subroutine sync9

View File

@ -1,4 +1,4 @@
//----------------------------------------------------------------- MainWindow //---------------------------------------------------------------- MainWindow
#include "mainwindow.h" #include "mainwindow.h"
#include "ui_mainwindow.h" #include "ui_mainwindow.h"
#include "devsetup.h" #include "devsetup.h"