dio

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0

README

go-dio

Go Report Card Godoc License

go-dio is an unofficial pure Go implementation of DIO the fundamental frequency estimation method.

DIO is one feature of World the speech analysis, manipulation and synthesis system.

This version omits the downsampling function. If you want high speed, downsample the input in advance.

Test

Before testing, you must make these preparations.

  • ./tools/make-test must be compiled by running ./tools/build.sh
  • Some *.wav (16 bit, Mono) files must be placed in ./testdata/.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Estimator

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

Estimator is the struct holds the variables needed to estimate f0 by Dio.

func New

func New(x []float64, fs float64, option *Option) *Estimator

New creates new Estimator.

func (*Estimator) Estimate

func (s *Estimator) Estimate() ([]float64, []float64)

Estimate estimates the F0 based on Distributed Inline-filter Operation.

type Option

type Option struct {
	F0Floor          float64
	F0Ceil           float64
	ChannelsInOctave float64
	FramePeriod      float64 // msec
	Speed            int     // (1, 2, ..., 12)
	AllowedRange     float64 // Threshold used for fixing the F0 contour.
}

Option is the struct to order the parameter for Dio.

func NewOption

func NewOption() *Option

NewOption creates new Option with the default parameters.

type Session

type Session struct {
	*Estimator
	// contains filtered or unexported fields
}

func NewSession

func NewSession(fs float64, option *Option) *Session

NewSession creates new Session.

func (*Session) Estimate

func (s *Session) Estimate(x []float64) []float64

func (*Session) F0Length

func (s *Session) F0Length() int

func (*Session) FramePeriod

func (s *Session) FramePeriod() float64

func (*Session) Len

func (s *Session) Len() int

func (*Session) Start

func (s *Session) Start() (chan<- []float64, <-chan []float64)

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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