mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-18 01:52:05 -05:00
0037e7ad05
JT6M modes avesp2: ditto. In addition, dependence of Zap behavior on decoding history has been removed. wsjt.py: corrected default setting of PTTPort under Win32. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@229 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
53 lines
1.4 KiB
Fortran
53 lines
1.4 KiB
Fortran
subroutine avesp2(dat,jza,nadd,f0,mode,NFreeze,MouseDF,
|
|
+ DFTolerance,fzap)
|
|
|
|
real dat(jza)
|
|
integer DFTolerance
|
|
real psa(1024) !Ave ps, flattened and rolled off
|
|
real ref(557) !Ref spectrum, lines excised
|
|
real birdie(557) !Birdie spectrum (ave-ref)
|
|
real variance(557)
|
|
real s2(557,323)
|
|
real fzap(200)
|
|
|
|
iz=557 !Compute the 2d spectrum
|
|
df=11025.0/2048.0
|
|
nfft=nadd*1024
|
|
jz=jza/nfft
|
|
do j=1,jz
|
|
k=(j-1)*nfft + 1
|
|
call ps(dat(k),nfft,psa)
|
|
call move(psa,s2(1,j),iz)
|
|
enddo
|
|
|
|
C Flatten s2 and get psa, ref, and birdie
|
|
call flatten(s2,557,jz,psa,ref,birdie,variance)
|
|
|
|
call zero(fzap,200)
|
|
ia=300/df
|
|
ib=2700/df
|
|
n=0
|
|
fmouse=0.
|
|
if(mode.eq.2) fmouse=1270.46+MouseDF
|
|
if(mode.eq.4) fmouse=1076.66+MouseDF
|
|
|
|
do i=ia,ib
|
|
if(birdie(i)-ref(i).gt.3.0) then
|
|
f=i*df
|
|
|
|
C Don't zap unless Freeze is OFF or birdie is outside the "Tol" range.
|
|
if(NFreeze.eq.0 .or.
|
|
+ abs(f-fmouse).gt.float(DFTolerance)) then
|
|
if(n.lt.200 .and. variance(i-1).lt.2.5 .and.
|
|
+ variance(i).lt.2.5.and.variance(i+1).lt.2.5) then
|
|
n=n+1
|
|
fzap(n)=f
|
|
endif
|
|
endif
|
|
|
|
endif
|
|
enddo
|
|
|
|
return
|
|
end
|