kopia lustrzana https://github.com/jamescoxon/dl-fldigi
RSID decoder bug fix
* added windowing function to fft * corrected CalculateBuckets methodpull/2/head
rodzic
d77b8cc7b3
commit
6c0d3777b0
|
@ -145,13 +145,8 @@ RSIDs cRsId::rsid_ids[] = {
|
||||||
{ RSID_MFSK8, MODE_MFSK8 },
|
{ RSID_MFSK8, MODE_MFSK8 },
|
||||||
{ RSID_MFSK16, MODE_MFSK16 },
|
{ RSID_MFSK16, MODE_MFSK16 },
|
||||||
{ RSID_MFSK32, MODE_MFSK32 },
|
{ RSID_MFSK32, MODE_MFSK32 },
|
||||||
#ifdef EXPERIMENTAL
|
|
||||||
{ RSID_MFSK11, MODE_MFSK11 },
|
{ RSID_MFSK11, MODE_MFSK11 },
|
||||||
{ RSID_MFSK22, MODE_MFSK22 },
|
{ RSID_MFSK22, MODE_MFSK22 },
|
||||||
#else
|
|
||||||
{ RSID_MFSK11, NUM_MODES },
|
|
||||||
{ RSID_MFSK22, NUM_MODES },
|
|
||||||
#endif
|
|
||||||
|
|
||||||
{ RSID_RTTYM_8_250, NUM_MODES },
|
{ RSID_RTTYM_8_250, NUM_MODES },
|
||||||
{ RSID_RTTYM_16_500, NUM_MODES },
|
{ RSID_RTTYM_16_500, NUM_MODES },
|
||||||
|
@ -313,10 +308,9 @@ void cRsId::CalculateBuckets(const double *pSpectrum, int iBegin, int iEnd)
|
||||||
double Amp = 0.0, AmpMax = 0.0;
|
double Amp = 0.0, AmpMax = 0.0;
|
||||||
int iBucketMax = iBegin - RSID_RESOL;
|
int iBucketMax = iBegin - RSID_RESOL;
|
||||||
int i, j;
|
int i, j;
|
||||||
bool firstpass = true;
|
|
||||||
|
|
||||||
for (i = iBegin; i < iEnd; i += RSID_RESOL) {
|
for (i = iBegin; i < iEnd; i += RSID_RESOL) {
|
||||||
if (firstpass) {
|
if (iBucketMax == i - RSID_RESOL) {
|
||||||
AmpMax = pSpectrum[i];
|
AmpMax = pSpectrum[i];
|
||||||
iBucketMax = i;
|
iBucketMax = i;
|
||||||
for (j = i + RSID_RESOL; j < i + RSID_NTIMES + RSID_RESOL; j += RSID_RESOL) {
|
for (j = i + RSID_RESOL; j < i + RSID_NTIMES + RSID_RESOL; j += RSID_RESOL) {
|
||||||
|
@ -326,7 +320,6 @@ void cRsId::CalculateBuckets(const double *pSpectrum, int iBegin, int iEnd)
|
||||||
iBucketMax = j;
|
iBucketMax = j;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
firstpass = false;
|
|
||||||
} else {
|
} else {
|
||||||
j = i + RSID_NTIMES;
|
j = i + RSID_NTIMES;
|
||||||
Amp = pSpectrum[j];
|
Amp = pSpectrum[j];
|
||||||
|
@ -372,10 +365,9 @@ void cRsId::search( const double *pSamples, int nSamples )
|
||||||
memcpy (aInputSamples + ns, pSamples, ns * sizeof(double));
|
memcpy (aInputSamples + ns, pSamples, ns * sizeof(double));
|
||||||
|
|
||||||
memset (aFFTReal, 0, RSID_ARRAY_SIZE * sizeof(double));
|
memset (aFFTReal, 0, RSID_ARRAY_SIZE * sizeof(double));
|
||||||
memcpy (aFFTReal, aInputSamples, RSID_FFT_SIZE * sizeof(double));
|
|
||||||
// or
|
for (int i = 0; i < RSID_FFT_SIZE; i++)
|
||||||
// for (int i = 0; i < RSID_FFT_SIZE; i++)
|
aFFTReal[i] = aInputSamples[i] * fftwindow[i];
|
||||||
// aFFTReal[i] = aInputSamples[i] * fftwindow[i];
|
|
||||||
|
|
||||||
rsrfft( aFFTReal, 11);
|
rsrfft( aFFTReal, 11);
|
||||||
|
|
||||||
|
@ -710,9 +702,9 @@ void cRsId::send()
|
||||||
}
|
}
|
||||||
if (rmode == RSID_NONE)
|
if (rmode == RSID_NONE)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Encode(rmode, rsid);
|
Encode(rmode, rsid);
|
||||||
|
|
||||||
|
|
||||||
outbuf = new double[symlen];
|
outbuf = new double[symlen];
|
||||||
|
|
||||||
// transmit sequence of 15 symbols (tones)
|
// transmit sequence of 15 symbols (tones)
|
||||||
|
|
Ładowanie…
Reference in New Issue