mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-22 12:23:37 -05:00
2c17544f3f
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/WSJT/trunk@1 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
38 lines
659 B
Fortran
38 lines
659 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 + imag(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
|