Path: news.mathworks.com!not-for-mail
From: "Chen Sagiv" <chensagivron@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: time and frequency domain
Date: Wed, 14 May 2008 06:27:02 +0000 (UTC)
Organization: Image Processing &#38; Math More
Lines: 61
Message-ID: <g0e0nm$6h4$1@fred.mathworks.com>
References: <g03rl9$2pf$1@fred.mathworks.com> <g03tua$bpi$1@fred.mathworks.com>  <08b54431-1628-4ae0-9506-1ed9fe6469c3@f36g2000hsa.googlegroups.com>
Reply-To: "Chen Sagiv" <chensagivron@gmail.com>
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 1210746422 6692 172.30.248.35 (14 May 2008 06:27:02 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 14 May 2008 06:27:02 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 805005
Xref: news.mathworks.com comp.soft-sys.matlab:468284


Greg Heath <heath@alumni.brown.edu> wrote in message 
<08b54431-1628-4ae0-9506-
1ed9fe6469c3@f36g2000hsa.googlegroups.com>...
> 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
> 

Hi Greg,

Thanks for the example. 

Chen