# Thread: Fourier transform - odd funktion

1. ## Fourier transform - odd funktion

I'm transforming f(x) = 1-x trying to do so in an even and odd fashion... I think I get it right for the even, but I get stuck while tinkering with the odd one.

The period is 2, odd distribution.

$\dispalystyle b_n = \frac{2}{T} \int_0^2 (1-t) \sin (n \Omega t) dt$ ; $\Omega = \frac{2 \pi}{T} = \pi$ & $T = 2$

$\dispalystyle b_n = \int_0^2 (1-t) \sin (n \pi t) dt$ = [integrate by parts] = $[1-1] - \int_0^2 \cos (n \pi t) dt$

Here I get stuck because $sin(2\pi n ) = sin (0) = 0$.

If anyone could point out what I'm overseeing..?

2. ## Re: Fourier transform - odd funktion

Originally Posted by liquidFuzz
I'm transforming f(x) = 1-x trying to do so in an even and odd fashion... I think I get it right for the even, but I get stuck while tinkering with the odd one.

The period is 2, odd distribution.

$\dispalystyle b_n = \frac{2}{T} \int_0^2 (1-t) \sin (n \Omega t) dt$ ; $\Omega = \frac{2 \pi}{T} = \pi$ & $T = 2$

$\dispalystyle b_n = \int_0^2 (1-t) \sin (n \pi t) dt$ = [integrate by parts] = $[1-1] - \int_0^2 \cos (n \pi t) dt$

Here I get stuck because $sin(2\pi n ) = sin (0) = 0$.

If anyone could point out what I'm overseeing..?
Do you integration by parts again more carefully.

CB

3. ## Re: Fourier transform - odd funktion

No, I can't nail it...

What if I change the interval over wish integrate to [-1,0] + [0,1]. Maybe that would make it easier, but will my series convert to the odd distribution of 1-t?

Edit: Oh crap, I just realised something. I think my series could be right. My conclusion on the contrary... I was so preoccupied with the fact that $sin (n \pi) = 0$ that I sorta forgot the variable t.

Does this compute..?
$\sum_{n=1}^{\infinity} \frac{2 \sin (n \pi t)}{n\pi}$

4. ## Re: Fourier transform - odd funktion

Originally Posted by liquidFuzz
No, I can't nail it...

What if I change the interval over wish integrate to [-1,0] + [0,1]. Maybe that would make it easier, but will my series convert to the odd distribution of 1-t?

Edit: Oh crap, I just realised something. I think my series could be right. My conclusion on the contrary... I was so preoccupied with the fact that $sin (n \pi) = 0$ that I sorta forgot the variable t.

Does this compute..?
$\sum_{n=1}^{\infinity} \frac{2 \sin (n \pi t)}{n\pi}$
If I recall correctly yes

CB

5. ## Re: Fourier transform - odd funktion

Originally Posted by CaptainBlack
If I recall correctly yes

CB
I plotted the series in MatLab and got a result that points in an other direction. :-(
Here's the plot I got and the MatLab code I wrote.
MatLab
Code:
N = 20;
x = (-50:50)/20;   %interval : [-2.5,2.5]
f = ones(1,101);
%Odd fourier, no a_0 and a_i included.
for i = 1:1:N       %from 1 to N
f = f + (2 * sin(pi*i*x))  /  (i * pi);  %sum all terms over N iterations.
end
plot(x,f)
The function I was aiming for is 1-t and it should hold the points [0,1] and [2,-1] and then jump to next 'slope'. Eh, right?

I guess my question is, is it the series or is the MatLab tinkering that's wrong..?

6. ## Re: Fourier transform - odd funktion

Originally Posted by liquidFuzz
I plotted the series in MatLab and got a result that points in an other direction. :-(
Here's the plot I got and the MatLab code I wrote.
MatLab
Code:
N = 20;
x = (-50:50)/20;   %interval : [-2.5,2.5]
f = ones(1,101);
%Odd fourier, no a_0 and a_i included.
for i = 1:1:N       %from 1 to N
f = f + (2 * sin(pi*i*x))  /  (i * pi);  %sum all terms over N iterations.
end
plot(x,f)
The function I was aiming for is 1-t and it should hold the points [0,1] and [2,-1] and then jump to next 'slope'. Eh, right?

I guess my question is, is it the series or is the MatLab tinkering that's wrong..?
Why did you initialise f to one?

Try:

f = zeros(1,101)

CB

7. ## Re: Fourier transform - odd funktion

Eh, good question..?

Thanks for your help and patience dude!