Fourier Series

Overview

A Fourier series expresses a periodic function as the sum of sines and cosines.

A Chart of the sine function shows the periodic wavelike nature of the function.

[{"name":"line chart","body":{"config":{"highchart":{"chart":{"type":"line"},"xAxis":{"title":{"text":""}},"yAxis":{"title":{"text":""}},"title":{"text":""},"subtitle":{"text":""},"tooltip":{"valueSuffix":"C"},"legend":{"layout":"vertical","align":"right","verticalAlign":"top","borderWidth":0},"series":[{"properties":["y"],"name":"series","data":"curve","type":"line","xaxis":"x"}]}},"style":"#COMPONENT-ID{\n\tborder:solid;\n\tborder-width:1px;\n\tborder-color:lightgrey;\n\theight:300px;\n}\n"},"url":"/app/highcharts/v1.0.0/ctrl.mjs","site":"/home/documentation/template.html?url=/ctrls/highcharts/highlinechart/v1.0.0/site/doc.js","id":"ibrvxA8Kh-21P1-caR5-BSkz-Fug5p9Ov6RGZ","import":{"curve":{}}},{"name":"data","body":{"script":"\r\nfrom davinci.python import _from,val\r\nimport math\r\n\r\ndata = [\r\n {\"y\":math.sin(x), \"x\":x}\r\n for x in _from(0, 2*3.14159,1000)\r\n]\r\n\r\n'''\r\n\r\ndata = _from(0, 2*Math.PI).map(p=>{\r\n return {\r\n y:Math.sin(p),\r\n x:p\r\n };\r\n});\r\n\r\n'''\r\n\r\nval.set('curve', data);\r\n","config":{},"style":"#ID{\n height:400px; \n}\n \n #ID .script-area{\n\tborder:solid;\n\tborder-width:1px;\n\tborder-color:lightgray;\n\tmargin: 0;\n}"},"url":"/app/python/v1.0.0/ctrl.mjs"}]

Fourier Series Expansion

A fourier series expansion expresses a function as the weighted sum of sine and cosine functions.
{% f(x) \approx \frac{a_0}{2} + \sum_{i=1} ^n (a_n cos \frac{n \pi x}{c} + b_n sin \frac{n \pi x}{c})%}
the coefficients can be calculated by the following formulas
{% a_n = \frac{1}{\pi} \int_{- c}^{c} \; f(x)\; cos (\frac{n \pi x}{c}) \; dx %}
{% b_n = \frac{1}{\pi} \int_{- c}^{c} \; f(x)\; sin(\frac{n \pi x}{c}) \; dx %}
Note that c is generally taken to be equal to {% \pi %}, however, it can taken to be any size.

Formalization using Functional Analysis

In terms of functional analysis, the set of representable functions is a Hilbert Space, with the inner product given by
{% \int_a^b \bar{g}(x) f(x) dx %}
The sine and cosine functions represent a Schauder Basis of the space.