mirror of
https://github.com/saitohirga/WSJT-X.git
synced 2025-05-30 13:22:26 -04:00
Work in progress on Echo-mode averaging.
This commit is contained in:
parent
088429f468
commit
3a069e47a3
@ -1,4 +1,4 @@
|
|||||||
subroutine avecho(id2,ndop,nfrit,nauto,nqual,f1,xlevel,snrdb,snrdb0, &
|
subroutine avecho(id2,ndop,nfrit,nauto,navg,nqual,f1,xlevel,snrdb,snrdb0, &
|
||||||
db_err,dfreq,width,bDiskData)
|
db_err,dfreq,width,bDiskData)
|
||||||
|
|
||||||
integer TXLENGTH
|
integer TXLENGTH
|
||||||
@ -8,6 +8,8 @@ subroutine avecho(id2,ndop,nfrit,nauto,nqual,f1,xlevel,snrdb,snrdb0, &
|
|||||||
integer*2 id2(34560) !Buffer for Rx data
|
integer*2 id2(34560) !Buffer for Rx data
|
||||||
real sa(NZ) !Avg spectrum relative to initial Doppler echo freq
|
real sa(NZ) !Avg spectrum relative to initial Doppler echo freq
|
||||||
real sb(NZ) !Avg spectrum with Dither and changing Doppler removed
|
real sb(NZ) !Avg spectrum with Dither and changing Doppler removed
|
||||||
|
real, dimension (:,:), allocatable :: sax
|
||||||
|
real, dimension (:,:), allocatable :: sbx
|
||||||
real red0(NZ)
|
real red0(NZ)
|
||||||
real blue0(NZ)
|
real blue0(NZ)
|
||||||
integer nsum !Number of integrations
|
integer nsum !Number of integrations
|
||||||
@ -22,7 +24,17 @@ subroutine avecho(id2,ndop,nfrit,nauto,nqual,f1,xlevel,snrdb,snrdb0, &
|
|||||||
equivalence (x,c),(ipk,ipkv)
|
equivalence (x,c),(ipk,ipkv)
|
||||||
common/echocom/nclearave,nsum,blue(NZ),red(NZ)
|
common/echocom/nclearave,nsum,blue(NZ),red(NZ)
|
||||||
common/echocom2/fspread_self,fspread_dx
|
common/echocom2/fspread_self,fspread_dx
|
||||||
save dop0,sa,sb
|
data navg0/-1/
|
||||||
|
save dop0,navg0,sax,sbx
|
||||||
|
|
||||||
|
if(navg.ne.navg0) then
|
||||||
|
if(allocated(sax)) deallocate(sax)
|
||||||
|
if(allocated(sbx)) deallocate(sbx)
|
||||||
|
allocate(sax(1:navg,1:NZ))
|
||||||
|
allocate(sbx(1:navg,1:NZ))
|
||||||
|
nsum=0
|
||||||
|
navg0=navg
|
||||||
|
endif
|
||||||
|
|
||||||
fspread=fspread_dx !### Use the predicted Doppler spread ###
|
fspread=fspread_dx !### Use the predicted Doppler spread ###
|
||||||
if(bDiskData) fspread=width
|
if(bDiskData) fspread=width
|
||||||
@ -46,8 +58,8 @@ subroutine avecho(id2,ndop,nfrit,nauto,nqual,f1,xlevel,snrdb,snrdb0, &
|
|||||||
if(nclearave.ne.0) nsum=0
|
if(nclearave.ne.0) nsum=0
|
||||||
if(nsum.eq.0) then
|
if(nsum.eq.0) then
|
||||||
dop0=dop !Remember the initial Doppler
|
dop0=dop !Remember the initial Doppler
|
||||||
sa=0. !Clear the average arrays
|
sax=0. !Clear the average arrays
|
||||||
sb=0.
|
sbx=0.
|
||||||
endif
|
endif
|
||||||
|
|
||||||
x(TXLENGTH+1:)=0.
|
x(TXLENGTH+1:)=0.
|
||||||
@ -69,10 +81,14 @@ subroutine avecho(id2,ndop,nfrit,nauto,nqual,f1,xlevel,snrdb,snrdb0, &
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
nsum=nsum+1
|
nsum=nsum+1
|
||||||
|
j=mod(nsum-1,navg)+1
|
||||||
do i=1,NZ
|
do i=1,NZ
|
||||||
sa(i)=sa(i) + s(ia+i-2048) !Center at initial doppler freq
|
sax(j,i)=s(ia+i-2048) !Center at initial doppler freq
|
||||||
sb(i)=sb(i) + s(ib+i-2048) !Center at expected echo freq
|
sbx(j,i)=s(ib+i-2048) !Center at expected echo freq
|
||||||
|
sa(i)=sum(sax(1:navg,i))
|
||||||
|
sb(i)=sum(sbx(1:navg,i))
|
||||||
enddo
|
enddo
|
||||||
|
|
||||||
call echo_snr(s(ia-2047),s(ib-2047),fspread,blue0,red0,snrdb0, &
|
call echo_snr(s(ia-2047),s(ib-2047),fspread,blue0,red0,snrdb0, &
|
||||||
db_err,dfreq,snr_detect)
|
db_err,dfreq,snr_detect)
|
||||||
call echo_snr(sa,sb,fspread,blue,red,snrdb,db_err,dfreq,snr_detect)
|
call echo_snr(sa,sb,fspread,blue,red,snrdb,db_err,dfreq,snr_detect)
|
||||||
|
@ -155,7 +155,7 @@ extern "C" {
|
|||||||
|
|
||||||
void save_echo_params_(int* ndoptotal, int* ndop, int* nfrit, float* f1, float* fspread, short id2[], int* idir);
|
void save_echo_params_(int* ndoptotal, int* ndop, int* nfrit, float* f1, float* fspread, short id2[], int* idir);
|
||||||
|
|
||||||
void avecho_( short id2[], int* dop, int* nfrit, int* nauto, int* nqual, float* f1,
|
void avecho_( short id2[], int* dop, int* nfrit, int* nauto, int* navg, int* nqual, float* f1,
|
||||||
float* level, float* sigdb, float* sigdb0, float* snr, float* dfreq,
|
float* level, float* sigdb, float* sigdb0, float* snr, float* dfreq,
|
||||||
float* width, bool* bDiskData);
|
float* width, bool* bDiskData);
|
||||||
|
|
||||||
@ -1610,11 +1610,12 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
echocom_.nclearave=m_nclearave;
|
echocom_.nclearave=m_nclearave;
|
||||||
int nDop=m_fAudioShift;
|
int nDop=m_fAudioShift;
|
||||||
int nDopTotal=m_fDop;
|
int nDopTotal=m_fDop;
|
||||||
|
int navg=ui->sbEchoAvg->value();
|
||||||
if(m_diskData) {
|
if(m_diskData) {
|
||||||
int idir=-1;
|
int idir=-1;
|
||||||
save_echo_params_(&nDopTotal,&nDop,&nfrit,&f1,&width,dec_data.d2,&idir);
|
save_echo_params_(&nDopTotal,&nDop,&nfrit,&f1,&width,dec_data.d2,&idir);
|
||||||
}
|
}
|
||||||
avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&nqual,&f1,&xlevel,&sigdb,
|
avecho_(dec_data.d2,&nDop,&nfrit,&nauto,&navg,&nqual,&f1,&xlevel,&sigdb,
|
||||||
&sigdb0,&dBerr,&dfreq,&width,&m_diskData);
|
&sigdb0,&dBerr,&dfreq,&width,&m_diskData);
|
||||||
//Don't restart Monitor after an Echo transmission
|
//Don't restart Monitor after an Echo transmission
|
||||||
if(m_bEchoTxed and !m_auto) {
|
if(m_bEchoTxed and !m_auto) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user