mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-18 10:01:57 -05:00
c6544d05c3
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/jtms3@2528 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
24 lines
538 B
Fortran
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
|