Path: news.mathworks.com!not-for-mail
From: "Luca Zanotti Fragonara" <Luca_Zanotti@libero.it>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fft for beginners
Date: Sat, 4 Jul 2009 15:33:01 +0000 (UTC)
Organization: Politecnico Torino
Lines: 37
Message-ID: <h2nsnd$c8c$1@fred.mathworks.com>
References: <h2mtni$phl$1@fred.mathworks.com>
Reply-To: "Luca Zanotti Fragonara" <Luca_Zanotti@libero.it>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246721581 12556 172.30.248.35 (4 Jul 2009 15:33:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 4 Jul 2009 15:33:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1429161
Xref: news.mathworks.com comp.soft-sys.matlab:552785


Low indexes means low frequencies? 

Yes, but remember that the second half of W contains negative frequencies (which usually are useless, but depends from your field of applications).

Frequency are equally spaced?

Yes.

On what basis?

It depends from your sampling time. If you didn't choose the nfft option, the fft command uses the default option, which calculates a fft which has length equal the length of X (your array).
So in order to build your frequency axis, you will have to use:
f = Fs/2*linspace(0,1,NFFT/2+1);

Where Fs is your sampling frequency and NFFT is the length of your fft.

Greetings,

Luca


"JMMO MartinOlalla" <none@us.es> wrote in message <h2mtni$phl$1@fred.mathworks.com>...
> Hi all,
> 
> I am just starting doing fft with MatLab. No previous experience.
> 
> I am working with 2^19 experimental data points extending over some 50hours arranged as a vector X whose length is 2^19. I am getting on the fft since I need to study correlations and convutions in sets of different experimental data (so ifft will be also needed)
> 
> Since the rate of time in the experimental data is known I can control easily what the index of X means: say, from X(1,i) to X(1,i+1) there are 0.11ms while, of course, the first datapoint is t=0.
> 
> Now, I got: W=fft(X), which is again a vector whose length is 2^19.
> 
> My question is how is the index of this vector W running in the frequency domain? Say, low index means low frequency? frequencies are equally spaced? on what basis?
> 
> Also, I would like to know what would I be doing if I fftshift the vector W.
> 
> Thanks in advance.