WSJT-X/libm65/hipass.f90
Joe Taylor c6544d05c3 Are these properly registered, finally?
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2528 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2012-07-19 12:16:29 +00:00

24 lines
538 B
Fortran

subroutine hipass(y,npts,nwidth)
! Hipass filter for time-domain data. Removes an RC-type running
! mean (time constant nwidth) from array y(1:npts).
real y(npts)
c1=1.0/nwidth
c2=1.0-c1
s=0.
do i=1,nwidth !Get initial average
s=s+y(i)
enddo
ave=c1*s
do i=1,npts !Do the filtering
y0=y(i)
y(i)=y0-ave !Remove the mean
ave=c1*y0 + c2*ave !Update the mean
enddo
return
end subroutine hipass