1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-13 11:51:47 -05:00

BFM demod: basic RDS demodulator test

This commit is contained in:
Edouard Griffiths 2015-12-10 14:10:48 +01:00
parent 3cdab34fb7
commit 4ecc0f18bb
3 changed files with 12 additions and 4 deletions

View File

@ -146,10 +146,10 @@ public:
protected:
virtual void processPhase(Real *samples_out) const
{
samples_out[0] = m_psin; // f Pilot
samples_out[0] = m_psin; // Pilot signal (f)
// Generate double-frequency output.
// sin(2*x) = 2 * sin(x) * cos(x)
samples_out[1] = 2.0 * m_psin * m_pcos; // 2f Pilot
samples_out[2] = sin(3.0 * m_phase); // 3f pilot
samples_out[1] = 2.0 * m_psin * m_pcos; // Pilot signal (2f)
samples_out[2] = m_phase; // Pilot phase
}
};

View File

@ -141,6 +141,11 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
}
if (m_running.m_rdsActive)
{
m_rdsDemod.process(demod, m_pilotPLLSamples[2]);
}
Real sampleStereo;
// Process stereo if stereo mode is selected
@ -151,7 +156,7 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
if (m_running.m_showPilot)
{
m_sampleBuffer.push_back(Sample(m_pilotPLLSamples[2] * (1<<15), 0.0)); // debug 57 kHz pilot
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);

View File

@ -30,6 +30,7 @@
#include "dsp/filterrc.h"
#include "audio/audiofifo.h"
#include "util/message.h"
#include "rdsdemod.h"
#define rfFilterFftLength 1024
@ -187,6 +188,8 @@ private:
LowPassFilterRC m_deemphasisFilterY;
static const Real default_deemphasis = 50.0; // 50 us
RDSDemod m_rdsDemod;
void apply();
};