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[source]

Synthesis filter interface

All synthesis filters must implement this interface.

abstract filt(x, coef)[source]

Filter one sample

Parameters
xfloat

A input sample

coefarray

Filter coefficients

Returns
yfloat

A filtered sample

filtt(x, coef)[source]

Transpose filter

Can be optional.

Parameters
xfloat

A input sample

coefarray

Filter coefficients

Returns
yfloat

A filtered sample

Synthesizer

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

Speech waveform synthesizer

Attributes
filtSynthesisFilter

A speech synthesis filter

hopsizeint

Hop size

transposebool

Transpose filter or not. Default is False.

synthesis(source, b)[source]

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

Parameters
sourcearray

Source excitation

barray

Filter coefficients

Returns
yarray, shape (same as source)

Synthesized waveform

synthesis_one_frame(source, prev_b, curr_b)[source]

Synthesize one frame waveform

Parameters
sourcearray

Source excitation

prev_barray

Filter coefficients of previous frame

curr_barray

Filter coefficients of current frame

Returns
yarray

Synthesized waveform

SynthesisFilters

LMADF

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

LMA digital filter that wraps lmadf

Attributes
pdint

Order of pade approximation. Default is 4.

delayarray

Delay

filt(x, coef)[source]

Filter one sample using lmadf

Parameters
xfloat

A input sample

coef: array

LMA filter coefficients (i.e. Cepstrum)

Returns
yfloat

A filtered sample

MLSADF

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

MLSA digital filter that wraps mlsadf

Attributes
alphafloat

All-pass constant

pdint

Order of pade approximation. Default is 4.

delayarray

Delay

filt(x, coef)[source]

Filter one sample using mlsadf

Parameters
xfloat

A input sample

coef: array

MLSA filter coefficients

Returns
yfloat

A filtered sample

filtt(x, coef)[source]

Transpose filter using mlsadft

Parameters
xfloat

A input sample

coef: array

MLSA filter coefficients

Returns
yfloat

A filtered sample

GLSADF

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

GLSA digital filter that wraps glsadf

Attributes
stageint

-1/gamma

delayarray

Delay

filt(x, coef)[source]

Filter one sample using glsadf

Parameters
xfloat

A input sample

coef: array

GLSA filter coefficients

Returns
yfloat

A filtered sample

filtt(x, coef)[source]

Filter one sample using glsadft

Parameters
xfloat

A input sample

coef: array

GLSA filter coefficients

Returns
yfloat

A filtered sample

MGLSADF

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

MGLSA digital filter that wraps mglsadf

Attributes
alphafloat

All-pass constant

stageint

-1/gamma

delayarray

Delay

filt(x, coef)[source]

Filter one sample using mglsadf

Parameters
xfloat

A input sample

coef: array

MGLSA filter coefficients

Returns
yfloat

A filtered sample

filtt(x, coef)[source]

Filter one sample using mglsadft

Parameters
xfloat

A input sample

coef: array

MGLSA filter coefficients

Returns
yfloat

A filtered sample

AllZeroDF

class pysptk.synthesis.AllZeroDF(order=25)[source]

All-zero digital filter that wraps zerodf

Attributes
delayarray

Delay

filt(x, coef)[source]

Filter one sample using using zerodf

Parameters
xfloat

A input sample

coef: array

FIR parameters

_
yfloat

A filtered sample

filtt(x, coef)[source]

Filter one sample using using zerodft

Parameters
xfloat

A input sample

coef: array

FIR parameters

Returns
yfloat

A filtered sample

AllPoleDF

class pysptk.synthesis.AllPoleDF(order=25)[source]

All-pole digital filter that wraps poledf

Attributes
delayarray

Delay

filt(x, coef)[source]

Filter one sample using using poledf

Parameters
xfloat

A input sample

coef: array

LPC (with loggain)

Returns
yfloat

A filtered sample

filtt(x, coef)[source]

Filter one sample using using poledft

Parameters
xfloat

A input sample

coef: array

LPC (with loggain)

Returns
yfloat

A filtered sample

AllPoleLatticeDF

class pysptk.synthesis.AllPoleLatticeDF(order=25)[source]

All-pole lttice digital filter that wraps ltcdf

Attributes
delayarray

Delay

filt(x, coef)[source]

Filter one sample using using ltcdf

Parameters
xfloat

A input sample

coef: array

PARCOR coefficients (with loggain)

Returns
yfloat

A filtered sample