Documentation
¶
Index ¶
- Variables
- func NewPrediction(realtimeProvider providers.RealTime, historyProvider providers.History, ...) prediction.Interface
- type Estimator
- type FrequencySpectrum
- type Signal
- func (s *Signal) Denormalize(min, max float64) (*Signal, error)
- func (s *Signal) Duration() float64
- func (s *Signal) Filter(threshold float64) *Signal
- func (s *Signal) Frequencies() []float64
- func (s *Signal) FrequencySpectrum() *FrequencySpectrum
- func (s *Signal) IsPeriodic(cycleDuration time.Duration) bool
- func (s *Signal) Max() float64
- func (s *Signal) Min() float64
- func (s *Signal) Normalize() (*Signal, error)
- func (s *Signal) Num() int
- func (s *Signal) Plot(o ...charts.GlobalOpts) *charts.Line
- func (s *Signal) String() string
- func (s *Signal) Truncate(d time.Duration) (*Signal, int)
Constants ¶
This section is empty.
Variables ¶
View Source
var PeriodicityAmplitudeThreshold = 0.
Functions ¶
func NewPrediction ¶
func NewPrediction(realtimeProvider providers.RealTime, historyProvider providers.History, mc config.AlgorithmModelConfig) prediction.Interface
Types ¶
type Estimator ¶
type Estimator interface { GetEstimation(signal *Signal, cycleDuration time.Duration) *Signal String() string }
func NewFFTEstimator ¶
func NewMaxValueEstimator ¶
type FrequencySpectrum ¶
func (*FrequencySpectrum) Len ¶
func (f *FrequencySpectrum) Len() int
func (*FrequencySpectrum) Less ¶
func (f *FrequencySpectrum) Less(i, j int) bool
func (*FrequencySpectrum) Swap ¶
func (f *FrequencySpectrum) Swap(i, j int)
type Signal ¶
type Signal struct { // SampleRate is the sampling rate in hertz SampleRate float64 // Samples store all samples Samples []float64 }
Signal represents a discrete signal.
func SamplesToSignal ¶
func (*Signal) Denormalize ¶
Denormalize denormalizes the signal between min and max.
func (*Signal) Filter ¶
Filter filters out frequency components whose amplitudes are less than the threshold and returns a new signal
func (*Signal) Frequencies ¶
Frequencies returns the signal frequency components in hertz in descending order.
func (*Signal) FrequencySpectrum ¶
func (s *Signal) FrequencySpectrum() *FrequencySpectrum
FrequencySpectrum returns the frequency spectrum of the signal.
func (*Signal) IsPeriodic ¶
IsPeriodic checks whether the signal is periodic and its period is approximately equal to the given value
Click to show internal directories.
Click to hide internal directories.