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 13:09:01 +0000 (UTC)
Organization: Xoran Technologies
Lines: 30
Message-ID: <h108dd$f2k$1@fred.mathworks.com>
References: <8c3ffec9-42f0-4ba1-ac3c-f826d56dd963@y7g2000yqa.googlegroups.com> <abdeb4dc-441a-407f-98f2-46dd397fce7b@y17g2000yqn.googlegroups.com> <h107mt$1be$1@fred.mathworks.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 1244898541 15444 172.30.248.38 (13 Jun 2009 13:09:01 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Sat, 13 Jun 2009 13:09:01 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:547172


"Matt " <xys@whatever.com> wrote in message <h107mt$1be$1@fred.mathworks.com>...
> 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
> 


Sorry, make that last  part as follows

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