1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-07-26 12:04:13 -04:00

Wider maximum waterfall bandwidth.

This commit is contained in:
John Greb
2014-11-24 11:01:07 +00:00
parent 1964946afe
commit ad68f6a06c
5 changed files with 28 additions and 43 deletions
+1 -1
View File
@@ -141,7 +141,7 @@ void RTLSDRGui::on_gain_valueChanged(int value)
void RTLSDRGui::on_samplerate_valueChanged(int value)
{
int Rates[] = {288, 1024, 1536, 2048, 2304, 2500 };
int Rates[] = {288, 1024, 1536, 1152, 2048, 2500 };
int newrate = Rates[value];
ui->samplerateText->setText(tr("%1k").arg(newrate));
m_settings.m_samplerate = newrate * 1000;
+6 -4
View File
@@ -182,10 +182,12 @@ const QString& RTLSDRInput::getDeviceDescription() const
int RTLSDRInput::getSampleRate() const
{
int rate = m_settings.m_samplerate / 4;
if (rate < 200000)
return rate;
return (rate / 4);
int rate = m_settings.m_samplerate;
if (rate < 800000)
return (rate / 4);
if ((rate == 1152000) || (rate == 2048000))
return (rate / 8);
return (rate / 16);
}
quint64 RTLSDRInput::getCenterFrequency() const
+13 -26
View File
@@ -108,12 +108,14 @@ void RTLSDRThread::decimate8(SampleVector::iterator* it, const quint8* buf, qint
for (int pos = 0; pos < len - 15; pos += 8) {
xreal = buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4];
yimag = buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6];
Sample s1( xreal << 3, yimag << 3 );
pos += 8;
xreal += buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4];
yimag += buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6];
xreal = buf[pos+0] - buf[pos+3] + buf[pos+7] - buf[pos+4];
yimag = buf[pos+1] - buf[pos+5] + buf[pos+2] - buf[pos+6];
Sample s2( xreal << 3, yimag << 3 );
Sample s( xreal << 3, yimag << 3 );
**it = s;
m_decimator2.myDecimate(&s1, &s2);
**it = s2;
(*it)++;
}
}
@@ -144,33 +146,18 @@ void RTLSDRThread::decimate16(SampleVector::iterator* it, const quint8* buf, qin
// Decimate everything by 16x, except 288kHz
// Decimate everything by 16x, except 288kHz by 4x
// and 1152kHz, 2048kHz by 8x
void RTLSDRThread::callback(const quint8* buf, qint32 len)
{
SampleVector::iterator it = m_convertBuffer.begin();
int mode = 0;
if (m_samplerate < 800000)
mode = 2;
switch(mode) {
case 0:
decimate16(&it, buf, len);
break;
case 1:
break;
case 2:
decimate4(&it, buf, len);
break;
case 3:
break;
default:
decimate16(&it, buf, len);
break;
}
decimate4(&it, buf, len);
else if ((m_samplerate == 1152000)||(m_samplerate == 2048000))
decimate8(&it, buf, len);
else
decimate16(&it, buf, len);
m_sampleFifo->write(m_convertBuffer.begin(), it);