transform

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AnalyzeTimeFreqTransform

func AnalyzeTimeFreqTransform(
	srate float64,
	input []complex128,
	f Transform,
	scaling Scaling,
) (*freqresponse.FreqResponse, error)

AnalyzeTimeFreqTransform uses the given transform on the values, assuming they represent a time domain signal. The transform results are then interpreted as magnitude and phase in the frequency domain. These are used to make the returned frequency response. Returns non-nil error in case of failure. Only the first half of the transform results (positive frequencies) will be included in the frequency response.

func ScaleBy

func ScaleBy(vals []complex128, scaling Scaling)

ScaleBy applies the given scaling.

Types

type Scaling

type Scaling int

Scaling is the scaling type

const (
	// NoScaling scales by 1 (i.e. not at all)
	NoScaling Scaling = iota
	// ScaleByOneOverN scales by 1/N (N is array size)
	ScaleByOneOverN
	// ScaleByOneOverSqrtN scales by 1/sqrt(N) (N is array size)
	ScaleByOneOverSqrtN
)

type Transform

type Transform func(vals []complex128, scaling Scaling) ([]complex128, error)

Transform is a function that performs a transform (like from time to frequency domain) and scaling. Returns the transformed and scaled values. Returns non-nil error in case of failure.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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