mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-10-01 17:46:55 -04:00
Some cleanup of source-code comments.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@2967 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
3fae9c607c
commit
025dd59fff
@ -27,22 +27,17 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
df=0.5*11025.0/nfft
|
df=0.5*11025.0/nfft
|
||||||
psavg(1:nh)=0.
|
psavg(1:nh)=0.
|
||||||
|
|
||||||
! Compute power spectrum for each step and get average
|
do j=1,nsteps !Compute spectrum for each step, get average
|
||||||
do j=1,nsteps
|
|
||||||
k=(j-1)*nq + 1
|
k=(j-1)*nq + 1
|
||||||
! call limit(dat(k),nfft)
|
|
||||||
call ps24(dat(k),nfft,s2(1,j))
|
call ps24(dat(k),nfft,s2(1,j))
|
||||||
! if(mode65.eq.4) call smooth(s2(1,j),nh)
|
|
||||||
psavg(1:nh)=psavg(1:nh) + s2(1:nh,j)
|
psavg(1:nh)=psavg(1:nh) + s2(1:nh,j)
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call flat1(psavg,s2,nh,nsteps,NHMAX,NSMAX) !Flatten the spectra
|
call flat1(psavg,s2,nh,nsteps,NHMAX,NSMAX) !Flatten spectra
|
||||||
! Find the best frequency channel for CCF
|
|
||||||
! famin= 670.46
|
! Set freq and lag ranges
|
||||||
! fbmax=1870.46
|
|
||||||
famin=200.
|
famin=200.
|
||||||
fbmax=2700.
|
fbmax=2700.
|
||||||
|
|
||||||
fa=famin
|
fa=famin
|
||||||
fb=fbmax
|
fb=fbmax
|
||||||
if(NFreeze.eq.1) then
|
if(NFreeze.eq.1) then
|
||||||
@ -63,20 +58,21 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
lag2=59
|
lag2=59
|
||||||
syncbest=-1.e30
|
syncbest=-1.e30
|
||||||
syncbest2=-1.e30
|
syncbest2=-1.e30
|
||||||
|
|
||||||
ccfred=0.
|
ccfred=0.
|
||||||
do i=ia,ib
|
|
||||||
|
do i=ia,ib !Find best frequency channel for CCF
|
||||||
|
|
||||||
call xcor24(s2,i,nsteps,nsym,lag1,lag2,mode4,ccfblue,ccf0,lagpk0,flip)
|
call xcor24(s2,i,nsteps,nsym,lag1,lag2,mode4,ccfblue,ccf0,lagpk0,flip)
|
||||||
j=i-i0
|
j=i-i0
|
||||||
if(mode.eq.7) j=j + 3*mode4
|
if(mode.eq.7) j=j + 3*mode4
|
||||||
if(j.ge.-372 .and. j.le.372) ccfred(j)=ccf0
|
if(j.ge.-372 .and. j.le.372) ccfred(j)=ccf0
|
||||||
|
|
||||||
! Find rms of the CCF, without the main peak
|
! Find rms of the CCF, without main peak
|
||||||
call slope(ccfblue(lag1),lag2-lag1+1,lagpk0-lag1+1.0)
|
call slope(ccfblue(lag1),lag2-lag1+1,lagpk0-lag1+1.0)
|
||||||
sync=abs(ccfblue(lagpk0))
|
sync=abs(ccfblue(lagpk0))
|
||||||
ppmax=psavg(i)-1.0
|
ppmax=psavg(i)-1.0
|
||||||
|
|
||||||
! Find the best sync value
|
! Find best sync value
|
||||||
if(sync.gt.syncbest2) then
|
if(sync.gt.syncbest2) then
|
||||||
ipk2=i
|
ipk2=i
|
||||||
lagpk2=lagpk0
|
lagpk2=lagpk0
|
||||||
@ -100,12 +96,7 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
syncbest=syncbest2
|
syncbest=syncbest2
|
||||||
endif
|
endif
|
||||||
|
|
||||||
! Peak up in frequency to fraction of channel
|
dfx=(ipk-i0)*df
|
||||||
! call peakup(psavg(ipk-1),psavg(ipk),psavg(ipk+1),dx)
|
|
||||||
! if(dx.lt.-1.0) dx=-1.0
|
|
||||||
! if(dx.gt.1.0) dx=1.0
|
|
||||||
dx=0.
|
|
||||||
dfx=(ipk+dx-i0)*df
|
|
||||||
if(mode.eq.7) dfx=dfx + 3*mode4*df
|
if(mode.eq.7) dfx=dfx + 3*mode4*df
|
||||||
|
|
||||||
! Peak up in time, at best whole-channel frequency
|
! Peak up in time, at best whole-channel frequency
|
||||||
@ -127,14 +118,13 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
rms=sqrt(sq/nsq)
|
rms=sqrt(sq/nsq)
|
||||||
snrsync=abs(ccfblue(lagpk))/rms - 1.1 !Empirical
|
snrsync=abs(ccfblue(lagpk))/rms - 1.1 !Empirical
|
||||||
|
|
||||||
dt=2.0/11025.0
|
dt=2.0/11025.0
|
||||||
istart=xlag*nq
|
istart=xlag*nq
|
||||||
dtx=istart*dt
|
dtx=istart*dt
|
||||||
snrx=-99.0
|
snrx=-99.0
|
||||||
! ppmax=psavg(ipk)-1.0
|
ppmax=psavg(ipk)-1.0
|
||||||
if(ipk.ge.1 .and. ipk.le.1260) ppmax=psavg(ipk)-1.0 !###
|
|
||||||
|
|
||||||
if(ppmax.gt.0.0001) then
|
if(ppmax.gt.0.0001) then
|
||||||
snrx=db(ppmax*df/2500.0) + 7.5 !Empirical
|
snrx=db(ppmax*df/2500.0) + 7.5 !Empirical
|
||||||
@ -143,12 +133,8 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
if(snrx.lt.-33.0) snrx=-33.0
|
if(snrx.lt.-33.0) snrx=-33.0
|
||||||
|
|
||||||
! Compute width of sync tone to outermost -3 dB points
|
! Compute width of sync tone to outermost -3 dB points
|
||||||
! call pctile(ccfred(ia-i0),tmp,ib-ia+1,45,base)
|
|
||||||
! i1=max(-224,ia-i0)
|
|
||||||
! i2=min(224,ib-i0)
|
|
||||||
i1=max(-450,ia-i0)
|
i1=max(-450,ia-i0)
|
||||||
i2=min(450,ib-i0)
|
i2=min(450,ib-i0)
|
||||||
!### call pctile(ccfred(i1),tmp,i2-i1+1,45,base)
|
|
||||||
call pctile(ccfred(i1),i2-i1+1,45,base)
|
call pctile(ccfred(i1),i2-i1+1,45,base)
|
||||||
|
|
||||||
jpk=ipk-i0
|
jpk=ipk-i0
|
||||||
@ -169,7 +155,6 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
if(abs(jpk+i-1).gt.450 .or. abs(jpk+i).gt.450) then
|
if(abs(jpk+i-1).gt.450 .or. abs(jpk+i).gt.450) then
|
||||||
print*,'sync24 b:',jpk,i
|
print*,'sync24 b:',jpk,i
|
||||||
else
|
else
|
||||||
! x1=i-1+(stest-ccfred(jpk+i-1))/(ccfred(jpk+i)-ccfred(jpk+i-1))
|
|
||||||
x1=i-0.5
|
x1=i-0.5
|
||||||
endif
|
endif
|
||||||
|
|
||||||
@ -179,7 +164,6 @@ subroutine sync24(dat,jz,DFTolerance,NFreeze,MouseDF,mode,mode4, &
|
|||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
i=0
|
i=0
|
||||||
! 32 x2=i+1-(stest-ccfred(jpk+i+1))/(ccfred(jpk+i)-ccfred(jpk+i+1))
|
|
||||||
32 x2=i+0.5
|
32 x2=i+0.5
|
||||||
width=x2-x1
|
width=x2-x1
|
||||||
if(width.gt.1.2) width=sqrt(width**2 - 1.44)
|
if(width.gt.1.2) width=sqrt(width**2 - 1.44)
|
||||||
|
@ -27,6 +27,7 @@ program wsjt24d
|
|||||||
! write(*,3000) ifile,cfile6,jz,mode,mode4,idf
|
! write(*,3000) ifile,cfile6,jz,mode,mode4,idf
|
||||||
!3000 format(i3,2x,a6,i10,3i5)
|
!3000 format(i3,2x,a6,i10,3i5)
|
||||||
|
|
||||||
|
! call wsjt24(dat(4097),jz-4096,cfile6,NClearAve,MinSigdB,DFTolerance, &
|
||||||
call wsjt24(dat,jz,cfile6,NClearAve,MinSigdB,DFTolerance, &
|
call wsjt24(dat,jz,cfile6,NClearAve,MinSigdB,DFTolerance, &
|
||||||
NFreeze,mode,mode4,Nseg,MouseDF2,NAgain,idf,lumsg,lcum,nspecial, &
|
NFreeze,mode,mode4,Nseg,MouseDF2,NAgain,idf,lumsg,lcum,nspecial, &
|
||||||
ndf,NSyncOK,ccfblue,ccfred,ndiag)
|
ndf,NSyncOK,ccfblue,ccfred,ndiag)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
//---------------------------------------------------------------- MainWindow
|
//--------------------------------------------------------------- MainWindow
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
#include "ui_mainwindow.h"
|
#include "ui_mainwindow.h"
|
||||||
#include "devsetup.h"
|
#include "devsetup.h"
|
||||||
|
Loading…
Reference in New Issue
Block a user