Fourier Series for a piecewise function help

Click For Summary
SUMMARY

The discussion focuses on deriving the Fourier series for a piecewise function defined as f(x) = 0 for -π ≤ x ≤ 0, f(x) = -1 for 0 ≤ x ≤ π/2, and f(x) = 1 for π/2 ≤ x ≤ π. The user calculated the Fourier coefficients a_n and b_n, discovering that all even a_n coefficients are zero and that b_n coefficients are zero for odd n. The user initially encountered issues with plotting the function, which were resolved after correcting the summation expressions for a_m and b_m, leading to the final function representation g(x) = Σ a_m Cos((2m-1)x) + Σ b_m Sin((2m-1)x).

PREREQUISITES
  • Understanding of Fourier series and piecewise functions
  • Familiarity with integration techniques in calculus
  • Knowledge of trigonometric identities and their applications
  • Experience with mathematical software such as Mathematica for plotting functions
NEXT STEPS
  • Study the derivation of Fourier series for different types of piecewise functions
  • Learn about convergence properties of Fourier series
  • Explore the use of Mathematica for visualizing Fourier series
  • Investigate the implications of Fourier series in signal processing
USEFUL FOR

Students studying mathematical analysis, particularly those focusing on Fourier series, as well as educators and professionals in fields involving signal processing and mathematical modeling.

dinospamoni
Messages
90
Reaction score
0

Homework Statement



I'm trying to find a Fourier series for the piecewise function where f(x)=

0 \in -\pi \leq x \leq 0
-1 \in 0 \leq x \leq \frac{\pi}{2}
1 \in \frac{\pi}{2} \leq x \leq \pi

Homework Equations



a_{n} = \frac{1}{\pi} \int_{0}^{2\pi}\cos(nx)y(x)\,dx
b_{n} = \frac{1}{\pi} \int_{0}^{2\pi}\sin(nx)y(x)\,dx

The Attempt at a Solution



I found the pattern that every even a is 0, so that becomes
a_{m} = \sum_{m=1}^{\infty}\frac{(-1)^{m}2}{(2m-1)\pi}

and the b coefficients are 0 when n is odd and 0 for every other even n, so that becomes
b_{m} = \sum_{m=1}^{\infty}\frac{-2}{\frac{4m-2}{2}\pi}

however when I plot this, the plot between -pi and -pi/2 is switched with the plot between pi/2 and pi

I attached a picture for reference along with a plot of f(x)

Any ideas of where i went wrong?
 

Attachments

  • Screen capture00000000000000000 2013-04-24 at 4.01.46 PM.JPG
    Screen capture00000000000000000 2013-04-24 at 4.01.46 PM.JPG
    17.1 KB · Views: 532
  • Screen capture00000000000000000 2013-04-24 at 4.02.58 PM.JPG
    Screen capture00000000000000000 2013-04-24 at 4.02.58 PM.JPG
    8 KB · Views: 439
Last edited:
Physics news on Phys.org
dinospamoni said:
Any ideas of where i went wrong?
Not really since you didn't show your work. Just posting your final, probably wrong answer isn't very helpful.
 
Whoops sorry, I forgot I didn't do this all in mathematica:

a_{0} = 0

a_{1} = \frac{-2}{\pi}

a_{2} = 0

a_{3} = \frac{2}{3\pi}

a_{4} = 0

a_{5} = \frac{-2}{5\pi}

a_{6} = 0b_{1} = 0

b_{2} = \frac{-2}{\pi}

b_{3} = 0

b_{4} = 0

b_{5} = 0

b_{6} =\frac{-2}{3\pi}

b_{7} = 0

b_{8} = 0

b_{9} = 0

b_{10} =\frac{-2}{5\pi}

b_{11} = 0

b_{12} = 0

b_{13} = 0

b_{14} = \frac{-2}{7\pi}
 
Last edited:
And I figured out the summations from just looking at these in terms of n:

a_{n} = \sum\frac{(-1)^{n}2}{n\pi}

b_{n} = \sum\frac{-2}{\frac{n}{2}\pi}

and then to get rid of the 0s I made it in terms of m:

a_{m} = \sum\frac{(-1)^{m}2}{(2m-1)\pi}

b_{m} = \sum\frac{-2}{\frac{4m-2}{2}\pi}

The function is then:

g(x) = \sum_{m=1}^{\infty} a_m Cos((2m-1)x) + \sum_{m=1}^{\infty} b_m Sin((2m-1)x)
 
Last edited:
I figured out what I did wrong, but thanks!
 

Similar threads

  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 7 ·
Replies
7
Views
2K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 16 ·
Replies
16
Views
2K