mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-07-18 09:35:17 -04:00
Minor code cleanup.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7117 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
cd0895c26a
commit
7664a29fb6
@ -3,6 +3,12 @@ subroutine hspec(id2,k,nutc0,ntrpdepth,nrxfreq,ntol,bmsk144,ingain, &
|
|||||||
|
|
||||||
! Input:
|
! Input:
|
||||||
! k pointer to the most recent new data
|
! k pointer to the most recent new data
|
||||||
|
! nutc0 UTC for display of decode(s)
|
||||||
|
! ntrpdepth TR period and 1000*ndepth
|
||||||
|
! nrxfreq Rx audio center frequency
|
||||||
|
! ntol Decoding range is +/- ntol
|
||||||
|
! bmsk144 Boolean, true if in MSK144 mode
|
||||||
|
! ingain Relative gain for spectra
|
||||||
|
|
||||||
! Output:
|
! Output:
|
||||||
! green() power
|
! green() power
|
||||||
@ -62,19 +68,16 @@ subroutine hspec(id2,k,nutc0,ntrpdepth,nrxfreq,ntol,bmsk144,ingain, &
|
|||||||
aimag(cx(j-1))**2
|
aimag(cx(j-1))**2
|
||||||
s(i-1,jh)=fac*gain*sx
|
s(i-1,jh)=fac*gain*sx
|
||||||
enddo
|
enddo
|
||||||
! call smo121(s(0,jh),64) !### Good idea, or not? ###
|
|
||||||
if(ja+2*nfft.gt.k) exit
|
if(ja+2*nfft.gt.k) exit
|
||||||
enddo
|
enddo
|
||||||
k0=k
|
k0=k
|
||||||
|
|
||||||
!###
|
|
||||||
if(bmsk144) then
|
if(bmsk144) then
|
||||||
if(k.ge.7168) then
|
if(k.ge.7168) then
|
||||||
tsec=(k-7168)/12000.0
|
tsec=(k-7168)/12000.0
|
||||||
call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,nrxfreq,ndepth,line1)
|
call mskrtd(id2(k-7168+1:k),nutc0,tsec,ntol,nrxfreq,ndepth,line1)
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
!###
|
|
||||||
|
|
||||||
900 return
|
900 return
|
||||||
end subroutine hspec
|
end subroutine hspec
|
||||||
|
@ -37,11 +37,10 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
1,1,1,1,1,1,1,0/
|
1,1,1,1,1,1,1,0/
|
||||||
data xmc/2.0,4.5,2.5,3.5/ !Used to label decode with time at center of averaging mask
|
data xmc/2.0,4.5,2.5,3.5/ !Used to label decode with time at center of averaging mask
|
||||||
|
|
||||||
save first,t03,t12,nutc00,pnoise,nsnrlast,msglast
|
save first,tsec0,nutc00,pnoise,nsnrlast,msglast
|
||||||
|
|
||||||
if(first) then
|
if(first) then
|
||||||
t03=0.0
|
tsec0=tsec
|
||||||
t12=0.0
|
|
||||||
nutc00=nutc0
|
nutc00=nutc0
|
||||||
pnoise=-1.0
|
pnoise=-1.0
|
||||||
first=.false.
|
first=.false.
|
||||||
@ -50,7 +49,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
fc=nrxfreq
|
fc=nrxfreq
|
||||||
|
|
||||||
!!! Dupe checking should probaby be moved to mainwindow.cpp
|
!!! Dupe checking should probaby be moved to mainwindow.cpp
|
||||||
if( nutc00 .ne. nutc0 ) then ! reset dupe checker
|
if(nutc00.ne.nutc0 .or. tsec.lt.tsec0) then ! reset dupe checker
|
||||||
msglast=' '
|
msglast=' '
|
||||||
nsnrlast=-99
|
nsnrlast=-99
|
||||||
nutc00=nutc0
|
nutc00=nutc0
|
||||||
@ -63,7 +62,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
niterations=0
|
niterations=0
|
||||||
d(1:NZ)=id2
|
d(1:NZ)=id2
|
||||||
rms=sqrt(sum(d(1:NZ)*d(1:NZ))/NZ)
|
rms=sqrt(sum(d(1:NZ)*d(1:NZ))/NZ)
|
||||||
if(rms.lt.1.0) return
|
if(rms.lt.1.0) go to 999
|
||||||
fac=1.0/rms
|
fac=1.0/rms
|
||||||
d(1:NZ)=fac*d(1:NZ)
|
d(1:NZ)=fac*d(1:NZ)
|
||||||
d(NZ+1:NFFT1)=0.
|
d(NZ+1:NFFT1)=0.
|
||||||
@ -76,7 +75,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
do i=1,8
|
do i=1,8
|
||||||
ib=(i-1)*NSPM+1
|
ib=(i-1)*NSPM+1
|
||||||
ie=ib+NSPM-1
|
ie=ib+NSPM-1
|
||||||
pow(i)=dot_product(cdat(ib:ie),cdat(ib:ie))*rms**2
|
pow(i)=real(dot_product(cdat(ib:ie),cdat(ib:ie)))*rms**2
|
||||||
if( pow(i) .gt. pmax ) then
|
if( pow(i) .gt. pmax ) then
|
||||||
pmax=pow(i)
|
pmax=pow(i)
|
||||||
endif
|
endif
|
||||||
@ -91,7 +90,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
if( nsuccess .eq. 1 ) then
|
if( nsuccess .eq. 1 ) then
|
||||||
tdec=tsec+tdec
|
tdec=tsec+tdec
|
||||||
decsym=' & '
|
decsym=' & '
|
||||||
goto 999
|
goto 900
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
@ -122,7 +121,7 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
if(ndecodesuccess .gt. 0) then
|
if(ndecodesuccess .gt. 0) then
|
||||||
tdec=tsec+xmc(iavg)*tframe
|
tdec=tsec+xmc(iavg)*tframe
|
||||||
decsym=' ^ '
|
decsym=' ^ '
|
||||||
goto 999
|
goto 900
|
||||||
endif
|
endif
|
||||||
enddo !Slicer dither
|
enddo !Slicer dither
|
||||||
enddo !Peak loop
|
enddo !Peak loop
|
||||||
@ -138,11 +137,9 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
elseif( pavg .lt. pnoise ) then ! and quick to fall
|
elseif( pavg .lt. pnoise ) then ! and quick to fall
|
||||||
pnoise=pavg
|
pnoise=pavg
|
||||||
endif
|
endif
|
||||||
|
go to 999
|
||||||
|
|
||||||
return
|
900 continue
|
||||||
|
|
||||||
999 continue
|
|
||||||
|
|
||||||
! successful decode - estimate snr !!! noise estimate needs work
|
! successful decode - estimate snr !!! noise estimate needs work
|
||||||
if( pnoise .gt. 0.0 ) then
|
if( pnoise .gt. 0.0 ) then
|
||||||
snr0=10.0*log10(pmax/pnoise-1.0)
|
snr0=10.0*log10(pmax/pnoise-1.0)
|
||||||
@ -152,14 +149,17 @@ subroutine mskrtd(id2,nutc0,tsec,ntol,nrxfreq,ndepth,line)
|
|||||||
nsnr=nint(snr0)
|
nsnr=nint(snr0)
|
||||||
|
|
||||||
!!!! Temporary - dupe check. Only print if new message, or higher snr.
|
!!!! Temporary - dupe check. Only print if new message, or higher snr.
|
||||||
if( msgreceived .eq. msglast .and. nsnr .le. nsnrlast ) return
|
if(msgreceived.ne.msglast .or. nsnr.gt.nsnrlast .or. tsec.lt.tsec0) then
|
||||||
|
|
||||||
msglast=msgreceived
|
msglast=msgreceived
|
||||||
nsnrlast=nsnr
|
nsnrlast=nsnr
|
||||||
if( nsnr .lt. -8 ) nsnr=-8
|
if( nsnr .lt. -8 ) nsnr=-8
|
||||||
if( nsnr .gt. 24 ) nsnr=24
|
if( nsnr .gt. 24 ) nsnr=24
|
||||||
write(line,1020) nutc0,nsnr,tdec,nint(fest),decsym,msgreceived,char(0)
|
write(line,1020) nutc0,nsnr,tdec,nint(fest),decsym,msgreceived,char(0)
|
||||||
1020 format(i6.6,i4,f5.1,i5,a3,a22,a1)
|
1020 format(i6.6,i4,f5.1,i5,a3,a22,a1)
|
||||||
|
endif
|
||||||
|
|
||||||
|
999 tsec0=tsec
|
||||||
|
|
||||||
return
|
return
|
||||||
end subroutine mskrtd
|
end subroutine mskrtd
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user