Is there a closed-form approximation to a band-limited sawtooth?

494 Views Asked by At

A partial Fourier Series with no coefficients is equal to the closed form expression:

$${A \over n} \sum_{k=1}^n \cos(k\theta) = {A \over 2n} \left\{{\sin([2n + 1]\theta/2) \over \sin(\theta/2)} - 1\right\}$$

The sum of the harmonic series does not have a closed form expression, but can be approximated with the formula:

$$H_n = \sum_{k=1}^n h_k = \sum_{k=1}^n \frac1k = \ln n + \gamma +\frac1{2n} -\frac1{12n^2} + \frac1{120n^4} + ... $$

This can be done with varying accuracy, depending on how many terms are used in the approximation.

A band-limited sawtooth is a partial Fourier Series with harmonic coefficients. Given that the two parts of its Fourier series have approximations to n terms, does a band-limited sawtooth also have an approximation to n terms?

Observation #1

Related might be the harmonic generating function, which is:

$$\sum_{k=1}^\infty z^k H_k = {-\ln(1 - z) \over 1 - z}$$

If expressed as a partial sum, it could be used in summation by parts.

$$\sum_{k=1}^n h_k \cos(k\theta) = \sum_{k=1}^n h_k {1\over 2}(e^{ik\theta} + e^{-ik\theta}) = {1 \over 2} \sum_{k=1}^n h_k e^{ik\theta} + {1 \over 2} \sum_{k=1}^n h_k e^{-ik\theta}$$

$$\sum_{k=1}^n h_k e^{ik\theta} = H_n e^{in\theta} - \sum_{k=1}^{n-1} H_k e^{i(k+1)\theta} + \sum_{k=1}^{n-1} H_k e^{ik\theta}$$

The latter two terms being the partial sums. However, I can't find a partial sum of the generating function anywhere.

Observation #2

Also related is the following:

$$\sum_{k=1}^n H_k = (n + 1)H_n - n$$

Which could be used to further break up the problem through summation by parts:

$$\sum_{k=1}^{n-1} H_k e^{ik\theta} = ( nH_{n-1} - n + 1)e^{i(n-1)\theta} - \sum_{j=1}^{n-2}((j + 1)H_j - j)e^{i(j+1)\theta} + \sum_{j=1}^{n-2}((j + 1)H_j - j)e^{ij\theta}$$

If I kept using summation by parts this way, I'd eventually get to a point where I could stop and ignore the new summations... right?

If I were to stop here, I would get:

$$nH_n\cos((n-1)\theta) - n\cos((n-1)\theta) + nH_n\cos(n\theta) - n\cos(n\theta) + H_n\cos(n\theta)$$

Or:

$$(nH_n - n) * \left\{\cos([n-1]\theta) + \cos(n\theta)\right\} + H_n\cos(n\theta)$$

Graphing this does not give me a sawtooth wave, it gives me two sinusoids added together. What this method seems to do is approximate the sawtooth with more partials each time I break up the summation, from N to 1, which has no benefit over just evaluating the Fourier Series.

Observation #3

The Dirichlet Series is one way of expressing the sawtooth:

$$\sum_{k=1}^\infty {a_k \over k^s}, a_k = cos(k\theta)$$

This doesn't seem to have a partial sum either.

Observation #4

The Maclaurin Series for $\cos(\theta)$ is:

$$\sum_{k=0}^\infty {(-1)^k \over (2k)!} \theta^{2k}$$

Each term of the Fourier Series could be represented as a Maclaurin Series.

$$\sum_{k=1}^{n} h_k \cos(k\theta) = \sum_{k=1}^{n} h_k \sum_{j=0}^\infty {(-1)^j \over (2j)!} (k\theta)^{2j} = \sum_{k=1}^{n} {1 \over k} \sum_{j=0}^\infty {(-1)^j \over (2j)!} (k\theta)^{2j} = \sum_{k=1}^{n} \sum_{j=0}^\infty {(-1)^j \over (2j)! * k} (k\theta)^{2j}$$

But I'm not entirely sure where to go from there.

Wolfram Alpha

Well, I don't know why I didn't think of doing this before, but wolfram alpha can actually answer this, somewhat.

Now if I can figure out the Lerch Transcendent...

EDIT: The lerch transcendent in that equation is equivalent to the lerch-zeta function $ L(t, 1, N + 2) $, where $ t $ is the time variable. Also, this exists.

1

There are 1 best solutions below

0
On

The Lerch Transcendent is appealing for it's mathematical beauty but tricky to implement numerically. Harmonic Numbers are much easier to work with, especially on computers.

For faster approximations check out BLIT, BLEP, or miniBLEP.

For quality I like the following method of generating bandlimited sawtooth waves with an arbitrary number of harmonics $k$ :

$$\sin(x) \left(\frac{\cos(2 \pi k \cos(x)) \left(H_{k \cos(x)-\frac{3}{4}}-H_{k \cos(x)-\frac{1}{4}}\right)}{\pi }+1\right)$$

In Mathematica:

Sin[x]*((Cos[2*Pi*k*Cos[x]]*(HarmonicNumber[k*Cos[x] - 3/4] - HarmonicNumber[k*Cos[x] - 1/4]))/Pi + 1)

A plot of $x$ between $-\pi$ and $\pi$ when $k=1$:

1

A plot of $x$ between $-\pi$ and $\pi$ when $k=8$:

2

Note the discontinuities at 1 and -1. Use the reflection algorithm as values approach zero.

It can also be useful to rewrite using the Digamma function:

$$H_{k \cos(x)-\frac{3}{4}}-H_{k \cos(x)-\frac{1}{4}}=\psi^{(0)}\left(k \cos(x) +\frac{1}{4}\right)-\psi^{(0)}\left(k \cos(x)+\frac{3}{4}\right)$$

There are many good examples of the Digamma function on the web to learn from. Here is my favorite: https://people.sc.fsu.edu/~jburkardt/c_src/asa103/digama.c