dsp

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 24, 2025 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DCRemval

func DCRemval[T audio.Sample](signal []T)

DCRemoval removes the DC component from a signal.

func SQNR

func SQNR(bits int) float64

SQNR is the signal-to-quantization-noise ratio.

Types

type FrequencyPower

type FrequencyPower struct {
	Frequency int
	Magnitude float64
}

FrequencyPower denotes a single frequency and its magnitude in a Fast Fourier Transform of a signal.

type FrequencyPowerCalculator

type FrequencyPowerCalculator[T audio.Sample] struct {
	// SampleRate in samples per second.
	SampleRate int

	// Window function
	Window window.Window
	// contains filtered or unexported fields
}

func NewFrequencyPowerCalculator

func NewFrequencyPowerCalculator[T audio.Sample](sampleRate int, window window.Window) *FrequencyPowerCalculator[T]

func (*FrequencyPowerCalculator[T]) Apply

func (c *FrequencyPowerCalculator[T]) Apply(dst []FrequencyPower, samples audio.Samples[T]) []FrequencyPower

Apply applies a Fast Fourier Transform (FFT) on a slice of float64 `data`, with sample rate `sampleRate`. It returns a slice of FrequencyPower.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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