viz

package
v0.0.0-...-fff4e01 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2022 License: GPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Y_AVG    = 0.03
	FFT_AVG  = 0.05
	MIX_AVG  = 0.10
	BAL_AVG  = 0.05
	FFT_BINS = 512  // number of fft bins
	FFT_FREQ = 0.05 // time interval between fft updates
	MIX_FREQ = 0.02 // time interval between mixer updates
)

Variables

This section is empty.

Functions

This section is empty.

Types

type FFTFilter

type FFTFilter struct {
	FFTPlotterInput  *FFTPlotter
	FFTPlotterOutput *FFTPlotter
	// contains filtered or unexported fields
}

func NewFFTFilter

func NewFFTFilter(
	sampleRate int,
	taps []float32,
) *FFTFilter

func (*FFTFilter) PredictOutputSize

func (f *FFTFilter) PredictOutputSize(inputSize int) int

func (*FFTFilter) WorkBuffer

func (f *FFTFilter) WorkBuffer(input, output []float32) int

type FFTPlotter

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

func NewFFTPlotterComplex

func NewFFTPlotterComplex(name string, len, sampleRate int) *FFTPlotter

func NewFFTPlotterFloat

func NewFFTPlotterFloat(name string, len, sampleRate int) *FFTPlotter

func (*FFTPlotter) AddPlotOption

func (pb *FFTPlotter) AddPlotOption(opt PlotOptions)

func (*FFTPlotter) AppendComplex

func (p *FFTPlotter) AppendComplex(s []complex64)

func (*FFTPlotter) AppendFloat

func (p *FFTPlotter) AppendFloat(s []float32)

func (*FFTPlotter) GetImage

func (pb *FFTPlotter) GetImage() *ImageContainer

func (*FFTPlotter) Name

func (f *FFTPlotter) Name() string

func (*FFTPlotter) ShowBalance

func (f *FFTPlotter) ShowBalance(show bool)

type ImageContainer

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

type PlotOptions

type PlotOptions func(p *plot.Plot)

type PlotType

type PlotType int
const (
	PlotTypeDefault PlotType = iota
	PlotTypeScatter
	PlotTypeLines
)

type Producer

type Producer interface {
	Name() string
	GetImage() *ImageContainer
	AddPlotOption(opt PlotOptions)
}

type Server

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

func NewServer

func NewServer(port int, updateInterval time.Duration) *Server

func (*Server) Enable

func (s *Server) Enable(enable bool)

func (*Server) Receive

func (s *Server) Receive(img *ImageContainer)

func (*Server) Register

func (s *Server) Register(key string, p Producer)

func (*Server) Run

func (s *Server) Run(ctx context.Context) error

func (*Server) SetUpdateInterval

func (s *Server) SetUpdateInterval(interval time.Duration)

func (*Server) Stop

func (s *Server) Stop(ctx context.Context)

type TimeDomainPlotter

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

func NewTimeDomainPlotter

func NewTimeDomainPlotter(name string, size int) *TimeDomainPlotter

func (*TimeDomainPlotter) AddPlotOption

func (tp *TimeDomainPlotter) AddPlotOption(opt PlotOptions)

func (*TimeDomainPlotter) AppendFloat

func (tp *TimeDomainPlotter) AppendFloat(f []float32)

func (*TimeDomainPlotter) GetImage

func (tp *TimeDomainPlotter) GetImage() *ImageContainer

func (*TimeDomainPlotter) Name

func (t *TimeDomainPlotter) Name() string

func (*TimeDomainPlotter) SetPlotType

func (t *TimeDomainPlotter) SetPlotType(tp PlotType)

Jump to

Keyboard shortcuts

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