[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problem with fourier transform
From: |
Antonio L. |
Subject: |
Problem with fourier transform |
Date: |
Wed, 5 May 2004 03:33:33 -0500 |
User-agent: |
Internet Messaging Program (IMP) 3.2.1 |
Hello, I have a problem dealing with fourier transform in octave.
How is it possible to recover the value of a discrete periodic function, given
its fourier armonics coeficients?
I tried something like this:
-------- code ------------
y = [1,2,3,4,5]'; # original function
z = fftshift(fft(y)); # armonics
# given an integer value of x like -2,-1,0,1,2,3,4,5,6,....
x = <integer value>;
# we would get y(x) with this expression
y_x = sum(z.*exp((-2:2)'*i*pi*x/rows(z)))
------ end code ----------
But it doesn't give us even close original values of y suposed value i for x
will give us i-th value from vector y.
What am I doing wrong? Is it suposed to wortk other way octave fourier series?.
And what about the two dimentional case, in wich y is a general matrix and z =
fft2(y)? whould there be a similar way of finding original function values?
hundred thanks in advance, Antonio.
-------------------------------------------------
This mail sent through IMP: http://horde.org/imp/
-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.
Octave's home on the web: http://www.octave.org
How to fund new projects: http://www.octave.org/funding.html
Subscription information: http://www.octave.org/archive.html
-------------------------------------------------------------
- Problem with fourier transform,
Antonio L. <=