From c849652940b368a3017645693e830737bf4df663 Mon Sep 17 00:00:00 2001 From: Joe Taylor Date: Mon, 18 Apr 2016 14:37:44 +0000 Subject: [PATCH] Correct the alignment of data returned to id2 when reference spectrum is used. git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6625 ab8295b8-cf94-4d9e-aec4-7959e3be5d79 --- lib/refspectrum.f90 | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/lib/refspectrum.f90 b/lib/refspectrum.f90 index 8993acc43..884e64cce 100644 --- a/lib/refspectrum.f90 +++ b/lib/refspectrum.f90 @@ -5,7 +5,7 @@ subroutine refspectrum(id2,brefspec,buseref,fname) ! brefspec logical True when accumulating a reference spectrum parameter (NFFT=6912,NH=NFFT/2) - integer*2 id2(NH) + integer*2 id2(NFFT) logical*1 brefspec,buseref real x0(0:NH-1) !Input samples @@ -39,7 +39,7 @@ subroutine refspectrum(id2,brefspec,buseref,fname) endif if(brefspec) then - x(0:NH-1)=0.001*id2 + x(0:NH-1)=0.001*id2(1:NH) x(NH:NFFT-1)=0.0 call four2a(x,NFFT,1,-1,0) !r2c FFT @@ -120,7 +120,7 @@ subroutine refspectrum(id2,brefspec,buseref,fname) 10 close(16) firstuse=.false. endif - x0=id2 + x0=id2(NH+1:NFFT) x(0:NH-1)=x0s !Previous 2nd half to new 1st half x(NH:NFFT-1)=x0 !New 2nd half x0s=x0 !Save the new 2nd half @@ -129,10 +129,9 @@ subroutine refspectrum(id2,brefspec,buseref,fname) cx=fil*cx call four2a(cx,NFFT,1,1,-1) !c2r FFT (back to time domain) x1=x1s + x(0:NH-1) !Add previous segment's 2nd half - id2=nint(x1) + id2(1:NH)=nint(x1) x1s=x(NH:NFFT-1) !Save the new 2nd half endif - return end subroutine refspectrum