WSJT-X/lib/t1.f90
Joe Taylor 2fd8f10727 Rename refspec() to refspectrum().
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6601 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
2016-04-08 15:55:28 +00:00

53 lines
1.6 KiB
Fortran

program t1
parameter (NFFT=1024,NH=NFFT/2)
real w(-24:24)
real x(0:NFFT-1)
complex cx(0:NH)
equivalence (x,cx)
! FIR lowpass filter designed using ScopeFIR
! fsample = 48000 Hz
! Ntaps = 49
! fc = 4500 Hz
! fstop = 6000 Hz
! Ripple = 1 dB
! Stop Atten = 40 dB
! fout = 12000 Hz
! Filter coefficients:
data w/ &
0.000861074040, 0.010051920210, 0.010161983649, 0.011363155076, &
0.008706594219, 0.002613872664,-0.005202883094,-0.011720748164, &
-0.013752163325,-0.009431602741, 0.000539063909, 0.012636767098, &
0.021494659597, 0.021951235065, 0.011564169382,-0.007656470131, &
-0.028965787341,-0.042637874109,-0.039203309748,-0.013153301537, &
0.034320769178, 0.094717832646, 0.154224604789, 0.197758325022, &
0.213715139513, 0.197758325022, 0.154224604789, 0.094717832646, &
0.034320769178,-0.013153301537,-0.039203309748,-0.042637874109, &
-0.028965787341,-0.007656470131, 0.011564169382, 0.021951235065, &
0.021494659597, 0.012636767098, 0.000539063909,-0.009431602741, &
-0.013752163325,-0.011720748164,-0.005202883094, 0.002613872664, &
0.008706594219, 0.011363155076, 0.010161983649, 0.010051920210, &
0.000861074040/
x=0.
do i=-24,24
j=i
if(j.lt.0) j=j+NFFT
x(j)=w(i)
enddo
call four2a(x,NFFT,1,-1,0) !r2c FFT
df=48000.0/NFFT
do i=0,NH
y=abs(cx(i))
s=y*y
f=i*df
write(13,1000) f,y,s,db(s),cx(i)
1000 format(6f12.6)
enddo
end program t1