dsp

package
v0.0.0-...-18f3c65 Latest Latest
Warning

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

Go to latest
Published: Sep 13, 2020 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func L16MixSat160

func L16MixSat160(dst, src *int16)

Mixes together two audio frames containing 160 samples. Uses saturation adding so you don't hear clipping if ppl talk loud. Uses 128-bit SIMD instructions so we can add eight numbers at the same time.

func LinearToUlaw

func LinearToUlaw(linear int64) (ulaw int64)

Compresses a PCM audio sample into a G.711 μ-Law sample. The BSR instruction is what makes this code fast.

TODO(jart): How do I make assembly use proper types?

func UlawToLinear

func UlawToLinear(ulaw int64) (linear int64)

Turns a μ-Law byte back into an audio sample.

Types

type AWGN

type AWGN struct {
	// contains filtered or unexported fields
}

Awgn contains the white noise generator state information.

func NewAWGN

func NewAWGN(volume float64) (s *AWGN)

Returns a new comfort noise generator. The volume param is in decibels and -50.0 is a good value. The closer you get to 0.0, the louder the noise will become.

func NewAWGN_DBM0

func NewAWGN_DBM0(idum int64, level float64) (s *AWGN)

func NewAWGN_DBOV

func NewAWGN_DBOV(idum int64, level float64) (s *AWGN)

func (*AWGN) Get

func (s *AWGN) Get() int16

Jump to

Keyboard shortcuts

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