Finish implementing bins/Pixel on EchoGraph.

git-svn-id: svn+ssh://svn.code.sf.net/p/wsjt/wsjt/branches/wsjtx@5563 ab8295b8-cf94-4d9e-aec4-7959e3be5d79
This commit is contained in:
Joe Taylor 2015-06-09 16:15:35 +00:00
parent 4d9df69e17
commit 9d1a534aa0
3 changed files with 47 additions and 49 deletions

View File

@ -47,8 +47,8 @@ extern struct {
extern struct { extern struct {
int nclearave; int nclearave;
int nsum; int nsum;
float blue[2000]; float blue[4096];
float red[2000]; float red[4096];
} echocom_; } echocom_;
} }

View File

@ -80,7 +80,7 @@ void EPlotter::paintEvent(QPaintEvent *) // paintEvent()
void EPlotter::draw() //draw() void EPlotter::draw() //draw()
{ {
int i,j,y; int i,j,y;
float blue[2000],red[2000]; float blue[4096],red[4096];
float gain = pow(10.0,(m_plotGain/20.0)); float gain = pow(10.0,(m_plotGain/20.0));
if(m_2DPixmap.size().width()==0) return; if(m_2DPixmap.size().width()==0) return;
@ -88,24 +88,30 @@ void EPlotter::draw() //draw()
QRect tmp(0,0,m_w,m_h2); QRect tmp(0,0,m_w,m_h2);
painter2D.fillRect(tmp,Qt::black); painter2D.fillRect(tmp,Qt::black);
if(echocom_.nclearave==0) {
QPoint LineBuf[MAX_SCREENSIZE]; QPoint LineBuf[MAX_SCREENSIZE];
QPen penBlue(QColor(0,255,255),1); QPen penBlue(QColor(0,255,255),1);
QPen penRed(Qt::red,1); QPen penRed(Qt::red,1);
j=0; j=0;
int i0=1000 + int(m_StartFreq/(m_fftBinWidth*m_binsPerPixel)); for(i=0; i<4096/m_binsPerPixel; i++) {
for(i=0; i<2000; i++) { blue[i]=0.0;
blue[i]=echocom_.blue[i]; red[i]=0.0;
red[i]=echocom_.red[i]; for(int k=0; k<m_binsPerPixel; k++) {
blue[i]+=echocom_.blue[j];
red[i]+=echocom_.red[j];
j++;
}
} }
if(m_smooth>0) { if(m_smooth>0) {
for(i=0; i<m_smooth; i++) { for(i=0; i<m_smooth; i++) {
int n2000=2000; int n4096=4096;
smo121_(blue,&n2000); smo121_(blue,&n4096);
smo121_(red,&n2000); smo121_(red,&n4096);
} }
} }
// check i0 value! ...
int i0=2048/m_binsPerPixel + int(m_StartFreq/(m_fftBinWidth*m_binsPerPixel));
if(m_blue) { if(m_blue) {
painter2D.setPen(penBlue); painter2D.setPen(penBlue);
j=0; j=0;
@ -127,8 +133,6 @@ void EPlotter::draw() //draw()
j++; j++;
} }
painter2D.drawPolyline(LineBuf,j); painter2D.drawPolyline(LineBuf,j);
}
update(); //trigger a new paintEvent update(); //trigger a new paintEvent
} }
@ -158,8 +162,6 @@ void EPlotter::DrawOverlay() //DrawOverlay()
// m_StartFreq=50 * int((-0.5*m_fSpan)/50.0 - 0.5); // m_StartFreq=50 * int((-0.5*m_fSpan)/50.0 - 0.5);
m_StartFreq=m_freqPerDiv * int((-0.5*m_fSpan)/m_freqPerDiv - 0.5); m_StartFreq=m_freqPerDiv * int((-0.5*m_fSpan)/m_freqPerDiv - 0.5);
qDebug() << m_fSpan << m_freqPerDiv << m_StartFreq;
float pixPerHdiv = m_freqPerDiv/(m_fftBinWidth*m_binsPerPixel); float pixPerHdiv = m_freqPerDiv/(m_fftBinWidth*m_binsPerPixel);
float pixPerVdiv = float(m_h2)/float(VERT_DIVS); float pixPerVdiv = float(m_h2)/float(VERT_DIVS);

View File

@ -4,8 +4,8 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
parameter (TXLENGTH=27648) !27*1024 parameter (TXLENGTH=27648) !27*1024
parameter (NFFT=32768,NH=NFFT/2) parameter (NFFT=32768,NH=NFFT/2)
integer*2 id2(34560) !Buffer for Rx data integer*2 id2(34560) !Buffer for Rx data
real sa(2000) !Avg spectrum relative to initial Doppler echo freq real sa(4096) !Avg spectrum relative to initial Doppler echo freq
real sb(2000) !Avg spectrum with Dither and changing Doppler removed real sb(4096) !Avg spectrum with Dither and changing Doppler removed
integer nsum !Number of integrations integer nsum !Number of integrations
real dop0 !Doppler shift for initial integration (Hz) real dop0 !Doppler shift for initial integration (Hz)
real doppler !Doppler shift for current integration (Hz) real doppler !Doppler shift for current integration (Hz)
@ -14,7 +14,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
integer ipkv(1) integer ipkv(1)
complex c(0:NH) complex c(0:NH)
equivalence (x,c),(ipk,ipkv) equivalence (x,c),(ipk,ipkv)
common/echocom/nclearave,nsum,blue(2000),red(2000) common/echocom/nclearave,nsum,blue(4096),red(4096)
save dop0,sa,sb save dop0,sa,sb
dop=ndop dop=ndop
@ -48,9 +48,9 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
nsum=nsum+1 nsum=nsum+1
do i=1,2000 do i=1,4096
sa(i)=sa(i) + s(ia+i-1000) !Center at initial doppler freq sa(i)=sa(i) + s(ia+i-2048) !Center at initial doppler freq
sb(i)=sb(i) + s(ib+i-1000) !Center at expected echo freq sb(i)=sb(i) + s(ib+i-2048) !Center at expected echo freq
enddo enddo
call pctile(sb,200,50,r0) call pctile(sb,200,50,r0)
@ -58,7 +58,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
sum=0. sum=0.
sq=0. sq=0.
do i=1,2000 do i=1,4096
y=r0 + (r1-r0)*(i-100.0)/1800.0 y=r0 + (r1-r0)*(i-100.0)/1800.0
blue(i)=sa(i)/y blue(i)=sa(i)/y
red(i)=sb(i)/y red(i)=sb(i)/y
@ -105,13 +105,9 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
nsmo=max(0.0,0.25*bins) nsmo=max(0.0,0.25*bins)
do i=1,nsmo do i=1,nsmo
call smo121(red,2000) call smo121(red,4096)
call smo121(blue,2000) call smo121(blue,4096)
enddo enddo
900 continue 900 return
write(*,3001) ia*df,ib*df,dop,r0,r1,nfrit,nclearave,nsum
3001 format(5f10.1,3i6)
return
end subroutine avecho end subroutine avecho