excite#

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

See this page for details.

Parameters:
frame_periodint >= 1 [scalar]

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:
eTensor [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])

See also

pitch