foxConvolverAdapt

package
v0.0.0-...-2bc4062 Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2026 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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 IsPow2

func IsPow2(N int) bool

func MaxGainFromFFTOld

func MaxGainFromFFTOld(impulse []float64) float64

MaxGainFromFFT computes maximum magnitude in frequency domain

func NextPowerOf2

func NextPowerOf2(n int) int

func TukeyFFT

func TukeyFFT(X []complex128) []complex128

TukeyFFT simple Cooley-Tukey based FFT

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

func NewConvolver(impulse []float64) Convolver

NewConvolver initializes the convolver structure

func (*Convolver) AmendFilterImpulse

func (myConvolver *Convolver) AmendFilterImpulse(impulse []float64)

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

func (myConvolver *Convolver) ConvolveFFT(signal []float64) []float64

ConvolveFFT use convolver structure with precomputed Impulse values

func (*Convolver) ConvolveOverlapSave

func (myConvolver *Convolver) ConvolveOverlapSave(signalBlock []float64) []float64

ConvolveOverlapSave using Overlap and save method. Allows for signal to be sent in blocks

func (*Convolver) GetPaddedLength

func (myConvolver *Convolver) GetPaddedLength() int

func (*Convolver) GetTail

func (myConvolver *Convolver) GetTail() []float64

func (*Convolver) GobDecode

func (c *Convolver) GobDecode(data []byte) error

GobDecode implements the gob.GobDecoder interface for convolver to read cached data

func (Convolver) GobEncode

func (c Convolver) GobEncode() ([]byte, error)

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 (myConvolver *Convolver) MaxGainFromFFT(impulse []float64) float64

func (*Convolver) SetFFTProviderByString

func (myConvolver *Convolver) SetFFTProviderByString(provider string)

SetFFTProviderByString sets the FFT provider based on a string identifier

func (*Convolver) SetSignalBlockLength

func (myConvolver *Convolver) SetSignalBlockLength(signalBlockLength int)

func (*Convolver) SetTail

func (myConvolver *Convolver) SetTail(tail []float64)

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

Jump to

Keyboard shortcuts

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