summaryrefslogtreecommitdiff
path: root/qmap/libqmap/q65b.f90
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/q65b.f90
parent059831534c7e884f0a607ed86b582fd00d821731 (diff)
New upstream version 3.3.0~beta1+dfsgupstream/3.3.0_beta1+dfsg
Diffstat (limited to 'qmap/libqmap/q65b.f90')
-rw-r--r--qmap/libqmap/q65b.f9079
1 files changed, 42 insertions, 37 deletions
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