diff options
| author | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
|---|---|---|
| committer | hibby <d@vehibberd.com> | 2026-10-06 21:24:40 +0100 |
| commit | c25cbdf6fb6d946175f4335fab77bfea601b56db (patch) | |
| tree | 6f7a94b7b81f999e434f61b73d47e337dfd26bf2 /lib/superfox/qpc_sync.f90 | |
| parent | 71f5689252c9f13e70e1c24856904475b2307809 (diff) | |
| parent | 0685fcada9f95fe90f70b387cd7d757da8209624 (diff) | |
Merge tag 'debian/3.2.0_rc1+dfsg-2' into debian/trixie-backportsdebian/trixie-backports
tagging wsjtx 3.2.0~rc1+dfsg-2
Diffstat (limited to 'lib/superfox/qpc_sync.f90')
| -rw-r--r-- | lib/superfox/qpc_sync.f90 | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/lib/superfox/qpc_sync.f90 b/lib/superfox/qpc_sync.f90 index ea9afb5b..9c80b390 100644 --- a/lib/superfox/qpc_sync.f90 +++ b/lib/superfox/qpc_sync.f90 @@ -46,6 +46,12 @@ subroutine qpc_sync(crcvd0,fsample,isync,fsync,ftol,f2,t2,snrsync) s0=s0+s(i) s1=s1+(i-i0)*s(i) enddo + if(.not. (s0 .gt. 0.0)) then + f2=fsync-750.0 + t2=0.0 + snrsync=0.0 + return + endif delta=s1/s0 i0=nint(i0+delta) f2=i0*df2-750.0 @@ -105,9 +111,22 @@ subroutine qpc_sync(crcvd0,fsample,isync,fsync,ftol,f2,t2,snrsync) sp=sp + p(lag) sq=sq + p(lag)*p(lag) enddo + if(nsum .le. 0) then + snrsync=0.0 + return + endif ave=sp/nsum - rms=sqrt(sq/nsum-ave*ave) - snrsync=(pmax-ave)/rms + var=sq/nsum-ave*ave + if(.not. (var .gt. 0.0)) then + snrsync=0.0 + return + endif + rms=sqrt(var) + if(rms .gt. 0.0) then + snrsync=(pmax-ave)/rms + else + snrsync=0.0 + endif return end subroutine qpc_sync |
