Programs > Example: Fourier Polynomial
  
Example: Fourier Polynomial
1. Write a program that generates a periodic function:
Click to copy this expression
2. Plot the function:
Click to copy this expression
3. Enter the positive endpoint of the periodic interval:
Click to copy this expression
4. Specify the order of the Fourier series approximation:
Click to copy this expression
5. Write a program to compute the Fourier coefficients:
Click to copy this expression
6. Compute the Fourier coefficients:
Click to copy this expression
Click to copy this expression
Click to copy this expression
7. Compute the Nth Fourier polynomial:
Click to copy this expression
8. Plot the Fourier polynomial and the original function:
Click to copy this expression
P1 approximation of f is poor around the high frequency points (the sharp edges).
9. Compute the Fourier coefficients:
Click to copy this expression
Click to copy this expression
Click to copy this expression
Click to copy this expression
10. Compute the Nth Fourier polynomial:
Click to copy this expression
11. Plot the Fourier polynomial and the original function:
Click to copy this expression
P2, which uses Nt=20, provides a much better approximation of the original function especially around the high frequency points (the sharp edges).