mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-29 12:52:28 -04:00
Better orange sync curve. Clear message averaging after a successful decode.
This commit is contained in:
parent
f82356e199
commit
4fb90e336e
@ -183,8 +183,8 @@ contains
|
|||||||
1000 format(12b6.6,b5.5)
|
1000 format(12b6.6,b5.5)
|
||||||
call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent
|
call unpack77(c77,0,decoded,unpk77_success) !Unpack to get msgsent
|
||||||
nsnr=nint(snr2)
|
nsnr=nint(snr2)
|
||||||
call this%callback(nutc,sync,nsnr,xdt1,f1,decoded, &
|
call this%callback(nutc,sync,nsnr,xdt1,f1,decoded,idec,ntrperiod)
|
||||||
idec,ntrperiod)
|
call q65_clravg
|
||||||
else
|
else
|
||||||
! Report sync, even if no decode.
|
! Report sync, even if no decode.
|
||||||
nsnr=db(snr1) - 35.0
|
nsnr=db(snr1) - 35.0
|
||||||
|
@ -70,7 +70,6 @@ subroutine q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3)
|
|||||||
entry q65_avg2(ntrperiod,ntol,baud,nsubmode,nQSOprogress,lapcqonly, &
|
entry q65_avg2(ntrperiod,ntol,baud,nsubmode,nQSOprogress,lapcqonly, &
|
||||||
ibwa,ibwb,codewords,ncw,xdt,f0,snr1,snr2,dat4,idec)
|
ibwa,ibwb,codewords,ncw,xdt,f0,snr1,snr2,dat4,idec)
|
||||||
|
|
||||||
if(nsave.lt.2) go to 900
|
|
||||||
mode_q65=2**nsubmode
|
mode_q65=2**nsubmode
|
||||||
f0diff=baud*mode_q65
|
f0diff=baud*mode_q65
|
||||||
ibwa=1.8*log(baud*mode_q65) + 2
|
ibwa=1.8*log(baud*mode_q65) + 2
|
||||||
@ -117,7 +116,7 @@ subroutine q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3)
|
|||||||
xdtsave(i),f0save(i)
|
xdtsave(i),f0save(i)
|
||||||
1001 format(a1,i5.4,f6.1,f6.2,f7.1)
|
1001 format(a1,i5.4,f6.1,f6.2,f7.1)
|
||||||
enddo
|
enddo
|
||||||
if(navg.lt.2) go to 900
|
if(navg.lt.2) go to 100
|
||||||
|
|
||||||
s3avg=s3avg/navg
|
s3avg=s3avg/navg
|
||||||
nFadingModel=1
|
nFadingModel=1
|
||||||
@ -131,7 +130,7 @@ subroutine q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3)
|
|||||||
snr2=esnodb - 0.5*db(2500.0/baud) + 3.0 !Empirical adjustment
|
snr2=esnodb - 0.5*db(2500.0/baud) + 3.0 !Empirical adjustment
|
||||||
snr2=snr2 - db(float(navg)) !Is this right?
|
snr2=snr2 - db(float(navg)) !Is this right?
|
||||||
idec=100+navg
|
idec=100+navg
|
||||||
go to 900
|
go to 100
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
@ -176,11 +175,24 @@ subroutine q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3)
|
|||||||
snr2=esnodb - db(2500.0/baud) + 3.0 !Empirical adjustment
|
snr2=esnodb - db(2500.0/baud) + 3.0 !Empirical adjustment
|
||||||
snr2=snr2 - 0.5*db(float(navg)) !Is this right?
|
snr2=snr2 - 0.5*db(float(navg)) !Is this right?
|
||||||
idec=100*(iaptype+2) + navg
|
idec=100*(iaptype+2) + navg
|
||||||
! print*,'D dec2 ',ibw,dec,snr2,avemsg
|
go to 100
|
||||||
go to 900
|
|
||||||
endif
|
endif
|
||||||
enddo ! ibw
|
enddo ! ibw
|
||||||
enddo ! ipass
|
enddo ! ipass
|
||||||
|
|
||||||
900 return
|
100 return
|
||||||
|
|
||||||
|
entry q65_clravg
|
||||||
|
|
||||||
|
iutc=-1
|
||||||
|
iseq=-1
|
||||||
|
snr1save=0.
|
||||||
|
xdtsave=0.
|
||||||
|
f0save=0.0
|
||||||
|
nsave=0
|
||||||
|
if(allocated(s3save)) s3save=0.
|
||||||
|
if(allocated(s3avg)) s3avg=0.
|
||||||
|
|
||||||
|
return
|
||||||
|
|
||||||
end subroutine q65_avg
|
end subroutine q65_avg
|
||||||
|
@ -158,10 +158,6 @@ subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, &
|
|||||||
endif
|
endif
|
||||||
enddo ! imsg
|
enddo ! imsg
|
||||||
|
|
||||||
do i=-ia2,ia2
|
|
||||||
ccf2(i)=maxval(ccf(i,:))
|
|
||||||
enddo
|
|
||||||
|
|
||||||
i1=i0+ipk-64
|
i1=i0+ipk-64
|
||||||
i2=i1+LL-1
|
i2=i1+LL-1
|
||||||
j=j0+jpk-7
|
j=j0+jpk-7
|
||||||
@ -207,15 +203,15 @@ subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, &
|
|||||||
ccf2=ccf2-base
|
ccf2=ccf2-base
|
||||||
smax=maxval(ccf2)
|
smax=maxval(ccf2)
|
||||||
if(smax.gt.10.0) ccf2=10.0*ccf2/smax
|
if(smax.gt.10.0) ccf2=10.0*ccf2/smax
|
||||||
go to 200
|
go to 100
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
!######################################################################
|
|
||||||
! Establish xdt, f0, and snr1 using sync symbols (and perhaps some AP symbols)
|
|
||||||
100 ccf=0.
|
|
||||||
irc=-2
|
irc=-2
|
||||||
dat4=0
|
dat4=0
|
||||||
|
|
||||||
|
!######################################################################
|
||||||
|
! Compute the 2D CCF using sync symbols only
|
||||||
|
100 ccf=0.
|
||||||
do lag=lag1,lag2
|
do lag=lag1,lag2
|
||||||
do k=1,85
|
do k=1,85
|
||||||
n=NSTEP*(k-1) + 1
|
n=NSTEP*(k-1) + 1
|
||||||
@ -228,11 +224,10 @@ subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, &
|
|||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
ijpk=maxloc(ccf(-ia:ia,:))
|
ijpk=maxloc(ccf(-ia:ia,:))
|
||||||
ipk=ijpk(1)-ia-1
|
ipk=ijpk(1)-ia-1
|
||||||
jpk=ijpk(2)-53-1
|
jpk=ijpk(2)-53-1
|
||||||
f0=nfqso + ipk*df
|
|
||||||
xdt=jpk*dtstep
|
|
||||||
|
|
||||||
do i=-ia2,ia2
|
do i=-ia2,ia2
|
||||||
ccf2(i)=maxval(ccf(i,:))
|
ccf2(i)=maxval(ccf(i,:))
|
||||||
@ -252,46 +247,49 @@ subroutine q65_sync(nutc,iwave,ntrperiod,mode_q65,codewords,ncw,nsps, &
|
|||||||
rms=sqrt(sq/nsq)
|
rms=sqrt(sq/nsq)
|
||||||
smax=ccf(ipk,jpk)
|
smax=ccf(ipk,jpk)
|
||||||
snr1=smax/rms
|
snr1=smax/rms
|
||||||
ccf1=ccf(:,jpk)/rms
|
|
||||||
if(snr1.gt.10.0) ccf1=(10.0/snr1)*ccf1
|
|
||||||
ccf2=ccf2/rms
|
ccf2=ccf2/rms
|
||||||
if(snr1.gt.10.0) ccf2=(10.0/snr1)*ccf2
|
if(snr1.gt.10.0) ccf2=(10.0/snr1)*ccf2
|
||||||
|
|
||||||
if(iand(ndepth,16).eq.16) then
|
if(irc.le.0) then
|
||||||
|
f0=nfqso + ipk*df
|
||||||
|
xdt=jpk*dtstep
|
||||||
|
ccf1=ccf(:,jpk)/rms
|
||||||
|
if(snr1.gt.10.0) ccf1=(10.0/snr1)*ccf1
|
||||||
|
if(iand(ndepth,16).eq.16) then
|
||||||
! Fill s3() from s1() here, then call q65_avg().
|
! Fill s3() from s1() here, then call q65_avg().
|
||||||
i1=i0+ipk-64
|
i1=i0+ipk-64
|
||||||
i2=i1+LL-1
|
i2=i1+LL-1
|
||||||
if(snr1.ge.2.8 .and. i1.ge.1 .and. i2.le.iz) then
|
if(snr1.ge.2.8 .and. i1.ge.1 .and. i2.le.iz) then
|
||||||
j=j0+jpk-7
|
j=j0+jpk-7
|
||||||
n=0
|
n=0
|
||||||
do k=1,85
|
do k=1,85
|
||||||
j=j+8
|
j=j+8
|
||||||
if(sync(k).gt.0.0) then
|
if(sync(k).gt.0.0) then
|
||||||
cycle
|
cycle
|
||||||
endif
|
endif
|
||||||
n=n+1
|
n=n+1
|
||||||
if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j)
|
if(j.ge.1 .and. j.le.jz) s3(-64:LL-65,n)=s1(i1:i2,j)
|
||||||
enddo
|
enddo
|
||||||
! write(*,3002) 'B',xdt,f0,sum(s3)
|
call q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3)
|
||||||
!3002 format(a1,f7.2,2f8.1)
|
endif
|
||||||
call q65_avg(nutc,ntrperiod,LL,nfqso,ntol,lclearave,xdt,f0,snr1,s3)
|
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
200 smax=maxval(ccf1)
|
smax=maxval(ccf1)
|
||||||
i1=-9999
|
i1=-9999
|
||||||
i2=-9999
|
i2=-9999
|
||||||
do i=-ia,ia
|
do i=-ia,ia
|
||||||
if(i1.eq.-9999 .and. ccf1(i).ge.0.5*smax) i1=i
|
if(i1.eq.-9999 .and. ccf1(i).ge.0.5*smax) i1=i
|
||||||
if(i2.eq.-9999 .and. ccf1(-i).ge.0.5*smax) i2=-i
|
if(i2.eq.-9999 .and. ccf1(-i).ge.0.5*smax) i2=-i
|
||||||
enddo
|
enddo
|
||||||
|
width=df*(i2-i1)
|
||||||
|
|
||||||
do i=-ia2,ia2
|
do i=-ia2,ia2
|
||||||
freq=nfqso + i*df
|
freq=nfqso + i*df
|
||||||
write(17,1100) freq,ccf1(i),xdt,ccf2(i)
|
write(17,1100) freq,ccf1(i),xdt,ccf2(i)
|
||||||
1100 format(4f10.3)
|
1100 format(4f10.3)
|
||||||
enddo
|
enddo
|
||||||
close(17)
|
close(17)
|
||||||
width=df*(i2-i1)
|
|
||||||
|
|
||||||
900 return
|
900 return
|
||||||
end subroutine q65_sync
|
end subroutine q65_sync
|
||||||
|
Loading…
x
Reference in New Issue
Block a user