cq

package
v0.0.0-...-d2cf180 Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2016 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const DEBUG = false
View Source
const DEBUG_CQ = false
View Source
const DEBUG_CQI = false
View Source
const DEBUG_R = false
View Source
const (
	TAU = 2.0 * math.Pi
)

Variables

This section is empty.

Functions

func GenerateHeights

func GenerateHeights(octaves int) func() int

func ReadComplex

func ReadComplex(r io.Reader) complex128

func ReadComplexArray

func ReadComplexArray(r io.Reader, size int) []complex128

func ReadFloat32

func ReadFloat32(r io.Reader) float32

func Round

func Round(value float64) int64

HACK

func TerminalZeros

func TerminalZeros(val int) int

func UnsafeShift

func UnsafeShift(s int) int

TODO: Move into global exported utils

func WriteByte

func WriteByte(w io.Writer, b byte)

func WriteComplex

func WriteComplex(w io.Writer, c complex128)

func WriteComplexArray

func WriteComplexArray(w io.Writer, array []complex128)

func WriteFloat32

func WriteFloat32(w io.Writer, f float32)

func WriteInt32

func WriteInt32(w io.Writer, i int32)

Types

type CQInverse

type CQInverse struct {
	OutputLatency int
	// contains filtered or unexported fields
}

func NewCQInverse

func NewCQInverse(params CQParams) *CQInverse

func (*CQInverse) GetRemainingOutput

func (cqi *CQInverse) GetRemainingOutput() []float64

Return clamped!

func (*CQInverse) Process

func (cqi *CQInverse) Process(block [][]complex128) []float64

Return clamped!

func (*CQInverse) ProcessChannel

func (cqi *CQInverse) ProcessChannel(blocks <-chan []complex128) <-chan float64

Return clamped!

type CQKernel

type CQKernel struct {
	Properties Properties
	// contains filtered or unexported fields
}

func NewCQKernel

func NewCQKernel(params CQParams) *CQKernel

TODO - clean up a lot.

func (*CQKernel) BinCount

func (k *CQKernel) BinCount() int

func (*CQKernel) ProcessInverse

func (k *CQKernel) ProcessInverse(cv []complex128) []complex128

type CQParams

type CQParams struct {
	Octaves int

	BinsPerOctave int
	// contains filtered or unexported fields
}

func NewCQParams

func NewCQParams(sampleRate float64, octaves int, minFreq float64, binsPerOctave int) CQParams

type ConstantQ

type ConstantQ struct {
	OutputLatency int
	// contains filtered or unexported fields
}

func NewConstantQ

func NewConstantQ(params CQParams) *ConstantQ

func (*ConstantQ) BinCount

func (cq *ConstantQ) BinCount() int

func (*ConstantQ) GetRemainingOutput

func (cq *ConstantQ) GetRemainingOutput() [][]complex128

func (*ConstantQ) Process

func (cq *ConstantQ) Process(td []float64) [][]complex128

func (*ConstantQ) ProcessChannel

func (cq *ConstantQ) ProcessChannel(samples <-chan float64) <-chan []complex128

type KaiserWindow

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

type Kernel

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

type Phase

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

type Properties

type Properties struct {
	Q float64
	// contains filtered or unexported fields
}

type Resampler

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

func NewResampler

func NewResampler(sourceRate int, targetRate int, snr float64, bandwidth float64) *Resampler

func (*Resampler) GetLatency

func (r *Resampler) GetLatency() int

func (*Resampler) Process

func (r *Resampler) Process(src []float64) []float64

type Spectrogram

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

func NewSpectrogram

func NewSpectrogram(params CQParams) *Spectrogram

func (*Spectrogram) GetRemainingOutput

func (spec *Spectrogram) GetRemainingOutput() [][]complex128

func (*Spectrogram) InterpolateCQChannel

func (spec *Spectrogram) InterpolateCQChannel(columns <-chan []complex128) <-chan []complex128

func (*Spectrogram) Process

func (spec *Spectrogram) Process(values []float64) [][]complex128

func (*Spectrogram) ProcessChannel

func (spec *Spectrogram) ProcessChannel(samples <-chan float64) <-chan []complex128

type Window

type Window int
const (
	SqrtBlackmanHarris Window = iota
	SqrtBlackman
	SqrtHann
	BlackmanHarris
	Blackman
	Hann
)

Jump to

Keyboard shortcuts

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