Skip to content

Commit

Permalink
Cite D17 book
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jul 4, 2023
1 parent dbb623b commit 34eb409
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 5 deletions.
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

0 comments on commit 34eb409

Please sign in to comment.