core

package
v0.0.0-...-a0ae90f Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CodeToText

func CodeToText(code string) (result string)

func TextToCode

func TextToCode(text string) (result string)

Types

type Classes

type Classes struct {
	X []float64
	M []float64
}

func (*Classes) Class

func (m *Classes) Class(x float64) int

func (*Classes) Code

func (m *Classes) Code(segments []Segment) (code string)

func (*Classes) Extra

func (m *Classes) Extra(x float64) int

func (*Classes) Segments

func (m *Classes) Segments(first int) (result []Segment)

func (*Classes) Train

func (m *Classes) Train(K, epochs int)

type Decoder

type Decoder struct {
	Scatter int
	MaxMiss int
	Squelch float64
	Monitor Monitor
	Scanner Scanner
	History []Message
	Program func(Message) Message
}

func DefaultDecoder

func DefaultDecoder(Rate int) Decoder

func (*Decoder) Next

func (d *Decoder) Next(signal []float64) (result []Message)

func (*Decoder) Read

func (d *Decoder) Read(signal []float64) (result []Message)

type Encoder

type Encoder struct {
	Freq float64
	WPMs float64
	Rate float64
	// contains filtered or unexported fields
}

func (*Encoder) Tone

func (e *Encoder) Tone(code string) []float64

type History

type History struct {
	Items []Message
	Added func()
}

func (*History) Add

func (h *History) Add(items []Message)

func (*History) Length

func (h *History) Length() (count int)

type Message

type Message struct {
	Data []float64
	Body []Segment
	Code string
	Text string
	Freq int
	Time int
	Miss int
	Hide bool
}

func (Message) AGC

func (m Message) AGC(gain float64) []float64

func (Message) Merge

func (m Message) Merge(next Message) Message

type Monitor

type Monitor struct {
	Bass int
	Band int
	Rate int
	Time int
	STFT stft.STFT
	// contains filtered or unexported fields
}

func DefaultMonitor

func DefaultMonitor(Rate int) Monitor

func (*Monitor) Next

func (m *Monitor) Next(signal []float64) (result []Message)

type Scanner

type Scanner struct {
	Iter int
	Gain float64
}

func DefaultScanner

func DefaultScanner() Scanner

func (*Scanner) Scan

func (s *Scanner) Scan(source Message) Message

type Segment

type Segment struct {
	Class bool
	Since int
	Until int
	Width float64
	Level float64
}

Jump to

Keyboard shortcuts

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