1. Limited time only! Sign up for a free 30min personal 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 waveform

  1. Aug 16, 2014 #1
    1. The problem statement, all variables and given/known data

    Sketch the waveform and develop its Fourier series.

    [itex]
    f(\omega t)=
    \begin{cases}
    0 & if & 0 \leq \omega t \leq \frac{π}{2} \\
    V*sin(\omega t) & if & \frac{π}{2} \leq \omega t \leq π\\
    0 & if & π \leq \omega t \leq \frac{3π}{2} \\
    V*sin(\omega t) & if & \frac{3π}{2} \leq \omega t \leq 2π
    \end{cases}
    [/itex]

    2. Relevant equations



    3. The attempt at a solution

    I drew two sketches, please see attachment, I'm wondering which one is correct.

    Calculating coefficients with V=1 just to see what the F.S. should look like, I've got:
    [itex] a_0=0 [/itex]
    [itex] a_n=\frac{1}{π}\left(\frac{2*sin\frac{nπ}{2}(-n+sin\frac{nπ}{2})}{-1+n^2} \right) [/itex]

    [itex] b_n=0 [/itex]

    Now, if a0=0 that implies that the first sketch is correct. If bn=0 that means the function is even, well, none of my sketches is an even function, something is definitely wrong here. Also, I found even harmonics zero, so [itex] f(\omega t)=f(\omega t+π) [/itex] which is true for the second sketch.

    What did I do wrong? Thank you for looking into that.
     

    Attached Files:

    Last edited: Aug 16, 2014
  2. jcsd
  3. Aug 17, 2014 #2
    If you just sketched [itex]\sin(x)[/itex], where [itex]0 \le x \le 2\pi[/itex], and superimposed it on your graphs, then which one is a match?
     
  4. Aug 17, 2014 #3
    The first one. That means bn can't be zero since this is not an even function, also it has half-wave symmetry, so [itex] f(\omega t)=-f(\omega t+π) [/itex], my an calculation is wrong, so is bn.
     
  5. Aug 17, 2014 #4
    At least a0=0 for sure.
     
  6. Aug 17, 2014 #5
    Right. But the periodic extension of that graph is neither an even or odd function.
     
  7. Aug 17, 2014 #6
    Exactly. The fourier series must consist of both sine and cosine terms (i.e. an=something, bn=something), but with only odd harmonics.
     
  8. Aug 17, 2014 #7
    Let me just go back to this:
    [STRIKE]It's true that an even function only has cosine terms in its Fourier expansion, but the converse statement isn't necessarily true, i.e. the Fourier expansion of a function can consist only of cosine terms without the function being even.[/STRIKE]

    You just had an error in your Fourier coefficients. See below.
     
    Last edited: Aug 17, 2014
  9. Aug 17, 2014 #8

    olivermsun

    User Avatar
    Science Advisor

    Are you talking about functions which are even "almost everywhere"? I can't recall any "physical" functions which are odd but have only nonzero cosine terms, but I'd love to be reminded of an example.
     
  10. Aug 17, 2014 #9
    [STRIKE]Your Fourier coefficients look correct btw. So good job :thumbs:[/STRIKE]
     
    Last edited: Aug 17, 2014
  11. Aug 17, 2014 #10
    An odd function has only sine terms in its Fourier expansion, we can definitely agree on that :smile:

    What I'm saying is that, if a function is odd, then that implies it only has sine terms in its Fourier expansion. That kind of statement is of the type:
    [tex]
    p \Rightarrow q \qquad (1)
    [/tex]
    If (1) is always true, then that doesn't necessarily mean that:
    [tex]
    q \Rightarrow p
    [/tex]
    is always true.

    [STRIKE]The piecewise function included in the OP is an example of this.[/STRIKE]
     
    Last edited: Aug 17, 2014
  12. Aug 17, 2014 #11

    gneill

    User Avatar

    Staff: Mentor

    Hmm. My own tinkering with the problem would indicate that there is a non-zero ##b_0##, and the ##a_n## expression for n ≠ 0 looks suspicious to me. This is assuming that we're looking at the expressions in the first post.

    Hint: You may need to use limits and L'Hopital to evaluate the coefficients when n = 1.

    EDIT: That should be ##b_1## above, not ##b_0##; Of course there's no 0-term for the b's.
     
    Last edited: Aug 17, 2014
  13. Aug 17, 2014 #12
    Doh, you're absolutely right. ##b_1## is non-zero. I can't find a problem with the expression for ##a_n## though or that ##b_0 \neq 0##.

    Edit: I'm not entirely sure why you're considering ##b_0##.
     
    Last edited: Aug 17, 2014
  14. Aug 17, 2014 #13
    Well, I've certainly put my foot in my mouth this time. I was racking my brain trying to find an example of how you could have only cosine terms in the Fourier series and for it not to be an even function.

    Then I remembered that I'm an idiot and the sum of two even functions is even. Apologies to the OP and olivermsun.
     
    Last edited: Aug 17, 2014
  15. Aug 17, 2014 #14

    gneill

    User Avatar

    Staff: Mentor

    Besides not matching what I derived myself, if I set the ##a_n## terms as given above and generate and plot f(x) it doesn't resemble the specified function at all. If I use my own derived terms I get a satisfying match to the function.

    That was just me typing faster than I was thinking :redface:

    Of course there's no ##b_0##. It's ##b_1## that's nonzero. I apologize for any confusion I may have stirred up.
     
  16. Aug 17, 2014 #15
    Hmm, I get the same values for ##a_n## as shown here:
    http://www.wolframalpha.com/input/?i=Table%5Bint+1%2Fpi*Piecewise%5B%7B%7B0%2C0%3C%3Dx%3Cpi%2F2%7D%2C%7Bsin%28x%29%2Cpi%2F2%3C%3Dx%3Cpi%7D%2C%7B0%2Cpi%3C%3Dx%3C3*pi%2F2%7D%2C%7Bsin%28x%29%2C3*pi%2F2%3C%3Dx%3C2*pi%7D%7D%5D*cos%28n*x%29+from+x+%3D+0+to+2*pi%2C%7Bn%2C1%2C10%7D%5D

    Which matches with those from the OP:
    http://www.wolframalpha.com/input/?i=limit+1/pi*2*sin(n*pi/2)*(-n+sin(n*pi/2))/(-1+n^2)+as+n->1
    http://www.wolframalpha.com/input/?i=Table[1/pi*2*sin(n*pi/2)*(-n+sin(n*pi/2))/(-1+n^2),{n,2,10}]

    You get something different? I haven't tried plotting it.
     
  17. Aug 17, 2014 #16

    gneill

    User Avatar

    Staff: Mentor

    I retract my claim! While my expression for ##a_n## is different, they do yield the same values. No doubt we took a different trig-identity path somewhere along the line. I was fooled when the plotted results looked way off. However, when I plotted the OP's I failed to include the ##b_1## term! So yes, I goofed there.
     
  18. Aug 17, 2014 #17
    I tried plotting it and forgot to include the ##a_1## term. That was 30 min well spent staring at a graph. All's well that ends well!
     
  19. Aug 17, 2014 #18

    The Electrician

    User Avatar
    Gold Member

    Here's a plot:

    attachment.php?attachmentid=72229&stc=1&d=1408308723.png
     

    Attached Files:

  20. Aug 18, 2014 #19
    Thank you everyone for your comments.

    It turns out my calculation was correct, however I keep getting b1=zero.

    [itex] \frac{1}{π}\int_{\frac{π}{2}}^{π} sin(x)sin(nx)dx + \frac{1}{π}\int_{\frac{3π}{2}}^{2π} sin(x)sin(nx)dx = \frac{1}{π}\left( \frac{(-1+2cos(nπ)+2nsin(\frac{nπ}{2}))sin(nπ))}{-1+n^2}\right) [/itex]
     
  21. Aug 18, 2014 #20
    Last edited by a moderator: May 6, 2017
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 waveform
Loading...