excite#

class diffsptk.ExcitationGeneration(frame_period, voiced_region='pulse', unvoiced_region='gauss')[source]#

See this page for details.

Parameters:
frame_periodint >= 1

Frame period in samples, \(P\).

voiced_region[‘pulse’, ‘sinusoidal’, ‘sawtooth’]

Value on voiced region.

unvoiced_region[‘gauss’, ‘zeros’]

Value on unvoiced region.

forward(p)[source]#

Generate a simple excitation signal.

Parameters:
pTensor [shape=(…, N)]

Pitch in seconds.

Returns:
outTensor [shape=(…, NxP)]

Excitation signal.

Examples

>>> p = torch.tensor([2.0, 3.0])
>>> excite = diffsptk.ExcitationGeneration(3)
>>> e = excite(p)
>>> e
tensor([1.4142, 0.0000, 1.6330, 0.0000, 0.0000, 1.7321])
diffsptk.functional.excite(p, frame_period=80, voiced_region='pulse', unvoiced_region='gauss')[source]#

Generate a simple excitation signal.

Parameters:
pTensor [shape=(…, N)]

Pitch in seconds.

frame_periodint >= 1

Frame period in samples, \(P\).

voiced_region[‘pulse’, ‘sinusoidal’, ‘sawtooth’]

Value on voiced region.

unvoiced_region[‘gauss’, ‘zeros’]

Value on unvoiced region.

Returns:
outTensor [shape=(…, NxP)]

Excitation signal.

See also

pitch