Documentation ¶
Overview ¶
Package vocoder provides support for vocoding.
Index ¶
- func B2MC(b []float64, alpha float64) []float64
- func MC2B(mcep []float64, alpha float64) []float64
- func MCep2MLSAFilterCoef(mcep []float64, alpha float64) []float64
- func MGCep2MGLSAFilterCoef(melgcep []float64, alpha, gamma float64) []float64
- type MGLSABaseFilter
- type MGLSAFilter
- type MGLSASpeechSynthesizer
- type MLSABaseFilter
- type MLSACascadeFilter
- type MLSAFilter
- type MLSASpeechSynthesizer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func MCep2MLSAFilterCoef ¶
MCep2MLSAFilterCoef performs a conversion from mel-cepstrum to MLSA filter coefficients given mel-cepstrum and all-pass constant(alpha).
func MGCep2MGLSAFilterCoef ¶
MGCep2MGLSAFilterCoef performs a conversion from mel-generalized cepstrum to MGLSA filter coefficients.
Types ¶
type MGLSABaseFilter ¶
type MGLSABaseFilter struct { Order int // Order of mel-cepstrum // all-pass constant (alpha) that determines how frequency axis is warped. Alpha float64 // contains filtered or unexported fields }
MGLSABaseFilter represents a base filter of MGLSAFilter.
func NewMGLSABaseFilter ¶
func NewMGLSABaseFilter(order int, alpha float64) *MGLSABaseFilter
type MGLSAFilter ¶
type MGLSAFilter struct {
// contains filtered or unexported fields
}
MGLSAFilter represents a Mel-generalized log-spectral approximation filter.
func NewMGLSAFilter ¶
func NewMGLSAFilter(order int, alpha float64, numStage int) *MGLSAFilter
type MGLSASpeechSynthesizer ¶
type MGLSASpeechSynthesizer struct { FrameShift int Alpha float64 // all-pass constant Gamma float64 // parameter of generalized logarithmic function NumStage int // contains filtered or unexported fields }
MGLSASpeechSynthesizer represents a speech synthesizer based on the MGLSA Filter.
func NewMGLSASpeechSynthesizer ¶
func NewMGLSASpeechSynthesizer(order int, alpha float64, numStage int, frameShift int) *MGLSASpeechSynthesizer
NewMGLSASpeechSynthesizer returns its instance given parameters.
func (*MGLSASpeechSynthesizer) Synthesis ¶
func (s *MGLSASpeechSynthesizer) Synthesis(excite []float64, mgcepSequence [][]float64) []float64
Synthesis synthesizes a speech signal from an excitation signal and corresponding mel-ceptrum sequence.
func (*MGLSASpeechSynthesizer) SynthesisOneFrame ¶
func (s *MGLSASpeechSynthesizer) SynthesisOneFrame(excite []float64, previousMgcep, currentMgcep []float64) []float64
SynthesisOneFrame synthesizes a part of speech signal from an excitation signal and succesive two mel-cepstrum sequence. It requires all-pass constant (alpha). Mel-cepstral coefficients between two succesive mel-cepstrum are linearly interpolated.
type MLSABaseFilter ¶
type MLSABaseFilter struct { Order int // Order of mel-cepstrum // all-pass constant (alpha) that determines how frequency axis is warped. Alpha float64 // contains filtered or unexported fields }
MLSABaseFilter represents a base filter of the MLSA digital filter.
func NewMLSABaseFilter ¶
func NewMLSABaseFilter(order int, alpha float64) *MLSABaseFilter
NewMLSABaseFilter returns its instance. It requires the order of mel-cepstrum and all-pass constant (alpha).
type MLSACascadeFilter ¶
type MLSACascadeFilter struct {
// contains filtered or unexported fields
}
MLSACascadeFilter represents a cascade filter which contains MLSA base filters.
func NewMLSACascadeFilter ¶
func NewMLSACascadeFilter(order int, alpha float64, orderOfPade int) *MLSACascadeFilter
NewMLSABaseFilter returns its instance and error with the order of mel-cepstrum, all-pass constant (alpha) and the order of pade approximation. Order of pade approximation 4 or 5 is only supported. If other one is specified, it returns non-nil error.
type MLSAFilter ¶
type MLSAFilter struct {
// contains filtered or unexported fields
}
MLSAFilter represents a Mel-Log Spectrum Approximation (MLSA) filter, which is composed of two cascade filters.
func NewMLSAFilter ¶
func NewMLSAFilter(order int, alpha float64, orderOfPade int) *MLSAFilter
NewMLSAFilter returns its instance and error. It requires the order of mel-cepstrum, all-pass constant (alpha) and the order of pade approximation.
type MLSASpeechSynthesizer ¶
type MLSASpeechSynthesizer struct { CoreFilter *MLSAFilter // used in sample by sample speech generation FrameShift int Alpha float64 // all-pass constant }
MLSASpeechSynthesizer represents a speech synthesizer based on MLSA Filter.
func NewMLSASpeechSynthesizer ¶
func NewMLSASpeechSynthesizer(numMceps int, alpha float64, orderOfPade int, frameShift int) *MLSASpeechSynthesizer
NewMLSASpeechSynthesizer returns its instance given parameters.
func (*MLSASpeechSynthesizer) Synthesis ¶
func (s *MLSASpeechSynthesizer) Synthesis(excite []float64, mcepSequence [][]float64) []float64
Synthesis synthesizes a speech signal from an excitation signal and corresponding mel-ceptrum sequence.
func (*MLSASpeechSynthesizer) SynthesisOneFrame ¶
func (s *MLSASpeechSynthesizer) SynthesisOneFrame(excite []float64, previousMcep, currentMcep []float64) []float64
SynthesisOneFrame synthesizes a part of speech signal from an excitation signal and succesive two mel-cepstrum sequence. It requires all-pass constant (alpha). Mel-cepstral coefficients between two succesive mel-cepstrum are linearly interpolated.