mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-05 00:41:19 -05:00
c2ceb42b28
svn+ssh://svn.berlios.de/svnroot/repos/wsjt/WSJT/branches/linux merged into svn+ssh://svn.berlios.de/svnroot/repos/wsjt/trunk git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/trunk@155 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
38 lines
660 B
Fortran
38 lines
660 B
Fortran
subroutine spec441(dat,jz,s,f0)
|
|
|
|
C Computes average spectrum over a range of dat, e.g. for a ping.
|
|
C Returns spectral array and frequency of peak value.
|
|
|
|
parameter (NFFT=256)
|
|
parameter (NR=NFFT+2)
|
|
parameter (NH=NFFT/2)
|
|
real*4 dat(jz)
|
|
real*4 x(NR),s(NH)
|
|
complex c(0:NH)
|
|
equivalence (x,c)
|
|
|
|
call zero(s,NH)
|
|
nz=jz/NFFT
|
|
do n=1,nz
|
|
j=1 + (n-1)*NFFT
|
|
call move(dat(j),x,NFFT)
|
|
call xfft(x,NFFT)
|
|
do i=1,NH
|
|
s(i)=s(i)+real(c(i))**2 + aimag(c(i))**2
|
|
enddo
|
|
enddo
|
|
|
|
smax=0.
|
|
df=11025.0/NFFT
|
|
fac=1.0/(100.0*nfft*nz)
|
|
do i=1,nh
|
|
s(i)=fac*s(i)
|
|
if(s(i).gt.smax) then
|
|
smax=s(i)
|
|
f0=i*df
|
|
endif
|
|
enddo
|
|
|
|
return
|
|
end
|