libsdr  0.1.0
A simple SDR library
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
sdr::FSKDetector Class Reference

Implements the basic FSK/AFSK symbol detection. More...

#include <fsk.hh>

Inheritance diagram for sdr::FSKDetector:
sdr::Sink< int16_t > sdr::Source sdr::SinkBase

Public Member Functions

 FSKDetector (float baud, float Fmark, float Fspace)
 Constructor. More...
 
void config (const Config &src_cfg)
 Needs to be implemented by any sub-type to check and perform the configuration of the node. More...
 
void process (const Buffer< int16_t > &buffer, bool allow_overwrite)
 Needs to be implemented by any sub-type to process the received data. More...
 
- Public Member Functions inherited from sdr::Sink< int16_t >
 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

uint8_t _process (int16_t sample)
 Updates the mark/space FIR filter and returns the sampled symbol. 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

float _baud
 Baudrate of the transmission. More...
 
size_t _corrLen
 The filter lenght. More...
 
size_t _lutIdx
 The current FIR filter LUT index. More...
 
float _Fmark
 Mark "tone" frequency. More...
 
float _Fspace
 Space "tone" frequency. More...
 
Buffer< std::complex< float > > _markLUT
 Mark frequency FIR filter LUT. More...
 
Buffer< std::complex< float > > _spaceLUT
 Space frequency FIR filter LUT. More...
 
Buffer< std::complex< float > > _markHist
 FIR filter buffer. More...
 
Buffer< std::complex< float > > _spaceHist
 FIR filter buffer. More...
 
Buffer< int8_t > _buffer
 Output buffer. 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

Implements the basic FSK/AFSK symbol detection.

This node contains two FIR filters for the detection of the mark and space frequencies. The node returns a sequence of symbols (i.e. sub-bits) which need to be processed to obtain a sequenc of transmitted bits (i.e. by the BitStream node).

Constructor & Destructor Documentation

FSKDetector::FSKDetector ( float  baud,
float  Fmark,
float  Fspace 
)

Constructor.

Parameters
baudSpecifies the baud-rate of the signal.
FmarkSpecifies the mark frequency in Hz.
FspaceSpecifies the space frequency in Hz.

Member Function Documentation

uint8_t FSKDetector::_process ( int16_t  sample)
protected

Updates the mark/space FIR filter and returns the sampled symbol.

void FSKDetector::config ( const Config src_cfg)
virtual

Needs to be implemented by any sub-type to check and perform the configuration of the node.

Implements sdr::SinkBase.

void FSKDetector::process ( const Buffer< int16_t > &  buffer,
bool  allow_overwrite 
)
virtual

Needs to be implemented by any sub-type to process the received data.

Implements sdr::Sink< int16_t >.

Member Data Documentation

float sdr::FSKDetector::_baud
protected

Baudrate of the transmission.

Needed to compute the filter length of the FIR mark/space filters.

Buffer<int8_t> sdr::FSKDetector::_buffer
protected

Output buffer.

size_t sdr::FSKDetector::_corrLen
protected

The filter lenght.

float sdr::FSKDetector::_Fmark
protected

Mark "tone" frequency.

float sdr::FSKDetector::_Fspace
protected

Space "tone" frequency.

size_t sdr::FSKDetector::_lutIdx
protected

The current FIR filter LUT index.

Buffer< std::complex<float> > sdr::FSKDetector::_markHist
protected

FIR filter buffer.

Buffer< std::complex<float> > sdr::FSKDetector::_markLUT
protected

Mark frequency FIR filter LUT.

Buffer< std::complex<float> > sdr::FSKDetector::_spaceHist
protected

FIR filter buffer.

Buffer< std::complex<float> > sdr::FSKDetector::_spaceLUT
protected

Space frequency FIR filter LUT.


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