Wolfram Research

Function Repository Resource:

NFourierSeries

Source Notebook

Find a numerical approximation for an exponential Fourier series expansion of a function

Contributed by: Wolfram Research

ResourceFunction["NFourierSeries"][expr,t,n]

gives a numerical approximation to the nth-order Fourier series expansion of expr in t.

Details and Options

The numerical approximation to the order n Fourier exponential series expansion of expr is by default defined to be , where Fk is given by .
With the setting FourierParameters{a,b}, the order n Fourier exponential series expansion computed by ResourceFunction["NFourierSeries"] is , where Fk is given by .
In addition to the option FourierParameters, ResourceFunction["NFourierSeries"] can also accept the options available to NIntegrate. These options are passed directly to NIntegrate.

Examples

Basic Examples

Numerical approximation for an exponential Fourier series:

In[1]:=
ResourceFunction["NFourierSeries"][Sin[Cos[t]] + Abs[t]/5, t, 4, FourierParameters -> {1, -2 \[Pi]}] // Chop
Out[1]=
In[2]:=
Plot[%, {t, -2, 2}]
Out[2]=

Compare with a plot of the original function:

In[3]:=
Plot[Sin[Cos[(t - Round[t])]] + Abs[t - Round[t]]/5, {t, -2, 2}]
Out[3]=

Requirements

Wolfram Language 11.3 (March 2018) or above

Resource History

License Information