69 template <
class Scalar>
85 if (Config::typeId<int16_t>() != src_cfg.
type()) {
87 err <<
"Can not configure ASKDetector: Invalid type " << src_cfg.
type()
88 <<
", expected " << Config::typeId<int16_t>();
96 msg <<
"Config ASKDetector node: " << std::endl
97 <<
" threshold: " << 0 << std::endl
98 <<
" invert: " << (
_invert ?
"yes" :
"no" ) << std::endl
99 <<
" symbol rate: " << src_cfg.
sampleRate() <<
" Hz";
107 for (
size_t i=0; i<buffer.
size(); i++) {
192 #endif // __SDR_FSK_HH__
Buffer< std::complex< float > > _markHist
FIR filter buffer.
Definition: fsk.hh:51
Buffer< std::complex< float > > _spaceHist
FIR filter buffer.
Definition: fsk.hh:53
A collection of configuration information that is send by a source to all connected sinks to properga...
Definition: node.hh:35
float _omega
Phase velocity.
Definition: fsk.hh:160
ASKDetector(bool invert=false)
Constructor.
Definition: fsk.hh:74
float _pllGain
PLL gain.
Definition: fsk.hh:166
size_t _symIdx
Insertion index for the next symbol.
Definition: fsk.hh:152
float _phase
Current bit "phase".
Definition: fsk.hh:158
std::ostream & _stream
The output stream.
Definition: fsk.hh:188
Buffer< uint8_t > _buffer
The output buffer.
Definition: fsk.hh:117
BitStream(float baud, Mode mode=TRANSITION)
Constructor.
Definition: fsk.cc:102
virtual void send(const RawBuffer &buffer, bool allow_overwrite=false)
Sends the given buffer to all connected sinks.
Definition: node.cc:67
Typed sink.
Definition: node.hh:192
float _baud
Baudrate of the transmission.
Definition: fsk.hh:37
Definition: autocast.hh:8
void process(const Buffer< int16_t > &buffer, bool allow_overwrite)
Needs to be implemented by any sub-type to process the received data.
Definition: fsk.cc:90
void config(const Config &src_cfg)
Needs to be implemented by any sub-type to check and perform the configuration of the node...
Definition: fsk.hh:80
bool hasSampleRate() const
If true, the configuration has a sample rate.
Definition: node.hh:75
void config(const Config &src_cfg)
Needs to be implemented by any sub-type to check and perform the configuration of the node...
Definition: fsk.cc:109
Generic source class.
Definition: node.hh:213
Mode _mode
The bit detection mode.
Definition: fsk.hh:146
Transition mode (i.e. transition -> 0, no transition -> 1).
Definition: fsk.hh:130
Buffer< uint8_t > _buffer
Output buffer.
Definition: fsk.hh:170
int32_t _symSum
Sum over all received symbol (encoded as -1 & 1).
Definition: fsk.hh:154
float _Fspace
Space "tone" frequency.
Definition: fsk.hh:45
size_t size() const
Returns the number of elements of type T in this buffer.
Definition: buffer.hh:166
bool hasType() const
If true, the configuration has a type.
Definition: node.hh:69
bool _invert
If true the symbol logic is inverted.
Definition: fsk.hh:115
Buffer< std::complex< float > > _spaceLUT
Space frequency FIR filter LUT.
Definition: fsk.hh:49
uint8_t _lastBits
The last decoded bits (needed for transition mode).
Definition: fsk.hh:168
Buffer< int8_t > _buffer
Output buffer.
Definition: fsk.hh:55
FSKDetector(float baud, float Fmark, float Fspace)
Constructor.
Definition: fsk.cc:12
virtual void setConfig(const Config &config)
Stores the configuration and propergates it if the configuration has been changed.
Definition: node.cc:98
float _baud
The baud rate.
Definition: fsk.hh:144
Buffer< T > head(size_t n) const
Returns a new view on this buffer.
Definition: buffer.hh:237
Buffer< int8_t > _symbols
Last received symbols.
Definition: fsk.hh:150
void log(const LogMessage &message)
Logs a message.
Definition: logger.cc:100
Type type() const
Returns the type.
Definition: node.hh:71
float _omegaMax
Maximum phase velocity.
Definition: fsk.hh:164
Trivial node to dump a bit-stream to a std::ostream.
Definition: fsk.hh:176
static Logger & get()
Returns the singleton instance of the logger.
Definition: logger.cc:89
BitDump(std::ostream &stream)
Constructor.
Definition: fsk.cc:208
The configuration error class.
Definition: exception.hh:24
A log message.
Definition: logger.hh:22
size_t bufferSize() const
Returns the max.
Definition: node.hh:83
void process(const Buffer< Scalar > &buffer, bool allow_overwrite)
Needs to be implemented by any sub-type to process the received data.
Definition: fsk.hh:106
Implements the basic FSK/AFSK symbol detection.
Definition: fsk.hh:18
size_t _lutIdx
The current FIR filter LUT index.
Definition: fsk.hh:41
Mode
Possible bit decoding modes.
Definition: fsk.hh:128
void config(const Config &src_cfg)
Needs to be implemented by any sub-type to check and perform the configuration of the node...
Definition: fsk.cc:19
Rather trivial node to detect mark/space symbols by the amplitude.
Definition: fsk.hh:70
size_t _corrLen
The filter lenght.
Definition: fsk.hh:39
Normal mode (i.e. mark -> 1, space -> 0).
Definition: fsk.hh:129
void config(const Config &src_cfg)
Needs to be implemented by any sub-type to check and perform the configuration of the node...
Definition: fsk.cc:215
void process(const Buffer< uint8_t > &buffer, bool allow_overwrite)
Needs to be implemented by any sub-type to process the received data.
Definition: fsk.cc:229
Buffer< std::complex< float > > _markLUT
Mark frequency FIR filter LUT.
Definition: fsk.hh:47
size_t _corrLen
The approximative bit length in samples.
Definition: fsk.hh:148
Forward declaration of type tratis template.
Definition: traits.hh:20
int32_t _lastSymSum
Last sum over all received symbol (encoded as -1 & 1).
Definition: fsk.hh:156
float _omegaMin
Minimum phase velocity.
Definition: fsk.hh:162
Decodes a bitstream with the desired baud rate.
Definition: fsk.hh:124
uint8_t _process(int16_t sample)
Updates the mark/space FIR filter and returns the sampled symbol.
Definition: fsk.cc:69
A typed buffer.
Definition: buffer.hh:111
double sampleRate() const
Returns the sample rate.
Definition: node.hh:77
float _Fmark
Mark "tone" frequency.
Definition: fsk.hh:43
void process(const Buffer< uint8_t > &buffer, bool allow_overwrite)
Needs to be implemented by any sub-type to process the received data.
Definition: fsk.cc:158