dsp

package
v1.8.5 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 2 Imported by: 1

Documentation

Overview

Package dsp provides audio analysis

Some notes:

https://dlbeer.co.nz/articles/fftvis.html https://www.cg.tuwien.ac.at/courses/WissArbeiten/WS2010/processing.pdf https://github.com/hvianna/audioMotion-analyzer/blob/master/src/audioMotion-analyzer.js#L1053 https://dsp.stackexchange.com/questions/6499/help-calculating-understanding-the-mfccs-mel-frequency-cepstrum-coefficients https://stackoverflow.com/questions/3694918/how-to-extract-frequency-associated-with-fft-values-in-python

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Analyzer added in v1.5.0

type Analyzer interface {
	BinCount() int
	ProcessBin(int, []complex128) float64
	Recalculate(int) int
}

func NewAnalyzer added in v1.5.0

func NewAnalyzer(cfg AnalyzerConfig) Analyzer

type AnalyzerConfig added in v1.7.0

type AnalyzerConfig struct {
	SampleRate    float64   // audio sample rate
	SampleSize    int       // number of samples per slice
	SquashLow     bool      // squash the low end the spectrum
	SquashLowOld  bool      // squash the low end using the old method
	DontNormalize bool      // dont run math.Log on output
	BinMethod     BinMethod // method used for calculating bin value
}

type BinMethod added in v1.7.0

type BinMethod func(int, float64, float64) float64

func AverageSamples added in v1.7.0

func AverageSamples() BinMethod

Average all the samples together.

func MaxSampleValue added in v1.8.0

func MaxSampleValue() BinMethod

Return the maximum value of all the samples.

func MinNonZeroSampleValue added in v1.8.0

func MinNonZeroSampleValue() BinMethod

Return the minimum value of all the samples that is not zero.

func SumSamples added in v1.7.0

func SumSamples() BinMethod

Sum all the samples together.

type Smoother added in v1.6.2

type Smoother interface {
	SmoothBuffers([][]float64)
	SmoothBin(int, int, float64) float64
	GetMethod() SmoothingMethod
	SetMethod(SmoothingMethod)
}

func NewSmoother added in v1.6.2

func NewSmoother(cfg SmootherConfig) Smoother

type SmootherConfig added in v1.7.0

type SmootherConfig struct {
	AverageSize     int             // size of window for average methods
	ChannelCount    int             // number of channels
	SampleSize      int             // number of samples per slice
	SampleRate      float64         // sample rate
	SmoothingFactor float64         // smoothing factor
	SmoothingMethod SmoothingMethod // smoothing method
}

type SmoothingMethod added in v1.8.0

type SmoothingMethod int
const (
	SmoothMin           SmoothingMethod = iota // 0
	SmoothSimple                               // 1
	SmoothAverage                              // 2
	SmoothSimpleAverage                        // 3
	SmoothNew                                  // 4
	SmoothNewAverage                           // 5
	SmoothNone                                 // 6
	SmoothMax                                  // 7

	SmoothDefault = SmoothSimpleAverage
)

Directories

Path Synopsis
Package window provides Window Functions for singnal analysis
Package window provides Window Functions for singnal analysis

Jump to

Keyboard shortcuts

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