|
Oakfield API Documentation 1.0.0
Numerical core APIs
|
Jacobi-theta-derived waveform helpers. More...
#include <stddef.h>
Go to the source code of this file.
Classes | |
| struct | theta_eval |
| Theta waveform value with error estimate and convergence metadata. More... | |
Typedefs | |
| typedef enum theta_status | theta_status |
| Research-grade evaluation of real Jacobi-theta-derived waveform families. | |
| typedef struct theta_eval | theta_eval |
| Theta waveform value with error estimate and convergence metadata. | |
Enumerations | |
| enum | theta_status { THETA_STATUS_OK = 0 , THETA_STATUS_DOMAIN_ERROR , THETA_STATUS_SINGULAR , THETA_STATUS_NO_CONVERGENCE } |
| Research-grade evaluation of real Jacobi-theta-derived waveform families. More... | |
Functions | |
| const char * | theta_status_string (theta_status status) |
| Human-readable description of a theta_status value. | |
| theta_eval | theta1_norm_eval (double z, double q, double s1, double c1) |
| Evaluate theta1(z,q) / theta2(0,q). | |
| theta_eval | theta_square_eval (double z, double q, double s1, double c1) |
| Evaluate the square-like theta quotient [theta3(0,q)/theta2(0,q)] * [theta1(z,q)/theta4(z,q)]. | |
| theta_eval | theta_saw_unit_eval (double z, double q, double s1, double c1) |
| Evaluate the phase-based saw map (1/pi) arg(1 - q exp(-i z)). | |
| theta_eval | theta_triangle_eval (double z, double q, double s1, double c1) |
| Evaluate the triangle-like odd-harmonic Lambert/theta series. | |
| double | theta1_norm (double z, double q, double s1, double c1) |
| double | theta_square (double z, double q, double s1, double c1) |
| double | theta_saw_unit (double z, double q, double s1, double c1) |
| double | theta_triangle (double z, double q, double s1, double c1) |
Jacobi-theta-derived waveform helpers.
| typedef enum theta_status theta_status |
Research-grade evaluation of real Jacobi-theta-derived waveform families.
For a real phase z and real nome q with 0 <= q < 1, the classical Jacobi theta functions are evaluated through their Fourier series,
theta1(z,q) = 2 sum_{n>=0} (-1)^n q^{(n+1/2)^2} sin((2n+1) z), theta2(0,q) = 2 sum_{n>=0} q^{(n+1/2)^2}, theta3(0,q) = 1 + 2 sum_{n>=1} q^{n^2}, theta4(z,q) = 1 + 2 sum_{n>=1} (-1)^n q^{n^2} cos(2n z).
The functions below expose waveform-oriented combinations of these series while also reporting numerical diagnostics. The API accepts precomputed s1 = sin(z) and c1 = cos(z) so that a caller can reuse oscillator state or SIMD pipelines. If the supplied pair is not close to the unit circle, the implementation falls back to recomputing sin(z) and cos(z) internally.
| enum theta_status |
Research-grade evaluation of real Jacobi-theta-derived waveform families.
For a real phase z and real nome q with 0 <= q < 1, the classical Jacobi theta functions are evaluated through their Fourier series,
theta1(z,q) = 2 sum_{n>=0} (-1)^n q^{(n+1/2)^2} sin((2n+1) z), theta2(0,q) = 2 sum_{n>=0} q^{(n+1/2)^2}, theta3(0,q) = 1 + 2 sum_{n>=1} q^{n^2}, theta4(z,q) = 1 + 2 sum_{n>=1} (-1)^n q^{n^2} cos(2n z).
The functions below expose waveform-oriented combinations of these series while also reporting numerical diagnostics. The API accepts precomputed s1 = sin(z) and c1 = cos(z) so that a caller can reuse oscillator state or SIMD pipelines. If the supplied pair is not close to the unit circle, the implementation falls back to recomputing sin(z) and cos(z) internally.
| theta_eval theta1_norm_eval | ( | double | z, |
| double | q, | ||
| double | s1, | ||
| double | c1 | ||
| ) |
Evaluate theta1(z,q) / theta2(0,q).
This is the odd, 2*pi-periodic theta quotient used as the base sinusoid-like member of the family. For q -> 0 it satisfies the analytic limit
theta1(z,q) / theta2(0,q) -> sin(z).
| z | Real phase variable. |
| q | Real nome, required to satisfy 0 <= q < 1. |
| s1 | Optional cached sin(z). |
| c1 | Optional cached cos(z). |
| theta_eval theta_saw_unit_eval | ( | double | z, |
| double | q, | ||
| double | s1, | ||
| double | c1 | ||
| ) |
Evaluate the phase-based saw map (1/pi) arg(1 - q exp(-i z)).
This function is not itself a classical theta quotient. It is the principal- branch argument of a first-order analytic phase map and serves as a smooth saw surrogate. For q -> 1^- it approaches a centered sawtooth on the principal branch, away from the branch point at z = 2*pi*m.
| z | Real phase variable. Only used when s1/c1 must be recomputed. |
| q | Real shaping parameter, required to satisfy 0 <= q < 1. |
| s1 | Optional cached sin(z). |
| c1 | Optional cached cos(z). |
| theta_eval theta_square_eval | ( | double | z, |
| double | q, | ||
| double | s1, | ||
| double | c1 | ||
| ) |
Evaluate the square-like theta quotient [theta3(0,q)/theta2(0,q)] * [theta1(z,q)/theta4(z,q)].
Under the standard change of variable v = pi*u/(2*K(k)), this is the classical theta-function quotient for Jacobi sn(u,k). In the small-nome limit q -> 0 it reduces analytically to sin(z).
| z | Real phase variable. |
| q | Real nome, required to satisfy 0 <= q < 1. |
| s1 | Optional cached sin(z). |
| c1 | Optional cached cos(z). |
| theta_eval theta_triangle_eval | ( | double | z, |
| double | q, | ||
| double | s1, | ||
| double | c1 | ||
| ) |
Evaluate the triangle-like odd-harmonic Lambert/theta series.
T(z,q) = (8/pi^2) * [(-log q)/sqrt(q)]
Despite the historical function name, the chosen normalization does not recover the classical triangle-wave series as q -> 1^-. Instead, the coefficients tend to the smoother cubic odd-harmonic law 8/(pi^2 (2n+1)^3), so the limit is a twice-integrated square-wave family rather than an exact triangle. The expression is singular as q -> 0^+ and therefore this routine is defined only for 0 < q < 1.
| z | Real phase variable. |
| q | Real nome/shaping parameter, required to satisfy 0 < q < 1. |
| s1 | Optional cached sin(z). |
| c1 | Optional cached cos(z). |