summaryrefslogtreecommitdiff
path: root/qmap/libqmap/q65b.f90
diff options
context:
space:
mode:
authorDave Hibberd <hibby@debian.org>2024-04-27 12:26:26 +0100
committerDave Hibberd <hibby@debian.org>2024-04-27 12:26:26 +0100
commit93f7198f9c2864ef9630cc0cc9e46d6cc1933aa9 (patch)
tree74e80fba0ae76af8a4f9d5d1b6c8c8de8e383480 /qmap/libqmap/q65b.f90
parentffea9660ba79a513401639a2f5d90e2fdc190fb8 (diff)
New upstream version 2.7.0~rc4+repackupstream/2.7.0_rc4+repack
Diffstat (limited to 'qmap/libqmap/q65b.f90')
-rwxr-xr-xqmap/libqmap/q65b.f90102
1 files changed, 74 insertions, 28 deletions
diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90
index 260aebf9..cd41626b 100755
--- a/qmap/libqmap/q65b.f90
+++ b/qmap/libqmap/q65b.f90
@@ -1,6 +1,7 @@
subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
- mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,nkhz_center, newdat,nagain, &
- max_drift,offset,ndepth,datetime,ndop00,idec)
+ ntrperiod,iseq,mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,nkhz_center, &
+ newdat,nagain,bClickDecode,max_drift,offset,ndepth,datetime,nCFOM, &
+ ndop00,nhsym,idec)
! This routine provides an interface between QMAP and the Q65 decoder
! in WSJT-X. All arguments are input data obtained from the QMAP GUI.
@@ -8,28 +9,34 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
! in common/cacb. Decoded messages are sent back to the GUI.
use q65_decode
+ use wavhdr
use timer_module, only: timer
parameter (MAXFFT1=5376000) !56*96000
parameter (MAXFFT2=336000) !56*6000 (downsampled by 1/16)
parameter (NMAX=60*12000)
parameter (RAD=57.2957795)
+ type(hdr) h
integer*2 iwave(60*12000)
integer offset
complex ca(MAXFFT1) !FFT of raw I/Q data from Linrad
complex cx(0:MAXFFT2-1),cz(0:MAXFFT2)
real*8 fcenter,freq0,freq1
+ logical*1 bClickDecode
character*12 mycall0,hiscall0
character*12 mycall,hiscall
character*6 hisgrid
character*4 grid4
- character*60 result
- character*20 datetime
- common/decodes/ndecodes,ncand,nQDecoderDone,nWDecoderBusy, &
- nWTransmitting,result(50)
+ character*3 csubmode
+ character*17 fname
+ character*64 result,ctmp
+ character*20 datetime,datetime1
+ common/decodes/ndecodes,ncand2,nQDecoderDone,nWDecoderBusy, &
+ nWTransmitting,kHzRequested,result(50)
common/cacb/ca
+ data ifile/0/
save
-
+
if(mycall0(1:1).ne.' ') mycall=mycall0
if(hiscall0(1:1).ne.' ') hiscall=hiscall0
if(hisgrid(1:4).ne.' ') grid4=hisgrid(1:4)
@@ -37,26 +44,18 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
! Find best frequency from sync_dat, the "orange sync curve".
df3=96000.0/32768.0
ipk=(1000.0*f0-1.0)/df3
+ if(nagain.ge.2) ipk = nint(1000.0*(fqso-nkhz_center+48.0)/df3)
nfft1=MAXFFT1
nfft2=MAXFFT2
df=96000.0/NFFT1
- if(nfsample.eq.95238) then
- nfft1=5120000
- nfft2=322560
- df=96000.0/nfft1
- endif
nh=nfft2/2
- f_mouse=1000.0*(fqso+48.0) + mousedf
k0=nint((ipk*df3-1000.0)/df)
- if(nagain.eq.1) k0=nint((f_mouse-1000.0)/df)
-
if(k0.lt.nh .or. k0.gt.MAXFFT1-nfft2+1) go to 900
fac=1.0/nfft2
- cx(0:nfft2-1)=ca(k0:k0+nfft2-1)
- cx=fac*cx
+ cx(0:nfft2-1)=fac*ca(k0:k0+nfft2-1)
! Here cx is frequency-domain data around the selected
-! QSO frequency, taken from the full-length FFT computed in filbig().
+! QSO frequency, taken from the full-length FFT computed in fftbig().
! Values for fsample, nfft1, nfft2, df, and the downsampled data rate
! are as follows:
@@ -89,19 +88,65 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
nsubmode=mode_q65-1
nfa=990 !Tight limits around ipk for the wideband decode
nfb=1010
- if(nagain.eq.1) then !For nagain=1, use limits of +/- ntol
+ if(nagain.ge.1) then !For nagain>=1, use limits of +/- ntol
nfa=max(100,1000-ntol)
nfb=min(2500,1000+ntol)
endif
nsnr0=-99 !Default snr for no decode
+ if(iseq.eq.1) iwave(1:360000)=iwave(360001:720000)
+
+ csubmode(1:2)='60'
+ csubmode(3:3)=char(ichar('A')+nsubmode)
+ nhhmmss=100*nutc
+ nutc1=nutc
+ datetime(12:13)='00'
+ datetime1=datetime
+ if(ntrperiod.eq.30) then
+ csubmode(1:2)='30'
+ nhhmmss=100*nutc + iseq*30
+ nutc1=nhhmmss
+ if(iseq.eq.1) datetime1(12:13)='30'
+ endif
+
+ if(nagain.ge.2) then
+ ifile=ifile+1
+ write(fname,1000) ifile
+1000 format('000000_',i6.6,'.wav')
+ open(27,file=fname,status='unknown',access='stream')
+ if(nagain.eq.2) then
+ h=default_header(12000,60*12000)
+ ia=1
+ ib=60*12000
+ else if(nagain.eq.3) then
+ h=default_header(12000,30*12000)
+ ia=1
+ ib=30*12000
+ else
+ h=default_header(12000,30*12000)
+ ia=30*12000 + 1
+ ib=60*12000
+ endif
+ write(27) h,iwave(ia:ib)
+ close(27)
+ go to 900
+ endif
+
! NB: Frequency of ipk is now shifted to 1000 Hz.
- call map65_mmdec(nutc,iwave,nqd,nsubmode,nfa,nfb,1000,ntol, &
- newdat,nagain,max_drift,ndepth,mycall,hiscall,hisgrid)
- MHz=fcenter
+ nagain2=0
+ call map65_mmdec(nutc1,iwave,nqd,ntrperiod,nsubmode,nfa,nfb,1000,ntol, &
+ newdat,nagain2,max_drift,ndepth,mycall,hiscall,hisgrid)
+ MHz=fcenter
freq0=MHz + 0.001d0*ikhz
if(nsnr0.gt.-99) then
+
+ do i=1,ndecodes !Check for dupes
+ i1=index(result(i)(42:),trim(msg0))
+! If this is a dupe, don't save it again:
+ if(i1.gt.0 .and. (.not.bClickDecode .or. nhsym.eq.390)) go to 800
+ enddo
+
nq65df=nint(1000*(0.001*k0*df+nkhz_center-48.0+1.000-1.27046-ikhz))-nfcal
nq65df=nq65df + nfreq0 - 1000
ikhz1=ikhz
@@ -110,15 +155,16 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
if(ndf.lt.-500) ikhz1=ikhz + (nq65df-500)/1000
ndf=nq65df - 1000*(ikhz1-ikhz)
freq1=freq0 + 0.001d0*(ikhz1-ikhz)
- ndecodes=ndecodes+1
frx=0.001*k0*df+nkhz_center-48.0+1.0 - 0.001*nfcal
fsked=frx - 0.001*ndop00/2.0 - 0.001*offset
- write(result(ndecodes),1120) nutc,frx,fsked,xdt0,nsnr0,trim(msg0)
-1120 format(i4.4,f9.3,f7.1,f7.2,i5,2x,a)
- write(12,1130) datetime,trim(result(ndecodes)(5:))
-1130 format(a11,1x,a)
+ ctmp=csubmode//' '//trim(msg0)
+ ndecodes=min(ndecodes+1,50)
+ write(result(ndecodes),1120) nhhmmss,frx,fsked,xdt0,nsnr0,trim(ctmp)
+1120 format(i6.6,f9.3,f7.1,f7.2,i5,2x,a)
+ write(12,1130) datetime1,trim(result(ndecodes)(7:))
+1130 format(a13,1x,a)
result(ndecodes)=trim(result(ndecodes))//char(0)
- idec=0
+800 idec=0
endif
900 flush(12)