mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2024-11-24 21:28:41 -05:00
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:
parent
4d9df69e17
commit
9d1a534aa0
@ -47,8 +47,8 @@ extern struct {
|
||||
extern struct {
|
||||
int nclearave;
|
||||
int nsum;
|
||||
float blue[2000];
|
||||
float red[2000];
|
||||
float blue[4096];
|
||||
float red[4096];
|
||||
} echocom_;
|
||||
|
||||
}
|
||||
|
28
echoplot.cpp
28
echoplot.cpp
@ -80,7 +80,7 @@ void EPlotter::paintEvent(QPaintEvent *) // paintEvent()
|
||||
void EPlotter::draw() //draw()
|
||||
{
|
||||
int i,j,y;
|
||||
float blue[2000],red[2000];
|
||||
float blue[4096],red[4096];
|
||||
float gain = pow(10.0,(m_plotGain/20.0));
|
||||
|
||||
if(m_2DPixmap.size().width()==0) return;
|
||||
@ -88,24 +88,30 @@ void EPlotter::draw() //draw()
|
||||
QRect tmp(0,0,m_w,m_h2);
|
||||
painter2D.fillRect(tmp,Qt::black);
|
||||
|
||||
if(echocom_.nclearave==0) {
|
||||
QPoint LineBuf[MAX_SCREENSIZE];
|
||||
QPen penBlue(QColor(0,255,255),1);
|
||||
QPen penRed(Qt::red,1);
|
||||
|
||||
j=0;
|
||||
int i0=1000 + int(m_StartFreq/(m_fftBinWidth*m_binsPerPixel));
|
||||
for(i=0; i<2000; i++) {
|
||||
blue[i]=echocom_.blue[i];
|
||||
red[i]=echocom_.red[i];
|
||||
for(i=0; i<4096/m_binsPerPixel; i++) {
|
||||
blue[i]=0.0;
|
||||
red[i]=0.0;
|
||||
for(int k=0; k<m_binsPerPixel; k++) {
|
||||
blue[i]+=echocom_.blue[j];
|
||||
red[i]+=echocom_.red[j];
|
||||
j++;
|
||||
}
|
||||
}
|
||||
if(m_smooth>0) {
|
||||
for(i=0; i<m_smooth; i++) {
|
||||
int n2000=2000;
|
||||
smo121_(blue,&n2000);
|
||||
smo121_(red,&n2000);
|
||||
int n4096=4096;
|
||||
smo121_(blue,&n4096);
|
||||
smo121_(red,&n4096);
|
||||
}
|
||||
}
|
||||
|
||||
// check i0 value! ...
|
||||
int i0=2048/m_binsPerPixel + int(m_StartFreq/(m_fftBinWidth*m_binsPerPixel));
|
||||
if(m_blue) {
|
||||
painter2D.setPen(penBlue);
|
||||
j=0;
|
||||
@ -127,8 +133,6 @@ void EPlotter::draw() //draw()
|
||||
j++;
|
||||
}
|
||||
painter2D.drawPolyline(LineBuf,j);
|
||||
}
|
||||
|
||||
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=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 pixPerVdiv = float(m_h2)/float(VERT_DIVS);
|
||||
|
||||
|
@ -4,8 +4,8 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
|
||||
parameter (TXLENGTH=27648) !27*1024
|
||||
parameter (NFFT=32768,NH=NFFT/2)
|
||||
integer*2 id2(34560) !Buffer for Rx data
|
||||
real sa(2000) !Avg spectrum relative to initial Doppler echo freq
|
||||
real sb(2000) !Avg spectrum with Dither and changing Doppler removed
|
||||
real sa(4096) !Avg spectrum relative to initial Doppler echo freq
|
||||
real sb(4096) !Avg spectrum with Dither and changing Doppler removed
|
||||
integer nsum !Number of integrations
|
||||
real dop0 !Doppler shift for initial 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)
|
||||
complex c(0:NH)
|
||||
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
|
||||
|
||||
dop=ndop
|
||||
@ -48,9 +48,9 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
|
||||
|
||||
nsum=nsum+1
|
||||
|
||||
do i=1,2000
|
||||
sa(i)=sa(i) + s(ia+i-1000) !Center at initial doppler freq
|
||||
sb(i)=sb(i) + s(ib+i-1000) !Center at expected echo freq
|
||||
do i=1,4096
|
||||
sa(i)=sa(i) + s(ia+i-2048) !Center at initial doppler freq
|
||||
sb(i)=sb(i) + s(ib+i-2048) !Center at expected echo freq
|
||||
enddo
|
||||
|
||||
call pctile(sb,200,50,r0)
|
||||
@ -58,7 +58,7 @@ subroutine avecho(id2,ndop,nfrit,nqual,f1,rms0,sigdb,snr,dfreq,width)
|
||||
|
||||
sum=0.
|
||||
sq=0.
|
||||
do i=1,2000
|
||||
do i=1,4096
|
||||
y=r0 + (r1-r0)*(i-100.0)/1800.0
|
||||
blue(i)=sa(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)
|
||||
|
||||
do i=1,nsmo
|
||||
call smo121(red,2000)
|
||||
call smo121(blue,2000)
|
||||
call smo121(red,4096)
|
||||
call smo121(blue,4096)
|
||||
enddo
|
||||
|
||||
900 continue
|
||||
write(*,3001) ia*df,ib*df,dop,r0,r1,nfrit,nclearave,nsum
|
||||
3001 format(5f10.1,3i6)
|
||||
|
||||
return
|
||||
900 return
|
||||
end subroutine avecho
|
||||
|
Loading…
Reference in New Issue
Block a user