# Homework Help: Fourier Series Representation of a Square Wave using only cosine terms.

1. Jun 19, 2009

### Dint

Hello, I am attempting a past exam paper in preparation for an upcoming exam. The past exam papers do not come with answers and I'm a little unsure as to whether I'm doing all of the questions correctly and would like some feedback if I'm going wrong somewhere.

Any help is greatly appreciated :)

Here are the questions:

1. The problem statement, all variables and given/known data

Draw a square wave of amplitude 1 and period 1 second whose trigonometric Fourier Series Representation consists of only cosine terms and has no DC component.

Now, I assume they want the FSR to be made up of only cosine terms, there is another question on another past exam that asks for the same thing but in sine terms. A normal square wave that is:

1 for 0<x<.5
0 for -.5<x<0

Consists of only sine terms when you do the FSR (when I did it). It also makes sense because it looks like a sine wave in that it rises at the origin.

2. The attempt at a solution

However, to make it consist of only cosine terms, I'm not quite sure how to draw this, this is what I came up with.

http://img34.imageshack.us/img34/2/squarewave.jpg [Broken]

I did this because I figured it resembles what a cosine wave looks like, in that it peaks at the origin. (I know it's a square wave so it doesn't really peak, but I'm picturing a cosine wave representing the signal in the box)

PART B - 1. The problem statement, all variables and given/known data

The next part of the problem asks:

For the signal in part A, compute the trigonometrical FSR.

then

Compute the exponential FSR directly from the trigonometric FSR.

2. Relevant equations

$$a_{0} = \frac{1}{T} \int\limits_{f_{0}}^{f_{0}+T} f(t) dt$$

$$a_{n} = \frac{2}{T} \int\limits_{f_{0}}^{f_{0}+T} f(t) cos\left(\frac{2{\pi}nt}{T}\right) dt$$

$$b_{n} = \frac{2}{T} \int\limits_{f_{0}}^{f_{0}+T} f(t) sin\left(\frac{2{\pi}nt}{T}\right) dt$$

I've also been told that for the exponential FSR:

$$c_{0} = a_{0}$$

$$c_{n} = {\frac{1}{2}}\left(a_{n} - jb_{n}\right)$$

$$c_{-n} = {\frac{1}{2}}\left(a_{n} + jb_{n}\right)$$

3. The attempt at a solution

$$a_{0} = \frac{1}{2}$$

By inspection I can see that the average value of one period of the square wave is going to be 0.5.

$$a_{n} = \frac{2}{1} \int\limits_{-{\frac{1}{4}}}^{{\frac{1}{4}}} cos\left(\frac{2{\pi}nt}{1}\right) dt$$

Now when I do this integral, I get:

$$\frac{1}{{\pi}n} \left[ sin\left(\frac{{\pi}n}{2}\right) - sin\left(-\frac{{\pi}n}{2}\right)\right]$$

I'm kinda stuck here. This answer does not give zero, I need the FSR to contain no sine terms, and this answer for my an term does give sine terms...

Any ideas?

Thanks a lot for taking the time to read this.

Last edited by a moderator: May 4, 2017
2. Jun 19, 2009

### Dint

This is also my first time using latex, so if I stuffed anything up I'm sorry.

3. Jun 19, 2009

### Cyosis

A sine wave is 0 at the origin, sin(0)=0.

Hint: If you want the cosine series to be zero you should find yourself an f(t) which is odd.

Last edited: Jun 19, 2009
4. Jun 19, 2009

### Dint

In the drawing that I did, was I wrong to say the amplitude of that is 1? Is the amplitude actually .5? If it's a square wave as I drew it, does that not mean that It's pk-pk amplitude is 1?

I'm getting really confused with the amplitude now. I've always understood amplitudes using sin and cosine waves but i've never worked out amplitudes with a vertical shift.

5. Jun 20, 2009

### Cyosis

In your drawing their are no negative peaks, so there is no ambiguity. The peak to peak amplitude is the same as half peak to peak amplitude in this case. You're correct that the amplitude is 1.

6. Jun 21, 2009

### acurabot

hi ENB242 guy, to begin with, what you are doing is wrong. I have done it and comparing what i have done to yours, im wondering why you dont have the -ve part of the signal?? Also your initial assumption is wrong as well.

7. Jun 21, 2009

### macca75

can you clarify what you mean? do you mean there should be a negative component as well in the cos wave. that makes sense. i dont get why there is no negative part there. would the amplitudes be 1 and -1 respectively?

8. Jun 21, 2009

### acurabot

Well to put it blunty, yes there should be a -ve and +ve part in the one period. This would mean having amplitudes of -1 and 1 respectively.

9. Jun 21, 2009

### ENB242Dude

Hey,

EVEN --> all cosine terms, bn = 0
ODD --> all sine terms, a0 = 0 and an = 0

So I am assuming one would have to draw an even square wave for all cos terms and an odd square wave for all sine terms.

10. Jun 21, 2009

### Dint

I've figured out this problem. What I was actually getting confused with was that when it asked for no cosine/sin terms, it was actually referring to an/bn respectively.

My confusion came when I integrated sin and got a cos term, thinking this meant that there were cosine terms. When really this was just the sin term (bn).

Anyway, it's all cleared up and it makes sense to me now.

11. Jun 21, 2009

### macca75

thanks that explains alot. just a question with the drawing. if it had a negative component going down to -1 at t = .5 second would it still be an even function? would it still reflect across the x axis or wouldn it reflect across both.. therefore making it an odd function.. i think im confusing myself unnecessarily..

12. Jun 21, 2009

### Dint

An even function is when f(x) = f(-x)

In other words, it is symmetrical about the Y-axis (if you flip it over the Y axis, it is identical.

An odd function is when -f(x) = f(-x)

In other words when the function is symmetrical about the X-axis, once flipped about the Y-axis.

Hope this helped.

Last edited: Jun 21, 2009
13. Jun 21, 2009

### Dint

Yeah I'm not really sure of your question, I just re-read it and I don't know if I really answered it.

Draw your function on a page, if you fold it so the positive axis flips onto the negative axis and they perfectly line up, the function is even :P

That's probably the easiest way I can explain it. Otherwise, just check if f(x) = f(-x)

14. Jun 21, 2009

### macca75

ha ahh im so going to do that.. thanks alot. yeah i was just trying to visualise the question above with a negative component.. but the folding thing just confirmed what i already had. thanks alot mate.. good luck for 242

15. Jun 22, 2009

### ENB242Dude

16. Jun 22, 2009

### macca75

yeah any type.. good luck

17. Jun 22, 2009

### macca75

guys what about the fourier transform of s(t) * thatoddsymbol (t)

where s((t) = pike 1 (t)

sorry for horrible use of english there

i get that it will be a square wave of width 1 from 0 to 1 convolving with a ?? i dont get that part. any ideas?

18. Jun 22, 2009

### Dint

that's delta...

When you find the fourier transform of the convolution of two functions... eg.

$$s(t) * \delta(t)$$

The answer is the multiplication of each functions fourier transform.

The fourier transform of a delta function (that funny symbol), is 1. So it's actually just the fourier transform of s(t).

Correct me if I'm wrong, but I'm pretty positive.

Last edited: Jun 22, 2009
19. Jun 22, 2009