diff options
| author | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:23 +0200 |
|---|---|---|
| committer | Christoph Berg <myon@debian.org> | 2025-09-15 23:04:23 +0200 |
| commit | 0a13f1fdb9928b6d012569dd65f7f6ef18fac2f8 (patch) | |
| tree | d702795f99ac38e0cc17e25f0f7e50fa3e05baf9 /lib/sh65snr.f90 | |
| parent | 310d05acf2c9233f7e336ae7dd9ffb7b54ca4e62 (diff) | |
New upstream version 3.0.0~rc1+repackupstream/3.0.0_rc1+repack
Diffstat (limited to 'lib/sh65snr.f90')
| -rwxr-xr-x | lib/sh65snr.f90 | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/lib/sh65snr.f90 b/lib/sh65snr.f90 index 3d449010..bc4cab7d 100755 --- a/lib/sh65snr.f90 +++ b/lib/sh65snr.f90 @@ -1,36 +1,36 @@ -subroutine sh65snr(x,nz,snr) - - real x(nz) - - ipk=0 !Shut up compiler warnings. -db - smax=-1.e30 - do i=1,nz - if(x(i).gt.smax) then - ipk=i - smax=x(i) - endif - s=s+x(i) - enddo - - s=0. - ns=0 - do i=1,nz - if(abs(i-ipk).ge.3) then - s=s+x(i) - ns=ns+1 - endif - enddo - ave=s/ns - - sq=0. - do i=1,nz - if(abs(i-ipk).ge.3) then - sq=sq+(x(i)-ave)**2 - ns=ns+1 - endif - enddo - rms=sqrt(sq/(nz-2)) - snr=(smax-ave)/rms - - return -end subroutine sh65snr +subroutine sh65snr(x,nz,snr)
+
+ real x(nz)
+
+ ipk=0 !Shut up compiler warnings. -db
+ smax=-1.e30
+ do i=1,nz
+ if(x(i).gt.smax) then
+ ipk=i
+ smax=x(i)
+ endif
+ s=s+x(i)
+ enddo
+
+ s=0.
+ ns=0
+ do i=1,nz
+ if(abs(i-ipk).ge.3) then
+ s=s+x(i)
+ ns=ns+1
+ endif
+ enddo
+ ave=s/ns
+
+ sq=0.
+ do i=1,nz
+ if(abs(i-ipk).ge.3) then
+ sq=sq+(x(i)-ave)**2
+ ns=ns+1
+ endif
+ enddo
+ rms=sqrt(sq/(nz-2))
+ snr=(smax-ave)/rms
+
+ return
+end subroutine sh65snr
|
