31 m_filterChainSetMode(false),
32 m_sampleSink(sampleSink),
34 m_requestedOutputSampleRate(0),
35 m_requestedCenterFrequency(0),
36 m_currentOutputSampleRate(0),
37 m_currentCenterFrequency(0)
39 QString name =
"DownChannelizer(" + m_sampleSink->objectName() +
")";
51 messageQueue->
push(cmd);
57 messageQueue->
push(cmd);
60 void DownChannelizer::feed(
const SampleVector::const_iterator& begin,
const SampleVector::const_iterator& end,
bool positiveOnly)
75 for(SampleVector::const_iterator sample = begin; sample != end; ++sample)
82 #ifndef SDR_RX_SAMPLE_24BIT 86 if(!(*stage)->work(&s))
94 #ifdef SDR_RX_SAMPLE_24BIT 113 qDebug() <<
"DownChannelizer::start: thread: " << thread()
135 qDebug() <<
"DownChannelizer::handleMessage: DSPSignalNotification: m_inputSampleRate: " <<
m_inputSampleRate;
167 qDebug() <<
"DownChannelizer::handleMessage: MsgSetChannelizer";
174 qDebug() <<
"DownChannelizer::handleMessage: MsgThreadedSink: forwarded to demod";
179 qDebug() <<
"DownChannelizer::handleMessage: " << cmd.
getIdentifier() <<
" unhandled";
190 qDebug() <<
"DownChannelizer::applyConfiguration: m_inputSampleRate=0 aborting";
223 std::vector<unsigned int> stageIndexes;
235 qDebug() <<
"DownChannelizer::applySetting inputSampleRate:" <<
m_inputSampleRate 238 <<
" nb_filters: " << stageIndexes.size()
248 #ifdef SDR_RX_SAMPLE_24BIT 300 if(sigEnd <= sigStart)
302 if(chanEnd <= chanStart)
304 return (sigStart <= chanStart) && (sigEnd >= chanEnd);
309 Real sigBw = sigEnd - sigStart;
310 Real rot = sigBw / 4;
338 Real ofs = ((chanEnd - chanStart) / 2.0 + chanStart) - ((sigEnd - sigStart) / 2.0 + sigStart);
346 std::vector<unsigned int>::const_reverse_iterator rit = stageIndexes.rbegin();
351 for (; rit != stageIndexes.rend(); ++rit)
355 }
else if (*rit == 1) {
357 }
else if (*rit == 2) {
372 qDebug(
"DownChannelizer::debugFilterChain: %lu stages",
m_filterStages.size());
376 switch ((*it)->m_mode)
379 qDebug(
"DownChannelizer::debugFilterChain: center %s", (*it)->m_sse ?
"sse" :
"no_sse");
382 qDebug(
"DownChannelizer::debugFilterChain: lower %s", (*it)->m_sse ?
"sse" :
"no_sse");
385 qDebug(
"DownChannelizer::debugFilterChain: upper %s", (*it)->m_sse ?
"sse" :
"no_sse");
388 qDebug(
"DownChannelizer::debugFilterChain: none %s", (*it)->m_sse ?
"sse" :
"no_sse");
int m_currentOutputSampleRate
int m_currentCenterFrequency
void configure(MessageQueue *messageQueue, int sampleRate, int centerFrequency)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
#define DOWNCHANNELIZER_HB_FILTER_ORDER
unsigned int getFilterChainHash() const
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
void inputSampleRateChanged()
SampleVector m_sampleBuffer
bool signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const
static double convertToIndexes(unsigned int log2, unsigned int chainHash, std::vector< unsigned int > &chainIndexes)
int m_requestedCenterFrequency
bool m_filterChainSetMode
virtual void feed(const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool positiveOnly)=0
virtual void feed(const SampleVector::const_iterator &begin, const SampleVector::const_iterator &end, bool positiveOnly)
virtual bool handleMessage(const Message &cmd)=0
Processing of a message. Returns true if message has actually been processed.
int m_requestedOutputSampleRate
virtual ~DownChannelizer()
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
FilterStages m_filterStages
IntHalfbandFilterEO< qint32, qint32, DOWNCHANNELIZER_HB_FILTER_ORDER > * m_filter
Real createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd)
virtual bool handleMessage(const Message &cmd)
Processing of a message. Returns true if message has actually been processed.
void set(MessageQueue *messageQueue, unsigned int log2Decim, unsigned int filterChainHash)
static bool match(const Message *message)
unsigned int getLog2Decim() const
int getSampleRate() const
virtual const char * getIdentifier() const
WorkFunction m_workFunction
void applySetting(unsigned int log2Decim, unsigned int filterChainHash)
BasebandSampleSink * m_sampleSink
Demodulator.
void applyConfiguration()
void setFilterChain(const std::vector< unsigned int > &stageIndexes)
static MsgChannelizerNotification * create(int samplerate, qint64 frequencyOffset)