mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2026-06-04 15:04:56 -04:00
1. Add AGC for waterfall in *Ref Spec* mode.
2. Don't display orange warning bar when in WSPR mode. 3. Fix a longstanding compiler warning. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6616 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
+27
-25
@@ -17,35 +17,37 @@ subroutine flat4(s,npts0,nflatten)
|
||||
do i=1,npts
|
||||
s(i)=10.0*log10(s(i)) !Convert to dB scale
|
||||
enddo
|
||||
if(nflatten.eq.0) go to 900
|
||||
|
||||
nlen=npts/nseg !Length of test segment
|
||||
i0=npts/2 !Midpoint
|
||||
k=0
|
||||
do n=1,nseg !Skip first segment, likely rolloff here
|
||||
ib=n*nlen
|
||||
ia=ib-nlen+1
|
||||
if(n.eq.nseg) ib=npts
|
||||
call pctile(s(ia),ib-ia+1,npct,base) !Find lowest npct of points in segment
|
||||
do i=ia,ib
|
||||
if(s(i).le.base) then
|
||||
if (k.lt.1000) k=k+1 !Save these "lower envelope" points
|
||||
x(k)=i-i0
|
||||
y(k)=s(i)
|
||||
endif
|
||||
if(nflatten.gt.0) then
|
||||
nterms=5
|
||||
if(nflatten.eq.2) nterms=1
|
||||
nlen=npts/nseg !Length of test segment
|
||||
i0=npts/2 !Midpoint
|
||||
k=0
|
||||
do n=1,nseg !Skip first segment, likely rolloff here
|
||||
ib=n*nlen
|
||||
ia=ib-nlen+1
|
||||
if(n.eq.nseg) ib=npts
|
||||
call pctile(s(ia),ib-ia+1,npct,base) !Find lowest npct of points
|
||||
do i=ia,ib
|
||||
if(s(i).le.base) then
|
||||
if (k.lt.1000) k=k+1 !Save these "lower envelope" points
|
||||
x(k)=i-i0
|
||||
y(k)=s(i)
|
||||
endif
|
||||
enddo
|
||||
enddo
|
||||
enddo
|
||||
kz=k
|
||||
a=0.
|
||||
nterms=5
|
||||
kz=k
|
||||
a=0.
|
||||
|
||||
call polyfit(x,y,y,kz,nterms,0,a,chisqr) !Fit a low-order polynomial
|
||||
call polyfit(x,y,y,kz,nterms,0,a,chisqr) !Fit a low-order polynomial
|
||||
|
||||
do i=1,npts
|
||||
t=i-i0
|
||||
yfit=a(1)+t*(a(2)+t*(a(3)+t*(a(4)+t*(a(5)))))
|
||||
s(i)=s(i)-yfit !Subtract the fitted baseline
|
||||
enddo
|
||||
do i=1,npts
|
||||
t=i-i0
|
||||
yfit=a(1)+t*(a(2)+t*(a(3)+t*(a(4)+t*(a(5)))))
|
||||
s(i)=s(i)-yfit !Subtract the fitted baseline
|
||||
enddo
|
||||
endif
|
||||
|
||||
900 return
|
||||
end subroutine flat4
|
||||
|
||||
Reference in New Issue
Block a user