1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2024-11-26 01:39:05 -05:00

NFM modulator: pull a number of input audio samples depending on total interpolation. Fixes issue #43

This commit is contained in:
f4exb 2017-08-06 17:38:17 +02:00
parent fdfa4351ad
commit 18b22b58fb
3 changed files with 8 additions and 4 deletions

View File

@ -154,7 +154,7 @@ void NFMMod::pull(Sample& sample)
void NFMMod::pullAudio(int nbSamples)
{
unsigned int nbSamplesAudio = nbSamples * m_interpolatorDistance;
unsigned int nbSamplesAudio = nbSamples * ((Real) m_config.m_audioSampleRate / (Real) m_config.m_basebandSampleRate);
if (nbSamplesAudio > m_audioBuffer.size())
{
@ -291,13 +291,15 @@ bool NFMMod::handleMessage(const Message& cmd)
{
UpChannelizer::MsgChannelizerNotification& notif = (UpChannelizer::MsgChannelizerNotification&) cmd;
m_config.m_outputSampleRate = notif.getSampleRate();
m_config.m_basebandSampleRate = notif.getBasebandSampleRate();
m_config.m_outputSampleRate = notif.getSampleRate();
m_config.m_inputFrequencyOffset = notif.getFrequencyOffset();
apply();
qDebug() << "NFMMod::handleMessage: MsgChannelizerNotification:"
<< " m_outputSampleRate: " << m_config.m_outputSampleRate
<< " m_basebandSampleRate: " << m_config.m_basebandSampleRate
<< " m_outputSampleRate: " << m_config.m_outputSampleRate
<< " m_inputFrequencyOffset: " << m_config.m_inputFrequencyOffset;
return true;

View File

@ -293,6 +293,7 @@ private:
};
struct Config {
int m_basebandSampleRate;
int m_outputSampleRate;
qint64 m_inputFrequencyOffset;
Real m_rfBandwidth;
@ -307,6 +308,7 @@ private:
float m_ctcssFrequency;
Config() :
m_basebandSampleRate(0),
m_outputSampleRate(-1),
m_inputFrequencyOffset(0),
m_rfBandwidth(-1),

View File

@ -23,7 +23,7 @@
const PluginDescriptor NFMModPlugin::m_pluginDescriptor = {
QString("NFM Modulator"),
QString("3.5.0"),
QString("3.5.4"),
QString("(c) Edouard Griffiths, F4EXB"),
QString("https://github.com/f4exb/sdrangel"),
true,