summaryrefslogtreecommitdiff
path: root/lib/jtty/ana64a.f90
blob: fe7c7fb8cca3995c87ace3a5bf78247ec243f11e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
subroutine ana64a(iwave,npts,c0,nfft1)
  implicit none
  integer*2, intent(in)   :: iwave(npts)   !Raw data at 12000 Hz
  integer, intent(in)     :: npts, nfft1   
  integer                 :: nfft2
  real                    :: fac 
  complex, intent(out)    :: c0(0:nfft1-1)

  nfft2=nfft1/2
  fac=2.0/(32767.0*NFFT1)
  c0(0:npts-1)=fac*iwave(1:npts)
  c0(npts:)=0.
  call four2a(c0,NFFT1,1,-1,1)             !Forward c2c FFT
  c0(nfft2/2+1:nfft2-1)=0.                 !Set negative freqs to 0.
  c0(0)=0.5*c0(0)
  call four2a(c0,nfft2,1,1,1)              !Inverse c2c FFT; c0 is the analytic sig
  c0(npts:)=0.
  return
end subroutine ana64a