1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-06-07 16:34:45 -04:00

BFM demod: added pilot view option and pilot power display

This commit is contained in:
f4exb
2015-12-09 00:04:46 +01:00
parent f300b675bf
commit fa2d9aecf5
7 changed files with 115 additions and 18 deletions
+22 -7
View File
@@ -69,9 +69,15 @@ BFMDemod::~BFMDemod()
DSPEngine::instance()->removeAudioSink(&m_audioFifo);
}
void BFMDemod::configure(MessageQueue* messageQueue, Real rfBandwidth, Real afBandwidth, Real volume, Real squelch, bool audioStereo)
void BFMDemod::configure(MessageQueue* messageQueue,
Real rfBandwidth,
Real afBandwidth,
Real volume,
Real squelch,
bool audioStereo,
bool showPilot)
{
Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth, afBandwidth, volume, squelch, audioStereo);
Message* cmd = MsgConfigureBFMDemod::create(rfBandwidth, afBandwidth, volume, squelch, audioStereo, showPilot);
messageQueue->push(cmd);
}
@@ -123,17 +129,23 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_m2Sample = m_m1Sample;
m_m1Sample = rf[i];
m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
if (!m_running.m_showPilot)
{
m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
}
Real sampleStereo;
// Process stereo if stereo mode is selected
if (m_running.m_audioStereo)
{
//Real pilotSample;
//m_pilotPLL.process(demod, pilotSample);
m_pilotPLL.process(demod, m_pilotPLLSamples);
//m_sampleBuffer.push_back(Sample(pilotSample * (1<<15), 0.0)); // debug pilot
if (m_running.m_showPilot)
{
m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[1] * (1<<15), 0.0)); // debug 38 kHz pilot
}
Complex s(demod*2.0*m_pilotPLLSamples[1], 0);
@@ -243,6 +255,7 @@ 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_showPilot = cfg.getShowPilot();
apply();
@@ -250,7 +263,8 @@ bool BFMDemod::handleMessage(const Message& cmd)
<< " m_afBandwidth: " << m_config.m_afBandwidth
<< " m_volume: " << m_config.m_volume
<< " m_squelch: " << m_config.m_squelch
<< " m_audioStereo: " << m_config.m_audioStereo;
<< " m_audioStereo: " << m_config.m_audioStereo
<< " m_showPilot: " << m_config.m_showPilot;
return true;
}
@@ -341,5 +355,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_showPilot = m_config.m_showPilot;
}