polynomialMathematical Operations:Opcode Equivalents of Functionspolynomialpolynomial
Efficiently evaluates a polynomial of arbitrary order.
Description
The polynomial opcode calculates a polynomial with a single a-rate input variable. The polynomial is a sum of any number of terms in the form kn*x^n where kn is the nth coefficient of the expression. These coefficients are k-rate values.
Syntaxaout polynomial ain, k0 [, k1 [, k2 [...]]]Performanceain -- the input signal used as the independent variable of the polynomial ("x").
aout -- the output signal ("y").
k0, k1, k2, ... -- the coefficients for each term of the polynomial.
If we consider the input parameter ain to be "x" and the output aout to be "y", then the polynomial opcode calculates the following equation:
y = k0 + k1*x + k2*x^2 + k3*x^3 + ...
Examples
Here is an example of the polynomial opcode. It uses the file polynomial.csd.
Example of the polynomial opcode.See the sections Real-time Audio and Command Line Flags for more information on using command line flags.See alsoWaveshapingOpcode Equivalents of FunctionsCreditsAuthor: &nameanthony;January 2008New in Csound version 5.08