mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-25 21:58:38 -05:00
Protect against possible bounds error in Q65 snr calculation.
This commit is contained in:
parent
0107901be9
commit
d2b4fdad5f
@ -678,8 +678,8 @@ subroutine q65_snr(dat4,dtdec,f0dec,mode_q65,nused,snr2)
|
||||
|
||||
i0=nint(f0dec/df)
|
||||
nsum=max(10*mode_q65,nint(50.0/df))
|
||||
ia=i0 - 2*nsum
|
||||
ib=i0 + 2*nsum
|
||||
ia=max(1,i0-2*nsum)
|
||||
ib=min(iz0,i0+2*nsum)
|
||||
sum1=sum(spec(ia:ia+nsum-1))
|
||||
sum2=sum(spec(ib-nsum+1:ib))
|
||||
avg=(sum1+sum2)/(2.0*nsum)
|
||||
|
Loading…
Reference in New Issue
Block a user