mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-29 23:58:39 -05:00
21 lines
303 B
Fortran
21 lines
303 B
Fortran
|
subroutine averms(x,n,nskip,ave,rms)
|
||
|
real x(n)
|
||
|
integer ipk(1)
|
||
|
|
||
|
ns=0
|
||
|
s=0.
|
||
|
sq=0.
|
||
|
ipk=maxloc(x)
|
||
|
do i=1,n
|
||
|
if(abs(i-ipk(1)).gt.nskip) then
|
||
|
s=s + x(i)
|
||
|
sq=sq + x(i)**2
|
||
|
ns=ns+1
|
||
|
endif
|
||
|
enddo
|
||
|
ave=s/ns
|
||
|
rms=sqrt(sq/ns - ave*ave)
|
||
|
|
||
|
return
|
||
|
end subroutine averms
|