Documentation ¶
Overview ¶
Package: github.com/Foxenfurter/foxAudioLib/foxConvolver filename foxConvolver.go Package is designed to manage convolution of Filter Impulse Responses includes any logic neeeded to prepare the filter for convolution, such as Resampling and Normalization
Index ¶
- func CalculateFFT(input []complex128) []complex128
- func CalculateInverseFFT(input []complex128) []complex128
- func CalculateMaxGain(audioData []float64) float64
- func ConvolveImpulseOverlapSave(impulse, signalBlock []float64, savedOverlap []complex128) ([]float64, []complex128)
- func ConvolveImpulsesFFT(impulse, signal []float64) []float64
- func ConvolveImpulsesSlow(impulse1 []float64, impulse2 []float64) []float64
- func InverseTukeyFFT(X []complex128) []complex128
- func Normalize(inputSamples [][]float64, targetLevel float64) float64
- func NormalizeAudioImpulseTrue(audioImpulse []float64, targetLevel float64) []float64
- func ReadnResampleFirFile(filePath string, targetSampleRate int) (*bytes.Reader, error)
- func TargetGain(fromSampleRate, toSampleRate int) float64
- func TukeyFFT(X []complex128) []complex128
- type Convolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalculateFFT ¶
func CalculateFFT(input []complex128) []complex128
func CalculateInverseFFT ¶
func CalculateInverseFFT(input []complex128) []complex128
const FilterLength = 4000
func CalculateMaxGain ¶
Calculates the Maximum Gain Value - used for Normalization functions
func ConvolveImpulseOverlapSave ¶
func ConvolveImpulseOverlapSave(impulse, signalBlock []float64, savedOverlap []complex128) ([]float64, []complex128)
func ConvolveImpulsesFFT ¶
use convolver directly without precomputed Impulse values and then convolve signal the impulse is the filter that you want to apply and the signal is what you want to apply it to - and output the original signal length will be kept
func ConvolveImpulsesSlow ¶
Simple convolver multiplication calculation for baseline testing
func InverseTukeyFFT ¶
func InverseTukeyFFT(X []complex128) []complex128
simple Cooley-Tukey based inverse FFT for baseline benchmark
func NormalizeAudioImpulseTrue ¶
Normalises and audio signal to the target level and calculate a max level. Max Level is therefore only for the current channel
func ReadnResampleFirFile ¶
func TargetGain ¶
Calculate the target gain level based on the sampling frequency parameters: Sample Rate (int) returns the target gain level as float64
func TukeyFFT ¶
func TukeyFFT(X []complex128) []complex128
simple Cooley-Tukey based FFT for baseline benchmark
Types ¶
type Convolver ¶
type Convolver struct { Impulse []float64 // Impulse response ImpulseLength int // Length of the impulse response WindowedImpulse []float64 // Windowed impulse response OverlapFactor float64 // Overlap factor OverlapLength int // Length of overlap HopSize int // Hop size OverlapTail []complex128 // Overlap tail DebugFunc func(string) WarningFunc func(string) }
Convolver represents a convolver structure
func NewConvolver ¶
Init initializes the convolver structure supply FIR filter impulse and overlap factor as a value between 0.1 and 0.9
func (*Convolver) ConvolveImpulsesFFT ¶
use convolver structure with precomputed Impulse values and then convolve signal