octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #42859] bugs in periodogram.m


From: Drew Abbot
Subject: [Octave-bug-tracker] [bug #42859] bugs in periodogram.m
Date: Thu, 07 Aug 2014 23:56:32 +0000
User-agent: Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/36.0.1985.125 Safari/537.36

Follow-up Comment #3, bug #42859 (project octave):

As far as I can tell, as of MATLAB 2013a:


 pxx = periodogram (1:8, [], 4)


yields [ 25.7831 ; 1.2732 ; 0.3183 ], and Octave yields the same result.

However, in MATLAB, the following also yields that same result (as it should)


 pxx = periodogram (1:8, [], 4, 'onesided')


but in Octave, the result is [ 162 ; 8 ; 2 ], which is the same result as
before but scaled by (2*pi).  This is related to both the code


 if (nargin<4)
   Pxx /= 2*pi;
 elseif (! isempty (fs))
   Pxx /= fs;
 endif


and the fact that fs is initialized to [].  To get around this, fs could be
initialized to 2*pi, or to be even more complete, multiple MATLAB
compatibility modes could be supported (as is done in the Octave signal
package's pwelch() method), with default fs values of 1.0 or 2*pi accordingly.




    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?42859>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]