libsdr  0.1.0
A simple SDR library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sdr::FilterSource< Scalar > Class Template Reference

Performs the overlap-add FFT filtering and back-transform. More...

#include <filternode.hh>

Inheritance diagram for sdr::FilterSource< Scalar >:
sdr::Sink< std::complex< Scalar > > sdr::Source sdr::SinkBase

Public Member Functions

 FilterSource (size_t block_size, double fmin, double fmax)
 Constructor. More...
 
virtual ~FilterSource ()
 Destructor. More...
 
void setFreq (double fmin, double fmax)
 Set the frequency range. More...
 
virtual void config (const Config &src_cfg)
 Configures the filter node. More...
 
virtual void process (const Buffer< std::complex< Scalar > > &buffer, bool allow_overwrite)
 Performs the FFT filtering and back-transform. More...
 
- Public Member Functions inherited from sdr::Sink< std::complex< Scalar > >
 Sink ()
 Constructor. More...
 
virtual ~Sink ()
 Drestructor. More...
 
virtual void handleBuffer (const RawBuffer &buffer, bool allow_overwrite)
 Re-implemented from SinkBase. More...
 
- Public Member Functions inherited from sdr::SinkBase
 SinkBase ()
 Constructor. More...
 
virtual ~SinkBase ()
 Destructor. More...
 
- Public Member Functions inherited from sdr::Source
 Source ()
 Constructor. More...
 
virtual ~Source ()
 Destructor. More...
 
virtual void send (const RawBuffer &buffer, bool allow_overwrite=false)
 Sends the given buffer to all connected sinks. More...
 
void connect (SinkBase *sink, bool direct=false)
 Connect this source to a sink. More...
 
void disconnect (SinkBase *sink)
 Disconnect a sink again. More...
 
virtual void setConfig (const Config &config)
 Stores the configuration and propergates it if the configuration has been changed. More...
 
virtual double sampleRate () const
 Returns the configured sample rate or 0 otherwise. More...
 
virtual Config::Type type () const
 Returns the configured source type or Config::Type_UNDEFINED otherwise. More...
 
template<class T >
void addEOS (T *instance, void(T::*function)())
 Adds a callback to the end-of-stream signal of the source. More...
 

Protected Member Functions

void _updateFilter ()
 Updates the sink-filter. More...
 
- Protected Member Functions inherited from sdr::Source
void signalEOS ()
 Signals the EOS. More...
 
void propagateConfig (const Config &config)
 Propagates the given configuration to all connected sinks. More...
 

Protected Attributes

size_t _block_size
 Holds the block size of the filter. More...
 
double _sample_rate
 The current sample-rate. More...
 
Buffer< std::complex< Scalar > > _in_buffer
 An input buffer. More...
 
Buffer< std::complex< Scalar > > _trafo_buffer
 A compute buffer. More...
 
Buffer< std::complex< Scalar > > _last_trafo
 Holds a copy of the second-half of the last output signal. More...
 
Buffer< std::complex< Scalar > > _kern
 Holds the current filter kernel. More...
 
BufferSet< std::complex< Scalar > > _buffers
 The output buffers. More...
 
double _fmin
 The lower frequency range. More...
 
double _fmax
 The upper frequency range. More...
 
FFTPlan< Scalar > _plan
 The FFT plan for the FFT back-transform. More...
 
- Protected Attributes inherited from sdr::Source
Config _config
 Holds the source configuration, this can be updated by calling setConfig. More...
 
std::map< SinkBase *, bool > _sinks
 The connected sinks. More...
 
std::list< DelegateInterface * > _eos
 The connected EOS singal handlers. More...
 

Detailed Description

template<class Scalar>
class sdr::FilterSource< Scalar >

Performs the overlap-add FFT filtering and back-transform.

Constructor & Destructor Documentation

template<class Scalar >
sdr::FilterSource< Scalar >::FilterSource ( size_t  block_size,
double  fmin,
double  fmax 
)
inline

Constructor.

template<class Scalar >
virtual sdr::FilterSource< Scalar >::~FilterSource ( )
inlinevirtual

Destructor.

Member Function Documentation

template<class Scalar >
void sdr::FilterSource< Scalar >::_updateFilter ( )
inlineprotected

Updates the sink-filter.

template<class Scalar >
virtual void sdr::FilterSource< Scalar >::config ( const Config src_cfg)
inlinevirtual

Configures the filter node.

Implements sdr::SinkBase.

template<class Scalar >
virtual void sdr::FilterSource< Scalar >::process ( const Buffer< std::complex< Scalar > > &  buffer,
bool  allow_overwrite 
)
inlinevirtual

Performs the FFT filtering and back-transform.

Implements sdr::Sink< std::complex< Scalar > >.

template<class Scalar >
void sdr::FilterSource< Scalar >::setFreq ( double  fmin,
double  fmax 
)
inline

Set the frequency range.

Member Data Documentation

template<class Scalar >
size_t sdr::FilterSource< Scalar >::_block_size
protected

Holds the block size of the filter.

template<class Scalar >
BufferSet< std::complex<Scalar> > sdr::FilterSource< Scalar >::_buffers
protected

The output buffers.

template<class Scalar >
double sdr::FilterSource< Scalar >::_fmax
protected

The upper frequency range.

template<class Scalar >
double sdr::FilterSource< Scalar >::_fmin
protected

The lower frequency range.

template<class Scalar >
Buffer< std::complex<Scalar> > sdr::FilterSource< Scalar >::_in_buffer
protected

An input buffer.

template<class Scalar >
Buffer< std::complex<Scalar> > sdr::FilterSource< Scalar >::_kern
protected

Holds the current filter kernel.

template<class Scalar >
Buffer< std::complex<Scalar> > sdr::FilterSource< Scalar >::_last_trafo
protected

Holds a copy of the second-half of the last output signal.

template<class Scalar >
FFTPlan<Scalar> sdr::FilterSource< Scalar >::_plan
protected

The FFT plan for the FFT back-transform.

template<class Scalar >
double sdr::FilterSource< Scalar >::_sample_rate
protected

The current sample-rate.

template<class Scalar >
Buffer< std::complex<Scalar> > sdr::FilterSource< Scalar >::_trafo_buffer
protected

A compute buffer.


The documentation for this class was generated from the following file: