Learn R Programming

MECfda (version 0.2.1)

Fourier_series-class: s4 class of Fourier summation series

Description

A s4 class that represents the linear combination of Fourier basis functions below: $$\frac{a_0}{2} + \sum_{k=1}^{p_a} a_k \cos{(\frac{2\pi}{T}k(x-t_0))} + \sum_{k=1}^{p_b} b_k \sin{(\frac{2\pi}{T}k(x-t_0))}, \qquad x\in[t_0,t_0+T]$$

Arguments

Slots

double_constant

value of \(a_0\).

cos

values of coefficients of \(\cos\) waves, \(a_k\).

sin

values of coefficients of \(\sin\) waves, \(b_k\).

k_cos

values of \(k\) corresponding to the coefficients of \(\cos\) waves

k_sin

values of \(k\) corresponding to the coefficients of \(\sin\) waves

t_0

left end of the domain interval, \(t_0\)

period

length of the domain interval, \(T\).

Author

Heyang Ji

Details

If not assigned, \(t_0 = 0\), \(T = 2\pi\). If not assigned, k_cos and k_sin equals 1, 2, 3, ...

Examples

Run this code
fsc = Fourier_series(
           double_constant = 0.5,
           cos = c(0,0.3),
           sin = c(1,0.7),
           k_cos = 1:2,
           )

Run the code above in your browser using DataLab