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!

The period, angular frequency of a piecewise function

  1. Jan 14, 2017 #1
    1. The problem statement, all variables and given/known data
    The function ##f## is defined as follows:
    \begin{equation*}
    f(t) =
    \begin{cases}
    1, \text{ when } 2k < t < (2k+1),\\
    0, \text{ when } t = k,\\
    2, \text{ when } (2k-1) < t < 2k, & k \in \mathbb{Z}\\
    \end{cases}
    \end{equation*}

    What is the period ##T## of the function ##f##? How about angular frequency? Calculate the following definite integrals:
    [tex]
    a_n = \frac{2}{T}\int_{0}^{T} f(t) \cos (n \omega t) dt
    \text{ and }
    b_n = \frac{2}{T}\int_{0}^{T} f(t) \sin (n \omega t) dt,
    [/tex]
    where ##n = 0,1,2, \ldots##
    2. Relevant equations
    Angular freguency:
    \begin{equation}
    \omega = 2 \pi f = \frac{2 \pi}{T}
    \end{equation}

    3. The attempt at a solution
    I should preface this by saying, that something in me thinks this should be a simple problem, and that I'm just confused by the notation used.

    Anyways, I started by cataloging how the function should behave with different values of ##k \in \mathbb{Z}##:
    \begin{array}{ | l | c | c | c | c | c | c |}
    \hline
    k & 2k-1 & 2k & 2k+1 & f(t), (2k-1) < t < 2k & f(t), t = k & f(t), 2k < t < (2k+1)\\
    \hline
    0 & -1 & 0 & 1 & 2 & 0 & 1\\
    1 & 1 & 2 & 3 & 2 & 0 & 1\\
    2 & 3 & 4 & 5 & 2 & 0 & 1\\
    3 & 5 & 6 & 7 & 2 & 0 & 1\\
    4 & 7 & 8 & 9 & 2 & 0 & 1\\
    \hline
    \end{array}
    It looks like ##f## will repeat in intervals of ##2##, since whenever ##k## is increased by ##1##, the domain of ##f## is shifted by ##2## to the right, and within that new domain ##f## is defined identically. Now here's the first thing that confuses me: I know I can test for periodicity by plugging ##t+T## in place of ##t## in ##f(t)##. However, here it wouldn't create a nice expression that simplified into the original through trig symmetry or some other trick. How can I show in writing, that what I stated above is true, or is the above intuitive realization enough for a proof?

    Moving on, assuming the period was 2 implies that ##\omega = \frac{2 \pi}{2} = \pi##. Which leads us into the integration part of the problem, where another confusing thing occurs. Evaluating the integral seems simple enough: just split it into two parts between ##0## and ##T = 2## based on how ##f## is defined. However, in the assignment it is stated that ##n \in {0} \cup \mathbb{N}##. Does this mean I need to evaluate the integral infinitely many times, since the expression contains an ##n## that gains all of those values? Of course not, but I have no idea what this means in practise.

    Help a derp, please?
     
  2. jcsd
  3. Jan 14, 2017 #2

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    The first task is to draw the graph of ##f##. Can you describe in 1-2 simple sentences what ##f## looks like?

    PS I don't like the definition as it's too loose. Personally, I would define it differently.
     
  4. Jan 14, 2017 #3
    I did this in GeoGebra, and it looks like a step function that has a period of 2, except that the function is zero when ##t \in \mathbb{Z}## and varies between 2 and 1 between the integers.

    Maybe I should do a Matlab implementation of the picture because of GG limitations...
     
  5. Jan 14, 2017 #4

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Could I sketch the function based on your description? If I hadn't seen the formula? It's a good idea to be precise in mathematics.

    By the way, setting ##f(t) =0## on a finite (or countable) set of points will make no difference to any integrals.
     
  6. Jan 14, 2017 #5
    Alright, let's try again. Let ##k \in \mathbb{Z}##. Between -1 and 0, ##f(t) = 2## and between 0 and 1 ##f(t) = 1##. The function repeats this pattern ad infinitum with what seems to be a period of 2, shifting between the values 2 and 1 while being zero when ##t = k##.

    Is this any better?
     
  7. Jan 14, 2017 #6

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Okay, so you've got ##f(t)## figured out. What about ##\cos(n\omega t)##?
     
  8. Jan 14, 2017 #7
    Since we have now established, that our period seems to be 2, our angular frequency ##\omega = \pi \Rightarrow \cos (n \omega t) = \cos (n \pi t)##. Here ##n \pi## increases the frequency by multiples of ##\pi##, while dividing the period by the same factor. Cosine of ##t## has a period of ##2 \pi##, so ##\cos (n \pi t) = \cos (n \pi t + \frac{2\pi}{n\pi}) = \cos (n \pi t + \frac{2}{n})##.

    In other words, unless ##n = 0##, in which case ##cos(n\pi t) = 1##, ##\cos (n \pi t)## is just the usual cosine function with it's frequency increased, meaning it is squished in the ##t##-direction.
     
  9. Jan 14, 2017 #8

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    I'm not sure I see the point of this question. If ##T=2## you just have to integrate over ##(0,1)## and ##(1,2)## on which ##f(t)## is constant.
     
  10. Jan 14, 2017 #9
    I should have prefaced this by saying, that this is the first week of a course of Fourier methods, and the teacher gave us review excercises for homework, before we get into the proper subject matter. I wouldn't say this question is pointless since it is giving me a headache.

    Are you saying, that the ##n## is there just to throw me off? Surely the integral evaluates differently depending on the value of ##n## in that interval?
     
  11. Jan 14, 2017 #10

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes, you can go ahead and evaluate them. See what you get.
     
  12. Jan 14, 2017 #11
    Alright, it took me a moment, but the results I got are as follows:

    [tex]a_n = \frac{2 \sin (2 \pi n) - \sin (n \pi)}{n \pi}, n \neq 0[/tex]
    and
    [tex]b_n = \frac{1 + \cos(n \pi) - 2 \cos (2 n \pi)}{n \pi}, n \neq 0.[/tex]
    So even though it was originally stated, that ##n \in {0,1,2,...}##, ##n## can't be zero. Otherwise this was pretty straightforward.

    EDIT: A mistake in ##b_n##: Forgot to include the factor 2 in front of ##\cos (2 \pi n)##.
     
    Last edited: Jan 14, 2017
  13. Jan 14, 2017 #12

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    You can't stop there! You'll have to simplify those expressions.
     
  14. Jan 14, 2017 #13
    Using trig identities doesn't seem to allow us to get rid of that annoying ##n \pi## in the denominator, which is why I assume we should be trying to simplify these even further. I'm a bit lost here.
     
  15. Jan 14, 2017 #14

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Let me help you a little bit: ##\sin(n\pi) = 0##.
     
  16. Jan 14, 2017 #15
    Of course. o:)
    So ##a_n = 0##.

    As for ##b_n##, [tex]\cos(2 \pi n) = 1 \Rightarrow \frac{1 + \cos(n \pi) - 2\cos(2 \pi n)}{n \pi} = \frac{1+\cos(n \pi) - 2}{n \pi} = \frac{\cos(n \pi) - 1}{n \pi}[/tex]
     
  17. Jan 14, 2017 #16

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Just a bit more to do ...

    PS I take back what I said about this problem: it's a good work-out for the Fourier Analysis to come!
     
  18. Jan 14, 2017 #17
    As far as I can see, the only thing we can do at this point is to say, that if ##n## is even, ##b_n = 0## , and if ##n## is odd, ##b_n = \frac{-2}{n\pi}, n \neq 0##.
     
  19. Jan 14, 2017 #18

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Yes. This sort of thing with ##1 \pm \cos(n\pi)## crops up frequently, so it's worth remembering this.
     
  20. Jan 14, 2017 #19
    Alright, thank you very much.

    One last thing that is still bothring me is the fact that there were ##n##'s in the denominators of the expressions that reduced to zero as well. Do we not need to worry about those, or should I have included ##n \neq 0## with those as well?
     
  21. Jan 14, 2017 #20

    PeroK

    User Avatar
    Science Advisor
    Homework Helper
    Gold Member

    Technically, you still have ##n=0## to do. These are special cases, as ##\sin## and ##\cos## are constant. One thing to remember is that you cannot differentiate or integrate these and then plug in ##n=0## later. You must treat them as constant functions from the outset. It's the same with trig identities. You can easily go wrong if you don't exclude ##n=0## before you use an identity.
     
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: The period, angular frequency of a piecewise function
  1. Piecewise functions (Replies: 5)

  2. Piecewise functions (Replies: 9)

  3. Piecewise functions (Replies: 7)

  4. Piecewise Function (Replies: 1)

Loading...