mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-16 17:11:53 -05:00
e25dd201a3
1. Change to rectangular FFT window for 2D sync spectrum (ss). 2. Move 2D sync spectrum array to common block. 3. Change to quarter-symbol steps for the ss array. 4. Allow up to 4 decoding passes. 5. Wire up Fast/Normal/Deep for 2, 3, or 4 decoding passes. 6. Make minsmo=0 (instead of 1) for minimally spread JT65B/C signals. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@8178 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
41 lines
731 B
Fortran
41 lines
731 B
Fortran
subroutine slope(y,npts,xpk)
|
|
|
|
! Remove best-fit slope from data in y(i). When fitting the straight line,
|
|
! ignore the peak around xpk +/- 2 bins
|
|
|
|
real y(npts)
|
|
|
|
sumw=0.
|
|
sumx=0.
|
|
sumy=0.
|
|
sumx2=0.
|
|
sumxy=0.
|
|
sumy2=0.
|
|
do i=1,npts
|
|
if(abs(i-xpk).gt.4.0) then
|
|
sumw=sumw + 1.0
|
|
x=i
|
|
sumx=sumx + x
|
|
sumy=sumy + y(i)
|
|
sumx2=sumx2 + x*x
|
|
sumxy=sumxy + x*y(i)
|
|
sumy2=sumy2 + y(i)**2
|
|
endif
|
|
enddo
|
|
|
|
delta=sumw*sumx2 - sumx**2
|
|
a=(sumx2*sumy - sumx*sumxy) / delta
|
|
b=(sumw*sumxy - sumx*sumy) / delta
|
|
|
|
sq=0.
|
|
do i=1,npts
|
|
y(i)=y(i)-(a + b*i)
|
|
if(abs(i-xpk).gt.2.0) sq=sq + y(i)**2
|
|
enddo
|
|
rms=sqrt(sq/(sumw-2.0))
|
|
y=y/rms
|
|
|
|
return
|
|
end subroutine slope
|
|
|