mirror of
https://github.com/f4exb/sdrangel.git
synced 2024-11-26 09:48:45 -05:00
BFM demod: basic RDS demodulator test
This commit is contained in:
parent
3cdab34fb7
commit
4ecc0f18bb
@ -146,10 +146,10 @@ public:
|
|||||||
protected:
|
protected:
|
||||||
virtual void processPhase(Real *samples_out) const
|
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.
|
// Generate double-frequency output.
|
||||||
// sin(2*x) = 2 * sin(x) * cos(x)
|
// sin(2*x) = 2 * sin(x) * cos(x)
|
||||||
samples_out[1] = 2.0 * m_psin * m_pcos; // 2f Pilot
|
samples_out[1] = 2.0 * m_psin * m_pcos; // Pilot signal (2f)
|
||||||
samples_out[2] = sin(3.0 * m_phase); // 3f pilot
|
samples_out[2] = m_phase; // Pilot phase
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -141,6 +141,11 @@ void BFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
|||||||
m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
|
m_sampleBuffer.push_back(Sample(demod * (1<<15), 0.0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_running.m_rdsActive)
|
||||||
|
{
|
||||||
|
m_rdsDemod.process(demod, m_pilotPLLSamples[2]);
|
||||||
|
}
|
||||||
|
|
||||||
Real sampleStereo;
|
Real sampleStereo;
|
||||||
|
|
||||||
// Process stereo if stereo mode is selected
|
// 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)
|
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);
|
Complex s(demod*2.0*m_pilotPLLSamples[1], 0);
|
||||||
|
@ -30,6 +30,7 @@
|
|||||||
#include "dsp/filterrc.h"
|
#include "dsp/filterrc.h"
|
||||||
#include "audio/audiofifo.h"
|
#include "audio/audiofifo.h"
|
||||||
#include "util/message.h"
|
#include "util/message.h"
|
||||||
|
#include "rdsdemod.h"
|
||||||
|
|
||||||
#define rfFilterFftLength 1024
|
#define rfFilterFftLength 1024
|
||||||
|
|
||||||
@ -187,6 +188,8 @@ private:
|
|||||||
LowPassFilterRC m_deemphasisFilterY;
|
LowPassFilterRC m_deemphasisFilterY;
|
||||||
static const Real default_deemphasis = 50.0; // 50 us
|
static const Real default_deemphasis = 50.0; // 50 us
|
||||||
|
|
||||||
|
RDSDemod m_rdsDemod;
|
||||||
|
|
||||||
void apply();
|
void apply();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user