| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | #include "dsp/channelizer.h"
 | 
					
						
							|  |  |  | #include "dsp/inthalfbandfilter.h"
 | 
					
						
							|  |  |  | #include "dsp/dspcommands.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-21 08:54:28 +02:00
										 |  |  | #include <QString>
 | 
					
						
							| 
									
										
										
										
											2015-08-09 10:33:04 +02:00
										 |  |  | #include <QDebug>
 | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-19 22:12:52 +02:00
										 |  |  | MESSAGE_CLASS_DEFINITION(Channelizer::MsgChannelizerNotification, Message) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | Channelizer::Channelizer(SampleSink* sampleSink) : | 
					
						
							|  |  |  | 	m_sampleSink(sampleSink), | 
					
						
							| 
									
										
										
										
											2015-08-24 02:06:11 +02:00
										 |  |  | 	m_inputSampleRate(0), | 
					
						
							|  |  |  | 	m_requestedOutputSampleRate(0), | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	m_requestedCenterFrequency(0), | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 	m_currentOutputSampleRate(0), | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	m_currentCenterFrequency(0) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-21 08:54:28 +02:00
										 |  |  | 	QString name = "Channelizer(" + m_sampleSink->objectName() + ")"; | 
					
						
							|  |  |  | 	setObjectName(name); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Channelizer::~Channelizer() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	freeFilterChain(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Channelizer::configure(MessageQueue* messageQueue, int sampleRate, int centerFrequency) | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 	Message* cmd = new DSPConfigureChannelizer(sampleRate, centerFrequency); | 
					
						
							|  |  |  | 	messageQueue->push(cmd); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-25 08:24:23 +02:00
										 |  |  | void Channelizer::feed(const SampleVector::const_iterator& begin, const SampleVector::const_iterator& end, bool positiveOnly) | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 	if(m_sampleSink == 0) { | 
					
						
							| 
									
										
										
										
											2014-06-15 09:32:25 +01:00
										 |  |  | 		m_sampleBuffer.clear(); | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 	m_mutex.lock(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	for(SampleVector::const_iterator sample = begin; sample != end; ++sample) | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		Sample s(*sample); | 
					
						
							|  |  |  | 		FilterStages::iterator stage = m_filterStages.begin(); | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		for (; stage != m_filterStages.end(); ++stage) | 
					
						
							|  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 			if(!(*stage)->work(&s)) | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 			{ | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 				break; | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		if(stage == m_filterStages.end()) | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 			m_sampleBuffer.push_back(s); | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 	m_mutex.unlock(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-06-15 09:32:25 +01:00
										 |  |  | 	m_sampleSink->feed(m_sampleBuffer.begin(), m_sampleBuffer.end(), positiveOnly); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	m_sampleBuffer.clear(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Channelizer::start() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-24 02:06:11 +02:00
										 |  |  | 	if (m_sampleSink != 0) | 
					
						
							| 
									
										
										
										
											2015-08-13 01:14:21 +02:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 		qDebug() << "Channelizer::start: thread: " << thread() | 
					
						
							|  |  |  | 				<< " m_inputSampleRate: " << m_inputSampleRate | 
					
						
							|  |  |  | 				<< " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate | 
					
						
							|  |  |  | 				<< " m_requestedCenterFrequency: " << m_requestedCenterFrequency; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		m_sampleSink->start(); | 
					
						
							| 
									
										
										
										
											2015-08-13 01:14:21 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Channelizer::stop() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 	if(m_sampleSink != 0) | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		m_sampleSink->stop(); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | bool Channelizer::handleMessage(const Message& cmd) | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 	qDebug() << "Channelizer::handleMessage: " << cmd.getIdentifier(); | 
					
						
							| 
									
										
										
										
											2015-08-12 09:03:02 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-07 01:15:55 +02:00
										 |  |  | 	// TODO: apply changes only if input sample rate or requested output sample rate change. Change of center frequency has no impact.
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-17 08:29:34 +02:00
										 |  |  | 	if (DSPSignalNotification::match(cmd)) | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2015-08-17 08:29:34 +02:00
										 |  |  | 		DSPSignalNotification& notif = (DSPSignalNotification&) cmd; | 
					
						
							|  |  |  | 		m_inputSampleRate = notif.getSampleRate(); | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 		qDebug() << "Channelizer::handleMessage: DSPSignalNotification: m_inputSampleRate: " << m_inputSampleRate; | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		applyConfiguration(); | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 		if (m_sampleSink != 0) | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2015-08-17 08:29:34 +02:00
										 |  |  | 			m_sampleSink->handleMessage(notif); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-07-12 09:32:54 +02:00
										 |  |  | 		emit inputSampleRateChanged(); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		return true; | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2015-08-19 22:12:52 +02:00
										 |  |  | 	else if (DSPConfigureChannelizer::match(cmd)) | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2015-08-17 08:29:34 +02:00
										 |  |  | 		DSPConfigureChannelizer& chan = (DSPConfigureChannelizer&) cmd; | 
					
						
							|  |  |  | 		m_requestedOutputSampleRate = chan.getSampleRate(); | 
					
						
							|  |  |  | 		m_requestedCenterFrequency = chan.getCenterFrequency(); | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 		qDebug() << "Channelizer::handleMessage: DSPConfigureChannelizer:" | 
					
						
							|  |  |  | 				<< " m_requestedOutputSampleRate: " << m_requestedOutputSampleRate | 
					
						
							|  |  |  | 				<< " m_requestedCenterFrequency: " << m_requestedCenterFrequency; | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		applyConfiguration(); | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		return true; | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	else | 
					
						
							|  |  |  | 	{ | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 		if (m_sampleSink != 0) | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 			return m_sampleSink->handleMessage(cmd); | 
					
						
							| 
									
										
										
										
											2015-08-14 05:00:28 +02:00
										 |  |  | 		} | 
					
						
							|  |  |  | 		else | 
					
						
							|  |  |  | 		{ | 
					
						
							| 
									
										
										
										
											2015-08-10 00:09:10 +02:00
										 |  |  | 			return false; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Channelizer::applyConfiguration() | 
					
						
							|  |  |  | { | 
					
						
							| 
									
										
										
										
											2015-08-24 02:06:11 +02:00
										 |  |  | 	if (m_inputSampleRate == 0) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		qDebug() << "Channelizer::applyConfiguration: m_inputSampleRate=0 aborting"; | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 	m_mutex.lock(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	freeFilterChain(); | 
					
						
							| 
									
										
										
										
											2015-08-24 02:06:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	m_currentCenterFrequency = createFilterChain( | 
					
						
							|  |  |  | 		m_inputSampleRate / -2, m_inputSampleRate / 2, | 
					
						
							|  |  |  | 		m_requestedCenterFrequency - m_requestedOutputSampleRate / 2, m_requestedCenterFrequency + m_requestedOutputSampleRate / 2); | 
					
						
							| 
									
										
										
										
											2015-08-24 02:06:11 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-06 10:21:06 +02:00
										 |  |  | 	m_mutex.unlock(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	m_currentOutputSampleRate = m_inputSampleRate / (1 << m_filterStages.size()); | 
					
						
							| 
									
										
										
										
											2015-07-12 09:32:54 +02:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-09 10:33:04 +02:00
										 |  |  | 	qDebug() << "Channelizer::applyConfiguration in=" << m_inputSampleRate | 
					
						
							| 
									
										
										
										
											2015-05-15 11:29:41 +02:00
										 |  |  | 			<< ", req=" << m_requestedOutputSampleRate | 
					
						
							|  |  |  | 			<< ", out=" << m_currentOutputSampleRate | 
					
						
							| 
									
										
										
										
											2015-08-09 10:33:04 +02:00
										 |  |  | 			<< ", fc=" << m_currentCenterFrequency; | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	if (m_sampleSink != 0) | 
					
						
							|  |  |  | 	{ | 
					
						
							|  |  |  | 		MsgChannelizerNotification notif(m_currentOutputSampleRate, m_currentCenterFrequency); | 
					
						
							|  |  |  | 		m_sampleSink->handleMessage(notif); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Channelizer::FilterStage::FilterStage(Mode mode) : | 
					
						
							|  |  |  | 	m_filter(new IntHalfbandFilter), | 
					
						
							| 
									
										
										
										
											2015-08-24 00:51:27 +02:00
										 |  |  | 	m_workFunction(0) | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | { | 
					
						
							|  |  |  | 	switch(mode) { | 
					
						
							|  |  |  | 		case ModeCenter: | 
					
						
							|  |  |  | 			m_workFunction = &IntHalfbandFilter::workDecimateCenter; | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		case ModeLowerHalf: | 
					
						
							|  |  |  | 			m_workFunction = &IntHalfbandFilter::workDecimateLowerHalf; | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		case ModeUpperHalf: | 
					
						
							|  |  |  | 			m_workFunction = &IntHalfbandFilter::workDecimateUpperHalf; | 
					
						
							|  |  |  | 			break; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Channelizer::FilterStage::~FilterStage() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	delete m_filter; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | bool Channelizer::signalContainsChannel(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) const | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	//qDebug("   testing signal [%f, %f], channel [%f, %f]", sigStart, sigEnd, chanStart, chanEnd);
 | 
					
						
							|  |  |  | 	if(sigEnd <= sigStart) | 
					
						
							|  |  |  | 		return false; | 
					
						
							|  |  |  | 	if(chanEnd <= chanStart) | 
					
						
							|  |  |  | 		return false; | 
					
						
							|  |  |  | 	return (sigStart <= chanStart) && (sigEnd >= chanEnd); | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Real Channelizer::createFilterChain(Real sigStart, Real sigEnd, Real chanStart, Real chanEnd) | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	Real sigBw = sigEnd - sigStart; | 
					
						
							|  |  |  | 	Real safetyMargin = sigBw / 20; | 
					
						
							|  |  |  | 	Real rot = sigBw / 4; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	safetyMargin = 0; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 	//fprintf(stderr, "Channelizer::createFilterChain: ");
 | 
					
						
							|  |  |  | 	//fprintf(stderr, "Signal [%.1f, %.1f] (BW %.1f), Channel [%.1f, %.1f], Rot %.1f, Safety %.1f\n", sigStart, sigEnd, sigBw, chanStart, chanEnd, rot, safetyMargin);
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | #if 1
 | 
					
						
							|  |  |  | 	// check if it fits into the left half
 | 
					
						
							|  |  |  | 	if(signalContainsChannel(sigStart + safetyMargin, sigStart + sigBw / 2.0 - safetyMargin, chanStart, chanEnd)) { | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 		//fprintf(stderr, "-> take left half (rotate by +1/4 and decimate by 2)\n");
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		m_filterStages.push_back(new FilterStage(FilterStage::ModeLowerHalf)); | 
					
						
							|  |  |  | 		return createFilterChain(sigStart, sigStart + sigBw / 2.0, chanStart, chanEnd); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// check if it fits into the right half
 | 
					
						
							|  |  |  | 	if(signalContainsChannel(sigEnd - sigBw / 2.0f + safetyMargin, sigEnd - safetyMargin, chanStart, chanEnd)) { | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 		//fprintf(stderr, "-> take right half (rotate by -1/4 and decimate by 2)\n");
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		m_filterStages.push_back(new FilterStage(FilterStage::ModeUpperHalf)); | 
					
						
							|  |  |  | 		return createFilterChain(sigEnd - sigBw / 2.0f, sigEnd, chanStart, chanEnd); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// check if it fits into the center
 | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 	// Was: if(signalContainsChannel(sigStart + rot + safetyMargin, sigStart + rot + sigBw / 2.0f - safetyMargin, chanStart, chanEnd)) {
 | 
					
						
							|  |  |  | 	if(signalContainsChannel(sigStart + rot + safetyMargin, sigEnd - rot - safetyMargin, chanStart, chanEnd)) { | 
					
						
							|  |  |  | 		//fprintf(stderr, "-> take center half (decimate by 2)\n");
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 		m_filterStages.push_back(new FilterStage(FilterStage::ModeCenter)); | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 		// Was: return createFilterChain(sigStart + rot, sigStart + sigBw / 2.0f + rot, chanStart, chanEnd);
 | 
					
						
							|  |  |  | 		return createFilterChain(sigStart + rot, sigEnd - rot, chanStart, chanEnd); | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	} | 
					
						
							|  |  |  | #endif
 | 
					
						
							|  |  |  | 	Real ofs = ((chanEnd - chanStart) / 2.0 + chanStart) - ((sigEnd - sigStart) / 2.0 + sigStart); | 
					
						
							| 
									
										
										
										
											2015-05-15 03:12:27 +02:00
										 |  |  | 	//fprintf(stderr, "-> complete (final BW %.1f, frequency offset %.1f)\n", sigBw, ofs);
 | 
					
						
							| 
									
										
										
										
											2014-05-18 16:52:39 +01:00
										 |  |  | 	return ofs; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | void Channelizer::freeFilterChain() | 
					
						
							|  |  |  | { | 
					
						
							|  |  |  | 	for(FilterStages::iterator it = m_filterStages.begin(); it != m_filterStages.end(); ++it) | 
					
						
							|  |  |  | 		delete *it; | 
					
						
							|  |  |  | 	m_filterStages.clear(); | 
					
						
							|  |  |  | } |