Alternatively, you can use the FFT technique. Then the number of evaluated locations (sampling points) of the function f(x) must be a power of 2.

The function f(x) is evaluated for the interval [0, L] or alternatively for the interval [-L/2, L/2].

Without using FFT, you can freely choose the number of sampling points.

This number determines the

If you use the coefficients in the sense of a

By specifying k

The given function f(x) (black) and its approximation (yellow) by the first Fourier series terms

a

are graphically represented in a diagram.

The Fourier series coefficients a

The

H(x) = 0 for x < 0 and

H(x) = 1 for ≥ 0

H(x) is also called a step function. It is discontinuous at x=0.

With the help of H(x) you can "hide" certain areas of a function. This is how it is initially

H(x-a) = 0 for x < a and

H(x-a) = 1 for x ≥ a

and

H(a-x) = 1 for x ≤ a and

H(a-x) = 0 for x > a

For any function f(x) then the following applies:

f(x)*H(x-a) = 0 for x < a and

f(x)*H(x-a) = f(x) for x ≥ a

as well as

f(x)*H(a-x) = f(x) for x ≤ a and

f(x)*H(a-x) = 0 for x > a

and applied bilaterally for a, b ∈ ℝ with a < b:

f(x)*H(x-a)*H(b-x) = f(x) for a ≤ x ≤ b

f(x)*H(x-a)*H(b-x) = 0 otherwise

How the function specified in the function definition f(x) behaves outside this interval is irrelevant.

Normally you first decide whether you want to use interval [-L,L] or interval [0,2L].

Then you define the function f(x).

If you then change the interval, a different Fourier series will usually result.

In the examples, all function definitions were chosen so that they lead to the same Fourier series, regardless of the selected interval.

Normally, this “double definition” will not be necessary.

more JavaScript applications