Documentation
¶
Index ¶
- func CompareAllFFTs(data []complex128, iterations int)
- func Compute(x []complex128) error
- func InvCompute(x []complex128) error
- func InverseTukeyFFT(X []complex128) []complex128
- func IsPow2(N int) bool
- func MaxGainFromFFTOld(impulse []float64) float64
- func NextPowerOf2(n int) int
- func TukeyFFT(X []complex128) []complex128
- type Convolver
- func (myConvolver *Convolver) AmendFilterImpulse(impulse []float64)
- func (myConvolver *Convolver) ConvolveChannel(inputSignalChannel, outputSignalChannel chan []float64)
- func (myConvolver *Convolver) ConvolveFFT(signal []float64) []float64
- func (myConvolver *Convolver) ConvolveOverlapSave(signalBlock []float64) []float64
- func (myConvolver *Convolver) GetPaddedLength() int
- func (myConvolver *Convolver) GetTail() []float64
- func (c *Convolver) GobDecode(data []byte) error
- func (c Convolver) GobEncode() ([]byte, error)
- func (myConvolver *Convolver) InitForStreaming()
- func (myConvolver *Convolver) MaxGainFromFFT(impulse []float64) float64
- func (myConvolver *Convolver) SetFFTProviderByString(provider string)
- func (myConvolver *Convolver) SetSignalBlockLength(signalBlockLength int)
- func (myConvolver *Convolver) SetTail(tail []float64)
- type FFTProvider
- type FoxFFTAdapter
- type FoxFFTAdapterReal
- type FoxFFTHORAdapter
- type ScientificGoAdapter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CompareAllFFTs ¶
func CompareAllFFTs(data []complex128, iterations int)
CompareAllFFTs benchmarks different FFT implementations
func Compute ¶
func Compute(x []complex128) error
func InvCompute ¶
func InvCompute(x []complex128) error
func InverseTukeyFFT ¶
func InverseTukeyFFT(X []complex128) []complex128
InverseTukeyFFT simple Cooley-Tukey based inverse FFT
func MaxGainFromFFTOld ¶
MaxGainFromFFT computes maximum magnitude in frequency domain
func NextPowerOf2 ¶
Types ¶
type Convolver ¶
type Convolver struct {
FilterImpulse []float64
Buffer []float64
DebugOn bool
DebugFunc func(string)
WarningFunc func(string)
// contains filtered or unexported fields
}
Convolver represents a convolver structure
func NewConvolver ¶
NewConvolver initializes the convolver structure
func (*Convolver) AmendFilterImpulse ¶
AmendFilterImpulse allows the impulse to be changed
func (*Convolver) ConvolveChannel ¶
func (myConvolver *Convolver) ConvolveChannel(inputSignalChannel, outputSignalChannel chan []float64)
ConvolveChannel optimized for go channels
func (*Convolver) ConvolveFFT ¶
ConvolveFFT use convolver structure with precomputed Impulse values
func (*Convolver) ConvolveOverlapSave ¶
ConvolveOverlapSave using Overlap and save method. Allows for signal to be sent in blocks
func (*Convolver) GetPaddedLength ¶
func (*Convolver) GobDecode ¶
GobDecode implements the gob.GobDecoder interface for convolver to read cached data
func (Convolver) GobEncode ¶
GobEncode implements the gob.GobEncoder interface for convolver to cache data
func (*Convolver) InitForStreaming ¶
func (myConvolver *Convolver) InitForStreaming()
InitForStreaming Initialise Convolver for Streaming convolution
func (*Convolver) MaxGainFromFFT ¶
func (*Convolver) SetFFTProviderByString ¶
SetFFTProviderByString sets the FFT provider based on a string identifier
func (*Convolver) SetSignalBlockLength ¶
type FFTProvider ¶
type FFTProvider interface {
Transform(input []complex128, inverse bool) []complex128
}
FFTProvider defines the interface for different FFT implementations
type FoxFFTAdapter ¶
type FoxFFTAdapter struct{}
FoxFFTAdapter implements FFTProvider using the internal Go implementation
func (*FoxFFTAdapter) Transform ¶
func (a *FoxFFTAdapter) Transform(input []complex128, inverse bool) []complex128
type FoxFFTAdapterReal ¶
type FoxFFTAdapterReal struct{}
func (*FoxFFTAdapterReal) Transform ¶
func (a *FoxFFTAdapterReal) Transform(input []complex128, inverse bool) []complex128
type FoxFFTHORAdapter ¶
type FoxFFTHORAdapter struct{}
FoxFFTHORAdapter implements FFTProvider using internal Tukey implementation
func (*FoxFFTHORAdapter) Transform ¶
func (a *FoxFFTHORAdapter) Transform(input []complex128, inverse bool) []complex128
type ScientificGoAdapter ¶
type ScientificGoAdapter struct{}
ScientificGoAdapter implements FFTProvider using scientificgo.org/fft
func (*ScientificGoAdapter) Transform ¶
func (a *ScientificGoAdapter) Transform(input []complex128, inverse bool) []complex128