1
0
mirror of https://github.com/f4exb/sdrangel.git synced 2026-08-10 13:33:49 -04:00

Tx ph.2: UpChannelizer: interpolator (1) draft

This commit is contained in:
f4exb
2016-10-28 18:39:45 +02:00
parent 1f58b6ece7
commit e9f0bb0d45
3 changed files with 91 additions and 14 deletions
+17 -8
View File
@@ -63,14 +63,23 @@ void UpChannelizer::pull(Sample& sample)
{
m_mutex.lock();
// TODO: handle multiple stages
FilterStages::iterator stage = m_filterStages.begin();
FilterStages::iterator last = m_filterStages.end();
last--;
if ((*stage)->work(&m_sampleIn, &sample))
{
m_sampleSource->pull(m_sampleIn);
}
// m_sampleIn
for (; stage != m_filterStages.end(); ++stage)
{
// let's make it work for one stage only (96 kS/s < SR < 192 kS/s)
if(stage == last)
{
if ((*stage)->work(&m_sampleIn, &sample))
{
m_sampleSource->pull(m_sampleIn); // get new input sample
}
}
}
m_mutex.unlock();
}
@@ -162,9 +171,9 @@ void UpChannelizer::applyConfiguration()
m_currentInputSampleRate = m_outputSampleRate / (1 << m_filterStages.size());
qDebug() << "UpChannelizer::applyConfiguration in=" << m_outputSampleRate
qDebug() << "UpChannelizer::applyConfiguration out=" << m_outputSampleRate
<< ", req=" << m_requestedInputSampleRate
<< ", out=" << m_currentInputSampleRate
<< ", in=" << m_currentInputSampleRate
<< ", fc=" << m_currentCenterFrequency;
if (m_sampleSource != 0)