[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Thu, 29 Oct 1998 10:57:08 -0300
>>>>> On Thu, 29 Oct 1998 14:25:00 +0100,
>>>>> Diego Alberto Arias Prado <address@hidden> said:
> There is something in the fft() function that I don't understand. I
> compute the fft of a vector containing the samples of a sinc(), an exp() and
> a rectangular pulse and what I get is a vector of the same size. What I
> don't understand is this: in the positions 1, 2, 4.. and N-3, N-2, N-1 and N
> of the vector (its size is 1 N) I get "big" values and in the central
> positions the values (I mean, far from 1 and N) I get values near to cero.
> Thus, from transforming a sinc() I get something that hasn't
> anything to see with a rectangular pulse (for example). HELP!
> Thanks in advance.
Som care has to be taken wth the sample points in order to get the
expexted results with the fft(). The assumption is that the function
is periodic so that point N, which is at (N-1)*L/N should get the
value of the function at -L/N.
The simplest way that I found to get thigs work is to take the
coordinates of points as follows:
Dx = L/N
x_j = (j-1)*Dx for j=1,....,N/2
x_j = (j-1)*Dx-L for j=N/2+1,...,N
Note that if the function is periodic the shift in length L does not
matter. The way to code this in Octave is:
Attached below is a demo.
Hope this helps.
Mario Alberto Storti | Fax: (54)(42) 55.09.44 |
Centro Internacional de Metodos Computacionales| Tel: (54)(42) 55.91.75 |
en Ingenieria - CIMEC (INTEC/CONICET-UNL) |........................|
INTEC, Guemes 3450 - 3000 Santa Fe, Argentina |
Reply: address@hidden, http://venus.unl.edu.ar/gtm-eng.html |
title(["Fourier transform of " Title])
- fft, Diego Alberto Arias Prado, 1998/10/29