mirror of
https://github.com/f4exb/sdrangel.git
synced 2025-04-08 12:38:46 -04:00
Wider maximum waterfall bandwidth.
This commit is contained in:
parent
1964946afe
commit
ad68f6a06c
@ -55,8 +55,7 @@ void USBDemod::configure(MessageQueue* messageQueue, Real Bandwidth, Real volume
|
||||
|
||||
/* Fractional Downsample to 48 kHz.
|
||||
* 192 1:4 (3072 / 16)
|
||||
* 144 1:3 (2304 / 16)
|
||||
* 120 2:5 (1920 / 16)
|
||||
* 144 1:3 (1152 / 8)
|
||||
* 96 1:2 (1536 / 16)
|
||||
* 72 2:3 ( 288 / 4)
|
||||
* 64 3:4 (1024 / 16)
|
||||
@ -66,8 +65,7 @@ double rerate(int rate)
|
||||
switch (rate)
|
||||
{
|
||||
case 64000 : return (3.0 * 64000); break;
|
||||
case 72000 :
|
||||
case 120000: return (2.0 * rate); break;
|
||||
case 72000 : return (2.0 * 72000); break;
|
||||
case 0 : return (1.0 ) ; break;
|
||||
default : return (1.0 * rate ); break;
|
||||
}
|
||||
@ -82,11 +80,9 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
int samplestep = 2;
|
||||
|
||||
if ((m_sampleRate == 72000)||(m_sampleRate == 144000))
|
||||
samplestep = 3; // !! FFT buffer length is a power of two
|
||||
samplestep = 3;
|
||||
if ((m_sampleRate == 64000)||(m_sampleRate == 192000))
|
||||
samplestep = 4; // buffer length should be good
|
||||
if (m_sampleRate == 120000)
|
||||
samplestep = 5;
|
||||
samplestep = 4;
|
||||
|
||||
for(SampleVector::const_iterator it = begin; it < end; it ++) {
|
||||
a = it->real();
|
||||
@ -94,7 +90,7 @@ void USBDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
c = Complex(a / 65536.0, b / 65536.0);
|
||||
|
||||
n_out = USBFilter->run(c, &sideband, true);
|
||||
if ((m_sampleRate <= 72000)||(m_sampleRate == 120000))
|
||||
if (m_sampleRate <= 72000)
|
||||
n_out += USBFilter->run(c, &sideband, true);
|
||||
if (m_sampleRate == 64000)
|
||||
n_out += USBFilter->run(c, &sideband, true);
|
||||
|
@ -60,12 +60,12 @@ void WFMDemod::feed(SampleVector::const_iterator begin, SampleVector::const_iter
|
||||
Complex c(it->real() , it->imag());
|
||||
Complex d = c * conj(m_lastSample);
|
||||
m_lastSample = c;
|
||||
demod = atan2(d.imag(), d.real()) * (1 /M_PI);
|
||||
Complex e(demod, 0);
|
||||
demod = atan2(d.imag(), d.real());
|
||||
Complex e(demod * 3000 / M_PI, 0);
|
||||
|
||||
consumed = false;
|
||||
if(m_interpolator.interpolate(&m_sampleDistanceRemain, e, &consumed, &ci)) {
|
||||
sample = (qint16)(3000.0 * ci.real() * m_volume);
|
||||
sample = (qint16)(ci.real() * m_volume);
|
||||
m_sampleBuffer.push_back(Sample(sample, sample));
|
||||
m_audioBuffer[m_audioBufferFill].l = sample;
|
||||
m_audioBuffer[m_audioBufferFill].r = sample;
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
|
@ -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);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user