Skip to content

Commit

Permalink
Merge pull request #5 from JuliaAlgebra/bl/d17
Browse files Browse the repository at this point in the history
Cite Dimitrescu's book
  • Loading branch information
yuanchenyang authored Jan 30, 2025
2 parents dbb623b + 2ccb598 commit 66d75ed
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 8 deletions.
3 changes: 3 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
TrigPolys = "bbdedc48-cb31-4a37-9fe3-b015aecc8dd3"

[compat]
Documenter = "1"
3 changes: 0 additions & 3 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
]
Expand Down
14 changes: 10 additions & 4 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 8 additions & 1 deletion src/TrigPolys.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 66d75ed

Please sign in to comment.