From: Greg Heath on
The MATLAB fft is defined over the nonnegative
time interval
t = dt*(0:N-1);
t = 0:dt:T-dt;
t = linspace(0,T-dt,N);
where
dt = 1/Fs
and
T = N*dt
is the temporal period (corresponding discrete
time period is N) induced by ifft(fft(x))

When xb is defined over the "centered" bipolar time
interval
tb = t - dt*ceil((N-1)/2);
= dt*[-ceil((N-1)/2) : floor((N-1)/2))];
the location of the negative time components can be
periodically shifted N units into the proper positive
time interval location by using ifftshift
x = ifftshift(xb);
and recovered by using the inverse fftshift
xb = fftshift(x);

X = fft(x) yields a transform with a spectral
period Fs (discrete frequency period N) that is
defined over the nonnegative frequency interval
f = df*(0:N-1);
f = 0:df:Fs-df;
f = linspace(0,Fs-df,N);
where
df = 1/T = Fs/N

Xb, the "centered" bipolar frequency transform
defined over the spectral interval
fb = f - df*ceil((N-1)/2)
= df*[-ceil((N-1)/2) : floor((N-1)/2))];
is obtained by using fftshift
Xb = fftshift(X)
and X is recovered using ifftshift
X = ifftshift(Xb)

If a time signal xb is defined over the
centered bipolar time interval and is
filtered using a transform, Hb, that is defined
over the centered bipolar frequency interval,
the resulting output, yb can be obtained in 7
steps:
xb => x => X => Xb => Yb = Hb.*Xb => Y
=> y => yb
which, of course are typically combined by the
experienced user.

Note that ifftshift is identical to fftshift
when N is even

Hope this helps.

Greg

From: Greg Heath on
On May 15, 1:45 pm, "Dave Robinson" <dave.robin...(a)somewhere.biz>
wrote:
> Greg Heath <he...(a)alumni.brown.edu> wrote in message <e48ebf08-396a-42de-8fe5-bedf08c96...(a)p17g2000vbe.googlegroups.com>...
> > The MATLAB fft is defined over the nonnegative
> > time interval
> > t = dt*(0:N-1);
> > t = 0:dt:T-dt;
> > t = linspace(0,T-dt,N);
> > where
> > dt = 1/Fs
> > and
> > T = N*dt
> > is the temporal period (corresponding discrete
> > time period is N) induced by ifft(fft(x))
>
> > When xb is defined over the "centered" bipolar time
> > interval
> > tb = t - dt*ceil((N-1)/2);
> >    = dt*[-ceil((N-1)/2) : floor((N-1)/2))];
> > the location of the negative time components can be
> > periodically shifted N units into the proper positive
> > time interval location by using ifftshift
> > x = ifftshift(xb);
> > and recovered by using the inverse fftshift
> > xb = fftshift(x);
>
> > X = fft(x) yields a transform with a spectral
> > period Fs (discrete frequency period N) that is
> > defined over the nonnegative frequency interval
> > f = df*(0:N-1);
> > f = 0:df:Fs-df;
> > f = linspace(0,Fs-df,N);
> > where
> > df = 1/T = Fs/N
>
> > Xb, the "centered" bipolar frequency transform
> > defined over the spectral interval
> > fb = f - df*ceil((N-1)/2)
> >    = df*[-ceil((N-1)/2) : floor((N-1)/2))];
> > is obtained by using fftshift
> > Xb = fftshift(X)
> > and X is recovered using ifftshift
> > X = ifftshift(Xb)
>
> > If a time signal xb is defined over the
> > centered bipolar time interval and is
> > filtered using a transform, Hb, that is defined
> > over the centered bipolar frequency interval,
> > the resulting output, yb can be obtained in 7
> > steps:
> > xb => x => X => Xb => Yb = Hb.*Xb => Y
> > => y => yb
> > which, of course are typically combined by the
> > experienced user.
>
> > Note that ifftshift is identical to fftshift
> > when N is even
>
> > Hope this helps.
>
> > Greg
>
> Ok Greg, now we know what the answer is, what was the question? ;-)

The question is posed in

Newsgroups: comp.soft-sys.matlab
From: "Nicolas " <nico_spect...(a)hotmail.com>
Date: Sat, 15 May 2010 00:36:04 +0000 (UTC)
Local: Fri, May 14 2010 8:36 pm
Subject: FFT-filter-IFFT problem

http://groups.google.com/group/comp.soft-sys.matlab/msg/5ea90824ec15e2f5?hl=en

My reply to him was to refer to this thread.

Since many other posters have had problems with MATLAB
concerning

a. negative times and frequencies using fft/ifft
b. zero matrix indices
c. ifftshift vs fftshift

I felt that this was the best way to respond.

Hope this helps.

Greg
From: dbd on
On May 15, 11:23 am, Greg Heath <he...(a)alumni.brown.edu> wrote:
> On May 15, 1:45 pm, "Dave Robinson" <dave.robin...(a)somewhere.biz>
> wrote:
> ...
>
> > Ok Greg, now we know what the answer is, what was the question? ;-)
>
-----------------------------------------------------------------------------------------------------------------------------------
Many thanks to Dave for having the good sense to not cross-post his
question to comp.dsp
-----------------------------------------------------------------------------------------------------------------------------------
> The question is posed in
>
> Newsgroups: comp.soft-sys.matlab
> From: "Nicolas " <nico_spect...(a)hotmail.com>
> Date: Sat, 15 May 2010 00:36:04 +0000 (UTC)
> Local: Fri, May 14 2010 8:36 pm
> Subject: FFT-filter-IFFT problem
>
> http://groups.google.com/group/comp.soft-sys.matlab/msg/5ea90824ec15e...
>
> My reply to him was to refer to this thread.
>
> Since many other posters have had problems with MATLAB
> concerning
>
> a. negative times and frequencies using fft/ifft
> b. zero matrix indices
> c. ifftshift vs fftshift
>
> I felt that this was the best way to respond.
>
> Hope this helps.
>
> Greg

Your other thread is not in comp.dsp. Why did you crosspost this here?

The OP of your other thread had a question that did not use or require
the use of a Matlab syntax containing "shift" So why spout FUD? Here?

Your "Filtering with MATLAB's ifftshift" does not address the
implementation requirements specific to filtering with fft-ifft even
if you do choose to use a "shift" syntax so it is still off topic
here, so why crosspost it here?

How can this possibly be helpful here?

Dale B. Dalrymple
From: Greg Heath on
On May 15, 8:23 pm, dbd <d...(a)ieee.org> wrote:
> On May 15, 11:23 am, Greg Heath <he...(a)alumni.brown.edu> wrote:> On May 15, 1:45 pm, "Dave Robinson" <dave.robin...(a)somewhere.biz>
> > wrote:
> > ...
>
> > > Ok Greg, now we know what the answer is, what was the question? ;-)
>
> ---------------------------------------------------------------------------­--
> Many thanks to Dave for having the good sense to not cross-
> post his question to comp.dsp
> ---------------------------------------------------------------------------­
> > The question is posed in
>
> > Newsgroups: comp.soft-sys.matlab
> > From: "Nicolas " <nico_spect...(a)hotmail.com>
> > Date: Sat, 15 May 2010 00:36:04 +0000 (UTC)
> > Local: Fri, May 14 2010 8:36 pm
> > Subject: FFT-filter-IFFT problem
>
> >http://groups.google.com/group/comp.soft-sys.matlab/msg/5ea90824ec15e...
>
> > My reply to him was to refer to this thread.
>
> > Since many other posters have had problems with MATLAB
> > concerning
>
> > a. negative times and frequencies using fft/ifft
> > b. zero matrix indices
> > c. ifftshift vs fftshift
>
> > I felt that this was the best way to respond.
>
> > Hope this helps.
>
> > Greg
>
> Your other thread is not in comp.dsp. Why did you crosspost >this here?

1. It was not "my" thread.
2. I found it difficult to answer OPs question directly because of the
can-of-worms syndrome.
3. My solution was to address how the problem could
be done without getting into his specific code.
4. As I began writing, images of previous posts in
comp.dsp as well as comp.soft-sys.matlab came to mind
regarding MATLAB fft/ifft problems with fftshift/ifftshift and
negative times/frequencies
5. Therefore, I posted to both groups and referred the
OP to the new thread.

> The OP of your other thread had a question that did not use
> or require the use of a Matlab syntax containing "shift"

Incorrect. The correct use of fftshift and ifftshift
to deal with negative times and frequencies is
the most essential component in solving his problem.

> So why spout FUD? Here?

There has been confusion in this group w.r.t. the
use of MATLABs ifftshift and fftshift w.r.t. dealing
with negative times and negative frequencies.

I was hoping the post would help clarify matters.

> Your "Filtering with MATLAB's ifftshift" does not address the
> implementation requirements specific to filtering with fft-ifft even
> if you do choose to use a "shift" syntax

I have no idea what that means.

> so it is still off topic here, so why crosspost it here?
>
> How can this possibly be helpful here?

I assumed that comp.dsp is read by users of
MATLAB that could use the info.

You haven't convinced me otherwise.

Greg
From: Jerry Avins on
On 5/15/2010 10:02 PM, Greg Heath wrote:
> On May 15, 8:23 pm, dbd<d...(a)ieee.org> wrote:
>> On May 15, 11:23 am, Greg Heath<he...(a)alumni.brown.edu> wrote:> On May 15, 1:45 pm, "Dave Robinson"<dave.robin...(a)somewhere.biz>
>>> wrote:
>>> ...
>>
>>>> Ok Greg, now we know what the answer is, what was the question? ;-)
>>
>> ---------------------------------------------------------------------------�--
>> Many thanks to Dave for having the good sense to not cross-
>> post his question to comp.dsp
>> ---------------------------------------------------------------------------�
>>> The question is posed in
>>
>>> Newsgroups: comp.soft-sys.matlab
>>> From: "Nicolas "<nico_spect...(a)hotmail.com>
>>> Date: Sat, 15 May 2010 00:36:04 +0000 (UTC)
>>> Local: Fri, May 14 2010 8:36 pm
>>> Subject: FFT-filter-IFFT problem
>>
>>> http://groups.google.com/group/comp.soft-sys.matlab/msg/5ea90824ec15e...
>>
>>> My reply to him was to refer to this thread.
>>
>>> Since many other posters have had problems with MATLAB
>>> concerning
>>
>>> a. negative times and frequencies using fft/ifft
>>> b. zero matrix indices
>>> c. ifftshift vs fftshift
>>
>>> I felt that this was the best way to respond.
>>
>>> Hope this helps.
>>
>>> Greg
>>
>> Your other thread is not in comp.dsp. Why did you crosspost>this here?
>
> 1. It was not "my" thread.
> 2. I found it difficult to answer OPs question directly because of the
> can-of-worms syndrome.
> 3. My solution was to address how the problem could
> be done without getting into his specific code.
> 4. As I began writing, images of previous posts in
> comp.dsp as well as comp.soft-sys.matlab came to mind
> regarding MATLAB fft/ifft problems with fftshift/ifftshift and
> negative times/frequencies
> 5. Therefore, I posted to both groups and referred the
> OP to the new thread.
>
>> The OP of your other thread had a question that did not use
>> or require the use of a Matlab syntax containing "shift"
>
> Incorrect. The correct use of fftshift and ifftshift
> to deal with negative times and frequencies is
> the most essential component in solving his problem.
>
>> So why spout FUD? Here?
>
> There has been confusion in this group w.r.t. the
> use of MATLABs ifftshift and fftshift w.r.t. dealing
> with negative times and negative frequencies.
>
> I was hoping the post would help clarify matters.
>
>> Your "Filtering with MATLAB's ifftshift" does not address the
>> implementation requirements specific to filtering with fft-ifft even
>> if you do choose to use a "shift" syntax
>
> I have no idea what that means.
>
>> so it is still off topic here, so why crosspost it here?
>>
>> How can this possibly be helpful here?
>
> I assumed that comp.dsp is read by users of
> MATLAB that could use the info.
>
> You haven't convinced me otherwise.

Thanks for the post. It's on topic if Matlab is.

Jerry
--
"I view the progress of science as ... the slow erosion of the tendency
to dichotomize." --Barbara Smuts, U. Mich.
�����������������������������������������������������������������������