diff --git a/docs/Project.toml b/docs/Project.toml index becdecc..e161b2e 100644 --- a/docs/Project.toml +++ b/docs/Project.toml @@ -1,3 +1,6 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" TrigPolys = "bbdedc48-cb31-4a37-9fe3-b015aecc8dd3" + +[compat] +Documenter = "1" diff --git a/docs/make.jl b/docs/make.jl index 8cf237d..d49d2ea 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -8,9 +8,6 @@ makedocs( prettyurls = get(ENV, "CI", nothing) == "true" ), - # See https://github.com/jump-dev/JuMP.jl/issues/1576 - strict = true, - pages = [ "Introduction" => "index.md", ] diff --git a/docs/src/index.md b/docs/src/index.md index ba2eb38..83ee6cb 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -3,12 +3,18 @@ [TrigPolys.jl](https://github.com/yuanchenyang/TrigPolys.jl) is a package for fast manipulation of trigonometric polynomials. - -A trignometric polynomial is defined on $$x \in [0,2\pi)$$ by - +A *Hermitian trigonometric polynomial* +can be viewed as a polynomial `R(z) \\in \\mathbb{C}[z]` [D17, (1.7)]: ```math -p(x) = a_0 + \sum_{k=1}^n a_k \cos(kx) + a_{-k} \sin(kx) +R(z) = a_0 + \\frac{1}{2} \\sum_{k=1}^n a_k z^{-k} + a_k^* z^k ``` +On the unit circle, this becomes [D17, (1.8)]: +```math +R(\\omega) = a_0 + \\sum_{k=1}^n a_{c,k} \\cos(k\\omega) + a_{s,k} \\sin(k\\omega) +``` +where ``a_{c,k}`` is `ac[k]` and ``a_{s,k}`` is `as[k]`. + +[D17] Dumitrescu, Bogdan. Positive trigonometric polynomials and signal processing applications. Vol. 103. Berlin: Springer, 2007. The polynomial $$p(x)$$ can be represented either by $$2n+1$$ coefficients $$a_k$$ or by evaluations at $$2n+1$$ distinct points in the interval diff --git a/src/TrigPolys.jl b/src/TrigPolys.jl index 51c744a..a307c5e 100644 --- a/src/TrigPolys.jl +++ b/src/TrigPolys.jl @@ -12,7 +12,14 @@ export pad_to, truncate as::VT # sin coefficients end -Represents a trigonometric polynomial by its coefficients. +Represents a *Hermitian trigonometric polynomial* by its coefficients. +The vectors `ac` and `as` should have the same length, that we call `n` in this +docstring. +This represent the following function +```julia +R(ω) = a0 + sum(ac[k] * cos(k * ω) + as[k] * sin(k * ω) for k in 1:n) +``` +which is a polynomial in the variable `x = cos(ω)`. """ struct TrigPoly{T<:AbstractFloat, VT<:AbstractVector{T}} a0::T # Constant coefficient