spectrogram

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2023 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetColorMapByName

func GetColorMapByName(name string) []color.Color

func GetWindowFunctionByName

func GetWindowFunctionByName(name string) func(int) []float64

func IsPowerOfTwo

func IsPowerOfTwo(n uint) bool

Types

type RenderInfo

type RenderInfo struct {
	MinFrequency uint
	MaxFrequency uint
	MinDb        float64
	MaxDb        float64
}

type RenderOptions

type RenderOptions struct {
	MinFrequency         *uint
	MaxFrequency         *uint
	RelativeMinFrequency *float64
	RelativeMaxFrequency *float64
	RelativeMinDecibels  *float64
	RelativeMaxDecibels  *float64
	ColorMap             []color.Color
}

type Spectrogram

type Spectrogram struct {
	SampleRate  uint
	NumChannels uint
	FftSamples  uint
	Data        [][]float64
}

func GenerateSpectrogram

func GenerateSpectrogram(audioFile audio.Source, options SpectrogramOptions) (*Spectrogram, error)

func (*Spectrogram) ToImage

func (spectrogram *Spectrogram) ToImage(options RenderOptions) (image.Image, *RenderInfo, error)

type SpectrogramOptions

type SpectrogramOptions struct {
	Channel        uint
	FftSamples     uint
	Overlap        *uint
	Segments       *uint
	WindowFunction WindowFunction
}

type WindowFunction

type WindowFunction func(int) []float64

Jump to

Keyboard shortcuts

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