dsp: maze.io/x/dsp/pcm Index | Files

package pcm

import "maze.io/x/dsp/pcm"

Index

Package Files

gain.go interleave.go

func DBAmplitude Uses

func DBAmplitude(gain float64) (db float64)

DBAmplitude converts from amplitude to power gain.

func DBSquaredAmplitude Uses

func DBSquaredAmplitude(gain float64) (db float64)

DBSquaredAmplitude converts from squared amplitude to power gain.

func FloatInterleave Uses

func FloatInterleave(l, r []float64) ([]float64, error)

FloatInterleave interleaves left and right (dual mono) channels to a stereo interleaved channel.

func FloatMix Uses

func FloatMix(a, b []float64, negate bool, normalize float64) ([]float64, error)

FloatMix mixes two sample buffers normalized by a constant.

type FloatAGC Uses

type FloatAGC struct {
    Attack float64
    Decay  float64
    // contains filtered or unexported fields
}

FloatAGC implements Automatic Gain Control, value settles in range (-0.5, +0.5).

func NewFloatAGC Uses

func NewFloatAGC(attack, decay float64) *FloatAGC

NewFloatAGCC starts a new FloatAGC block.

func (*FloatAGC) Process Uses

func (agc *FloatAGC) Process(in float64) float64

Process a sample.

type FloatSamples Uses

type FloatSamples []float64

func (FloatSamples) Deinterleave Uses

func (s FloatSamples) Deinterleave() ([]float64, []float64, error)

Deinterleave a stereo interleaved channel to dual mono left and right.

func (FloatSamples) Peak Uses

func (s FloatSamples) Peak() float64

Peak value of a buffer.

func (FloatSamples) RMS Uses

func (s FloatSamples) RMS() float64

RMS value of a buffer.

Package pcm imports 2 packages (graph). Updated 2019-11-19. Refresh now. Tools for package owners.