# Homework Help: Fourier Series: How do i simpligy this integral?

1. Oct 9, 2009

### exidez

Fourier Series: How do i simplify this integral?

1. The problem statement, all variables and given/known data
http://img18.imageshack.us/img18/4586/matlabfouriercomplex.jpg [Broken]

2. Relevant equations
$$g(t)=\sum_{n=-\infty}^{\infty}c_{n}e^{jn \omega t}$$

$$c_{n}=\frac{1}{T}\int_{t_{0}}^{t_{0}+T}g(t)e^{-jn \omega T}$$

3. The attempt at a solution

I need to find the complex fourier series of the above function extended as an odd function
I Just want to know how to simplify the final solution i have. So far i have

$$c_{n}=\frac{1}{T}\int_{t_{0}}^{t_{0}+T}g(t)e^{-jn \omega T}$$
$$c_{n}=\frac{1}{T}(\int_{-T/10}^{0}-Ae^{-jn \omega T}dt + \int_{0}^{T/10}Ae^{-jn \omega T}dt)$$
$$c_{n}=\frac{A}{T}( \frac{1}{jn \omega } - \frac{e^{(jn \omega T/10)}}{jn \omega } - \frac{e^{(-jn \omega T/10})}{jn \omega } + \frac{1}{jn \omega})$$
$$\omega = \frac{2 \pi }{T}$$
$$c_{n}=\frac{A}{jn2 \pi }(2 - e^{(jn2 \pi /10)} - e^{(-jn2 \pi /10)})$$

Now if i put this in matlab i will put

for n = -N:???????:N, % loop over series index n
cn = A/(j*n*2*pi)*(2-exp(j*n*(pi/5))-exp(-j*n*(pi/5))); % Fourier Series Coefficient
yce = yce + cn*exp(j*n*wo*t); % Fourier Series computation
end

I dont know what to incriment N by.. All the other fourier examples i have done have been in the form:
$$c_{n}=\frac{1}{jn \pi }(1 - e^{(jn \pi )})$$

Here i understand $$(1 - e^{(jn \pi )})$$ will be 0 when n is even 2 when n is odd
Hence the series becomes:

$$\sum_{n=odd}^{\infty}\frac{2}{ \pi jn}e^{jn \omega t}$$

and the loop will go:
for n = -N:2:N, % loop over series index n (odd)
cn = 1/(j*n*pi)*(1-exp(j*n*pi)); % Fourier Series Coefficient
yce = yce + cn*exp(j*n*wo*t); % Fourier Series computation
end

But what is it for my example??? It is not so straight forward. Can it be simplified like above? How do i progress from here?

Last edited by a moderator: May 4, 2017