> Hi all,
>
> I want to ask about taking FFT of a signal discrete-time whose indices are
> limited in [-6, +6] and with 13 data points.
>
> x[n]=
> 1, for n=-2 .. +2;
> 0, for other n in [-6, +6]
>
> However, in Matlab all indices start from 1, so I have to input this
> sequence as
>
> x=[0 0 0 0 1 1 1 1 1 0 0 0 0];
>
> y=fftshift(fft(x));
You are mistaken in your mapping. Matlab's x(1) corresponds to the time
sequence's x_0, x(2) <-> x_1, etc. For negative indecies you have to
take it mod(N), so x(13) corresponds to x_{-1}. Your vector should be
x = [1 1 1 0 0 0 0 0 0 0 0 1 1];
>
> since the indeces have been shifted, so the y has no zero imaginary part(the
> original input sequence is real and even so y should have zero imaginary
> parts)
>
> Now how to show the DFT of the original double-sided signal from -6 to 6?
> How to make y's imaginary parts zero?
>
> -----------------------------------------
>
> I have done the following experiments by using the shifting theorem: but I
> just could not make y's imaginary part zero... what's the probem?
>
You are shifting by the wrong amount. You shifted the original sample
by 1/2 the overall cycle time, try this:
fft(x) .* exp(0.5 * -1j*2*pi*[0:12]/13)
If you don't have it already this question could be answered in much
more depth by reading Oppenheim, Willsky & Young, "Signals and Systems"
or other similar books.
--
Tim Wescott
Wescott Design Services
http://www.wescottdesign.com
Reply by Clay Turner●November 27, 20042004-11-27
"kiki" <lunaliu3@yahoo.com> wrote in message
news:co9dg5$hs3$1@news.Stanford.EDU...
> Hi all,
>
> I want to ask about taking FFT of a signal discrete-time whose indices are
> limited in [-6, +6] and with 13 data points.
>
> x[n]=
> 1, for n=-2 .. +2;
> 0, for other n in [-6, +6]
>
> However, in Matlab all indices start from 1, so I have to input this
> sequence as
>
> x=[0 0 0 0 1 1 1 1 1 0 0 0 0];
>
> y=fftshift(fft(x));
>
> since the indeces have been shifted, so the y has no zero imaginary
part(the
> original input sequence is real and even so y should have zero imaginary
> parts)
>
> Now how to show the DFT of the original double-sided signal from -6 to 6?
> How to make y's imaginary parts zero?
>
> -----------------------------------------
>
Hello Kiki,
Look up the Heaviside shifting theorem for Fourier transforms and apply it
to your fft's output.
Clay
Reply by kiki●November 27, 20042004-11-27
Hi all,
I want to ask about taking FFT of a signal discrete-time whose indices are
limited in [-6, +6] and with 13 data points.
x[n]=
1, for n=-2 .. +2;
0, for other n in [-6, +6]
However, in Matlab all indices start from 1, so I have to input this
sequence as
x=[0 0 0 0 1 1 1 1 1 0 0 0 0];
y=fftshift(fft(x));
since the indeces have been shifted, so the y has no zero imaginary part(the
original input sequence is real and even so y should have zero imaginary
parts)
Now how to show the DFT of the original double-sided signal from -6 to 6?
How to make y's imaginary parts zero?
-----------------------------------------
I have done the following experiments by using the shifting theorem: but I
just could not make y's imaginary part zero... what's the probem?