In a Fourier series, the maximum error bound is the difference of the function and the partial sum of its Fourier series. Within an interval, as we increase the number of terms of partial sums, the error decreases.
$$e(x) = \left|f(x) − s(x)\right|$$
How can I determine the number of terms needed to calculate the partial sum so as to have a specific maximum error bound? For e.g $|e(x)| ≤ 0.01$ or $|e(x)| ≤ 0.001$
For example in a typical question, $f(x)$ defined as
$$f (x) = \begin{cases} 0 &−3 \leq x \leq 0\\ x^2(3 − x) & 0 < x < 3 \end{cases}$$
is a periodic function with period $6$ i.e., $f (x + 6) = f (x)$
- Plot $|e(x)|$ versus $x$ for $0 ≤ x ≤ 3$ for several values of $m$.
- Find the smallest value of $m$ for which $|e(x)| ≤ 0.1$ for all $x$.
Constructing the Fourier series for this periodic function and plotting $|e(x)|$ versus $x$ for several partial sums like $m = 5, 10, 20$ is easy. It can be accomplished by DiscretePlot
.
How can I find the smallest value of $m$ (i.e., the number of terms needed in the partial sum to achieve a specific error bound)?
I use Mathematica 6 and 7.
FourierTrigSeries[UnitStep[x] (3 - x) x^2, x, n, FourierParameters -> {1, Pi/3}]
, wheren
is the number of terms you need for the Fourier series. $\endgroup$ – J. M.'s ennui♦ May 24 '12 at 16:02