1. Not finding help here? Sign up for a free 30min tutor trial with Chegg Tutors
    Dismiss Notice
Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Fourier Series of a step function

  1. Jan 2, 2015 #1
    1. The problem statement, all variables and given/known data

    [tex]
    f(x)=\left\{\begin{array}{cc}0,&\mbox{ if }
    0< x < 2\\1, & \mbox{ if } 2<x<4\end{array}\right.
    [/tex]
    Show that the Cosine Fourier Series of f(x) for the range [0,4] is given by:

    [tex] A + B\sum^{\infty}_{n=0}\frac{(-1)^n}{(2m+1)}cos(\frac{(2m +1) \pi x}{2})[/tex]

    2. Relevant equations

    [tex]a_n = \frac{2}{L}\int^{x_0 + L}_{x_0} f(x)cos(\frac{2\pi nx}{L})dx[/tex]

    3. The attempt at a solution

    L = 4
    [tex]a_n = \frac{1}{2}\int^{4}_{0} f(x)cos(\frac{\pi nx}{2})dx =\frac{1}{2}\int^{2}_{0} 0cos(\frac{\pi nx}{2})dx+\frac{1}{2}\int^{4}_{2} cos(\frac{\pi nx}{2})dx = \frac{1}{2}\int^{4}_{2} cos(\frac{\pi nx}{2})dx[/tex]

    [tex] = \frac{1}{2}[\frac{2 sin(2n\pi)}{\pi n} - \frac{2 sin(n\pi)}{\pi n} = \frac{1}{2}[0 - 0] = 0[/tex]

    I do get a non-zero a0 term but it seems weird to me that B would be zero, is my L wrong?
     
    Last edited: Jan 2, 2015
  2. jcsd
  3. Jan 2, 2015 #2
    When dealing with Fourier cosine and sine series, you are actually extending a non-periodic function onto a periodic even or odd domain. Hence the effective period is actually twice as large instead, that is to say, you are actually working with the interval -4 < x < 4 here as the basic unit.
     
  4. Jan 2, 2015 #3
    I see, is this symmetrisation of the interval around x = 0 always necessary or does it depend on f(x)?
     
  5. Jan 2, 2015 #4
    Well, if you want to express a non-periodic function in terms of a Fourier series, then you will have to choose how to extend it to a periodic function - there are arbitrarily many different ways of doing so, but for convenience, usually we will choose the odd or even extensions, which lead respectively to the Fourier sine and cosine series.
     
  6. Jan 2, 2015 #5
    My function is only defined for 0 < x < 4. To make it periodic does my function become:

    [tex]
    f(x)=\left\{\begin{array}{cc}
    0,&\mbox{ if }
    -4< x < -2\\
    1,&\mbox{ if }
    -2< x < 0\\
    0,&\mbox{ if }
    0< x < 2\\1, & \mbox{ if } 2<x<4\end{array}\right.
    [/tex]
     
  7. Jan 3, 2015 #6

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    No. Because you're asked to find the cosine series, you have to extend f(x) such that it's even about x=0.
     
  8. Jan 5, 2015 #7
    Thanks! Is the choice completely arbitrary for the complex exponential Fourier Series since it has both sine and cosine components?
     
  9. Jan 5, 2015 #8

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Your problem is in that formula for ##a_n##. In your problem with ##L=4## it should read
    $$a_n = \frac 2 4 \int_0^4 f(x) \cos(\frac{n\pi x}{4})~dx$$
     
    Last edited: Jan 5, 2015
  10. Jan 5, 2015 #9
    I'm sorry but I don't really see that?
     
  11. Jan 5, 2015 #10

    LCKurtz

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Look here, for example:
    http://www.intmath.com/fourier-series/4-fourier-half-range-functions.php [Broken]
     
    Last edited by a moderator: May 7, 2017
  12. Jan 5, 2015 #11

    vela

    User Avatar
    Staff Emeritus
    Science Advisor
    Homework Helper
    Education Advisor

    That's right. There's no symmetry requirement for the complex exponential series.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?
Draft saved Draft deleted



Similar Discussions: Fourier Series of a step function
Loading...