WSJT-X/lib/baddata.f90
Joe Taylor 1a9c6b3b6f Correct a problem with flagging supposedly bad data when reference spectrum
is used.


git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6624 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-04-18 14:15:09 +00:00

30 lines
481 B
Fortran

logical function baddata(id2,nz)
integer*2 id2(nz)
nadd=1200
j=0
smin=1.e30
smax=-smin
iz=49*12000/nadd
do i=1,iz
sq=0.
do n=1,nadd
j=j+1
x=id2(j)
sq=sq + x*x
enddo
rms=sqrt(sq/nadd)
if(i.gt.6) then
smin=min(smin,rms)
smax=max(smax,rms)
endif
enddo
sratio=smax/(smin+1.e-30)
baddata=.false.
if(sratio.gt.1.e30) baddata=.true.
return
end function baddata