Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: WARNING: Is there a use for ifft(X,M)?
Date: Sat, 13 Jun 2009 12:57:01 +0000 (UTC)
Organization: Xoran Technologies
Lines: 23
Message-ID: <h107mt$1be$1@fred.mathworks.com>
References: <8c3ffec9-42f0-4ba1-ac3c-f826d56dd963@y7g2000yqa.googlegroups.com> <abdeb4dc-441a-407f-98f2-46dd397fce7b@y17g2000yqn.googlegroups.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1244897821 1390 172.30.248.38 (13 Jun 2009 12:57:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 13 Jun 2009 12:57:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:547170


Rune Allnor <allnor@tele.ntnu.no> wrote in message <abdeb4dc-441a-407f-98f2-46dd397fce7b@y17g2000yqn.googlegroups.com>...


> % At this point we have the original spectrum
> % Next, make a copy of this spectrum and remove
> % the frequency components above the Nyquist
> % frequency:
> 
> Xx = X;
> Xx(ceil(N/2):end)=0;

Not bad, Rune. A couple things though. First, the creation of Xx needs some fixing

Xx = X;
Xx(ceil(N/2)+1:end)=0; %Note the +1

Xx(1)=Xx(1)/2; %Otherwise DC will be double-counted

if ~bitget(N,1) %N is even
 Xx(N/2)=Xx(N/2)/2; %Otherwise Nyqist frequency will be double-counted
end

Secondly, I fear this technique will get rather cumbersome when you go to higher dimensions and extended to fft2 or fftn.