Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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] ...

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