When the simulation is opened the upper window displays a red step function in the interval 0 < x < 2πt. It is periodically continued beyond this fundamental period (magenta).
The formula of the function is displayed in a text window.
Slider order n defines the order of the partial sum of the series (the nth approximation). In the text field below the displayed order can be edited, with values beyond the range of the slider.
Reset restores the default setting.
Slider c controls a parameter that changes functions continously, when it is appears in the formula.
The lower window optionally displays the spectrum of the Fourier coefficients, for an (the cosine coefficient), bn (the sine coefficient), or the power spectrum
√(an2+bn2).
After any change the calculation is started automatically; thus the result of variations is quickly visible.
The default function is editable in its text field. This makes the simulation very flexible. One can input any other function and investigate its spectrum. The proper syntax can be studied in the following examples. They are formulated in such a way that the base functions are symmetric along the x axis.
Symmetric rectangle: 2*step(x - pi) - 1
Rectangle pulse of adjustable length: step(x - pi) - step(x - c/pi)
Sawtooth: x/pi - 1
Sawtooth with adjustable overtone: x/pi - 1 + sin(c*x)
Triangle: 2*x/pi - 1 - 4/pi*(x - pi) * step(x - pi)
Triangle with adjustable overtone: 2*x/pi - 1 - 4/pi*(x - pi) * step(x - pi) + sin(c*x)
Gaussian of adjustable width: exp(-c*(x - pi)^2)