bugGNU Octave - Bugs: bug #46373, [octave forge] (signal)...

 
 

bug #46373: [octave forge] (signal) documentation of xcorr misleading

Submitter:  Mirko Scholz <srtlg>
Submitted:  Tue 03 Nov 2015 09:52:24 PM UTC
   
 
Category:  Octave Package Severity:  2 - Minor
Priority:  5 - Normal Item Group:  Documentation
Status:  Works For Me Assigned to:  mtmiller
Originator Name:  Open/Closed:  * Closed
Release:  * other Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 20 Mar 2018 10:34:17 PM UTC, comment #2: 

Closing with no response. Future documentation improvements are always welcome, especially with specific wording notes or patches.

Mike Miller <mtmiller>
Group Member
Sun 13 Aug 2017 10:28:28 PM UTC, comment #1: 

Hi The following passes for me, meaning that it gives the same as xcorr


na   = 5;
a    = ones(1,na);
lag  = -(na-1):(na-1); # doc say N-1 is the default
nl   = length (lag);
ac   = prepad (postpad (a,na+floor(nl/2)), na+nl); # doc says pad with zeros
R_xy = zeros (1,nl);

for k=1:length(lags);
  R_xy(k) = sum (shift(ac,lag(k)) .* ac); # formula in the doc
end;

assert (xcorr (a, 'none'), R_xy, sqrt (eps));
assert (xcorr (a, 'biased'), R_xy/na, sqrt (eps));
assert (xcorr (a, 'unbiased'), R_xy./(na-abs(lag)), sqrt (eps));


What is exactly the misleading part of the documentation?

@devs: please mark as "needs info" or "closed"

Juan Pablo Carbajal <juanpi>
Group Member
Tue 03 Nov 2015 09:52:24 PM UTC, original submission:  

The documentation of the latest (1.3.2) it states that
none: return the unscaled correlation, R
biased: return the biased average, R/N
unbiased: return the unbiased average, R(k)/(N-|k|)
this is incorrect with the definition of R(k) given above: R_k = sum_i = x_{k+i} conj(y_i)

Just execute the following and substitute calculate R_k manually given the above definition.


a = ones(1,5)
xcorr(a,'none')
xcorr(a,'biased')
xcorr(a,'unbiased')


Even though looking at the source the divisions are actually done that way, I assume that has something to do with the implementation as FFT

Mirko Scholz <srtlg>

 

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

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by juanpi (Posted a comment)
  • -email is unavailable- added by jwe (Updated the item)
  • -email is unavailable- added by mtmiller (Updated the item)
  • -email is unavailable- added by srtlg (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only group members can vote.

     

    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2018-03-20 mtmiller StatusNeed Info Works For Me
        Open/ClosedOpen Closed
    2017-08-13 jwe Summarysignal package: documentation of xcorr misleading [octave forge] (signal) documentation of xcorr misleading
    2015-12-22 mtmiller Severity3 - Normal 2 - Minor
        StatusNone Need Info
        Assigned toNone mtmiller

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code