Lesson 18 of 18
Fourier Sine Coefficients
Fourier Series
Any periodic function can be expressed as a sum of sines and cosines — the Fourier series:
for functions on . The coefficients are:
Sine Coefficients of
Since is an odd function, all cosine coefficients . The sine coefficients are:
So:
| 1 | 2.0000 |
| 2 | −1.0000 |
| 3 | 0.6667 |
Numerical Computation
Approximate the integral using the left Riemann sum with steps on :
Your Task
Implement double fourier_bn(f, n, steps) that numerically computes the -th Fourier sine coefficient of on .
TCC compiler loading...
Loading...
Click "Run" to execute your code.