mel

package
v1.8.1 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2022 License: BSD-3-Clause Imports: 4 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FreqToBin

func FreqToBin(freq, nFft, sampleRate float64) int

FreqToBin converts frequency into FFT bin number, using parameters of number of FFT bins and sample rate

func FreqToMel

func FreqToMel(freq float64) float64

FreqToMel converts frequency to mel scale

func MelToFreq

func MelToFreq(mel float64) float64

FreqToMel converts mel scale to frequency

Types

type FilterBank

type FilterBank struct {
	NFilters    int     `view:"+" def:"32,26" desc:"number of Mel frequency filters to compute"`
	LoHz        float64 `view:"+" def:"120,300" step:"10.0" desc:"low frequency end of mel frequency spectrum"`
	HiHz        float64 `` /* 160-byte string literal not displayed */
	LogOff      float64 `` /* 206-byte string literal not displayed */
	LogMin      float64 `view:"+" def:"-10" desc:"minimum value a log can produce -- puts a lower limit on log output"`
	Renorm      bool    `desc:" whether to perform renormalization of the mel values"`
	RenormMin   float64 `` /* 150-byte string literal not displayed */
	RenormMax   float64 `` /* 150-byte string literal not displayed */
	RenormScale float64 `view:"-" desc:"1.0 / (ren_max - ren_min)"`
}

FilterBank contains mel frequency feature bank sampling parameters

func (*FilterBank) Defaults

func (mfb *FilterBank) Defaults()

Defaults initializes FBank values - these are the ones you most likely need to adjust for your particular signals

type Params

type Params struct {
	FBank  FilterBank `view:"inline"`
	BinPts []int32    `view:"-" desc:" mel scale points in fft bins"`
	HzPts  []float64  `view:"-" desc:" mel scale points in hz"`
	MFCC   bool       `view:"+" def:"false" desc:" compute cepstrum discrete cosine transform (dct) of the mel-frequency filter bank features"`
	Deltas bool       `view:"+" def:"false" desc:" compute the MFCC deltas and delta-deltas"`
	NCoefs int        `viewif:"MFCC" def:"13" desc:" number of mfcc coefficients to output -- typically 1/2 of the number of filterbank features"` // Todo: should be 12 total - 2 - 13, higher ones not useful
}

Params

func (*Params) CepstrumDct

func (mel *Params) CepstrumDct(step int, fBankData *etensor.Float64, mfccSegment *etensor.Float64, mfccDct *etensor.Float64)

CepstrumDct applies a discrete cosine transform (DCT) to get the cepstrum coefficients on the mel filterbank values

func (*Params) Defaults

func (mel *Params) Defaults()

Defaults

func (*Params) FftReal

func (mel *Params) FftReal(out []complex128, in *etensor.Float64)

FftReal

func (*Params) FilterDft

func (mel *Params) FilterDft(step int, dftPowerOut *etensor.Float64, segmentData *etensor.Float64, fBankData *etensor.Float64, filters *etensor.Float64)

FilterDft applies the mel filters to power of dft

func (*Params) InitFilters

func (mel *Params) InitFilters(dftSize int, sampleRate int, filters *etensor.Float64)

InitFilters computes the filter bin values

Jump to

Keyboard shortcuts

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