mirror of https://github.com/f4exb/sdrangel.git
NFM demod: implemented interpolator for audio
This commit is contained in:
parent
e7215b54da
commit
9bd9c805de
|
@ -163,9 +163,29 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||||
Complex c(it->real(), it->imag());
|
Complex c(it->real(), it->imag());
|
||||||
c *= m_nco.nextIQ();
|
c *= m_nco.nextIQ();
|
||||||
|
|
||||||
|
if (m_interpolatorDistance < 1.0f) // interpolate
|
||||||
|
{
|
||||||
|
while (!m_interpolator.interpolate(&m_interpolatorDistanceRemain, c, &ci))
|
||||||
|
{
|
||||||
|
processOneSample(ci);
|
||||||
|
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else // decimate
|
||||||
|
{
|
||||||
if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
|
if (m_interpolator.decimate(&m_interpolatorDistanceRemain, c, &ci))
|
||||||
{
|
{
|
||||||
|
processOneSample(ci);
|
||||||
|
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
m_settingsMutex.unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
void NFMDemod::processOneSample(Complex &ci)
|
||||||
|
{
|
||||||
qint16 sample;
|
qint16 sample;
|
||||||
|
|
||||||
double magsqRaw; // = ci.real()*ci.real() + c.imag()*c.imag();
|
double magsqRaw; // = ci.real()*ci.real() + c.imag()*c.imag();
|
||||||
|
@ -327,10 +347,6 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||||
m_audioBufferFill = 0;
|
m_audioBufferFill = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_interpolatorDistanceRemain += m_interpolatorDistance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_audioBufferFill > 0)
|
if (m_audioBufferFill > 0)
|
||||||
{
|
{
|
||||||
uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill);
|
uint res = m_audioFifo.write((const quint8*)&m_audioBuffer[0], m_audioBufferFill);
|
||||||
|
@ -342,8 +358,6 @@ void NFMDemod::feed(const SampleVector::const_iterator& begin, const SampleVecto
|
||||||
|
|
||||||
m_audioBufferFill = 0;
|
m_audioBufferFill = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
m_settingsMutex.unlock();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void NFMDemod::start()
|
void NFMDemod::start()
|
||||||
|
|
|
@ -265,6 +265,8 @@ private:
|
||||||
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
void webapiFormatChannelReport(SWGSDRangel::SWGChannelReport& response);
|
||||||
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const NFMDemodSettings& settings, bool force);
|
void webapiReverseSendSettings(QList<QString>& channelSettingsKeys, const NFMDemodSettings& settings, bool force);
|
||||||
|
|
||||||
|
void processOneSample(Complex &ci);
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void networkManagerFinished(QNetworkReply *reply);
|
void networkManagerFinished(QNetworkReply *reply);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue