bugGNU Octave - Bugs: bug #33581, Error in fftshift's documentation

 
 

bug #33581: Error in fftshift's documentation

Submitted by:  None
Submitted on:  Thu 16 Jun 2011 07:38:16 PM UTC  
 
Category: NoneSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Documentation
Status: FixedAssigned to: None
Originator Name: Miguel BazdreschOriginator Email: -unavailable-
Open/Closed: ClosedRelease: 3.4.0
Operating System: GNU/Linux

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 26 Sep 2011 06:50:29 PM UTC, comment #3:

Fixed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/914c0b103a3d). The change will be available in version 3.4.3 which should be released in the next month. Alternatively the reporter can build from the stable code repository.

Rik <rik5>
Project Administrator
Sat 18 Jun 2011 02:59:41 PM UTC, comment #2:

I think the text box ate some of your comments because of mismatched verbatim tags. Here is what I think is the full text, reconstructed from the email notification I received:

I believe there could be a mistake in fftshift's documentation. It is claimed
that, after fftshift, the analog frequency vector is

where N is the number of samples and Dt is the time resolution.
Consider the case N = 6 and Dt = 1. The digital frequencies are

(The corresponding analog frequencies are the same, since Dt=1). As expected,
we see the Nyquist frequency (0.5). fftshift will arrange things so that the
FFT value corresponding to this frequency is aliased to -0.5. However, the
formula for f in fftshift's documentation produces:

This is incorrect, the 0.5 term was not aliased. The error can be
verified graphically by running:

where it will be clear that the spectrum is not symmetric around 0Hz. (See
also http://www.mathworks.com/matlabcentral/newsreader/view_thread/172590)

(By the way, the documented formula is correct for odd N). I believe a correct
formula for the frequencies is

where df=1/Dt. It may be expressed more succinctly, but I believe it is more
didactic expressed this way.

John W. Eaton <jwe>
Project Administrator
Fri 17 Jun 2011 04:58:15 PM UTC, comment #1:

The full bug report is here:

http://octave.1599824.n4.nabble.com/Incorrect-fftshift-documentation-td3603434.html

Miguel Bazdresch <miguelb>
Thu 16 Jun 2011 07:38:16 PM UTC, original submission:

I believe there could be a mistake in fftshift's documentation. It is claimed that, after fftshift, the analog frequency vector is

where N is the number of samples and Dt is the time resolution.
Consider the case N = 6 and Dt = 1. The digital frequencies are

Anonymous

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by rik5 (Posted a comment)
  • -unavailable- added by jwe (Posted a comment)
  • -unavailable- added by miguelb (Posted a comment)
  • -unavailable- added by None (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 2 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 26 Sep 2011 06:50:47 PM UTCrik5Open/ClosedOpen=>Closed
    Mon 26 Sep 2011 06:50:29 PM UTCrik5StatusNone=>Fixed

    Back to the top


    Powered by Savane 3.1-cleanup1