pol_root#
- class diffsptk.RootsToPolynomial(order)[source]#
This is the opposite module to
PolynomialToRoots()
.- orderint >= 1 [scalar]
Order of coefficients.
- forward(x)[source]#
Convert roots to polynomial coefficients.
- Parameters:
- xTensor [shape=(…, M)]
Complex roots.
- Returns:
- aTensor [shape=(…, M+1)]
Polynomial coefficients.
Examples
>>> x = torch.tensor([3, 4, -1]) >>> pol_root = diffsptk.RootsToPolynomial(x.size(-1)) >>> a = pol_root(x) >>> a tensor([ 1, -6, 5, 12])
See also