Fix off-by-one error and missing modem bw defaults

This commit is contained in:
Charles J. Cliffe 2015-12-14 19:31:18 -05:00
parent 744db7ea98
commit 423b590d7c
3 changed files with 6 additions and 4 deletions

View File

@ -2,7 +2,7 @@ cmake_minimum_required (VERSION 2.8)
SET(CUBICSDR_VERSION_MAJOR "0") SET(CUBICSDR_VERSION_MAJOR "0")
SET(CUBICSDR_VERSION_MINOR "1") SET(CUBICSDR_VERSION_MINOR "1")
SET(CUBICSDR_VERSION_PATCH "19") SET(CUBICSDR_VERSION_PATCH "20")
SET(CUBICSDR_VERSION_REL "alpha") SET(CUBICSDR_VERSION_REL "alpha")
SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}") SET(CUBICSDR_VERSION "${CUBICSDR_VERSION_MAJOR}.${CUBICSDR_VERSION_MINOR}.${CUBICSDR_VERSION_PATCH}-${CUBICSDR_VERSION_REL}")

View File

@ -984,6 +984,7 @@ void AppFrame::OnIdle(wxIdleEvent& event) {
// basic demodulators // basic demodulators
if (dSelection != "" && dSelection != mgr->getLastDemodulatorType()) { if (dSelection != "" && dSelection != mgr->getLastDemodulatorType()) {
mgr->setLastDemodulatorType(dSelection); mgr->setLastDemodulatorType(dSelection);
mgr->setLastBandwidth(Modem::getModemDefaultSampleRate(dSelection));
demodTuner->setHalfBand(dSelection=="USB" || dSelection=="LSB"); demodTuner->setHalfBand(dSelection=="USB" || dSelection=="LSB");
} }
#endif #endif

View File

@ -405,6 +405,7 @@ void SpectrumVisualProcessor::process() {
double visualAccum = 0; double visualAccum = 0;
double acc = 0, accCount = 0, i = 0; double acc = 0, accCount = 0, i = 0;
for (int x = 0, xMax = output->spectrum_points.size() / 2; x < xMax; x++) { for (int x = 0, xMax = output->spectrum_points.size() / 2; x < xMax; x++) {
visualAccum += visualRatio * double(SPECTRUM_VZM); visualAccum += visualRatio * double(SPECTRUM_VZM);
// while (visualAccum >= 1.0) { // while (visualAccum >= 1.0) {
@ -420,8 +421,8 @@ void SpectrumVisualProcessor::process() {
if (idx < 0) { if (idx < 0) {
idx = 0; idx = 0;
} }
if (idx > fftSizeInternal) { if (idx > fftSizeInternal-1) {
idx = fftSizeInternal; idx = fftSizeInternal-1;
} }
acc += fft_result_maa[idx]; acc += fft_result_maa[idx];
accCount += 1.0; accCount += 1.0;