Fix waterfall display by extracting global symspec vars and resetting the ja to the correct value after detector reset
This commit is contained in:
parent
e3ac4b22c3
commit
e5f07e3a0d
@ -50,15 +50,8 @@ void Detector::clear ()
|
|||||||
int prevKin = dec_data.params.kin;
|
int prevKin = dec_data.params.kin;
|
||||||
dec_data.params.kin = qMin ((msInPeriod * m_frameRate) / 1000, static_cast<unsigned> (sizeof (dec_data.d2) / sizeof (dec_data.d2[0])));
|
dec_data.params.kin = qMin ((msInPeriod * m_frameRate) / 1000, static_cast<unsigned> (sizeof (dec_data.d2) / sizeof (dec_data.d2[0])));
|
||||||
m_bufferPos = m_samplesPerFFT;
|
m_bufferPos = m_samplesPerFFT;
|
||||||
|
m_ns=secondInPeriod();
|
||||||
#if 0
|
|
||||||
// erase everything after kin.
|
|
||||||
//memset(dec_data.d2 + dec_data.params.kin, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0]) * dec_data.params.kin));
|
|
||||||
#else
|
|
||||||
// erase everything
|
|
||||||
memset(dec_data.d2, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0])));
|
memset(dec_data.d2, 0, sizeof(dec_data.d2) - (sizeof(dec_data.d2[0])));
|
||||||
#endif
|
|
||||||
|
|
||||||
qDebug() << "advancing detector buffer from" << prevKin << "to" << dec_data.params.kin << "delta" << dec_data.params.kin - prevKin;
|
qDebug() << "advancing detector buffer from" << prevKin << "to" << dec_data.params.kin << "delta" << dec_data.params.kin - prevKin;
|
||||||
#else
|
#else
|
||||||
dec_data.params.kin = 0;
|
dec_data.params.kin = 0;
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
#define RX_SAMPLE_RATE 12000
|
#define RX_SAMPLE_RATE 12000
|
||||||
|
|
||||||
#define JS8_USE_REFSPEC 1 // compute the signal refspec
|
#define JS8_USE_REFSPEC 0 // compute the signal refspec
|
||||||
#define JS8_USE_IHSYM 0 // compute ihsym manually instead of from symspec
|
#define JS8_USE_IHSYM 0 // compute ihsym manually instead of from symspec
|
||||||
#define JS8_RING_BUFFER 1 // use a ring buffer instead of clearing the decode frames
|
#define JS8_RING_BUFFER 1 // use a ring buffer instead of clearing the decode frames
|
||||||
#define JS8_DECODER_E2S 0 // decode every 2 seconds instead of at the half symbol stop
|
#define JS8_DECODER_E2S 0 // decode every 2 seconds instead of at the half symbol stop
|
||||||
@ -128,6 +128,7 @@ extern struct dec_data {
|
|||||||
char mygrid[6];
|
char mygrid[6];
|
||||||
char hiscall[12];
|
char hiscall[12];
|
||||||
char hisgrid[6];
|
char hisgrid[6];
|
||||||
|
int ndebug;
|
||||||
} params;
|
} params;
|
||||||
} dec_data;
|
} dec_data;
|
||||||
|
|
||||||
|
@ -55,6 +55,7 @@
|
|||||||
character(kind=c_char) :: mygrid(6)
|
character(kind=c_char) :: mygrid(6)
|
||||||
character(kind=c_char) :: hiscall(12)
|
character(kind=c_char) :: hiscall(12)
|
||||||
character(kind=c_char) :: hisgrid(6)
|
character(kind=c_char) :: hisgrid(6)
|
||||||
|
integer(c_int) :: ndebug
|
||||||
end type params_block
|
end type params_block
|
||||||
|
|
||||||
type, bind(C) :: dec_data
|
type, bind(C) :: dec_data
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
subroutine symspec(shared_data,k,k0,ntrperiod,nsps,ingain,nminw,pxdb,s, &
|
subroutine symspec(shared_data,k,k0,ja,ssum,ntrperiod,nsps,ingain,nminw,pxdb,s, &
|
||||||
df3,ihsym,npts8,pxdbmax)
|
df3,ihsym,npts8,pxdbmax)
|
||||||
|
|
||||||
! Input:
|
! Input:
|
||||||
@ -84,7 +84,9 @@ subroutine symspec(shared_data,k,k0,ntrperiod,nsps,ingain,nminw,pxdb,s, &
|
|||||||
do i=0,nfft3-1 !Copy data into cx
|
do i=0,nfft3-1 !Copy data into cx
|
||||||
j=ja+i-(nfft3-1)
|
j=ja+i-(nfft3-1)
|
||||||
xc(i)=0.
|
xc(i)=0.
|
||||||
if(j.ge.1 .and.j.le.NMAX) xc(i)=fac0*shared_data%id2(j)
|
if(j.ge.1 .and. j.le.NMAX) then
|
||||||
|
xc(i)=fac0*shared_data%id2(j)
|
||||||
|
endif
|
||||||
enddo
|
enddo
|
||||||
ihsym=ihsym+1
|
ihsym=ihsym+1
|
||||||
|
|
||||||
|
@ -79,7 +79,7 @@
|
|||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
//----------------------------------------------------- C and Fortran routines
|
//----------------------------------------------------- C and Fortran routines
|
||||||
void symspec_(struct dec_data *, int* k, int* k0, int* ntrperiod, int* nsps, int* ingain,
|
void symspec_(struct dec_data *, int* k, int* k0, int *ja, float ssum[], int* ntrperiod, int* nsps, int* ingain,
|
||||||
int* minw, float* px, float s[], float* df3, int* nhsym, int* npts8,
|
int* minw, float* px, float s[], float* df3, int* nhsym, int* npts8,
|
||||||
float *m_pxmax);
|
float *m_pxmax);
|
||||||
|
|
||||||
@ -2542,13 +2542,17 @@ int MainWindow::computeFramesNeededForDecode(int submode, int period){
|
|||||||
//-------------------------------------------------------------- dataSink()
|
//-------------------------------------------------------------- dataSink()
|
||||||
void MainWindow::dataSink(qint64 frames)
|
void MainWindow::dataSink(qint64 frames)
|
||||||
{
|
{
|
||||||
|
// symspec global vars
|
||||||
|
static int ja = 0;
|
||||||
static int k0 = 999999999;
|
static int k0 = 999999999;
|
||||||
|
static float ssum[NSMAX];
|
||||||
static float s[NSMAX];
|
static float s[NSMAX];
|
||||||
char line[80];
|
char line[80];
|
||||||
|
|
||||||
int k (frames);
|
int k (frames);
|
||||||
if(k0 == 999999999){
|
if(k0 == 999999999){
|
||||||
m_ihsym = int((float)frames/(float)m_nsps)*2;
|
m_ihsym = int((float)frames/(float)m_nsps)*2;
|
||||||
|
ja = k;
|
||||||
k0 = k;
|
k0 = k;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2615,8 +2619,8 @@ void MainWindow::dataSink(qint64 frames)
|
|||||||
/// END IHSYM
|
/// END IHSYM
|
||||||
#else
|
#else
|
||||||
m_ihsym=m_ihsym%(m_TRperiod*RX_SAMPLE_RATE/m_nsps*2);
|
m_ihsym=m_ihsym%(m_TRperiod*RX_SAMPLE_RATE/m_nsps*2);
|
||||||
qDebug() << "k" << k << "k0" << k0 << "ihsym" << m_ihsym;
|
symspec_(&dec_data,&k,&k0,&ja,ssum,&trmin,&nsps,&m_inGain,&nsmo,&m_px,s,&m_df3,&m_ihsym,&m_npts8,&m_pxmax);
|
||||||
symspec_(&dec_data,&k,&k0,&trmin,&nsps,&m_inGain,&nsmo,&m_px,s,&m_df3,&m_ihsym,&m_npts8,&m_pxmax);
|
ja = k;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if(m_ihsym <= 0) return;
|
if(m_ihsym <= 0) return;
|
||||||
|
Loading…
Reference in New Issue
Block a user