Documentation
¶
Index ¶
- Constants
- func CQString(number int) string
- func Checksum16(input string) string
- func Checksum16Valid(checksum, input string) bool
- func Checksum32(input string) string
- func Checksum32Valid(checksum, input string) bool
- func ContainsLettersAndNumbers(s string) bool
- func Deg2Grid(dlong, dlat float32) string
- func Escape(text string) string
- func FormatPWR(dbm int) string
- func FormatSNR(snr int) string
- func Grid2Deg(grid string) (float32, float32)
- func HBString(number int) string
- func IsCommandAllowed(cmd string) bool
- func IsCommandAutoreply(cmd string) bool
- func IsCommandBuffered(cmd string) bool
- func IsCommandChecksumed(cmd string) int
- func IsGridSquare(s string) bool
- func IsSNRCommand(cmd string) bool
- func Lstrip(str string) string
- func Pack5bits(packed uint8) string
- func Pack6bits(packed uint8) string
- func Pack16bits(packed uint16) string
- func Pack32bits(packed uint32) string
- func Pack64bits(packed uint64) string
- func Pack72bits(value uint64, rem uint8) string
- func PackGrid(grid string) uint16
- func PadMessage(message string, fillChar byte) (string, error)
- func ParseCallsigns(input string) []string
- func ParseGrids(input string) []string
- func PreprocessJS8Message(message string) string
- func Rstrip(str string) string
- func StartsWithCQ(text string) bool
- func StartsWithHB(text string) bool
- func Unescape(text string) string
- func Unpack5bits(value string) uint8
- func Unpack6bits(value string) uint8
- func Unpack16bits(value string) uint16
- func Unpack32bits(value string) uint32
- func Unpack64bits(value string) uint64
- func Unpack72bits(text string, pRem *uint8) uint64
- func UnpackGrid(packed uint16) string
- func ValidateMessage(message string) error
- type CppDSP
- func (d *CppDSP) Close()
- func (d *CppDSP) DecodeBuffer(audioData []int16, callback func(*DecodeResult)) (int, error)
- func (d *CppDSP) EncodeMessage(message string, mode JS8Mode) ([]int16, error)
- func (d *CppDSP) EstimateAudioDuration(mode JS8Mode) time.Duration
- func (d *CppDSP) GetError() string
- func (d *CppDSP) GetJS8Alphabet() string
- func (d *CppDSP) GetSampleRate() int
- func (d *CppDSP) GetStats() (totalDecoded, totalErrors uint32, err error)
- func (d *CppDSP) GetToneCount(mode JS8Mode) int
- func (d *CppDSP) Initialize() error
- func (d *CppDSP) SetSampleRate(rate int)
- func (d *CppDSP) ValidateJS8Message(message string) error
- type DSP
- func (d *DSP) Close()
- func (d *DSP) DecodeBuffer(audioData []int16, callback func(*DecodeResult)) (int, error)
- func (d *DSP) EncodeMessage(message string, mode JS8Mode) ([]int16, error)
- func (d *DSP) EstimateAudioDuration(mode JS8Mode) time.Duration
- func (d *DSP) GetError() string
- func (d *DSP) GetJS8Alphabet() string
- func (d *DSP) GetSampleRate() int
- func (d *DSP) GetToneCount(mode JS8Mode) int
- func (d *DSP) Initialize() error
- func (d *DSP) SetSampleRate(rate int)
- func (d *DSP) ValidateJS8Message(message string) error
- type DSPEngine
- type DecodeResult
- type FrameType
- type JS8Encoder
- type JS8Mode
- type TransmissionType
Constants ¶
const FrameTypeMax = 6
Variables ¶
This section is empty.
Functions ¶
func Checksum16 ¶
Checksum16 computes a 16-bit CRC checksum and packs it into 3 characters
func Checksum16Valid ¶
Checksum16Valid validates a 16-bit CRC checksum
func Checksum32 ¶
Checksum32 computes a 32-bit CRC checksum and packs it into 6 characters
func Checksum32Valid ¶
Checksum32Valid validates a 32-bit CRC checksum
func ContainsLettersAndNumbers ¶
ContainsLettersAndNumbers checks if a string contains both letters and numbers (exported for testing)
func Deg2Grid ¶
Deg2Grid converts decimal degrees to Maidenhead grid square (matches C++ implementation)
func Grid2Deg ¶
Grid2Deg converts Maidenhead grid square to decimal degrees (matches C++ implementation)
func IsCommandAllowed ¶
IsCommandAllowed checks if a command is allowed
func IsCommandAutoreply ¶
IsCommandAutoreply checks if a command should generate an automatic reply
func IsCommandBuffered ¶
IsCommandBuffered checks if a command should be buffered
func IsCommandChecksumed ¶
IsCommandChecksumed returns checksum type for command (0=none, 16=16bit, 32=32bit)
func IsGridSquare ¶
IsGridSquare checks if a string looks like a Maidenhead grid square (exported for testing)
func IsSNRCommand ¶
IsSNRCommand checks if a command is SNR-related
func Pack16bits ¶
Pack16bits packs a 16-bit value into 3 base-41 characters
func Pack32bits ¶
Pack32bits packs a 32-bit value into 6 base-41 characters
func Pack64bits ¶
Pack64bits packs a 64-bit value into 12 base-41 characters
func Pack72bits ¶
Pack72bits packs 72 bits (64 + 8) into 12 base-64 characters
func PadMessage ¶
PadMessage pads a message to exactly 12 characters using a fill character
func ParseCallsigns ¶
ParseCallsigns extracts callsigns from input text
func ParseGrids ¶
ParseGrids extracts grid squares from input text
func PreprocessJS8Message ¶
PreprocessJS8Message preprocesses a message to make it compatible with JS8 encoding This handles common JS8 message formats and removes invalid characters
func StartsWithHB ¶
StartsWithHB checks if text starts with HB (heartbeat)
func Unpack5bits ¶
Unpack5bits extracts a 5-bit value from a character
func Unpack6bits ¶
Unpack6bits extracts a 6-bit value from a character
func Unpack16bits ¶
Unpack16bits extracts a 16-bit value from 3 base-41 characters
func Unpack32bits ¶
Unpack32bits extracts a 32-bit value from 6 base-41 characters
func Unpack64bits ¶
Unpack64bits extracts a 64-bit value from 12 base-41 characters
func Unpack72bits ¶
Unpack72bits extracts 72 bits from 12 base-64 characters, returning first 64 bits and last 8 bits
func UnpackGrid ¶
UnpackGrid unpacks a 16-bit value into a grid square using JS8 format
func ValidateMessage ¶
ValidateMessage checks if a message contains only valid JS8 characters
Types ¶
type CppDSP ¶
type CppDSP struct {
// contains filtered or unexported fields
}
CppDSP represents the C++ DSP engine with real JS8Call algorithms
func (*CppDSP) DecodeBuffer ¶
func (d *CppDSP) DecodeBuffer(audioData []int16, callback func(*DecodeResult)) (int, error)
DecodeBuffer decodes audio samples and calls the callback for each decoded message
func (*CppDSP) EncodeMessage ¶
EncodeMessage encodes a text message to audio samples using C++ DSP
func (*CppDSP) EstimateAudioDuration ¶
EstimateAudioDuration estimates the duration of encoded audio for a given mode
func (*CppDSP) GetJS8Alphabet ¶
GetJS8Alphabet returns the valid JS8 alphabet
func (*CppDSP) GetSampleRate ¶
GetSampleRate returns the current sample rate
func (*CppDSP) GetToneCount ¶
GetToneCount returns the number of tones for a given mode
func (*CppDSP) Initialize ¶
Initialize initializes the C++ DSP library
func (*CppDSP) SetSampleRate ¶
SetSampleRate sets the audio sample rate
func (*CppDSP) ValidateJS8Message ¶
ValidateJS8Message validates that a message contains only valid JS8 characters
type DSP ¶
type DSP struct {
// contains filtered or unexported fields
}
DSP represents the pure Go JS8 DSP engine
func (*DSP) Close ¶
func (d *DSP) Close()
Close cleans up the DSP library (pure Go - nothing to clean up)
func (*DSP) DecodeBuffer ¶
func (d *DSP) DecodeBuffer(audioData []int16, callback func(*DecodeResult)) (int, error)
DecodeBuffer decodes audio samples and calls the callback for each decoded message Now uses gonum/fourier for signal detection
func (*DSP) EncodeMessage ¶
EncodeMessage encodes a text message to audio samples using pure Go
func (*DSP) EstimateAudioDuration ¶
EstimateAudioDuration estimates the duration of encoded audio for a given mode
func (*DSP) GetJS8Alphabet ¶
GetJS8Alphabet returns the valid JS8 alphabet
func (*DSP) GetSampleRate ¶
GetSampleRate returns the current sample rate
func (*DSP) GetToneCount ¶
GetToneCount returns the number of tones for a given mode
func (*DSP) Initialize ¶
Initialize initializes the DSP library (pure Go - always succeeds)
func (*DSP) SetSampleRate ¶
SetSampleRate sets the audio sample rate
func (*DSP) ValidateJS8Message ¶
ValidateJS8Message validates that a message contains only valid JS8 characters
type DSPEngine ¶
type DSPEngine interface {
Initialize() error
Close()
SetSampleRate(rate int)
GetSampleRate() int
DecodeBuffer(audioData []int16, callback func(*DecodeResult)) (int, error)
EncodeMessage(message string, mode JS8Mode) ([]int16, error)
GetError() string
ValidateJS8Message(message string) error
GetJS8Alphabet() string
EstimateAudioDuration(mode JS8Mode) time.Duration
GetToneCount(mode JS8Mode) int
}
DSPEngine defines the interface for JS8 DSP implementations
type DecodeResult ¶
type DecodeResult struct {
UTC int `json:"utc"`
SNR int `json:"snr"`
DT float32 `json:"dt"`
Frequency float32 `json:"frequency"`
Message string `json:"message"`
Type int `json:"type"`
Quality float32 `json:"quality"`
Mode int `json:"mode"`
}
DecodeResult represents a decoded JS8 message
type JS8Encoder ¶
type JS8Encoder struct{}
JS8Encoder represents a pure Go JS8 encoder
func (*JS8Encoder) EncodeMessage ¶
func (e *JS8Encoder) EncodeMessage(message string, frameType int) ([]int, error)
EncodeMessage encodes a JS8 message to tone sequence
func (*JS8Encoder) EncodeToAudio ¶
EncodeToAudio is a convenience function that encodes message directly to audio
func (*JS8Encoder) GenerateAudio ¶
func (e *JS8Encoder) GenerateAudio(tones []int, sampleRate int) []int16
GenerateAudio converts tone sequence to audio samples
type TransmissionType ¶
type TransmissionType uint8
JS8 transmission types
const ( JS8Call TransmissionType = 0 // Any other frame of the message JS8CallFirst TransmissionType = 1 // First frame of a message JS8CallLast TransmissionType = 2 // Last frame of a message JS8CallData TransmissionType = 4 // Flagged frame (no frame type header) )