mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-16 09:01:59 -05:00
fivehz.F90: Added function gran()
wsjt1.F: Option to intentionally degrade SNR for test purposes deep65.F: Tweaked parameters for computing qual git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@200 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
229fbd60fc
commit
d2254f0310
17
deep65.F
17
deep65.F
@ -73,7 +73,8 @@
|
||||
callgrid(icall)=callsign(1:j2)
|
||||
|
||||
mz=1
|
||||
if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1) mz=MAXRPT+1
|
||||
if(n.eq.1 .and. j3.lt.1 .and. j4.lt.1 .and.
|
||||
+ flip.gt.0.0) mz=MAXRPT+1
|
||||
do m=1,mz
|
||||
if(m.gt.1) grid=rpt(m-1)
|
||||
if(j3.lt.1 .and.j4.lt.1)
|
||||
@ -135,25 +136,19 @@ C If sync=OOO, no CQ messages
|
||||
if(pp(ntot-i).ne.pp(ntot)) go to 40
|
||||
enddo
|
||||
40 iref=min(ntot-i,nint(0.68*ntot))
|
||||
pbias=1.04*pp(ntot-i)
|
||||
! pbias=1.40*pp(iref)
|
||||
qual=50.0*(p1-pbias)
|
||||
pbias=1.08*pp(ntot-i)
|
||||
qual=100.0*(p1-pbias)
|
||||
|
||||
! if(mode65.eq.1) qual=100.0*(p1-0.335)
|
||||
! if(mode65.eq.4) qual=100.0*(p1-0.505)
|
||||
decoded=' '
|
||||
c=' '
|
||||
|
||||
if(qual.gt.1.0) then
|
||||
if(qual.lt.4.0) c='?'
|
||||
if(qual.lt.6.0) c='?'
|
||||
decoded=testmsg(ip1)
|
||||
endif
|
||||
decoded(22:22)=c
|
||||
|
||||
! write(71,1010) mycall,qual,nhard1,p1,p1/pp(ntot-i),
|
||||
! + p1/pp(iref),nint(sum1),nint(ref0),nint(ref1),i,decoded
|
||||
! write(*,1010) mycall,qual,nhard1,p1,p1/pp(ntot-i),
|
||||
! + p1/pp(iref),nint(sum1),nint(ref0),nint(ref1),i,decoded
|
||||
! 1010 format(a6,f6.1,i3,f6.3,2f6.2,4i5,1x,a22)
|
||||
if(qual.lt.0.) qual=0.
|
||||
if(qual.gt.10.) qual=10.
|
||||
|
||||
|
17
fivehz.F90
17
fivehz.F90
@ -212,9 +212,9 @@ end subroutine fivehztx
|
||||
|
||||
subroutine addnoise(n)
|
||||
integer*2 n
|
||||
real r(12)
|
||||
real*8 txsnrdb0
|
||||
include 'gcom1.f90'
|
||||
data idum/0/
|
||||
save
|
||||
|
||||
if(txsnrdb.gt.40.0) return
|
||||
@ -224,9 +224,7 @@ subroutine addnoise(n)
|
||||
if(snr.gt.1.0) fac=3000.0/snr
|
||||
txsnrdb0=txsnrdb
|
||||
endif
|
||||
call random_number(r)
|
||||
x=sum(r)-6.0
|
||||
i=fac*(x + n*snr/32768.0)
|
||||
i=fac*(gran(idum) + n*snr/32768.0)
|
||||
if(i>32767) i=32767;
|
||||
if(i<-32767) i=-32767;
|
||||
n=i
|
||||
@ -234,3 +232,14 @@ subroutine addnoise(n)
|
||||
return
|
||||
end subroutine addnoise
|
||||
|
||||
real function gran(idum)
|
||||
real r(12)
|
||||
integer nseed(1)
|
||||
data nseed/714478811/
|
||||
if(idum.lt.0) then
|
||||
call random_seed(PUT=nseed)
|
||||
idum=0
|
||||
endif
|
||||
call random_number(r)
|
||||
gran=sum(r)-6.0
|
||||
end function gran
|
||||
|
2
wsjt.py
2
wsjt.py
@ -1,4 +1,4 @@
|
||||
#------------------------------------------------------------------ WSJT
|
||||
#------------------------------------------------------------------- WSJT
|
||||
from Tkinter import *
|
||||
from tkFileDialog import *
|
||||
import Pmw
|
||||
|
18
wsjt1.F
18
wsjt1.F
@ -90,7 +90,7 @@
|
||||
if(mode.eq.4 .and. jz.gt.330750) jz=330750 !### Fix this!
|
||||
|
||||
sum=0.
|
||||
do j=1,jz !Convert raw data from byte to real, remove DC
|
||||
do j=1,jz !Convert raw data from i*2 to real, remove DC
|
||||
dat(j)=0.1*d(j)
|
||||
sum=sum + dat(j)
|
||||
enddo
|
||||
@ -112,6 +112,21 @@
|
||||
|
||||
endif
|
||||
|
||||
if(ndiag.ne.0 .and. nclip.lt.0) then
|
||||
C Intentionally degrade SNR by -nclip dB.
|
||||
sq=0.
|
||||
do i=1,jz
|
||||
sq=sq + dat(i)**2
|
||||
enddo
|
||||
p0=sq/jz
|
||||
p1=p0*10.0**(-0.1*nclip)
|
||||
dnoise=sqrt(p1-p0)
|
||||
idum=-1
|
||||
do i=1,jz
|
||||
dat(i)=dat(i) + dnoise*gran(idum)
|
||||
enddo
|
||||
endif
|
||||
|
||||
if(mode.ne.2 .and. nzap.ne.0) then
|
||||
if(jz.gt.100000) call avesp2(dat,jz,2,f0a,NFreeze,MouseDF,
|
||||
+ DFTolerance,fzap)
|
||||
@ -306,3 +321,4 @@ C Now the multi-tone decoding
|
||||
|
||||
return
|
||||
end
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user