Page 16-29
Next, we move to the CASDIR sub-directory under HOME to change the value
of variable PERIOD, e.g., „ (hold) §`J @)CASDI `2 K @PERIOD
`
Return to the sub-directory where you defined functions f and g, and calculate
the coefficients (Accept change to Complex mode when requested):
Thus, c
0
= 1/3, c
1
= (π⋅i+2)/π
2
, c
2
= (π⋅i+1)/(2π
2
).
The Fourier series with three elements will be written as
g(t) ≈ Re[(1/3) + (π⋅i+2)/π
2
⋅exp(i⋅π⋅t)+ (π⋅i+1)/(2π
2
)⋅exp(2⋅i⋅π⋅t)].
A plot of the shifted function g(t) and the Fourier series fitting follows: