dsp

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2025 License: MIT Imports: 4 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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