2015-11-17 20:28:12 -05:00
|
|
|
subroutine analytic(d,npts,nfft,c)
|
2012-07-10 09:44:17 -04:00
|
|
|
|
|
|
|
! Convert real data to analytic signal
|
|
|
|
|
2015-11-17 20:28:12 -05:00
|
|
|
parameter (NFFTMAX=1024*1024)
|
2012-07-10 09:44:17 -04:00
|
|
|
real d(npts)
|
2015-11-17 20:28:12 -05:00
|
|
|
real h(NFFTMAX/2)
|
2012-07-17 15:31:01 -04:00
|
|
|
complex c(NFFTMAX)
|
2015-11-17 20:28:12 -05:00
|
|
|
data nfft0/0/
|
|
|
|
save nfft0,h
|
2012-07-10 09:44:17 -04:00
|
|
|
|
2015-11-17 20:28:12 -05:00
|
|
|
df=12000.0/nfft
|
2012-07-10 09:44:17 -04:00
|
|
|
nh=nfft/2
|
2015-11-17 20:28:12 -05:00
|
|
|
if(nfft.ne.nfft0) then
|
|
|
|
t=1.0/2000.0
|
2016-06-21 22:29:37 -04:00
|
|
|
beta=0.1
|
2015-11-17 20:28:12 -05:00
|
|
|
pi=4.0*atan(1.0)
|
|
|
|
do i=1,nh+1
|
|
|
|
ff=(i-1)*df
|
|
|
|
f=ff-1500.0
|
|
|
|
h(i)=0.
|
|
|
|
if(abs(f).le.(1-beta)/(2*t)) h(i)=1.0
|
|
|
|
if(abs(f).gt.(1-beta)/(2*t) .and. abs(f).le.(1+beta)/(2*t)) then
|
|
|
|
h(i)=0.5*(1+cos((pi*t/beta )*(abs(f)-(1-beta)/(2*t))))
|
|
|
|
endif
|
2016-06-21 22:29:37 -04:00
|
|
|
! h(i)=sqrt(h(i))
|
2015-11-17 20:28:12 -05:00
|
|
|
enddo
|
|
|
|
nfft0=nfft
|
|
|
|
endif
|
|
|
|
|
2012-07-10 09:44:17 -04:00
|
|
|
fac=2.0/nfft
|
|
|
|
c(1:npts)=fac*d(1:npts)
|
|
|
|
c(npts+1:nfft)=0.
|
|
|
|
call four2a(c,nfft,1,-1,1) !Forward c2c FFT
|
|
|
|
|
2015-11-17 20:28:12 -05:00
|
|
|
! do i=1,nh
|
|
|
|
! f=(i-1)*df
|
|
|
|
! s(i)=real(c(i))**2 + aimag(c(i))**2
|
|
|
|
! write(12,3001) f,s(i),db(s(i))
|
|
|
|
!3001 format(3f12.3)
|
|
|
|
! enddo
|
|
|
|
|
|
|
|
! ia=700.0/df
|
|
|
|
! c(1:ia)=0.
|
|
|
|
! ib=2300.0/df
|
|
|
|
! c(ib:nfft)=0.
|
2012-07-10 09:44:17 -04:00
|
|
|
|
2015-11-17 20:28:12 -05:00
|
|
|
c(1:nh+1)=h(1:nh+1)*c(1:nh+1)
|
|
|
|
c(1)=0.5*c(1) !Half of DC term
|
|
|
|
c(nh+2:nfft)=0. !Zero the negative frequencies
|
2012-07-10 09:44:17 -04:00
|
|
|
call four2a(c,nfft,1,1,1) !Inverse c2c FFT
|
|
|
|
|
|
|
|
return
|
|
|
|
end subroutine analytic
|