32 m_filterChainSetMode(false),
33 m_sampleSource(sampleSource),
34 m_outputSampleRate(0),
35 m_requestedInputSampleRate(0),
36 m_requestedCenterFrequency(0),
37 m_currentInputSampleRate(0),
38 m_currentCenterFrequency(0)
40 QString name =
"UpChannelizer(" + m_sampleSource->objectName() +
")";
52 messageQueue->
push(cmd);
58 messageQueue->
push(cmd);
77 std::vector<Sample>::iterator stageSample =
m_stageSamples.begin();
83 if ((*stage)->work(&
m_sampleIn, &(*stageSample)))
90 if (!(*stage)->work(&(*(stageSample+1)), &(*stageSample)))
119 qDebug() <<
"UpChannelizer::start: thread: " << thread()
135 qDebug() <<
"UpChannelizer::handleMessage: " << cmd.
getIdentifier();
143 qDebug() <<
"UpChannelizer::handleMessage: DSPSignalNotification: m_outputSampleRate: " <<
m_outputSampleRate;
164 qDebug() <<
"UpChannelizer::handleMessage: DSPConfigureChannelizer:" 175 qDebug() <<
"UpChannelizer::handleMessage: MsgSetChannelizer";
200 qDebug() <<
"UpChannelizer::applyConfiguration: aborting (out=0):" 221 qDebug() <<
"UpChannelizer::applyConfiguration:" 237 std::vector<unsigned int> stageIndexes;
308 if(sigEnd <= sigStart)
310 if(chanEnd <= chanStart)
312 return (sigStart <= chanStart) && (sigEnd >= chanEnd);
317 Real sigBw = sigEnd - sigStart;
318 Real rot = sigBw / 4;
321 qDebug() <<
"UpChannelizer::createFilterChain: start:" 322 <<
" sig: [" << sigStart <<
":" << sigEnd <<
"]" 324 <<
" chan: [" << chanStart <<
":" << chanEnd <<
"]" 330 qDebug() <<
"UpChannelizer::createFilterChain: take left half (rotate by +1/4 and decimate by 2):" 332 <<
" sig: [" << sigStart <<
":" << sigStart + sigBw / 2.0 <<
"]";
341 qDebug() <<
"UpChannelizer::createFilterChain: take right half (rotate by -1/4 and decimate by 2):" 343 <<
" sig: [" << sigEnd - sigBw / 2.0f <<
":" << sigEnd <<
"]";
353 qDebug() <<
"UpChannelizer::createFilterChain: take center half (decimate by 2):" 355 <<
" sig: [" << sigStart + rot <<
":" << sigEnd - rot <<
"]";
362 Real ofs = ((chanEnd - chanStart) / 2.0 + chanStart) - ((sigEnd - sigStart) / 2.0 + sigStart);
364 qDebug() <<
"UpChannelizer::createFilterChain: complete:" 375 std::vector<unsigned int>::const_reverse_iterator rit = stageIndexes.rbegin();
376 double ofs = 0.0, ofs_stage = 0.25;
382 for (; rit != stageIndexes.rend(); ++rit)
FilterStages m_filterStages
virtual void pull(Sample &sample)
void push(Message *message, bool emitSignal=true)
Push message onto queue.
double setFilterChain(const std::vector< unsigned int > &stageIndexes)
returns offset in ratio of sample rate
unsigned int getFilterChainHash() const
int m_requestedInputSampleRate
int m_currentCenterFrequency
BasebandSampleSource * m_sampleSource
Modulator.
static double convertToIndexes(unsigned int log2, unsigned int chainHash, std::vector< unsigned int > &chainIndexes)
MessageQueue * getInputMessageQueue()
Get the queue for asynchronous inbound communication.
IntHalfbandFilterDB< qint32, UPCHANNELIZER_HB_FILTER_ORDER > * m_filter
unsigned int getLog2Interp() const
Real createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd)
void set(MessageQueue *messageQueue, unsigned int log2Interp, unsigned int filterChainHash)
static MsgChannelizerNotification * create(int basebandSampleRate, int samplerate, qint64 frequencyOffset)
void applySetting(unsigned int log2Decim, unsigned int filterChainHash)
void outputSampleRateChanged()
#define MESSAGE_CLASS_DEFINITION(Name, BaseClass)
virtual void pull(Sample &sample)=0
static bool match(const Message *message)
SampleVector m_sampleBuffer
virtual bool handleMessage(const Message &cmd)
Processing of a message. Returns true if message has actually been processed.
bool m_filterChainSetMode
WorkFunction m_workFunction
int m_requestedCenterFrequency
int m_currentInputSampleRate
bool signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const
int getSampleRate() const
virtual const char * getIdentifier() const
void applyConfiguration()
#define UPCHANNELIZER_HB_FILTER_ORDER
std::vector< Sample > m_stageSamples
void configure(MessageQueue *messageQueue, int sampleRate, int centerFrequency)