mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-12-24 11:40:31 -05:00
Starting to implement display of reference spectrum in plotter.cpp.
git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@6604 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
parent
50cbdbb807
commit
35f7f73a7a
@ -61,7 +61,8 @@ extern struct dec_data {
|
||||
|
||||
extern struct {
|
||||
float syellow[NSMAX];
|
||||
} jt9w_;
|
||||
float ref[3457];
|
||||
} spectra_;
|
||||
|
||||
extern struct {
|
||||
int nclearave;
|
||||
|
@ -10,15 +10,16 @@ subroutine refspectrum(id2,brefspec)
|
||||
real x(NFFT)
|
||||
real s(0:NH)
|
||||
complex cx(0:NH)
|
||||
common/spectra/syellow(6827),ref(0:NH)
|
||||
equivalence(x,cx)
|
||||
data nsave/0/,brefspec0/.false./
|
||||
save brefspec0,nsave,s
|
||||
! save brefspec0,nsave,ref
|
||||
save
|
||||
|
||||
if(brefspec) then
|
||||
if(.not.brefspec0) then
|
||||
nsave=0
|
||||
s=0.
|
||||
brefspec0=.true.
|
||||
endif
|
||||
|
||||
x(1:NH)=0.001*id2
|
||||
@ -32,10 +33,10 @@ subroutine refspectrum(id2,brefspec)
|
||||
|
||||
if(mod(nsave,34).eq.0) then !About 9.8 sec
|
||||
df=12000.0/NFFT
|
||||
! ia=nint(500.0/df)
|
||||
! ib=nint(2500.0/df)
|
||||
! call pctile(s(ia),ib-ia+1,50,xmed)
|
||||
! db0=db(xmed)
|
||||
ia=nint(500.0/df)
|
||||
ib=nint(2500.0/df)
|
||||
call pctile(s(ia),ib-ia+1,50,xmed)
|
||||
db0=db(xmed)
|
||||
! nhadd=10
|
||||
open(16,file='refspec.dat',status='unknown')
|
||||
do i=1,NH
|
||||
@ -43,12 +44,14 @@ subroutine refspectrum(id2,brefspec)
|
||||
! ia=max(1,i-nhadd)
|
||||
! ib=min(NH,i+nhadd)
|
||||
! smo=sum(s(ia:ib))/(ib-ia+1)
|
||||
write(16,1000) freq,s(i),db(s(i))
|
||||
ref(i)=db(s(i)) - db0
|
||||
write(16,1000) freq,s(i),ref(i)
|
||||
1000 format(f10.3,e12.3,f12.6)
|
||||
enddo
|
||||
close(16)
|
||||
endif
|
||||
endif
|
||||
brefspec0=brefspec
|
||||
|
||||
return
|
||||
end subroutine refspectrum
|
||||
|
@ -30,7 +30,7 @@ subroutine symspec(shared_data,k,ntrperiod,nsps,ingain,nminw,pxdb,s, &
|
||||
complex cx(0:MAXFFT3/2)
|
||||
integer nch(7)
|
||||
|
||||
common/jt9w/syellow(NSMAX)
|
||||
common/spectra/syellow(NSMAX),ref(0:3456)
|
||||
data rms/999.0/,k0/99999999/,nfft3z/0/
|
||||
data nch/1,2,4,9,18,36,72/
|
||||
equivalence (xc,cx)
|
||||
|
@ -168,11 +168,17 @@ void CPlotter::draw(float swide[], bool bScroll) //dr
|
||||
float sum=0.0;
|
||||
int j=j0+m_binsPerPixel*i;
|
||||
for(int k=0; k<m_binsPerPixel; k++) {
|
||||
sum+=jt9w_.syellow[j++];
|
||||
sum+=spectra_.syellow[j++];
|
||||
}
|
||||
y2=gain2d*sum/m_binsPerPixel + m_plot2dZero;
|
||||
}
|
||||
|
||||
if(m_bReference) { //Reference (red)
|
||||
float df_ref=12000.0/6912.0;
|
||||
int j=FreqfromX(i)/df_ref + 0.5;
|
||||
y2=gain2d*spectra_.ref[j] + m_plot2dZero;
|
||||
}
|
||||
|
||||
if(i==iz-1) painter2D.drawPolyline(LineBuf,j);
|
||||
LineBuf[j].setX(i);
|
||||
LineBuf[j].setY(int(0.9*m_h2-y2*m_h2/70.0));
|
||||
|
Loading…
Reference in New Issue
Block a user