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

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

[Octave-bug-tracker] [bug #64400] [octave-forge](signal) corr() change b


From: Dmitri A. Sergatskov
Subject: [Octave-bug-tracker] [bug #64400] [octave-forge](signal) corr() change broke filtfilt BIST
Date: Sun, 9 Jul 2023 11:14:53 -0400 (EDT)

URL:
  <https://savannah.gnu.org/bugs/?64400>

                 Summary: [octave-forge](signal) corr() change broke filtfilt
BIST
                   Group: GNU Octave
               Submitter: dasergatskov
               Submitted: Sun 09 Jul 2023 03:14:51 PM UTC
                Category: Octave Forge Package
                Severity: 3 - Normal
                Priority: 5 - Normal
              Item Group: None
                  Status: None
             Assigned to: None
         Originator Name: 
        Originator Email: 
             Open/Closed: Open
                 Release: dev
         Discussion Lock: Any
        Operating System: Any
           Fixed Release: None
         Planned Release: None


    _______________________________________________________

Follow-up Comments:


-------------------------------------------------------
Date: Sun 09 Jul 2023 03:14:51 PM UTC By: Dmitri A. Sergatskov <dasergatskov>
In octave 9.x corr() became more Matlab-compatible. 
It does not work on row-vectors the same as on column-vectors
(see https://savannah.gnu.org/bugs/?64395). 
That broke filtfilt BIST:

octave:3> test filtfilt
***** test
 randn('state',0);
 r = randn(1,1000);
 s = 10 * sin(pi * 4e-2 * (1:length(r)));
 [b,a] = cheby1(2, .5, [4e-4 8e-2]);
 y = filtfilt(b, a, r+s);
 assert (size(r), size(y));
 assert (mean(abs(y)) < 1e3);
 assert (corr(s(250:750), y(250:750)) > .95)
 [b,a] = butter(2, [4e-4 8e-2]);
 yb = filtfilt(b, a, r+s);
 assert (mean(abs(yb)) < 1e3);
 assert (corr(y, yb) > .99)
!!!!! test failed
c(501,_): out of bound 1 (dimensions are 1x1)


I guess the easiest fix is to change "(corr(y, yb)" to 
"(corr(y(:), yb(:))"

Dmitri.
-- 









    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?64400>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/




reply via email to

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