excite#
- class diffsptk.ExcitationGeneration(frame_period: int, *, voiced_region: str = 'pulse', unvoiced_region: str = 'gauss', polarity: str = 'auto', init_phase: str = 'zeros')[source]#
See this page for details.
- Parameters:
- frame_periodint >= 1
The frame period in samples, \(P\).
- voiced_region[‘pulse’, ‘sinusoidal’, ‘sawtooth’, ‘inverted-sawtooth’, ‘triangle’, ‘square’]
The type of voiced region.
- unvoiced_region[‘zeros’, ‘gauss’]
The type of unvoiced region.
- polarity[‘auto’, ‘unipolar’, ‘bipolar’]
The polarity.
- init_phase[‘zeros’, ‘random’]
The initial phase.
- forward(p: Tensor) Tensor [source]#
Generate a simple excitation signal.
- Parameters:
- pTensor [shape=(…, N)]
The pitch in seconds.
- Returns:
- outTensor [shape=(…, NxP)]
The 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: Tensor, frame_period: int = 80, *, voiced_region: str = 'pulse', unvoiced_region: str = 'gauss', polarity: str = 'auto', init_phase: str = 'zeros') Tensor [source]#
Generate a simple excitation signal.
- Parameters:
- pTensor [shape=(…, N)]
The pitch in seconds.
- frame_periodint >= 1
The frame period in samples, \(P\).
- voiced_region[‘pulse’, ‘sinusoidal’, ‘sawtooth’, ‘inverted-sawtooth’, ‘triangle’, ‘square’]
The type of voiced region.
- unvoiced_region[‘zeros’, ‘gauss’]
The type of unvoiced region.
- polarity[‘auto’, ‘unipolar’, ‘bipolar’]
The polarity.
- init_phase[‘zeros’, ‘random’]
The initial phase.
- Returns:
- outTensor [shape=(…, NxP)]
The excitation signal.
See also