Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!f36g2000hsa.googlegroups.com!not-for-mail
From: Greg Heath <heath@alumni.brown.edu>
Newsgroups: comp.soft-sys.matlab
Subject: Re: time and frequency domain
Date: Mon, 12 May 2008 17:09:18 -0700 (PDT)
Organization: http://groups.google.com
Lines: 47
Message-ID: <08b54431-1628-4ae0-9506-1ed9fe6469c3@f36g2000hsa.googlegroups.com>
References: <g03rl9$2pf$1@fred.mathworks.com> <g03tua$bpi$1@fred.mathworks.com> 
NNTP-Posting-Host: 69.141.173.117
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
X-Trace: posting.google.com 1210637358 8196 127.0.0.1 (13 May 2008 00:09:18 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Tue, 13 May 2008 00:09:18 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: f36g2000hsa.googlegroups.com; posting-host=69.141.173.117; 
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; 
Xref: news.mathworks.com comp.soft-sys.matlab:468039


On May 12, 4:13 am, "Chen Sagiv" <chensagiv...@gmail.com> wrote:
> -----SNIP
> If you take the code suggested in the beginning of this all
> discussion and display the imaginary rather the abs value
> you will get a phase, which you should be aware of if you
> account for the real and imaginary values of the FT
> separately. This is my point !

There are two impotant points:

1. The difference between  the fft of x1(t) and
   x2(t) = x(t-t0) is a complex multiplier linear
   phase shift exp(-2*pi*f*t0). Therefore, if
   X1 = fft(x1) is real, X2 = fft(x2) will be
   complex.
2. The fft of a zero padded version of x will also
   be complex.

close all, clear all, clc, k=0

x0 = ones(1,16);
x1 = [ones(1,16) zeros(1,16)];
x2 = [zeros(1,8) ones(1,16) zeros(1,8)];
x3 = [zeros(1,16) ones(1,16)];

k=k+1,figure(k)

subplot(2,2,1); plot(x0); axis([-5 35 -0.1 1.1])
subplot(2,2,2); plot(x1); axis([-5 35 -0.1 1.1])
subplot(2,2,3); plot(x2); axis([-5 35 -0.1 1.1])
subplot(2,2,4); plot(x3); axis([-5 35 -0.1 1.1])

X0 = fftshift(fft(x0));
X1 = fftshift(fft(x1));
X2 = fftshift(fft(x2));
X3 = fftshift(fft(x3));

k=k+1,figure(k)
subplot(2,2,1); plot(imag(X0)); axis([-5 35  -11 11])
subplot(2,2,2); plot(imag(X1)); axis([-5 35  -11 11])
subplot(2,2,3); plot(imag(X2)); axis([-5 35  -11 11])
subplot(2,2,4); plot(imag(X3)); axis([-5 35  -11 11])

Hope this helps,

Greg