Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: fft for beginners
Date: Mon, 6 Jul 2009 08:53:01 +0000 (UTC)
Organization: Sevilla
Lines: 60
Message-ID: <h2se1d$ce5$1@fred.mathworks.com>
References: <h2mtni$phl$1@fred.mathworks.com> <b03e0cd2-9bba-477e-b2d0-37431867c269@j32g2000yqh.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1246870381 12741 172.30.248.38 (6 Jul 2009 08:53:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Mon, 6 Jul 2009 08:53:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1896218
Xref: news.mathworks.com comp.soft-sys.matlab:552993


Thank you very much to Greg and and Luca; much more clear now.

Yes, I 'lied', it was not 0.11ms. Actually it was 0.11111111111mh=4s.


Greg <heath@alumni.brown.edu> wrote in message <b03e0cd2-9bba-477e-b2d0-37431867c269@j32g2000yqh.googlegroups.com>...
> On Jul 4, 2:44?am, "JMMO MartinOlalla" <n...@us.es> wrote:
> > Hi all,
> >
> > I am just starting doingfftwith 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 thefftsince I need to study correlations and convutions in sets of different experimental data (so ifft will be also needed)
> 
> N     =   2^19           %  524288
> tmax =  50*60*60     % 180000
> dt     =  tmax/(N-1)    %  0.3433
> 
> t      =   dt*(0:N-1);
> T     =   N*dt
> t      =   0:dt:T-dt;
> 
> Fs   =  1/dt
> df    =  1/T
> Fs   =  N*df
> f      =  df*(0:N-1);
> f      =  0:df:Fs-df;
> 
> > 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.
> 
> You lied. If
> 
> dt = 1.1e-4
> 
> % then
> 
> tmaxsec = (N-1)*dt        % 57.6716 seconds
> 
> tmaxhr = tmaxsec/3600  % 0.0160 hours (NOT ~ 50)
> 
> did you mean tmax ~ 50 sec ???
> 
> Anyway, go back and recalculate all of the above quantities
> 
> > 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?
> 
> See above formula for f
> 
> > Also, I would like to know what would I be doing if I fftshift the vector W.
> 
> Then the N index periodicity is used to shift all frequences
> at the Nyquist frequency Fs/2 = N*df/2 and above to negative
> frequencies
> 
> fb = df*(-N/2:N/2-1);
> 
> Hope this helps.
> 
> Greg