diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:33 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:33 +0200 |
| commit | e1c678ef00f0159bbeb5571e5ebb0d4697121334 (patch) | |
| tree | 6547edef81a62a812a4d0f64e03fda226b5f0a7e /map65/libm65 | |
| parent | b9daa22c4c3ad51cd4bc0ef624a19f21d01c9305 (diff) | |
| parent | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (diff) | |
Update upstream source from tag 'upstream/3.0.0_rc1+repack'
Update to upstream version '3.0.0~rc1+repack'
with Debian dir 68c212e23136fecf9ebc6f12ff355579224d27ee
Diffstat (limited to 'map65/libm65')
| -rwxr-xr-x | map65/libm65/astrosub.f90 | 12 | ||||
| -rwxr-xr-x | map65/libm65/decode0.f90 | 4 | ||||
| -rwxr-xr-x | map65/libm65/display.f90 | 49 | ||||
| -rwxr-xr-x | map65/libm65/ftninit.f90 | 3 | ||||
| -rwxr-xr-x | map65/libm65/gen_q65_cwave.f90 | 6 | ||||
| -rwxr-xr-x | map65/libm65/m65.f90 | 6 | ||||
| -rwxr-xr-x | map65/libm65/m65a.f90 | 2 | ||||
| -rwxr-xr-x | map65/libm65/map65a.f90 | 26 | ||||
| -rwxr-xr-x | map65/libm65/mapsim.f90 | 37 | ||||
| -rwxr-xr-x | map65/libm65/q65b.f90 | 28 | ||||
| -rwxr-xr-x | map65/libm65/q65b_for_Linux.f90 | 205 | ||||
| -rwxr-xr-x | map65/libm65/wideband_sync.f90 | 31 |
12 files changed, 329 insertions, 80 deletions
diff --git a/map65/libm65/astrosub.f90 b/map65/libm65/astrosub.f90 index c1f8b328..5704df57 100755 --- a/map65/libm65/astrosub.f90 +++ b/map65/libm65/astrosub.f90 @@ -12,3 +12,15 @@ subroutine astrosub(nyear,month,nday,uth8,nfreq,mygrid,hisgrid, & return
end subroutine astrosub
+
+subroutine astrosub00(nyear,month,nday,uth8,nfreq,mygrid,ndop00)
+
+ implicit real*8 (a-h,o-z)
+ character*6 mygrid
+
+ call astrosub(nyear,month,nday,uth8,nfreq,mygrid,mygrid, &
+ AzSun8,ElSun8,AzMoon8,ElMoon8,AzMoonB8,ElMoonB8,ntsky,ndop,ndop00, &
+ RAMoon8,DecMoon8,Dgrd8,poloffset8,xnr8)
+
+ return
+end subroutine astrosub00
diff --git a/map65/libm65/decode0.f90 b/map65/libm65/decode0.f90 index 411e38ed..aa4c83c5 100755 --- a/map65/libm65/decode0.f90 +++ b/map65/libm65/decode0.f90 @@ -12,7 +12,7 @@ subroutine decode0(dd,ss,savg,nstandalone) common/npar/fcenter,nutc,idphi,mousedf,mousefqso,nagain, &
ndepth,ndiskdat,neme,newdat,nfa,nfb,nfcal,nfshift, &
mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, &
- nfast,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid,datetime
+ ndop00,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid,datetime
common/early/nhsym1,nhsym2,ldecoded(32768)
common/decodes/ndecodes
data neme0/-99/,mcall3b/1/
@@ -56,7 +56,7 @@ subroutine decode0(dd,ss,savg,nstandalone) mousedf,mousefqso,nagain,ndecdone,nfshift,ndphi,max_drift, &
nfcal,nkeep,mcall3b,nsum,nsave,nxant,mycall,mygrid, &
neme,ndepth,nstandalone,hiscall,hisgrid,nhsym,nfsample, &
- ndiskdat,nxpol,nmode)
+ ndiskdat,nxpol,nmode,ndop00)
call timer('map65a ',1)
call timer('decode0 ',1)
diff --git a/map65/libm65/display.f90 b/map65/libm65/display.f90 index 811cea50..cd193506 100755 --- a/map65/libm65/display.f90 +++ b/map65/libm65/display.f90 @@ -3,7 +3,7 @@ subroutine display(nkeep,ftol) parameter (MAXLINES=400,MX=400,MAXCALLS=500)
integer indx(MAXLINES),indx2(MX)
character*83 line(MAXLINES),line2(MX),line3(MAXLINES)
- character out*52,out0*52,cfreq0*3,livecq*58
+ character out*63,out0*63,cfreq0*3 ! was 57,57,3
character*6 callsign,callsign0
character*12 freqcall(MAXCALLS)
real freqkHz(MAXLINES)
@@ -11,12 +11,15 @@ subroutine display(nkeep,ftol) real*8 f0
save
+ character(len=83) :: livecq2
+ character(len=83) :: livecq3
+
out0=' '
rewind(26)
do i=1,MAXLINES
read(26,1010,end=10) line(i)
-1010 format(a77)
+1010 format(a83) ! was a77
read(line(i),1020) f0,ndf,nh,nm
1020 format(f8.3,i5,25x,i3,i2)
utc(i)=60*nh + nm
@@ -33,7 +36,7 @@ subroutine display(nkeep,ftol) nage=utcz-utc(i)
if(nage.lt.0) nage=nage+1440
iage=nage/nquad
- write(line(i)(73:74),1021) iage
+ write(line(i)(79:80),1021) iage ! was 73:74
1021 format(i2)
enddo
@@ -55,7 +58,7 @@ subroutine display(nkeep,ftol) utc(i)=utc(j)
freqkHz(i)=freqkHz(j)
write(26,1022) line(i)
-1022 format(a77)
+1022 format(a83) ! was a77
enddo
endif
@@ -122,29 +125,23 @@ subroutine display(nkeep,ftol) nc=0
callsign0=' '
do k=1,k3
- out=line3(k)(6:13)//line3(k)(28:31)//line3(k)(39:45)// &
- line3(k)(35:38)//line3(k)(46:74)
- if(out(1:3).ne.' ') then
- cfreq0=out(1:3)
- livecq=line3(k)(6:13)//line3(k)(28:31)//line3(k)(39:45)// &
- line3(k)(23:27)//line3(k)(35:38)//line3(k)(46:70)// &
- line3(k)(73:77)
- if(livecq(56:56).eq.':') livecq(56:58)=' '//livecq(56:57)
- if(index(livecq,' CQ ').gt.0 .or. index(livecq,' QRZ ').gt.0 .or. &
- index(livecq,' QRT ').gt.0 .or. index(livecq,' CQV ').gt.0 .or. &
- index(livecq,' CQH ').gt.0) write(19,1029) livecq
-1029 format(a58)
+ out=line3(k)(1:13)//line3(k)(28:31)//line3(k)(39:45)// &
+ line3(k)(35:38)//line3(k)(46:80) ! was 46:74
+ livecq2=line3(k)
+ if(out(6:8).ne.' ') then
+ cfreq0=out(6:8)
! Suppress listing duplicate (same time, decoded message, and frequency)
- if(out(14:17).ne.out0(14:17) .or. out(26:50).ne.out0(26:50) .or. &
- out(1:3).ne.out0(1:3)) then
- write(*,1030) out !Messages
-1030 format('@',a52)
- out0=out
+ if(out(19:22).ne.out0(19:22) .or. out(31:55).ne.out0(31:55) .or. &
+ out(6:8).ne.out0(6:8)) then
+ livecq3 = out(1:61) // ' ' // livecq2(23:27) // ' ' // livecq2(79:83) ! was 1:55 and 73:77
+ write(*,1030) livecq3
+1030 format('@',a83) ! was a77
+ out0=out
endif
- i1=index(out(26:),' ')
- callsign=out(i1+26:)
+ i1=index(out(31:),' ')
+ callsign=out(i1+31:)
i2=index(callsign,' ')
if(i2.gt.1) callsign(i2:)=' '
if(callsign.ne.' ' .and. callsign.ne.callsign0) then
@@ -152,16 +149,16 @@ subroutine display(nkeep,ftol) if(len.lt.0) len=6
if(len.ge.4) then !Omit short "callsigns"
if(nc.lt.MAXCALLS) nc=nc+1
- freqcall(nc)=cfreq0//' '//callsign//line3(k)(73:74)
+ freqcall(nc)=cfreq0//' '//callsign//line3(k)(79:80) ! was 73:74
callsign0=callsign
endif
endif
if(callsign.ne.' ' .and. callsign.eq.callsign0) then
- freqcall(nc)=cfreq0//' '//callsign//line3(k)(73:74)
+ freqcall(nc)=cfreq0//' '//callsign//line3(k)(79:80) ! was 73:74
endif
endif
enddo
- flush(19)
+
if(nc.lt.MAXCALLS) nc=nc+1
freqcall(nc)=' '
if(nc.lt.MAXCALLS) nc=nc+1
diff --git a/map65/libm65/ftninit.f90 b/map65/libm65/ftninit.f90 index ffe35bca..c6c90716 100755 --- a/map65/libm65/ftninit.f90 +++ b/map65/libm65/ftninit.f90 @@ -10,8 +10,9 @@ subroutine ftninit(appd) addpfx=' '
call pfxdump(appd//'/prefixes.txt')
+ open(12,file=appd//'/wb_q65.txt',status='unknown')
open(13,file=appd//'/map65.log',status='unknown')
- open(19,file=appd//'/livecq.txt',status='unknown')
+! open(19,file=appd//'/livecq.txt',status='unknown') ! not written with new livecq code
open(21,file=appd//'/map65_rx.log',status='unknown',access='append',err=950)
open(26,file=appd//'/tmp26.txt',status='unknown')
diff --git a/map65/libm65/gen_q65_cwave.f90 b/map65/libm65/gen_q65_cwave.f90 index c9d30960..305d2e5c 100755 --- a/map65/libm65/gen_q65_cwave.f90 +++ b/map65/libm65/gen_q65_cwave.f90 @@ -5,8 +5,8 @@ subroutine gen_q65_cwave(msg,ntxfreq,ntone_spacing,msgsent,cwave,nwave) use packjt
use q65_encoding
parameter (NMAX=60*96000)
- character*22 msg
- character*22 msgsent !Message as it will be received
+ character*24 msg !w3sz was *22
+ character*24 msgsent !w3sz was *22 !Message as it will be received
character*37 msg37
real*8 t,dt,phi,f,f0,dfgen,dphi,twopi,tsym
complex cwave(NMAX)
@@ -18,7 +18,7 @@ subroutine gen_q65_cwave(msg,ntxfreq,ntone_spacing,msgsent,cwave,nwave) msgsent=msg
msg37=''
- msg37(1:22)=msg
+ msg37(1:24)=msg !w3sz was 1:22
call get_q65_tones(msg37,codeword,itone)
! Set up necessary constants
diff --git a/map65/libm65/m65.f90 b/map65/libm65/m65.f90 index 2de5bcb3..72768826 100755 --- a/map65/libm65/m65.f90 +++ b/map65/libm65/m65.f90 @@ -7,9 +7,9 @@ program m65 !
! 10 binary input data, *.tf2 files
! 11 prefixes.txt
-! 12
+! 12 wb_w65.txt
! 13 map65.log
-! 14
+! 14
! 15
! 16 tquick log
! 17 saved *.tf2 files
@@ -41,7 +41,7 @@ program m65 common/npar/fcenter,nutc,idphi,mousedf,mousefqso,nagain, &
ndepth,ndiskdat,neme,newdat,nfa,nfb,nfcal,nfshift, &
mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, &
- nfast,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid,datetime
+ ndop00,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid,datetime
common/early/nhsym1,nhsym2,ldecoded(32768)
nargs=iargc()
diff --git a/map65/libm65/m65a.f90 b/map65/libm65/m65a.f90 index 2135c52f..6a23e90b 100755 --- a/map65/libm65/m65a.f90 +++ b/map65/libm65/m65a.f90 @@ -82,7 +82,7 @@ subroutine m65c(dd,ss,savg,nparams0) common/npar/fcenter,nutc,idphi,mousedf,mousefqso,nagain, &
ndepth,ndiskdat,neme,newdat,nfa,nfb,nfcal,nfshift, &
mcall3,nkeep,ntol,nxant,nrxlog,nfsample,nxpol,nmode, &
- nfast,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid, &
+ ndop00,nsave,max_drift,nhsym,mycall,mygrid,hiscall,hisgrid, &
datetime,junk1,junk2
common/early/nhsym1,nhsym2,ldecoded(32768)
equivalence (nparams,fcenter)
diff --git a/map65/libm65/map65a.f90 b/map65/libm65/map65a.f90 index e1f31993..fcaf343e 100755 --- a/map65/libm65/map65a.f90 +++ b/map65/libm65/map65a.f90 @@ -2,7 +2,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & mousedf,mousefqso,nagain,ndecdone,nfshift,ndphi,max_drift, &
nfcal,nkeep,mcall3b,nsum,nsave,nxant,mycall,mygrid, &
neme,ndepth,nstandalone,hiscall,hisgrid,nhsym,nfsample, &
- ndiskdat,nxpol,nmode)
+ ndiskdat,nxpol,nmode,ndop00)
! Processes timf2 data from Linrad to find and decode JT65 signals.
@@ -41,6 +41,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & data nfile/0/,nutc0/-999/,nid/0/,ip000/1/,ip001/1/,mousefqso0/-999/
save
+ rewind 12
ndecodes=0
! Clean start for Q65 at early decode
@@ -68,11 +69,11 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & endif
!###
! do k=1,ncand
-! freq=cand(k)%f+nkhz_center-48.0-1.27046
+! freq=cand(k)%f+nkhz_center-48.0
! ipk=cand(k)%indx
-! write(*,3010) nutc,k,db(cand(k)%snr),freq,cand(k)%xdt, &
+! write(71,3071) k,db(cand(k)%snr),freq,cand(k)%xdt, &
! cand(k)%ipol,cand(k)%iflip,ipk,ldecoded(ipk)
-!3010 format('=a',i5.4,i5,f8.2,f10.3,f8.2,2i3,i6,L4)
+!3071 format(i3,f8.2,f10.3,f8.2,2i3,i6,L4)
! enddo
!###
@@ -365,7 +366,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & call timer('q65b ',0)
call q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf, &
ntol,xpol,mycall,mygrid, hiscall,hisgrid,mode_q65,f0,fqso, &
- newdat,nagain,max_drift,nhsym,idec)
+ newdat,nagain,max_drift,nhsym,ndop00,idec)
call timer('q65b ',1)
if(idec.ge.0) candec(icand)=.true.
enddo
@@ -376,7 +377,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & call timer('q65b ',0)
call q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf, &
ntol,xpol,mycall,mygrid,hiscall,hisgrid,mode_q65,f0,fqso, &
- newdat,nagain,max_drift,nhsym,idec)
+ newdat,nagain,max_drift,nhsym,ndop00,idec)
call timer('q65b ',1)
endif
endif
@@ -420,7 +421,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & call timer('q65b ',0)
call q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
xpol,mycall,mygrid,hiscall,hisgrid,mode_q65,f0,fqso,newdat, &
- nagain,max_drift,nhsym,idec)
+ nagain,max_drift,nhsym,ndop00,idec)
call timer('q65b ',1)
if(idec.ge.0) candec(icand)=.true.
enddo ! icand
@@ -500,12 +501,12 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & if(mode65.eq.2) cmode='#B'
if(mode65.eq.4) cmode='#C'
write(26,1014) f0,ndf,ndf0,ndf1,ndf2,dt,npol,nsync1, &
- nsync2,nutc,decoded,cp,cmode
-1014 format(f8.3,i5,3i3,f5.1,i4,i3,i4,i5.4,4x,a22,2x,a1,3x,a2)
+ nsync2,nutc,decoded,'#',cp,cmode ! was decoded,cp,
+1014 format(f8.3,i5,3i3,f5.1,i4,i3,i4,i5.4,4x,a22,7x,2a1,2x,a2) ! was a22,2x,a1,3x,a2
ndecodes=ndecodes+1
- write(21,1100) f0,ndf,dt,npol,nsync2,nutc,decoded,cp, &
- cmode(1:1),cmode(2:2)
-1100 format(f8.3,i5,f5.1,2i4,i5.4,2x,a22,2x,a1,3x,a1,1x,a1)
+ write(21,1100) f0,ndf,dt,npol,nsync2,nutc,decoded,'#',cp, &
+ cmode(1:1),cmode(2:2)! was decoded,cp,
+1100 format(f8.3,i5,f5.1,2i4,i5.4,2x,a22,7x,2a1,3x,a1,1x,a1) ! was a22,2x,a1,1x,a1
endif
endif
@@ -520,6 +521,7 @@ subroutine map65a(dd,ss,savg,newdat,nutc,fcenter,ntol,idphi,nfa,nfb, & ndecdone=2
900 close(23)
+ call flush(12)
ndphi=0
mcall3b=mcall3a
diff --git a/map65/libm65/mapsim.f90 b/map65/libm65/mapsim.f90 index 49645b70..ab933942 100755 --- a/map65/libm65/mapsim.f90 +++ b/map65/libm65/mapsim.f90 @@ -10,13 +10,18 @@ program mapsim complex z,zx,zy
real*8 fcenter,fsample,samfac,f,dt,twopi,phi,dphi
logical bq65
- character msg0*22,message*22,msgsent*22,arg*8,fname*11,mode*2
- character*16 msg_list(60)
+ character msg0*24,message*24,msgsent*24,arg*8,fname*11,mode*2 !w3sz msg* was size 22
+ character*24 msg_list(60) ! was *16
+ integer*2 hhmm
data msg_list/ &
- 'W1AAA K2BBB EM00','W2CCC K3DDD EM01','W3EEE K4FFF EM02', &
- 'W5GGG K6HHH EM03','W7III K8JJJ EM04','W9KKK K0LLL EM05', &
- 'G0MMM F1NNN JN06','G2OOO F3PPP JN07','G4QQQ F5RRR JN08', &
- 'G6SSS F7TTT JN09','W1XAA K2XBB EM10','W2XCC K3XDD EM11', &
+ ! 'CQ K1WDG/P','CQ YL/EA8DBM','<YL/EA8DBM> OH3LWP KP11', &
+ ! 'CQ PJ4/KA1ABC','CQ KH1/KH7Z','W2XCC K3XDD EM11', &
+ ! '<K1WDG/P> W3SZ fn20','<PJ4/KA1ABC> WA9XYZ -10','WA9XYZ <KH1/KH7Z> -12', &
+ ! '<YW18FIFA> KA1ABC 73','CQ KA1GT FN54','CQ YW18FIFA', &
+ ! 'PJ4/KA1ABC <WA9XYZ> -11','<WA9XYZ> PJ4/KA1ABC 73','<WA9XYZ> PJ4/KA1ABC RR73', &
+ ! '<YW18FIFA> KA1ABC FN42','<PJ4/KA1ABC> WA9XYZ R-09','<PJ4/KA1ABC> WA9XYZ EN90', &
+ 'CQ DL4KGC JN68','CQ HB9Q JN47','CQ G3LTF IO91', &
+ 'CQ K1JT FN20','CQ W3SZ FN10','CQ DL3WDG JN68', &
'W3XEE K4XFF EM12','W5XGG K6XHH EM13','W7XII K8XJJ EM14', &
'W9XKK K0XLL EM15','G0XMM F1XNN JN16','G2XOO F3XPP JN17', &
'G4XQQ F5XRR JN18','G6XSS F7XTT JN19','W1YAA K2YBB EM20', &
@@ -28,6 +33,8 @@ program mapsim 'G0ZMM F1ZNN JN36','G2ZOO F3ZPP JN37','G4ZQQ F5ZRR JN38', &
'G6ZSS F7ZTT JN39','W1AXA K2BXB EM40','W2CXC K3DXD EM41', &
'W3EXE K4FXF EM42','W5GXG K6HXH EM43','W7IXI K8JXJ EM44', &
+ 'CQ DG2YCB JO42','CQ ON4AOI JO21','CQ KA1GT FN54', &
+ 'G6SSS F7TTT JN09','W1XAA K2XBB EM10','W2XCC K3XDD EM11', &
'W9KXK K0LXL EM45','G0MXM F1NXN JN46','G2OXO F3PXP JN47', &
'G4QXQ F5RXR JN48','G6SXS F7TXT JN49','W1AYA K2BYB EM50', &
'W2CYC K3DYD EM51','W3EYE K4FYF EM52','W5GYG K6HYH EM53', &
@@ -35,9 +42,9 @@ program mapsim 'G2OYO F3PYP JN57','G4QYQ F5RYR JN58','G6SYS F7TYT JN59'/
nargs=iargc()
- if(nargs.ne.10) then
- print*,'Usage: mapsim "message" mode DT fa fb nsigs pol fDop SNR nfiles'
- print*,'Example: mapsim "CQ K1ABC FN42" B 2.5 -20 20 21 45 0.0 -20 1'
+ if(nargs.ne.12) then
+ print*,'Usage: mapsim "message" mode DT fa fb nsigs pol fDop SNR nfiles fcenter HHmm'
+ print*,'Example: mapsim "CQ K1ABC FN42" B 2.5 -20 20 21 45 0.0 -20 1 1296.1 1803'
print*,' '
print*,' mode = A B C for JT65; QA-QE for Q65-60A'
print*,' fa = lowest freq in kHz, relative to center'
@@ -66,12 +73,16 @@ program mapsim call getarg(9,arg)
read(arg,*) snrdb !S/N
call getarg(10,arg)
- read(arg,*) nfiles !Number of files
+ read(arg,*) nfiles !Number of files !S/N
+ call getarg(11,arg) ! added by w3sz
+ read(arg,*) fcenter ! added by w3sz
+ call getarg(12,arg) ! added by w3sz
+ read(arg,*) hhmm ! added by w3sz
message=msg0 !Transmitted message
rmsdb=25.
rms=10.0**(0.05*rmsdb)
- fcenter=144.125d0 !Center frequency (MHz)
+ ! w3sz fcenter=144.125d0 !Center frequency (MHz)
fsample=96000.d0 !Sample rate (Hz)
dt=1.d0/fsample !Sample interval (s)
twopi=8.d0*atan(1.d0)
@@ -94,7 +105,7 @@ program mapsim ilist=0
nmin=ifile-1
if(mode(2:2).eq.' ') nmin=2*nmin
- write(fname,1002) nmin !Create the output filenames
+ write(fname,1002) hhmm !Create the output filenames ! w3sz was nmin
1002 format('000000_',i4.4)
open(10,file=fname//'.iq',access='stream',status='unknown')
open(11,file=fname//'.tf2',access='stream',status='unknown')
@@ -138,7 +149,7 @@ program mapsim if(snrdb.eq.0.0) snrdbx=-15.0 - 15.0*(isig-1.0)/nsigs
sig=sqrt(2.2*2500.0/96000.0) * 10.0**(0.05*snrdbx)
write(*,1020) ifile,isig,mode,dt0,0.001*f,nint(pol),fDop,snrdbx,msgsent
-1020 format(i3,i3,2x,a2,f6.2,f8.3,i5,2f7.1,2x,a22)
+1020 format(i3,i3,2x,a2,f6.2,f8.3,i5,2f7.1,2x,a24) !w3sz was a22
phi=0.
! i0=fsample*(3.5d0+0.05d0*(isig-1))
diff --git a/map65/libm65/q65b.f90 b/map65/libm65/q65b.f90 index 6e555284..20b37d0e 100755 --- a/map65/libm65/q65b.f90 +++ b/map65/libm65/q65b.f90 @@ -1,6 +1,6 @@ subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, &
mycall0,mygrid,hiscall0,hisgrid,mode_q65,f0,fqso,newdat,nagain, &
- max_drift,nhsym,idec)
+ max_drift,nhsym,ndop00,idec)
! This routine provides an interface between MAP65 and the Q65 decoder
! in WSJT-X. All arguments are input data obtained from the MAP65 GUI.
@@ -137,10 +137,11 @@ subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & nfb=min(2500,1000+ntol)
endif
nsnr0=-99 !Default snr for no decode
+ ndpth=3
! 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,mycall,hiscall,hisgrid)
+ call map65_mmdec(nutc,iwave,nqd,60,nsubmode,nfa,nfb,1000,ntol, &
+ newdat,nagain,max_drift,ndepth,mycall,hiscall0,hisgrid)
MHz=fcenter
freq0=MHz + 0.001d0*ikhz
@@ -154,16 +155,16 @@ subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & npol=npol-45
if(npol.lt.0) npol=npol+180
endif
- call txpol(xpol,msg0(1:22),mygrid,npol,nxant,ntxpol,cp)
+ call txpol(xpol,msg0(1:28),mygrid,npol,nxant,ntxpol,cp) ! was 1:22
ikhz1=ikhz
ndf=nq65df
if(ndf.gt.500) ikhz1=ikhz + (nq65df+500)/1000
if(ndf.lt.-500) ikhz1=ikhz + (nq65df-500)/1000
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, &
+ write(line,1020) ikhz1,ndf,npol,nutc,xdt0,nsnr0,msg0(1:28),cq0, &
ntxpol,cp
-1020 format('!',i3.3,i5,i4,i6.4,f5.1,i5,' : ',a27,a3,i4,1x,a1)
+1020 format('!',i3.3,i5,i4,i6.4,f5.1,i5,' : ',a28,a3,i4,1x,a1)
write(*,1100) trim(line)
1100 format(a)
endif
@@ -172,20 +173,25 @@ subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, & cmode=': '
cmode(2:2)=char(ichar('A') + mode_q65-1)
freq1=freq0 + 0.001d0*(ikhz1-ikhz)
- write(26,1014) freq1,ndf,0,0,0,xdt0,npol,0,nsnr0,nutc,msg0(1:22), &
- ':',cp,cmode
-1014 format(f8.3,i5,3i3,f5.1,i4,i3,i4,i5.4,4x,a22,1x,2a1,2x,a2)
+ write(26,1014) freq1,ndf,0,0,0,xdt0,npol,0,nsnr0,nutc,msg0(1:28), &
+ ':',cp,cmode ! was 1:22
+1014 format(f8.3,i5,3i3,f5.1,i4,i3,i4,i5.4,4x,a28,1x,2a1,2x,a2) ! was a22
! Suppress writing duplicates (same time, decoded message, and frequency)
! to map65_rx.log
if(nutc.ne.nutc00 .or. msg0(1:28).ne.msg00 .or. freq1.ne.freq1_00) then
! Write to file map65_rx.log:
ndecodes=ndecodes+1
- write(21,1110) freq1,ndf,xdt0,npol,nsnr0,nutc,msg0(1:28),cq0
-1110 format(f8.3,i5,f5.1,2i4,i5.4,2x,a28,': A',2x,a3)
+ write(21,1110) freq1,ndf,xdt0,npol,nsnr0,nutc,msg0(1:28), &
+ cmode(2:2),cq0
+1110 format(f8.3,i5,f5.1,2i4,i5.4,2x,a28,': ',a1,2x,a3)
nutc00=nutc
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(12,1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
+1120 format(i4.4,f9.3,f7.2,i5,2x,a,i6)
endif
endif
diff --git a/map65/libm65/q65b_for_Linux.f90 b/map65/libm65/q65b_for_Linux.f90 new file mode 100755 index 00000000..d4e829f7 --- /dev/null +++ b/map65/libm65/q65b_for_Linux.f90 @@ -0,0 +1,205 @@ +subroutine q65b(nutc,nqd,nxant,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, &
+ mycall0,mygrid,hiscall0,hisgrid,mode_q65,f0,fqso,newdat,nagain, &
+ max_drift,nhsym,ndop00,idec)
+
+! This routine provides an interface between MAP65 and the Q65 decoder
+! in WSJT-X. All arguments are input data obtained from the MAP65 GUI.
+! Raw Rx data are available as the 96 kHz complex spectrum ca(MAXFFT1)
+! in common/cacb. If xpol is true, we also have cb(MAXFFT1) for the
+! orthogonal polarization. Decoded messages are sent back to the GUI
+! on stdout.
+
+! use wavhdr
+ use q65_decode
+ use wideband_sync
+ 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 !Header for the .wav file
+ integer*2 iwave(60*12000)
+ complex ca(MAXFFT1),cb(MAXFFT1) !FFTs of raw x,y data
+ complex cx(0:MAXFFT2-1),cy(0:MAXFFT2-1),cz(0:MAXFFT2)
+ logical xpol,ldecoded
+ integer ipk1(1)
+ real*8 fcenter,freq0,freq1
+ character*12 mycall0,hiscall0
+ character*12 mycall,hiscall
+ character*6 mygrid,hisgrid
+ character*4 grid4
+ character*28 msg00
+ character*80 line
+ character*80 wsjtx_dir
+ character*1 cp,cmode*2
+ common/cacb/ca,cb
+ common/early/nhsym1,nhsym2,ldecoded(32768)
+ common/decodes/ndecodes
+ data nutc00/-1/,msg00/' '/
+ save
+
+ if(newdat.eq.1) nutc00=-1
+! open(9,file='wsjtx_dir.txt',status='old')
+! read(9,'(a)') wsjtx_dir !Establish the working directory
+! close(9)
+
+ if(mycall0(1:1).ne.' ') mycall=mycall0
+ if(hiscall0(1:1).ne.' ') hiscall=hiscall0
+ if(hisgrid(1:4).ne.' ') grid4=hisgrid(1:4)
+
+! Find best frequency and ipol from sync_dat, the "orange sync curve".
+ df3=96000.0/32768.0
+ ifreq=nint((1000.0*f0)/df3)
+ ia=nint(ifreq-ntol/df3)
+ ib=nint(ifreq+ntol/df3)
+ ipk1=maxloc(sync(ia:ib)%ccfmax)
+ ipk=ia+ipk1(1)-1
+ if(ldecoded(ipk)) go to 900
+ snr1=sync(ipk)%ccfmax
+ ipol=1
+ if(xpol) ipol=sync(ipk)%ipol
+
+ 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
+ f_ipk=ipk*df3
+ 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
+ if(snr1.lt.1.5) go to 900 !### Threshold needs work? ###
+
+ fac=1.0/nfft2
+ cx(0:nfft2-1)=ca(k0:k0+nfft2-1)
+ cx=fac*cx
+ if(xpol) then
+ cy(0:nfft2-1)=cb(k0:k0+nfft2-1)
+ cy=fac*cy
+ endif
+
+! Here cx and cy (if xpol) are frequency-domain data around the selected
+! QSO frequency, taken from the full-length FFT computed in filbig().
+! Values for fsample, nfft1, nfft2, df, and the downsampled data rate
+! are as follows:
+
+! fSample nfft1 df nfft2 fDownSampled
+! (Hz) (Hz) (Hz)
+!----------------------------------------------------
+! 96000 5376000 0.017857143 336000 6000.000
+! 95238 5120000 0.018601172 322560 5999.994
+
+ poldeg=0.
+ if(xpol) then
+ poldeg=sync(ipk)%pol
+ cz(0:MAXFFT2-1)=cos(poldeg/RAD)*cx + sin(poldeg/RAD)*cy
+ else
+ cz(0:MAXFFT2-1)=cx
+ endif
+
+ cz(MAXFFT2)=0.
+! Roll off below 500 Hz and above 2500 Hz.
+ ja=nint(500.0/df)
+ jb=nint(2500.0/df)
+ do i=0,ja
+ r=0.5*(1.0+cos(i*3.14159/ja))
+ cz(ja-i)=r*cz(ja-i)
+ cz(jb+i)=r*cz(jb+i)
+ enddo
+ cz(ja+jb+1:)=0.
+
+!Transform to time domain (real), fsample=12000 Hz
+ call four2a(cz,2*nfft2,1,1,-1)
+ do i=0,nfft2-1
+ j=nfft2-1-i
+ iwave(2*i+2)=nint(real(cz(j))) !Note the reversed order!
+ iwave(2*i+1)=nint(aimag(cz(j)))
+ enddo
+ iwave(2*nfft2+1:)=0
+
+! open(30,file='000000_0001.wav',status='unknown',access='stream')
+! h=default_header(12000,NMAX)
+! write(30) h,iwave
+! close(30)
+
+ 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
+ nfa=max(100,1000-ntol)
+ nfb=min(2500,1000+ntol)
+ endif
+ nsnr0=-99 !Default snr for no decode
+ ndpth=3
+
+! 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,hiscall0,hisgrid)
+
+ MHz=fcenter
+ freq0=MHz + 0.001d0*ikhz
+
+ if(nsnr0.gt.-99) then
+ ldecoded(ipk)=.true.
+ nq65df=nint(1000*(0.001*k0*df+nkhz_center-48.0+1.000-1.27046-ikhz))-nfcal
+ nq65df=nq65df + nfreq0 - 1000
+ npol=nint(poldeg)
+ if(nxant.ne.0) then
+ npol=npol-45
+ if(npol.lt.0) npol=npol+180
+ endif
+ call txpol(xpol,msg0(1:28),mygrid,npol,nxant,ntxpol,cp)
+ ikhz1=ikhz
+ ndf=nq65df
+ if(ndf.gt.500) ikhz1=ikhz + (nq65df+500)/1000
+ if(ndf.lt.-500) ikhz1=ikhz + (nq65df-500)/1000
+ 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:28),cq0, &
+ ntxpol,cp
+1020 format('!',i3.3,i5,i4,i6.4,f5.1,i5,' : ',a28,a3,i4,1x,a1)
+ 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)
+ write(26,1014) freq1,ndf,0,0,0,xdt0,npol,0,nsnr0,nutc,msg0(1:28), &
+ ':',cp,cmode ! was 1:22
+1014 format(f8.3,i5,3i3,f5.1,i4,i3,i4,i5.4,4x,a28,1x,2a1,2x,a2) ! was a22
+
+! Suppress writing duplicates (same time, decoded message, and frequency)
+! to map65_rx.log
+ if(nutc.ne.nutc00 .or. msg0(1:28).ne.msg00 .or. freq1.ne.freq1_00) then
+! Write to file map65_rx.log:
+ ndecodes=ndecodes+1
+ write(21,1110) freq1,ndf,xdt0,npol,nsnr0,nutc,msg0(1:28), &
+ cmode(2:2),cq0
+1110 format(f8.3,i5,f5.1,2i4,i5.4,2x,a28,': ',a1,2x,a3)
+ nutc00=nutc
+ 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(12,1120) nutc,fsked,xdt0,nsnr0,trim(msg0)
+1120 format(i4.4,f9.3,f7.2,i5,2x,a,i6)
+ endif
+ endif
+
+900 close(13)
+ close(17)
+ call flush(6)
+ idec=-1
+ read(cq0(2:2),*) idec
+
+ return
+end subroutine q65b
diff --git a/map65/libm65/wideband_sync.f90 b/map65/libm65/wideband_sync.f90 index 0b6689d1..009b3b00 100755 --- a/map65/libm65/wideband_sync.f90 +++ b/map65/libm65/wideband_sync.f90 @@ -41,7 +41,7 @@ subroutine get_candidates(ss,savg,xpol,jz,nfa,nfb,nts_jt65,nts_q65,cand,ncand) type(candidate) :: cand(MAX_CANDIDATES)
common/early/nhsym1,nhsym2,ldecoded(32768)
- call wb_sync(ss,savg,xpol,jz,nfa,nfb)
+ call wb_sync(ss,savg,xpol,jz,nfa,nfb) !Output to sync() array
tstep=2048.0/11025.0 !0.185760 s: 0.5*tsym_jt65, 0.3096*tsym_q65
df3=96000.0/NFFT
@@ -89,8 +89,6 @@ subroutine get_candidates(ss,savg,xpol,jz,nfa,nfb,nts_jt65,nts_q65,cand,ncand) if(diffhz.gt.-0.03*bw .and. diffhz.lt.1.03*bw) skip=.true.
enddo
if(skip) cycle
-! write(*,3301) i,k,m,f0,diffhz,bw,db(snr1)
-!3301 format('=A',3i5,f8.3,2f8.0,f8.2)
k=k+1
cand(k)%snr=snr1
cand(k)%f=f0
@@ -99,6 +97,8 @@ subroutine get_candidates(ss,savg,xpol,jz,nfa,nfb,nts_jt65,nts_q65,cand,ncand) cand(k)%ipol=sync(n)%ipol
cand(k)%iflip=nint(flip)
cand(k)%indx=n
+! write(50,3050) i,k,m,f0+32.0,diffhz,bw,snr1,db(snr1)
+!3050 format(3i5,f8.3,2f8.0,2f8.2)
if(k.ge.MAX_CANDIDATES) exit
enddo
ncand=k
@@ -251,14 +251,29 @@ subroutine wb_sync(ss,savg,xpol,jz,nfa,nfb) enddo ! i (frequency bin)
+ call pctile(sync(ia:ib)%ccfmax,ib-ia+1,50,base)
+ sync(ia:ib)%ccfmax=sync(ia:ib)%ccfmax/base
+
+ bw=65*4*1.66666667 !Q65-60C bandwidth
+ nbw=bw/df3 + 1 !Number of bins to blank
+ syncmin=2.0
+ nguard=10
+ do i=ia,ib
+ if(sync(i)%ccfmax.lt.syncmin) cycle
+ spk=maxval(sync(i:i+nbw)%ccfmax)
+ ip =maxloc(sync(i:i+nbw)%ccfmax)
+ i0=ip(1)+i-1
+ ja=min(i,i0-nguard)
+ jb=i0+nbw+nguard
+ sync(ja:jb)%ccfmax=0.
+ sync(i0)%ccfmax=spk
+ enddo
+
! do i=ia,ib
-! write(15,3015) 0.001*(i-1)*df3,sync(i)%ccfmax,sync(i)%xdt,sync(i)%ipol, &
-! sync(i)%iflip,sync(i)%birdie
+! write(15,3015) 0.001*(i-1)*df3+32.0,sync(i)%ccfmax,sync(i)%xdt, &
+! sync(i)%ipol,sync(i)%iflip,sync(i)%birdie
!3015 format(3f10.3,2i6,L5)
! enddo
-
- call pctile(sync(ia:ib)%ccfmax,ib-ia+1,50,base)
- sync(ia:ib)%ccfmax=sync(ia:ib)%ccfmax/base
return
end subroutine wb_sync
|
