bugGNU Octave - Bugs: bug #39729, Signal library periodogram returns...

 
 

bug #39729: Signal library periodogram returns incorrect result for row vectors

Submitted by:  None
Submitted on:  Thu 08 Aug 2013 03:24:48 PM UTC  
 
Category: Octave FunctionSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Incorrect Result
Status: ConfirmedAssigned to: None
Originator Name: m.reichOriginator Email: -unavailable-
Open/Closed: OpenRelease: dev
Operating System: Any

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

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

 

Fri 09 Aug 2013 03:34:35 AM UTC, comment #2:

Thanks for confirming.

Yes, it probably should work if lengths are the same, subject to compatibility.

As written, the function seems to broadcast a column window across the columns of a matrix signal argument, which is compatible with fft matrix handling. But, I have not tested this.

M.Reich

Anonymous
Fri 09 Aug 2013 02:50:15 AM UTC, comment #1:

Confirmed in the development version of Octave as well. The window is not applied but the signal is still normalized by the window power.

The function also fails if the signal argument is a row vector instead of a column vector, with or without a window. I think it should work on any combination of row or column vector inputs as long as they have the same length.

Mike Miller <mtmiller>
Project Member
Thu 08 Aug 2013 03:24:48 PM UTC, original submission:

periodogram(x,win,...)returns an incorrect result if win is a row vector or if win is a column vector whose length does not equal the length of parameter x. Here, '...' represents be the remaining optional parameters.

In the current implementation of periodogram, lines 108 through 114 apply the window 'win' only if either
(size (x) == size (window)
or if
(size (x, 1) == size (window, 1) && size (window, 2) == 1)
As a result, if 'win' is a row vector whose length equals the length of 'x', the window is not applied, although it would make sense to do so. In the case that the lengths of 'win' and 'x' do not match, it would make sense to flag an error.

Moreover, since line 147 normalizes the periodogram by 'win'even if the window was not applied, the function can return an incorrect result.

Most window functions in the signal library work correctly as the 'win' parameter since they return column vectors, e.g.
size(blackman(1000))
But those which return row vectors need conversion to column a vector to work correctly, e.g
size(blackmanharris(1000))

Anonymous

 

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

Attach File(s):
   
   
Comment:
   

Attached Files
file #31784:  periodogram.diff added by drewabbot (1kB - application/octet-stream - whoops, new bug #42859 just reported for this issue (and more) -- here's my proposed fix)

 

Depends on the following items: None found

Items that depend on this one

Digest:
   bug dependencies.

 

Carbon-Copy List
  • -unavailable- added by drewabbot (Updated the item)
  • -unavailable- added by mtmiller (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 7 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Tue 29 Jul 2014 06:51:28 AM UTCandy1978Dependencies-=>bugs #42859 is dependent
    Mon 28 Jul 2014 05:39:57 AM UTCdrewabbotAttached File-=>Added periodogram.diff, #31784
    Fri 09 Aug 2013 02:50:15 AM UTCmtmillerCategoryLibraries=>Octave Function
      StatusNone=>Confirmed
      Release3.6.4=>dev
      Operating SystemOther=>Any
      SummarySignal library periodogram returns incorrect result for row vector windows=>Signal library periodogram returns incorrect result for row vectors

    Back to the top


    Powered by Savane 3.1-cleanup