mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-20 16:48:35 -04:00
Code cleanup...
This commit is contained in:
parent
8507f6ff46
commit
388f61b45c
@ -1,6 +1,6 @@
|
|||||||
subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
||||||
mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,newdat,nagain, &
|
mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,newdat,nagain, &
|
||||||
max_drift,ndop00,idec)
|
max_drift,ndop00)
|
||||||
|
|
||||||
! This routine provides an interface between MAP65 and the Q65 decoder
|
! This routine provides an interface between MAP65 and the Q65 decoder
|
||||||
! in WSJT-X. All arguments are input data obtained from the MAP65 GUI.
|
! in WSJT-X. All arguments are input data obtained from the MAP65 GUI.
|
||||||
@ -25,21 +25,16 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
|||||||
character*12 mycall,hiscall
|
character*12 mycall,hiscall
|
||||||
character*6 hisgrid
|
character*6 hisgrid
|
||||||
character*4 grid4
|
character*4 grid4
|
||||||
character*28 msg00
|
|
||||||
character*80 line
|
|
||||||
character*1 cmode*2
|
|
||||||
character*60 result
|
character*60 result
|
||||||
common/decodes/ndecodes,ncand,result(50)
|
common/decodes/ndecodes,ncand,result(50)
|
||||||
common/cacb/ca
|
common/cacb/ca
|
||||||
data nutc00/-1/,msg00/' '/
|
|
||||||
save
|
save
|
||||||
|
|
||||||
if(newdat.eq.1) nutc00=-1
|
|
||||||
if(mycall0(1:1).ne.' ') mycall=mycall0
|
if(mycall0(1:1).ne.' ') mycall=mycall0
|
||||||
if(hiscall0(1:1).ne.' ') hiscall=hiscall0
|
if(hiscall0(1:1).ne.' ') hiscall=hiscall0
|
||||||
if(hisgrid(1:4).ne.' ') grid4=hisgrid(1:4)
|
if(hisgrid(1:4).ne.' ') grid4=hisgrid(1:4)
|
||||||
|
|
||||||
! Find best frequency and ipol from sync_dat, the "orange sync curve".
|
! Find best frequency from sync_dat, the "orange sync curve".
|
||||||
df3=96000.0/32768.0
|
df3=96000.0/32768.0
|
||||||
ifreq=nint((1000.0*f0)/df3)
|
ifreq=nint((1000.0*f0)/df3)
|
||||||
ia=nint(ifreq-ntol/df3)
|
ia=nint(ifreq-ntol/df3)
|
||||||
@ -47,7 +42,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
|||||||
ipk1=maxloc(sync(ia:ib)%ccfmax)
|
ipk1=maxloc(sync(ia:ib)%ccfmax)
|
||||||
ipk=ia+ipk1(1)-1
|
ipk=ia+ipk1(1)-1
|
||||||
snr1=sync(ipk)%ccfmax
|
snr1=sync(ipk)%ccfmax
|
||||||
ipol=1
|
|
||||||
|
|
||||||
nfft1=MAXFFT1
|
nfft1=MAXFFT1
|
||||||
nfft2=MAXFFT2
|
nfft2=MAXFFT2
|
||||||
@ -81,7 +75,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
|||||||
! 96000 5376000 0.017857143 336000 6000.000
|
! 96000 5376000 0.017857143 336000 6000.000
|
||||||
! 95238 5120000 0.018601172 322560 5999.994
|
! 95238 5120000 0.018601172 322560 5999.994
|
||||||
|
|
||||||
poldeg=0.
|
|
||||||
cz(0:MAXFFT2-1)=cx
|
cz(0:MAXFFT2-1)=cx
|
||||||
|
|
||||||
cz(MAXFFT2)=0.
|
cz(MAXFFT2)=0.
|
||||||
@ -123,47 +116,22 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
|||||||
if(nsnr0.gt.-99) then
|
if(nsnr0.gt.-99) then
|
||||||
nq65df=nint(1000*(0.001*k0*df+nkhz_center-48.0+1.000-1.27046-ikhz))-nfcal
|
nq65df=nint(1000*(0.001*k0*df+nkhz_center-48.0+1.000-1.27046-ikhz))-nfcal
|
||||||
nq65df=nq65df + nfreq0 - 1000
|
nq65df=nq65df + nfreq0 - 1000
|
||||||
npol=nint(poldeg)
|
|
||||||
ikhz1=ikhz
|
ikhz1=ikhz
|
||||||
ndf=nq65df
|
ndf=nq65df
|
||||||
if(ndf.gt.500) ikhz1=ikhz + (nq65df+500)/1000
|
if(ndf.gt.500) ikhz1=ikhz + (nq65df+500)/1000
|
||||||
if(ndf.lt.-500) ikhz1=ikhz + (nq65df-500)/1000
|
if(ndf.lt.-500) ikhz1=ikhz + (nq65df-500)/1000
|
||||||
ndf=nq65df - 1000*(ikhz1-ikhz)
|
ndf=nq65df - 1000*(ikhz1-ikhz)
|
||||||
if(nqd.eq.1 .and. abs(nq65df-mousedf).lt.ntol) then
|
|
||||||
write(line,1020) ikhz1,ndf,npol,nutc,xdt0,nsnr0,msg0(1:27),cq0
|
|
||||||
1020 format('!',i3.3,i5,i4,i6.4,f5.1,i5,' : ',a27,a3)
|
|
||||||
write(*,1100) trim(line)
|
|
||||||
1100 format(a)
|
|
||||||
endif
|
|
||||||
|
|
||||||
! Write to lu 26, for Messages and Band Map windows
|
|
||||||
cmode=': '
|
|
||||||
cmode(2:2)=char(ichar('A') + mode_q65-1)
|
|
||||||
freq1=freq0 + 0.001d0*(ikhz1-ikhz)
|
freq1=freq0 + 0.001d0*(ikhz1-ikhz)
|
||||||
|
ndecodes=ndecodes+1
|
||||||
! Suppress writing duplicates (same time, decoded message, and frequency)
|
frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal
|
||||||
! to map65_rx.log
|
fsked=frx - 0.001*ndop00/2.0 - 1.5
|
||||||
if(nutc.ne.nutc00 .or. msg0(1:28).ne.msg00 .or. freq1.ne.freq1_00) then
|
write(result(ndecodes),1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
|
||||||
! Write to file map65_rx.log:
|
write(12,1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
|
||||||
ndecodes=ndecodes+1
|
1120 format(i4.4,f9.3,f7.2,i5,2x,a,i6)
|
||||||
nutc00=nutc
|
result(ndecodes)=trim(result(ndecodes))//char(0)
|
||||||
msg00=msg0(1:28)
|
|
||||||
freq1_00=freq1
|
|
||||||
frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal
|
|
||||||
fsked=frx - 0.001*ndop00/2.0 - 1.5
|
|
||||||
write(result(ndecodes),1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
|
|
||||||
write(12,1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
|
|
||||||
1120 format(i4.4,f9.3,f7.2,i5,2x,a,i6)
|
|
||||||
result(ndecodes)=trim(result(ndecodes))//char(0)
|
|
||||||
endif
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
900 continue
|
900 call flush(6)
|
||||||
! close(13)
|
|
||||||
! close(17)
|
|
||||||
call flush(6)
|
|
||||||
idec=-1
|
|
||||||
read(cq0(2:2),*) idec
|
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine q65b
|
end subroutine q65b
|
||||||
|
@ -64,7 +64,7 @@ subroutine q65wa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
|
|||||||
call timer('q65b ',0)
|
call timer('q65b ',0)
|
||||||
call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
call q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
|
||||||
mycall,hiscall,hisgrid,mode_q65,f0,fqso,newdat, &
|
mycall,hiscall,hisgrid,mode_q65,f0,fqso,newdat, &
|
||||||
nagain,max_drift,ndop00,idec)
|
nagain,max_drift,ndop00)
|
||||||
call timer('q65b ',1)
|
call timer('q65b ',1)
|
||||||
if(idec.ge.0) candec(icand)=.true.
|
if(idec.ge.0) candec(icand)=.true.
|
||||||
enddo ! icand
|
enddo ! icand
|
||||||
|
@ -1,60 +0,0 @@
|
|||||||
subroutine s3avg(nsave,mode65,nutc,nhz,xdt,npol,ntol,s3,nsum,nkv,decoded)
|
|
||||||
|
|
||||||
! Save the current synchronized spectra, s3(64,63), for possible
|
|
||||||
! decoding of average.
|
|
||||||
|
|
||||||
real s3(64,63) !Synchronized spectra for 63 symbols
|
|
||||||
real s3a(64,63,64) !Saved spectra
|
|
||||||
real s3b(64,63) !Average spectra
|
|
||||||
integer iutc(64),ihz(64),ipol(64)
|
|
||||||
real dt(64)
|
|
||||||
character*22 decoded
|
|
||||||
logical ltext,first
|
|
||||||
data first/.true./
|
|
||||||
save
|
|
||||||
|
|
||||||
if(first) then
|
|
||||||
iutc=-1
|
|
||||||
ihz=0
|
|
||||||
ipol=0
|
|
||||||
first=.false.
|
|
||||||
ihzdiff=min(100,ntol)
|
|
||||||
dtdiff=0.2
|
|
||||||
endif
|
|
||||||
|
|
||||||
do i=1,64
|
|
||||||
if(nutc.eq.iutc(i) .and. abs(nhz-ihz(i)).lt.ihzdiff) then
|
|
||||||
nsave=mod(nsave-1+64,64)+1
|
|
||||||
go to 10
|
|
||||||
endif
|
|
||||||
enddo
|
|
||||||
|
|
||||||
iutc(nsave)=nutc !Save UTC
|
|
||||||
ihz(nsave)=nhz !Save freq in Hz
|
|
||||||
ipol(nsave)=npol !Save pol
|
|
||||||
dt(nsave)=xdt !Save DT
|
|
||||||
s3a(1:64,1:63,nsave)=s3 !Save the spectra
|
|
||||||
|
|
||||||
10 s3b=0.
|
|
||||||
do i=1,64 !Accumulate avg spectra
|
|
||||||
if(iutc(i).lt.0) cycle
|
|
||||||
if(mod(iutc(i),2).ne.mod(nutc,2)) cycle !Use only same sequence
|
|
||||||
if(abs(nhz-ihz(i)).gt.ihzdiff) cycle !Freq must match
|
|
||||||
if(abs(xdt-dt(i)).gt.dtdiff) cycle !DT must match
|
|
||||||
s3b=s3b + s3a(1:64,1:63,i)
|
|
||||||
nsum=nsum+1
|
|
||||||
enddo
|
|
||||||
|
|
||||||
decoded=' '
|
|
||||||
if(nsum.ge.2) then !Try decoding the sverage
|
|
||||||
nadd=mode65*nsum
|
|
||||||
call extract(s3b,nadd,ncount,nhist,decoded,ltext) !Extract the message
|
|
||||||
nkv=nsum
|
|
||||||
if(ncount.lt.0) then
|
|
||||||
nkv=0
|
|
||||||
decoded=' '
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
return
|
|
||||||
end subroutine s3avg
|
|
Loading…
Reference in New Issue
Block a user