|
libsdr
0.1.0
A simple SDR library
|
A simple (Audio) Frequency Shift Keying (AFSK) demodulator. More...
#include <afsk.hh>
Public Types | |
| enum | Mode { NORMAL, TRANSITION } |
| Possible bit decoding modes. More... | |
Public Member Functions | |
| AFSK (double baud=1200.0, double Fmark=1200.0, double Fspace=2200.0, Mode mode=TRANSITION) | |
Constructs a AFSK node with the specified baud rate and Fmark, Fspace frequencies. More... | |
| virtual | ~AFSK () |
| Destructor. More... | |
| virtual void | config (const Config &src_cfg) |
| Configures the node. More... | |
| virtual void | process (const Buffer< int16_t > &buffer, bool allow_overwrite) |
| Processes the given buffer. 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 | |
| double | _getSymbol () |
| Performs the convolution filtering of the mark & space frequencies. 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 | _sampleRate |
| The sample rate of the input signal. More... | |
| float | _symbolRate |
| A multiple of the baud rate. More... | |
| float | _baud |
| The baud rate. More... | |
| float | _Fmark |
| Mark "tone" frequency. More... | |
| float | _Fspace |
| Space "tone" frequency. More... | |
| Mode | _mode |
| Bit encoding mode. More... | |
| uint32_t | _corrLen |
| Correlation length, the number of "symbols" per bit. More... | |
| uint32_t | _lutIdx |
| The current FIR filter LUT index. 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... | |
| float | _mu |
| Symbol subsampling counter. More... | |
| float | _muIncr |
| Symbol subsampling. More... | |
| Buffer< float > | _dl |
| Delay line for the 8-pole interpolation filter. More... | |
| size_t | _dl_idx |
| Delay line index. More... | |
| Buffer< int16_t > | _symbols |
Ring buffer of the last _corrLen symbols. More... | |
| size_t | _symbolIdx |
| Insertion index. More... | |
| int32_t | _symSum |
Sum of the current _corrLen symbols. More... | |
| int32_t | _lastSymSum |
Sum of the last _corrLen symbols. More... | |
| uint32_t | _lastBits |
| Last received bits. More... | |
| float | _phase |
| Current PLL phase. More... | |
| float | _omega |
| PLL phase speed. More... | |
| float | _omegaMin |
| Maximum PLL phase speed. More... | |
| float | _omegaMax |
| Minimum PLL phase speed. More... | |
| float | _gainOmega |
| PLL gain. More... | |
| Buffer< uint8_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... | |
A simple (Audio) Frequency Shift Keying (AFSK) demodulator.
This node consists of two convolution peak-filters at the mark and space frequencies, a interpolating sub-sampler to match the baud-rate exactly and a PLL to lock to the symbol transitions. The node will decode the (A)FSK signal and will send a bit-stream (uint8_t).
| AFSK::AFSK | ( | double | baud = 1200.0, |
| double | Fmark = 1200.0, |
||
| double | Fspace = 2200.0, |
||
| Mode | mode = TRANSITION |
||
| ) |
Constructs a AFSK node with the specified baud rate and Fmark, Fspace frequencies.
The default valuse corresponds to those used for 1200 baud packet radio.
|
virtual |
Destructor.
|
inlineprotected |
Performs the convolution filtering of the mark & space frequencies.
|
virtual |
Configures the node.
Implements sdr::SinkBase.
|
virtual |
Processes the given buffer.
std::cerr << "Transition at phi=" << _phase << std::endl << " update omega from " << _omega << " to ";
Implements sdr::Sink< int16_t >.
|
protected |
The baud rate.
|
protected |
Output buffer.
|
protected |
Correlation length, the number of "symbols" per bit.
|
protected |
Delay line for the 8-pole interpolation filter.
|
protected |
Delay line index.
|
protected |
Mark "tone" frequency.
|
protected |
Space "tone" frequency.
|
protected |
PLL gain.
|
protected |
Last received bits.
|
protected |
Sum of the last _corrLen symbols.
|
protected |
The current FIR filter LUT index.
|
protected |
FIR filter buffer.
|
protected |
Mark frequency FIR filter LUT.
|
protected |
Bit encoding mode.
|
protected |
Symbol subsampling counter.
|
protected |
Symbol subsampling.
|
protected |
PLL phase speed.
|
protected |
Minimum PLL phase speed.
|
protected |
Maximum PLL phase speed.
|
protected |
Current PLL phase.
|
protected |
The sample rate of the input signal.
|
protected |
FIR filter buffer.
|
protected |
Space frequency FIR filter LUT.
|
protected |
Insertion index.
|
protected |
A multiple of the baud rate.
|
protected |
Ring buffer of the last _corrLen symbols.
|
protected |
Sum of the current _corrLen symbols.
1.8.9.1