WOLFRAM|DEMONSTRATIONS PROJECT

First and Second Derivatives of a Periodic Function Using Discrete Fourier Transforms

​
a
1
1
ω
1
1
a
2
1
ω
2
1
base-2 log of number of sample points
8
derivative order
0
1
2
Consider the family of periodic functions
f(t)=
a
1
sin(
ω
1
t)+
a
2
cos(
ω
2
t)
, where
0≤t≤4π
. This Demonstration applies the discrete Fourier transform to compute the first and second derivatives of
f(t)
. (The derivative order 0 gives the original function.) The derivatives obtained analytically are shown in dashed red, while the numerical solutions are shown in blue. For a large number of sample points, there is close agreement between the two methods.