High-level interface for waveform synthesis

Module pysptk.synthesis provides high-leve interface that wraps low-level SPTK waveform synthesis functions (e.g. mlsadf),

Synthesis filter interface

class pysptk.synthesis.SynthesisFilter

Synthesis filter interface

All synthesis filters must implement this interface.

filt(x, coef)

Filter one sample

Parameters:
x : float

A input sample

coef : array

Filter coefficients

Returns:
y : float

A filtered sample

filtt(x, coef)

Transpose filter

Can be optional.

Parameters:
x : float

A input sample

coef : array

Filter coefficients

Returns:
y : float

A filtered sample

Synthesizer

class pysptk.synthesis.Synthesizer(filt, hopsize, transpose=False)

Speech waveform synthesizer

Attributes:
filt : SynthesisFilter

A speech synthesis filter

hopsize : int

Hop size

transpose : bool

Transpose filter or not. Default is False.

synthesis(source, b)

Synthesize a waveform given a source excitation and sequence of filter coefficients (e.g. cepstrum).

Parameters:
source : array

Source excitation

b : array

Filter coefficients

Returns:
y : array, shape (same as source)

Synthesized waveform

synthesis_one_frame(source, prev_b, curr_b)

Synthesize one frame waveform

Parameters:
source : array

Source excitation

prev_b : array

Filter coefficients of previous frame

curr_b : array

Filter coefficients of current frame

Returns:
y : array

Synthesized waveform

SynthesisFilters

LMADF

class pysptk.synthesis.LMADF(order=25, pd=4)

LMA digital filter that wraps lmadf

Attributes:
pd : int

Order of pade approximation. Default is 4.

delay : array

Delay

filt(x, coef)

Filter one sample using lmadf

Parameters:
x : float

A input sample

coef: array

LMA filter coefficients (i.e. Cepstrum)

Returns:
y : float

A filtered sample

MLSADF

class pysptk.synthesis.MLSADF(order=25, alpha=0.35, pd=4)

MLSA digital filter that wraps mlsadf

Attributes:
alpha : float

All-pass constant

pd : int

Order of pade approximation. Default is 4.

delay : array

Delay

filt(x, coef)

Filter one sample using mlsadf

Parameters:
x : float

A input sample

coef: array

MLSA filter coefficients

Returns:
y : float

A filtered sample

filtt(x, coef)

Transpose filter using mlsadft

Parameters:
x : float

A input sample

coef: array

MLSA filter coefficients

Returns:
y : float

A filtered sample

GLSADF

class pysptk.synthesis.GLSADF(order=25, stage=1)

GLSA digital filter that wraps glsadf

Attributes:
stage : int

-1/gamma

delay : array

Delay

filt(x, coef)

Filter one sample using glsadf

Parameters:
x : float

A input sample

coef: array

GLSA filter coefficients

Returns:
y : float

A filtered sample

filtt(x, coef)

Filter one sample using glsadft

Parameters:
x : float

A input sample

coef: array

GLSA filter coefficients

Returns:
y : float

A filtered sample

MGLSADF

class pysptk.synthesis.MGLSADF(order=25, alpha=0.35, stage=1)

MGLSA digital filter that wraps mglsadf

Attributes:
alpha : float

All-pass constant

stage : int

-1/gamma

delay : array

Delay

filt(x, coef)

Filter one sample using mglsadf

Parameters:
x : float

A input sample

coef: array

MGLSA filter coefficients

Returns:
y : float

A filtered sample

filtt(x, coef)

Filter one sample using mglsadft

Parameters:
x : float

A input sample

coef: array

MGLSA filter coefficients

Returns:
y : float

A filtered sample

AllZeroDF

class pysptk.synthesis.AllZeroDF(order=25)

All-zero digital filter that wraps zerodf

Attributes:
delay : array

Delay

filt(x, coef)

Filter one sample using using zerodf

Parameters:
x : float

A input sample

coef: array

FIR parameters

_
y : float

A filtered sample

filtt(x, coef)

Filter one sample using using zerodft

Parameters:
x : float

A input sample

coef: array

FIR parameters

Returns:
y : float

A filtered sample

AllPoleDF

class pysptk.synthesis.AllPoleDF(order=25)

All-pole digital filter that wraps poledf

Attributes:
delay : array

Delay

filt(x, coef)

Filter one sample using using poledf

Parameters:
x : float

A input sample

coef: array

LPC (with loggain)

Returns:
y : float

A filtered sample

filtt(x, coef)

Filter one sample using using poledft

Parameters:
x : float

A input sample

coef: array

LPC (with loggain)

Returns:
y : float

A filtered sample

AllPoleLatticeDF

class pysptk.synthesis.AllPoleLatticeDF(order=25)

All-pole lttice digital filter that wraps ltcdf

Attributes:
delay : array

Delay

filt(x, coef)

Filter one sample using using ltcdf

Parameters:
x : float

A input sample

coef: array

PARCOR coefficients (with loggain)

Returns:
y : float

A filtered sample