1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-12-23 01:55:48 -05:00

Revert "BFM demod: introducing LSB stereo for what it's worth..."

This reverts commit b5669fee2f.
This commit is contained in:
f4exb 2015-12-25 19:59:45 +01:00
parent 7e67793059
commit 8065c4157c
8 changed files with 15 additions and 85 deletions

View File

@ -128,9 +128,7 @@ protected:
samples_out[0] = m_psin; // f Pilot
// Generate double-frequency output.
// sin(2*x) = 2 * sin(x) * cos(x)
samples_out[1] = 2.0 * m_psin * m_pcos; // 2f Pilot sin
// cos(2*x) = 2 * cos(x) * cos(x) - 1
samples_out[1] = (2.0 * m_pcos * m_pcos) - 1.0; // 2f Pilot cos
samples_out[1] = 2.0 * m_psin * m_pcos; // 2f Pilot
}
};
@ -152,8 +150,6 @@ protected:
// Generate double-frequency output.
// sin(2*x) = 2 * sin(x) * cos(x)
samples_out[1] = 2.0 * m_psin * m_pcos; // Pilot signal (2f)
// cos(2*x) = 2 * cos(x) * cos(x) - 1
samples_out[1] = (2.0 * m_pcos * m_pcos) - 1.0; // 2f Pilot cos
samples_out[3] = m_phase; // Pilot phase
samples_out[2] = m_phase; // Pilot phase
}
};

View File

@ -50,7 +50,7 @@ BFMDemod::BFMDemod(SampleSink* sampleSink, RDSParser *rdsParser) :
m_config.m_audioSampleRate = DSPEngine::instance()->getAudioSampleRate(); // normally 48 kHz
m_deemphasisFilterX.configure(default_deemphasis * m_config.m_audioSampleRate * 1.0e-6);
m_deemphasisFilterY.configure(default_deemphasis * m_config.m_audioSampleRate * 1.0e-6);
m_rfFilter = new fftfilt(-50000.0 / 384000.0, 50000.0 / 384000.0, filtFftLen);
m_rfFilter = new fftfilt(-50000.0 / 384000.0, 50000.0 / 384000.0, rfFilterFftLength);
m_phaseDiscri.setFMScaling(384000/m_fmExcursion);
apply();
@ -79,7 +79,6 @@ void BFMDemod::configure(MessageQueue* messageQueue,
Real volume,
Real squelch,
bool audioStereo,
bool lsbStereo,
bool showPilot,
bool rdsActive)
{
@ -88,7 +87,6 @@ void BFMDemod::configure(MessageQueue* messageQueue,
volume,
squelch,
audioStereo,
lsbStereo,
showPilot,
rdsActive);
messageQueue->push(cmd);
@ -140,8 +138,8 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
if (m_running.m_rdsActive)
{
//Complex r(demod * 2.0 * std::cos(3.0 * m_pilotPLLSamples[3]), 0.0);
Complex r(demod * 2.0 * std::cos(3.0 * m_pilotPLLSamples[3]), 0.0);
//Complex r(demod * 2.0 * std::cos(3.0 * m_pilotPLLSamples[2]), 0.0);
Complex r(demod * 2.0 * std::cos(3.0 * m_pilotPLLSamples[2]), 0.0);
if (m_interpolatorRDS.interpolate(&m_interpolatorRDSDistanceRemain, r, &cr))
{
@ -175,25 +173,12 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * (1<<15), 0.0)); // debug 38 kHz pilot
}
if (m_running.m_lsbStereo)
{
Complex s(demod * 1.21 * m_pilotPLLSamples[1], demod * 1.21 * m_pilotPLLSamples[2]);
Complex s(demod * 1.17 * m_pilotPLLSamples[1], 0);
if (m_interpolatorStereo.interpolate(&m_interpolatorStereoDistanceRemain, s, &cs))
{
sampleStereo = cs.real() + cs.imag();
m_interpolatorStereoDistanceRemain += m_interpolatorStereoDistance;
}
}
else
if (m_interpolatorStereo.interpolate(&m_interpolatorStereoDistanceRemain, s, &cs))
{
Complex s(demod * 1.17 * m_pilotPLLSamples[1], 0);
if (m_interpolatorStereo.interpolate(&m_interpolatorStereoDistanceRemain, s, &cs))
{
sampleStereo = cs.real();
m_interpolatorStereoDistanceRemain += m_interpolatorStereoDistance;
}
sampleStereo = cs.real();
m_interpolatorStereoDistanceRemain += m_interpolatorStereoDistance;
}
}
@ -206,16 +191,8 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
Real deemph_l, deemph_r; // Pre-emphasis is applied on each channel before multiplexing
m_deemphasisFilterX.process(ci.real() + sampleStereo, deemph_l);
m_deemphasisFilterY.process(ci.real() - sampleStereo, deemph_r);
if (m_running.m_lsbStereo)
{
m_audioBuffer[m_audioBufferFill].l = (qint16)(deemph_l * (1<<12) * m_running.m_volume);
m_audioBuffer[m_audioBufferFill].r = (qint16)(deemph_r * (1<<12) * m_running.m_volume);
}
else
{
m_audioBuffer[m_audioBufferFill].l = (qint16)(deemph_l * (1<<12) * m_running.m_volume);
m_audioBuffer[m_audioBufferFill].r = (qint16)(deemph_r * (1<<12) * m_running.m_volume);
}
m_audioBuffer[m_audioBufferFill].l = (qint16)(deemph_l * (1<<12) * m_running.m_volume);
m_audioBuffer[m_audioBufferFill].r = (qint16)(deemph_r * (1<<12) * m_running.m_volume);
}
else
{
@ -303,7 +280,6 @@ bool BFMDemod::handleMessage(const Message& cmd)
m_config.m_volume = cfg.getVolume();
m_config.m_squelch = cfg.getSquelch();
m_config.m_audioStereo = cfg.getAudioStereo();
m_config.m_lsbStereo = cfg.getLsbStereo();
m_config.m_showPilot = cfg.getShowPilot();
m_config.m_rdsActive = cfg.getRDSActive();
@ -314,7 +290,6 @@ bool BFMDemod::handleMessage(const Message& cmd)
<< " m_volume: " << m_config.m_volume
<< " m_squelch: " << m_config.m_squelch
<< " m_audioStereo: " << m_config.m_audioStereo
<< " m_lsbStereo: " << m_config.m_lsbStereo
<< " m_showPilot: " << m_config.m_showPilot
<< " m_rdsActive: " << m_config.m_rdsActive;
@ -417,7 +392,6 @@ void BFMDemod::apply()
m_running.m_volume = m_config.m_volume;
m_running.m_audioSampleRate = m_config.m_audioSampleRate;
m_running.m_audioStereo = m_config.m_audioStereo;
m_running.m_lsbStereo = m_config.m_lsbStereo;
m_running.m_showPilot = m_config.m_showPilot;
m_running.m_rdsActive = m_config.m_rdsActive;
}

View File

@ -34,6 +34,8 @@
#include "rdsdemod.h"
#include "rdsdecoder.h"
#define rfFilterFftLength 1024
class RDSParser;
class BFMDemod : public SampleSink {
@ -47,7 +49,6 @@ public:
Real volume,
Real squelch,
bool audioStereo,
bool lsbStereo,
bool showPilot,
bool rdsActive);
@ -78,7 +79,6 @@ private:
Real getVolume() const { return m_volume; }
Real getSquelch() const { return m_squelch; }
bool getAudioStereo() const { return m_audioStereo; }
bool getLsbStereo() const { return m_lsbStereo; }
bool getShowPilot() const { return m_showPilot; }
bool getRDSActive() const { return m_rdsActive; }
@ -87,7 +87,6 @@ private:
Real volume,
Real squelch,
bool audioStereo,
bool lsbStereo,
bool showPilot,
bool rdsActive)
{
@ -96,7 +95,6 @@ private:
volume,
squelch,
audioStereo,
lsbStereo,
showPilot,
rdsActive);
}
@ -107,7 +105,6 @@ private:
Real m_volume;
Real m_squelch;
bool m_audioStereo;
bool m_lsbStereo;
bool m_showPilot;
bool m_rdsActive;
@ -116,7 +113,6 @@ private:
Real volume,
Real squelch,
bool audioStereo,
bool lsbStereo,
bool showPilot,
bool rdsActive) :
Message(),
@ -125,7 +121,6 @@ private:
m_volume(volume),
m_squelch(squelch),
m_audioStereo(audioStereo),
m_lsbStereo(lsbStereo),
m_showPilot(showPilot),
m_rdsActive(rdsActive)
{ }
@ -151,7 +146,6 @@ private:
Real m_volume;
quint32 m_audioSampleRate;
bool m_audioStereo;
bool m_lsbStereo;
bool m_showPilot;
bool m_rdsActive;
@ -164,7 +158,6 @@ private:
m_volume(0),
m_audioSampleRate(0),
m_audioStereo(false),
m_lsbStereo(false),
m_showPilot(false),
m_rdsActive(false)
{ }
@ -188,7 +181,6 @@ private:
Lowpass<Real> m_lowpass;
fftfilt* m_rfFilter;
static const int filtFftLen = 1024;
Real m_squelchLevel;
int m_squelchState;
@ -206,7 +198,7 @@ private:
QMutex m_settingsMutex;
RDSPhaseLock m_pilotPLL;
Real m_pilotPLLSamples[4];
Real m_pilotPLLSamples[3];
RDSDemod m_rdsDemod;
RDSDecoder m_rdsDecoder;

View File

@ -110,7 +110,6 @@ QByteArray BFMDemodGUI::serialize() const
s.writeU32(7, m_channelMarker.getColor().rgb());
s.writeBlob(8, ui->spectrumGUI->serialize());
s.writeBool(9, ui->audioStereo->isChecked());
s.writeBool(10, ui->lsbStereo->isChecked());
return s.final();
}
@ -163,9 +162,6 @@ bool BFMDemodGUI::deserialize(const QByteArray& data)
d.readBool(9, &booltmp, false);
ui->audioStereo->setChecked(booltmp);
d.readBool(10, &booltmp, false);
ui->lsbStereo->setChecked(booltmp);
blockApplySettings(false);
m_channelMarker.blockSignals(false);
@ -247,11 +243,6 @@ void BFMDemodGUI::on_audioStereo_toggled(bool stereo)
applySettings();
}
void BFMDemodGUI::on_lsbStereo_toggled(bool lsb)
{
applySettings();
}
void BFMDemodGUI::on_showPilot_clicked()
{
applySettings();
@ -445,7 +436,6 @@ void BFMDemodGUI::applySettings()
ui->volume->value() / 10.0,
ui->squelch->value(),
ui->audioStereo->isChecked(),
ui->lsbStereo->isChecked(),
ui->showPilot->isChecked(),
ui->rds->isChecked());
}

View File

@ -63,7 +63,6 @@ private slots:
void on_volume_valueChanged(int value);
void on_squelch_valueChanged(int value);
void on_audioStereo_toggled(bool stereo);
void on_lsbStereo_toggled(bool lsb);
void on_showPilot_clicked();
void on_rds_clicked();
void on_g14ProgServiceNames_currentIndexChanged(int index);

View File

@ -21,7 +21,7 @@
<rect>
<x>10</x>
<y>20</y>
<width>411</width>
<width>311</width>
<height>121</height>
</rect>
</property>
@ -160,26 +160,6 @@
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="lsbStereo">
<property name="toolTip">
<string>Use only LSB from stereo subcarrier </string>
</property>
<property name="text">
<string/>
</property>
<property name="icon">
<iconset resource="../../../sdrbase/resources/res.qrc">
<normaloff>:/lsb.png</normaloff>:/lsb.png</iconset>
</property>
<property name="checkable">
<bool>true</bool>
</property>
<property name="autoRaise">
<bool>true</bool>
</property>
</widget>
</item>
<item>
<widget class="ButtonSwitch" name="showPilot">
<property name="toolTip">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 350 B

View File

@ -48,6 +48,5 @@
<file>carrier.png</file>
<file>rds.png</file>
<file>recycle.png</file>
<file>lsb.png</file>
</qresource>
</RCC>