core

package
v0.0.0-...-6c475a9 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2020 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var SUnits = hamradio.SUnits

SUnits contains all S-units (S0-S9)

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	FrequencyCorrection int
	Testmode            bool
	VFOHost             string
	FFTPerSecond        int
	DynamicRange        DBRange
}

Configuration parameters of the application.

type DB

type DB = hamradio.DB

DB alias for hamradio.DB

func FrctToDB

func FrctToDB(f Frct, r DBRange) DB

FrctToDB converts the given fraction into a DB value in the given range.

type DBMark

type DBMark struct {
	DB DB
	Y  Frct
}

DBMark on the dB scale

type DBRange

type DBRange = hamradio.DBRange

DBRange alias for hamradio.DBRange

type FFT

type FFT struct {
	Data          []float64
	Range         FrequencyRange
	Mean          float64
	PeakThreshold float64
	SigmaEnvelope []float64
	Peaks         []PeakIndexRange
}

FFT data and the corresponding frequency range

func (FFT) Frequency

func (fft FFT) Frequency(i int) Frequency

Frequency returns the center frequency of the ith bin of this FFT.

func (FFT) Resolution

func (fft FFT) Resolution() float64

Resolution of this FFT in Hz per Bin

func (FFT) ToIndex

func (fft FFT) ToIndex(f Frequency) int

ToIndex returns the index of the bin that the given frequency belongs to.

type FPoint

type FPoint struct {
	X, Y Frct
}

FPoint represents a point on the screen using the Frct unit for its coordinates.

type Frct

type Frct float64

Frct is a fraction of height or width; this is a abstraction of the coordinates on the screen.

func ToDBFrct

func ToDBFrct(value DB, r DBRange) Frct

ToDBFrct returns the fraction of the given value in this range.

func ToFrequencyFrct

func ToFrequencyFrct(f Frequency, r FrequencyRange) Frct

ToFrequencyFrct returns the fraction of the given frequency in the given range.

type Frequency

type Frequency = hamradio.Frequency

Frequeny alias for hamradio.Frequency

func FrctToFrequency

func FrctToFrequency(f Frct, r FrequencyRange) Frequency

FrctToFrequency converts the given fraction into a frequency from the given range.

type FrequencyMark

type FrequencyMark struct {
	Frequency Frequency
	X         Frct
}

FrequencyMark on the frequency scale

type FrequencyRange

type FrequencyRange = hamradio.FrequencyRange

FrequencyRange alias for hamradio.FrequencyRange

type HzPerPx

type HzPerPx float64

HzPerPx unit for resolution

func (HzPerPx) ToHz

func (r HzPerPx) ToHz(x Px) Frequency

ToHz converts the given Px to Hz

func (HzPerPx) ToPx

func (r HzPerPx) ToPx(f Frequency) Px

ToPx converts the given Frequency in Hz to Px

type Panorama

type Panorama struct {
	FrequencyRange FrequencyRange
	VFO            VFO
	Band           bandplan.Band
	Resolution     HzPerPx

	VFOLine        Frct
	VFOFilterFrom  Frct
	VFOFilterTo    Frct
	VFOSignalLevel DB

	FrequencyScale     []FrequencyMark
	DBScale            []DBMark
	Spectrum           []FPoint
	PeakThresholdLevel Frct
	SigmaEnvelope      []FPoint
	Peaks              []PeakMark
	Waterline          []Frct
}

Panorama current state

func (Panorama) ToHz

func (p Panorama) ToHz(x Px) Frequency

ToHz converts the given Px within the panorama to Hz.

func (Panorama) ToPx

func (p Panorama) ToPx(f Frequency) Px

ToPx converts the given frequency in Hz to Px within the panorama.

type PeakIndexRange

type PeakIndexRange struct {
	From  int
	To    int
	Max   int
	Value float64
}

PeakIndexRange contains the index values within FFT data that describe a peak.

type PeakMark

type PeakMark struct {
	FromX        Frct
	ToX          Frct
	MaxX         Frct
	MaxFrequency Frequency
	ValueY       Frct
	ValueDB      DB
}

PeakMark contains all information to visualize a peak

type Px

type Px float64

Px unit for pixels

type SUnit

type SUnit = hamradio.SUnit

SUnit alias for hamradio.SUnit

type SamplesInput

type SamplesInput interface {
	Samples() <-chan []complex128
	Close() error
}

SamplesInput interface.

type VFO

type VFO struct {
	Name        string
	Frequency   Frequency
	FilterWidth Frequency
	Mode        string
}

VFO current state

type ViewMode

type ViewMode int

ViewMode of the panorama.

const (
	ViewFixed ViewMode = iota
	ViewCentered
)

All view modes.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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