mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-24 11:40:31 -05:00
Fix a bug in analytic.f90 and enable amplitude flattening. This version is not intended for general use on MSK144 as it uses hardwired coefficients derived for use with a specific radio.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@7428 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
5ba225f0af
commit
9c3b30d927
@ -8,7 +8,7 @@ subroutine analytic(d,npts,nfft,c,dpc,bseq,bdeq)
|
|||||||
real h(NFFTMAX/2) ! real BPF magnitude
|
real h(NFFTMAX/2) ! real BPF magnitude
|
||||||
real dpc(3),dpclast(3) ! dynamic phase coeffs
|
real dpc(3),dpclast(3) ! dynamic phase coeffs
|
||||||
real spc(3),spclast(3) ! static phase coeffs
|
real spc(3),spclast(3) ! static phase coeffs
|
||||||
real ac(5) ! currently unused static amp coeffs
|
real sac(5),saclast(5) ! amp coeffs
|
||||||
real fp
|
real fp
|
||||||
|
|
||||||
complex corrs(NFFTMAX/2) ! allpass static phase correction
|
complex corrs(NFFTMAX/2) ! allpass static phase correction
|
||||||
@ -22,10 +22,11 @@ subroutine analytic(d,npts,nfft,c,dpc,bseq,bdeq)
|
|||||||
data nfft0/0/
|
data nfft0/0/
|
||||||
data bseqlast/.false./
|
data bseqlast/.false./
|
||||||
data spclast/0.0,0.0,0.0/
|
data spclast/0.0,0.0,0.0/
|
||||||
|
data saclast/1.0,0.0,0.0,0.0,0.0/
|
||||||
data spc/-0.952,0.768,-0.565/ ! baseline phase coeffs for TS2000
|
data spc/-0.952,0.768,-0.565/ ! baseline phase coeffs for TS2000
|
||||||
data ac/1.0,0.05532,0.11438,0.12918,0.09274/ ! amp coeffs for TS2000
|
data sac/1.0,0.05532,0.11438,0.12918,0.09274/ ! amp coeffs for TS2000
|
||||||
|
|
||||||
save nfft0,h,spc,spclast,dpclast,ac,pi,t,beta
|
save corrs,corrd,nfft0,h,sac,spc,saclast,spclast,dpclast,pi,t,beta
|
||||||
|
|
||||||
df=12000.0/nfft
|
df=12000.0/nfft
|
||||||
nh=nfft/2
|
nh=nfft/2
|
||||||
@ -39,20 +40,24 @@ subroutine analytic(d,npts,nfft,c,dpc,bseq,bdeq)
|
|||||||
h(i)=1.0
|
h(i)=1.0
|
||||||
if(abs(f).gt.(1-beta)/(2*t) .and. abs(f).le.(1+beta)/(2*t)) then
|
if(abs(f).gt.(1-beta)/(2*t) .and. abs(f).le.(1+beta)/(2*t)) then
|
||||||
h(i)=h(i)*0.5*(1+cos((pi*t/beta )*(abs(f)-(1-beta)/(2*t))))
|
h(i)=h(i)*0.5*(1+cos((pi*t/beta )*(abs(f)-(1-beta)/(2*t))))
|
||||||
|
elseif( abs(f) .gt. (1+beta)/(2*t) ) then
|
||||||
|
h(i)=0.0
|
||||||
endif
|
endif
|
||||||
enddo
|
enddo
|
||||||
nfft0=nfft
|
nfft0=nfft
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if( any(spclast .ne. spc) .or. any(dpclast .ne. dpc) ) then
|
if( any(spclast .ne. spc) .or. any(saclast .ne. sac) .or. any(dpclast .ne. dpc) ) then
|
||||||
spclast=spc
|
spclast=spc
|
||||||
dpclast=dpc
|
dpclast=dpc
|
||||||
|
saclast=sac
|
||||||
do i=1,nh+1
|
do i=1,nh+1
|
||||||
ff=(i-1)*df
|
ff=(i-1)*df
|
||||||
f=ff-1500.0
|
f=ff-1500.0
|
||||||
fp=f/1000.0
|
fp=f/1000.0
|
||||||
ps=fp*fp*(spc(1)+fp*(spc(2)+fp*spc(3)))
|
ps=fp*fp*(spc(1)+fp*(spc(2)+fp*spc(3)))
|
||||||
corrs(i)=cmplx(cos(ps),sin(ps))
|
amp=sac(1)+fp*(sac(2)+fp*(sac(3)+fp*(sac(4)+fp*sac(5))))
|
||||||
|
corrs(i)=amp*cmplx(cos(ps),sin(ps))
|
||||||
pd=fp*fp*(dpc(1)+fp*(dpc(2)+fp*dpc(3)))
|
pd=fp*fp*(dpc(1)+fp*(dpc(2)+fp*dpc(3)))
|
||||||
corrd(i)=cmplx(cos(pd),sin(pd))
|
corrd(i)=cmplx(cos(pd),sin(pd))
|
||||||
enddo
|
enddo
|
||||||
@ -76,7 +81,5 @@ subroutine analytic(d,npts,nfft,c,dpc,bseq,bdeq)
|
|||||||
c(1)=0.5*c(1) !Half of DC term
|
c(1)=0.5*c(1) !Half of DC term
|
||||||
c(nh+2:nfft)=0. !Zero the negative frequencies
|
c(nh+2:nfft)=0. !Zero the negative frequencies
|
||||||
call four2a(c,nfft,1,1,1) !Inverse c2c FFT
|
call four2a(c,nfft,1,1,1) !Inverse c2c FFT
|
||||||
spclast=spc
|
|
||||||
dpclast=dpc
|
|
||||||
return
|
return
|
||||||
end subroutine analytic
|
end subroutine analytic
|
||||||
|
@ -205,7 +205,7 @@ write(*,*) 'training ',navg,sqrt(chisqr),rmsdiff
|
|||||||
close(18)
|
close(18)
|
||||||
open(19,file='cframe.dat',status='unknown')
|
open(19,file='cframe.dat',status='unknown')
|
||||||
do i=1,864
|
do i=1,864
|
||||||
write(19,*) i,real(cframe(i)),imag(cframe(i))
|
write(19,*) i,real(cframe(i)),imag(cframe(i)),real(cross_avg(i)),imag(cross_avg(i))
|
||||||
enddo
|
enddo
|
||||||
close(19)
|
close(19)
|
||||||
pcoeffs=a(3:5)
|
pcoeffs=a(3:5)
|
||||||
|
Loading…
Reference in New Issue
Block a user