2017-01-25 14:43:01 -05:00
|
|
|
subroutine qra64b(nutc,nqd,fcenter,nfcal,nfsample,ikhz,mousedf,ntol,xpol, &
|
2017-01-21 14:13:49 -05:00
|
|
|
mycall_12,hiscall_12,hisgrid_6,mode64,nwrite_qra64)
|
2017-01-11 15:56:44 -05:00
|
|
|
|
2017-01-25 14:43:01 -05:00
|
|
|
parameter (MAXFFT1=5376000) !56*96000
|
|
|
|
parameter (MAXFFT2=336000) !56*6000 (downsampled by 1/16)
|
|
|
|
complex ca(MAXFFT1),cb(MAXFFT1) !FFTs of raw x,y data
|
|
|
|
complex cx(0:MAXFFT2-1),cy(0:MAXFFT2-1)
|
2017-01-13 10:12:27 -05:00
|
|
|
logical xpol
|
2017-01-21 14:13:49 -05:00
|
|
|
real*8 fcenter
|
2017-01-13 10:12:27 -05:00
|
|
|
character*12 mycall_12,hiscall_12
|
|
|
|
character*6 hisgrid_6
|
2017-01-11 15:56:44 -05:00
|
|
|
common/cacb/ca,cb
|
2017-01-16 12:25:50 -05:00
|
|
|
data nzap/3/
|
2017-01-13 16:42:32 -05:00
|
|
|
|
|
|
|
open(17,file='red.dat',status='unknown')
|
2017-01-25 14:43:01 -05:00
|
|
|
|
2017-10-23 13:29:03 -04:00
|
|
|
nfft1=MAXFFT1
|
|
|
|
nfft2=MAXFFT2
|
2017-01-11 15:56:44 -05:00
|
|
|
df=96000.0/NFFT1
|
2017-01-25 14:43:01 -05:00
|
|
|
if(nfsample.eq.95238) then
|
|
|
|
nfft1=5120000
|
|
|
|
nfft2=322560
|
|
|
|
df=96000.0/nfft1
|
|
|
|
endif
|
|
|
|
nh=nfft2/2
|
2017-01-21 14:13:49 -05:00
|
|
|
ikhz0=nint(1000.0*(fcenter-int(fcenter)))
|
|
|
|
k0=((ikhz-ikhz0+48.0+1.27)*1000.0+nfcal)/df
|
2017-01-25 14:43:01 -05:00
|
|
|
if(k0.lt.nh .or. k0.gt.nfft1-nh) go to 900
|
2017-10-23 13:29:03 -04:00
|
|
|
|
2017-01-25 14:43:01 -05:00
|
|
|
fac=1.0/nfft2
|
2017-01-11 15:56:44 -05:00
|
|
|
cx(0:nh)=ca(k0:k0+nh)
|
2017-01-25 14:43:01 -05:00
|
|
|
cx(nh+1:nfft2-1)=ca(k0-nh+1:k0-1)
|
2017-01-11 15:56:44 -05:00
|
|
|
cx=fac*cx
|
2017-01-25 14:43:01 -05:00
|
|
|
if(xpol) then
|
|
|
|
cy(0:nh)=cb(k0:k0+nh)
|
|
|
|
cy(nh+1:nfft2-1)=cb(k0-nh+1:k0-1)
|
|
|
|
cy=fac*cy
|
|
|
|
endif
|
|
|
|
|
|
|
|
! Here cx and cy (if xpol) are frequency-domain data around the selected
|
|
|
|
! QSO frequency, taken from the full-length FFT computed in filbig().
|
|
|
|
! Values for fsample, nfft1, nfft2, df, and the downsampled data rate
|
|
|
|
! are as follows:
|
|
|
|
|
|
|
|
! fSample nfft1 df nfft2 fDownSampled
|
|
|
|
! (Hz) (Hz) (Hz)
|
|
|
|
!----------------------------------------------------
|
|
|
|
! 96000 5376000 0.017857143 336000 6000.000
|
|
|
|
! 95238 5120000 0.018601172 322560 5999.994
|
2017-01-11 15:56:44 -05:00
|
|
|
|
2017-01-21 14:13:49 -05:00
|
|
|
! write(60) cx,cy,nutc,nqd,ikhz,mousedf,ntol,xpol,mycall_12, &
|
2017-01-18 14:30:46 -05:00
|
|
|
! hiscall_12,hisgrid_6
|
|
|
|
|
2017-01-21 14:13:49 -05:00
|
|
|
if(nzap.gt.0) call qra64zap(cx,cy,xpol,nzap)
|
2017-01-16 12:25:50 -05:00
|
|
|
|
2017-01-11 15:56:44 -05:00
|
|
|
! Transform back to time domain with sample rate 6000 Hz.
|
2017-01-25 14:43:01 -05:00
|
|
|
call four2a(cx,nfft2,1,-1,1)
|
|
|
|
call four2a(cy,nfft2,1,-1,1)
|
2017-01-11 15:56:44 -05:00
|
|
|
|
2017-01-21 14:13:49 -05:00
|
|
|
call qra64c(cx,cy,nutc,nqd,ikhz,mousedf,ntol,xpol,mycall_12, &
|
2017-01-19 10:45:30 -05:00
|
|
|
hiscall_12,hisgrid_6,mode64,nwrite_qra64)
|
2017-01-13 16:42:32 -05:00
|
|
|
close(17)
|
|
|
|
|
2017-01-20 13:50:13 -05:00
|
|
|
900 return
|
2017-01-11 15:56:44 -05:00
|
|
|
end subroutine qra64b
|