Documentation ¶
Index ¶
- Constants
- func NextPowerOf2(v int) int
- func RegisterParser(name string, parserFn NewParserFunc)
- type Data
- type Decoder
- func (d *Decoder) Allocate()
- func (d Decoder) Decode(input []byte) chan Message
- func (d Decoder) Filter(input []float64, output []byte)
- func (d Decoder) Log()
- func (d *Decoder) RegisterProtocol(p Parser)
- func (d *Decoder) Search(preamble []byte) []int
- func (d Decoder) Slice(indices []int) (pkts []Data)
- type Demodulator
- type Digest
- type FilterChain
- type LogMessage
- type MagLUT
- type Message
- type MessageFilter
- type NewParserFunc
- type PacketConfig
- type Parser
Constants ¶
const (
TimeFormat = "2006-01-02T15:04:05.000"
)
Variables ¶
This section is empty.
Functions ¶
func NextPowerOf2 ¶
func RegisterParser ¶
func RegisterParser(name string, parserFn NewParserFunc)
Given a name and a parser, register a parser for use. Later used by underscore improting each parser package:
import _ "github.com/bemasher/rtlamr/scm"
Types ¶
type Decoder ¶
type Decoder struct { Cfg PacketConfig Signal []float64 Quantized []byte // contains filtered or unexported fields }
Decoder contains buffers and radio configuration.
func NewDecoder ¶
func NewDecoder() Decoder
func (*Decoder) Allocate ¶
func (d *Decoder) Allocate()
Calculate lengths and allocate internal buffers.
func (Decoder) Filter ¶
Matched filter for Manchester coded signals. Output signal's sign at each sample determines the bit-value due to Manchester symbol odd symmetry.
func (*Decoder) RegisterProtocol ¶
Using a single decoder, register protocols to pass off decoded packets to.
func (*Decoder) Search ¶
Return a list of indices into the quantized signal at which a valid preamble exists.
- Pack the quantized signal into bytes.
- Build a list of indices by eliminating bytes that contain no bits matching the first bit of the preamble.
- Continue eliminating indices at which the preamble cannot exist.
- Convert indices from byte-based to sample-based.
- Check each of these indices for the preamble.
type Demodulator ¶
A Demodulator knows how to demodulate an array of uint8 IQ samples into an array of float64 samples.
type FilterChain ¶
type FilterChain []MessageFilter
A FilterChain takse a list of filters and applies them iteratively to messages sent through the chain.
func (*FilterChain) Add ¶
func (fc *FilterChain) Add(filter MessageFilter)
func (FilterChain) Match ¶
func (fc FilterChain) Match(msg Message) bool
type LogMessage ¶
type LogMessage struct { Time time.Time `xml:",attr"` Offset int64 `xml:",attr"` Length int `xml:",attr"` Type string `xml:",attr"` Message }
A LogMessage associates a message with a point in time and an offset and length into a binary sample file.
func (LogMessage) Record ¶
func (msg LogMessage) Record() (r []string)
func (LogMessage) String ¶
func (msg LogMessage) String() string
func (LogMessage) StringNoOffset ¶
func (msg LogMessage) StringNoOffset() string
type MagLUT ¶
type MagLUT []float64
Default Magnitude Lookup Table
type MessageFilter ¶
type NewParserFunc ¶
type PacketConfig ¶
type PacketConfig struct { Protocol string Preamble string DataRate int BlockSize, BlockSize2 int ChipLength, SymbolLength int SampleRate int PreambleSymbols, PacketSymbols int PreambleLength, PacketLength int BufferLength int CenterFreq uint32 }
PacketConfig specifies packet-specific radio configuration.