dsp

package
v0.0.0-...-e5a71df Latest Latest
Warning

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

Go to latest
Published: Feb 6, 2026 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func SplitSpectrogram

func SplitSpectrogram(spectrogram [][]complex128) ([][]float64, [][]float64)

SplitSpectrogram returns SpilitSpectrum for each time frame.

func SplitSpectrum

func SplitSpectrum(spec []complex128) ([]float64, []float64)

SplitSpectrum splits complex spectrum X(k) to amplitude |X(k)| and angle(X(k))

Types

type STFT

type STFT struct {
	FrameShift int
	FrameLen   int
	Window     func([]float64) []float64 // window function
}

func New

func New(frameShift, frameLen int) *STFT

New returns a new STFT instance.

func (*STFT) DivideFrames

func (s *STFT) DivideFrames(input []float64) [][]float64

DivideFrames returns overlapping divided frames for STFT.

func (*STFT) FrameAt

func (s *STFT) FrameAt(input []float64, index int) []float64

FrameAt returns frame at specified index given an input signal. Note that it doesn't make copy of input.

func (*STFT) NumFrames

func (s *STFT) NumFrames(input []float64) int

NumFrames returnrs the number of frames that will be analyzed in STFT.

func (*STFT) STFT

func (s *STFT) STFT(input []float64) [][]complex128

STFT returns complex spectrogram given an input signal.

Jump to

Keyboard shortcuts

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