summaryrefslogtreecommitdiff
path: root/qmap/libqmap
diff options
context:
space:
mode:
authorChristoph Berg <myon@debian.org>2026-10-09 14:12:35 +0200
committerChristoph Berg <myon@debian.org>2026-10-09 14:12:35 +0200
commitffc62c792c9a5196cb4ce7a353287dfe20db6524 (patch)
tree1269efa852935b183daae4bb33a58d1b4d2ffb53 /qmap/libqmap
parent059831534c7e884f0a607ed86b582fd00d821731 (diff)
New upstream version 3.3.0~beta1+dfsgupstream/3.3.0_beta1+dfsg
Diffstat (limited to 'qmap/libqmap')
-rw-r--r--qmap/libqmap/CMakeLists.txt2
-rw-r--r--qmap/libqmap/getcand2.f9015
-rw-r--r--qmap/libqmap/q65b.f9079
-rw-r--r--qmap/libqmap/qmapa.f909
4 files changed, 54 insertions, 51 deletions
diff --git a/qmap/libqmap/CMakeLists.txt b/qmap/libqmap/CMakeLists.txt
index 5480486b..44d6e1b2 100644
--- a/qmap/libqmap/CMakeLists.txt
+++ b/qmap/libqmap/CMakeLists.txt
@@ -2,6 +2,7 @@ set (libq65_FSRCS
# Modules come first:
qmap_decode_ipc.f90
cacb_mod.f90
+ getcand2.f90
# Non-module Fortran routines:
astro.f90
@@ -16,7 +17,6 @@ set (libq65_FSRCS
ftninit.f90
# ftnquit.f90
geocentric.f90
- getcand2.f90
grid2deg.f90
indexx.f90
lorentzian.f90
diff --git a/qmap/libqmap/getcand2.f90 b/qmap/libqmap/getcand2.f90
index c98c3088..61ecc18c 100644
--- a/qmap/libqmap/getcand2.f90
+++ b/qmap/libqmap/getcand2.f90
@@ -1,8 +1,4 @@
-subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
- ntol,f0_selected,bAlso30,cand,ncand2)
-
-! Get candidates for Q65 decodes, based on presence of sync tone.
-
+module qmap_candidates_mod
type candidate
real :: snr !Relative S/N of sync detection
real :: f !Freq of sync tone, 0 to 96000 Hz
@@ -11,6 +7,13 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
integer :: iseq !0 for first half-minute, 1 for second half
end type candidate
+contains
+
+subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
+ ntol,f0_selected,bAlso30,cand,ncand2)
+
+! Get candidates for Q65 decodes, based on presence of sync tone.
+
parameter (NFFT=32768) !FFTs done in symspec()
parameter (MAX_CANDIDATES=50)
type(candidate) :: cand(MAX_CANDIDATES)
@@ -22,6 +25,7 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
logical*1 bAlso30
data nseg/16/,npct/40/
+ ncand2=0
if(savg0(NFFT).eq.0) return !Avoid a program crash when spectrum is empty
savg=savg0 !Save the original spectrum
@@ -117,3 +121,4 @@ subroutine getcand2(ss,savg0,nts_q65,nagain,nhsym,ntx30a,ntx30b, &
return
end subroutine getcand2
+end module qmap_candidates_mod
diff --git a/qmap/libqmap/q65b.f90 b/qmap/libqmap/q65b.f90
index 619f785d..b6234588 100644
--- a/qmap/libqmap/q65b.f90
+++ b/qmap/libqmap/q65b.f90
@@ -1,3 +1,42 @@
+module qmap_q65_samples_mod
+ use iso_fortran_env, only: int16
+ implicit none
+contains
+ subroutine build_q65_samples(k0,nfft2,df,iseq,iwave)
+ use cacb_mod, only: ca
+ integer, intent(in) :: k0,nfft2,iseq
+ real, intent(in) :: df
+ integer(int16), intent(out) :: iwave(:)
+ integer, parameter :: MAXFFT2=336000
+ complex cx(0:MAXFFT2-1),cz(0:MAXFFT2)
+ save cx,cz
+ integer i,j,ja,jb
+ real fac,r
+
+ fac=1.0/nfft2
+ cx(0:nfft2-1)=fac*ca(k0:k0+nfft2-1)
+ cz(0:MAXFFT2-1)=cx
+ cz(MAXFFT2)=0.
+ 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.
+
+ 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)))
+ iwave(2*i+1)=nint(aimag(cz(j)))
+ enddo
+ iwave(2*nfft2+1:)=0
+ if(iseq.eq.1) iwave(1:360000)=iwave(360001:720000)
+ end subroutine build_q65_samples
+end module qmap_q65_samples_mod
+
subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
ntrperiod,iseq,mycall0,hiscall0,hisgrid,mode_q65,f0,fqso,nkhz_center, &
newdat,nagain,bClickDecode,max_drift,offset,ndepth,datetime,nCFOM, &
@@ -15,7 +54,8 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
use qmap_decode_ipc, only: max_decode_rows, decode_row_length, &
ndecodes, result, result2
use iso_fortran_env, only: int16
- use cacb_mod, only: ca, init_cacb
+ use cacb_mod, only: init_cacb
+ use qmap_q65_samples_mod, only: build_q65_samples
parameter (MAXFFT1=5376000) !56*96000
parameter (MAXFFT2=336000) !56*6000 (downsampled by 1/16)
@@ -24,7 +64,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
type(hdr) h
integer(int16) iwave(300*12000)
integer offset
- complex cx(0:MAXFFT2-1),cz(0:MAXFFT2)
real*8 fcenter,freq0,freq1
logical*1 bClickDecode
character*12 mycall0,hiscall0
@@ -54,39 +93,7 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol, &
nh=nfft2/2
k0=nint((ipk*df3-1000.0)/df)
if(k0.lt.nh .or. k0.gt.MAXFFT1-nfft2+1) go to 900
- fac=1.0/nfft2
- 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 fftbig().
-! 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
-
- cz(0:MAXFFT2-1)=cx
- 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
+ call build_q65_samples(k0,nfft2,df,iseq,iwave)
nsubmode=mode_q65-1
nfa=990 !Tight limits around ipk for the wideband decode
@@ -97,8 +104,6 @@ subroutine q65b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,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
diff --git a/qmap/libqmap/qmapa.f90 b/qmap/libqmap/qmapa.f90
index 2b785622..02ccf2c2 100644
--- a/qmap/libqmap/qmapa.f90
+++ b/qmap/libqmap/qmapa.f90
@@ -7,14 +7,7 @@ subroutine qmapa(dd,ss,savg,newdat,nutc,fcenter,ntol,nfa,nfb, &
use timer_module, only: timer
use qmap_decode_ipc, only: ndecodes, ncand2
-
- type candidate
- real :: snr !Relative S/N of sync detection
- real :: f !Freq of sync tone, 0 to 96000 Hz
- real :: xdt !DT of matching sync pattern, -1.0 to +4.0 s
- integer :: ntrperiod !60 for Q65-60x, 30 for Q65-30x
- integer :: iseq !0 for first half-minute, 1 for second half
- end type candidate
+ use qmap_candidates_mod, only: candidate, getcand2
type good_decode
real :: f !Freq of sync tone, 0 to 96000 Hz