Path: news.mathworks.com!not-for-mail
From: "Andy Robb" <ajrobb@hotmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: How to zoom into a certain part of FFT?
Date: Sun, 4 May 2008 07:09:06 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 103
Message-ID: <fvjnei$778$1@fred.mathworks.com>
References: <f5sk5g$qmm$1@news.Stanford.EDU>
Reply-To: "Andy Robb" <ajrobb@hotmail.com>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1209884946 7400 172.30.248.37 (4 May 2008 07:09:06 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sun, 4 May 2008 07:09:06 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1374918
Xref: news.mathworks.com comp.soft-sys.matlab:466481


"Vista" <abc@gmai.com> wrote in message
<f5sk5g$qmm$1@news.Stanford.EDU>...
> Hi all,
> 
> Suppose I have a signal f(t), t is in [0, +infinity).

It is a shame that you only have half the signal - missing
-infinity <= t < 0. But seriously, you don't mention
sampling. You have to be aware of the works in the '70s at
Bell Labs of Nyquist and Shannon.
http://en.wikipedia.org/wiki/Nyquist-Shannon_sampling_theorem

> 
> And I have its spectrum F(w).

Given that your time series is infinite, you spectrum will
have infinite resolution.

> 
> Let's say I found out that its main spectrum has 99.9% in
[-B, B].
> 

This is low-pass filtering.

> So I truncate/extract out the portion of F(w), for w in
[-B, B], and 
> discretized the interval into small grids with step size
deltaB.

Truncation of frequency spectra (or time series) is always a
BAD idea. You need to shape them with a window that reduces
the out of band components to zero but avoiding a steep
cut-off. Common windows are Hanning, Hamming and I like
Kaiser-Bessel.

> 
> And I then do the inverse FFT on the above samples of
F(w), let's call the 
> inverse FFT reconstruction f_hat.
> 
> Which part of f(t) does this inverse FFT f_hat represent?

It represents all of f(t) - in your example (-B to B), just
low-pass filtered and and at a lower sampling frequency.

> 
> If I want to zoom into a certain part of f(t), how can I
use inverse FFT to 
> do that?

You don't.

> Let's say I only need [a, b] where 0<a<b< infinity, in the
time domain,
> 
> I only need to visualize the f(t), for t in [a, b],
> 
> how do I sample F(w) and do the inverse FFT?

You don't.
 
> -------------------------
> 
> More generally, I am actually thinking of desing a
"spectrum analyzer" with 
> zoom-in feactures:
> 
> as you can see, first do a coarse level inverse FFT to
gain a big picture of 
> the f(t) curve, and then allow user to zoom into a
particular part of the 
> f(t) curve and display it with higher resolution of IFFT.
> 
> How to do all of these?

Be aware that a single spectral line maps to all of time
(-infinity < t < infinity) and that a single point in time
maps to all frequencies (-infinity < f < infinity).

FFT analysis is based on a fixed number of regular time
points mapping to the same number of frequencies. This only
works when an event in time can be captured completely or
repeats itself and you capture exactly one repeat.

Outside of those conditions, windows (Hanning etc) are used
to limit the time series and to get a useful approximation
of the spectrum albeit with some 'smudging' and changes in
amplitude and/or energy.

In order to complete your FFT analyser, you should include a
flat-top window to allow an accurate estimate of the height
of a single frequency.

> 
> Thanks a lot! 
> 
> 
I suspect this reply might be too late to help with your
assignment, but I hope that it helps you understand why your
grade was so bad.