ook

package
v0.0.0-...-cc108f9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2021 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AssignSymbols

func AssignSymbols(highs, lows ClusterDescriptions)

func LLoyds

func LLoyds(seqUnsorted []int, binCount int)

func ListenTo

func ListenTo(iface *net.Interface, addr *net.UDPAddr, burstChannel chan *Burst) error

func Quantify

func Quantify(burst *Burst)

Types

type BitStream

type BitStream struct {
	// contains filtered or unexported fields
}

func DecodeManchester

func DecodeManchester(syms []Symbol) (*BitStream, error)

func NewBitStream

func NewBitStream(sizedFor int) *BitStream

func (*BitStream) Add

func (bs *BitStream) Add(v int)

func (*BitStream) Reader

func (bs *BitStream) Reader() *BitStreamReader

type BitStreamReader

type BitStreamReader struct {
	// contains filtered or unexported fields
}

func (*BitStreamReader) EOF

func (bs *BitStreamReader) EOF() bool

func (*BitStreamReader) GetBit

func (bs *BitStreamReader) GetBit() int

func (*BitStreamReader) GetNibbleLSB

func (bs *BitStreamReader) GetNibbleLSB() (int, bool)

func (*BitStreamReader) PeekBit

func (bs *BitStreamReader) PeekBit() int

func (*BitStreamReader) PeekNibbleLSB

func (bs *BitStreamReader) PeekNibbleLSB() (int, bool)

func (*BitStreamReader) RemainingBits

func (bsr *BitStreamReader) RemainingBits() string

func (*BitStreamReader) UngetBit

func (bs *BitStreamReader) UngetBit()

func (*BitStreamReader) UngetNBits

func (bs *BitStreamReader) UngetNBits(n int)

func (*BitStreamReader) UngetNibble

func (bs *BitStreamReader) UngetNibble()

type Burst

type Burst struct {
	Position time.Duration
	Pulses   []Pulse
}

func DecodeBurst

func DecodeBurst(data []byte) (*Burst, int, error)

func (*Burst) Encode

func (burst *Burst) Encode() ([]byte, error)

type BurstHandler

type BurstHandler func(*Burst) bool

type ClusterDescription

type ClusterDescription struct {
	Min   int
	Max   int
	Count int
	Sum   int
	Sum2  int
	Sym   Symbol
}

func CombineClusters

func CombineClusters(a, b *ClusterDescription) *ClusterDescription

type ClusterDescriptions

type ClusterDescriptions []*ClusterDescription

func FoldLeadingRunt

func FoldLeadingRunt(s ClusterDescriptions, firstLength int) ClusterDescriptions

func GuessAndGrow

func GuessAndGrow(seqUnsorted []int, tolerance float64, verbose bool) ClusterDescriptions

func (ClusterDescriptions) Lookup

func (s ClusterDescriptions) Lookup(duration int) *ClusterDescription

type Pulse

type Pulse struct {
	High      uint32
	Low       uint32
	Frequency int32
}

type Reader

type Reader interface {
	Read() (*Burst, error)
	Close()
}

func OpenFile

func OpenFile(source io.Reader) (Reader, error)

type Symbol

type Symbol int
const (
	Spurious Symbol = iota
	HighShort
	HighLong
	LowShort
	LowLong
	EndOfTransmission
)

func (Symbol) String

func (s Symbol) String() string

type Writer

type Writer interface {
	Write(*Burst) error
	Close()
}

func NewTarWriter

func NewTarWriter(sink io.Writer) Writer

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL