bugGNU Octave - Bugs: bug #32741, filter initial conditions do not...

 
 

bug #32741: filter initial conditions do not work for matrix input

Submitter:  None
Submitted:  Thu 10 Mar 2011 07:09:51 PM UTC
   
 
Category:  Interpreter Severity:  3 - Normal
Priority:  5 - Normal Item Group:  None
Status:  Fixed Assigned to:  None
Originator Name:  Valentin Abramzon Originator Email:  -email is unavailable-
Open/Closed:  * Closed Release:  * 3.2.4
Operating System:  * GNU/Linux Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 04 Jun 2011 02:16:46 PM UTC, comment #5: 

I've checked in yet a third fix (http://hg.savannah.gnu.org/hgweb/octave/rev/9843b3b055e0).  This time I just rewrote the entire input checking routine for the SI vector rather than try to amend the existing code.  It works for the two failing test cases in this bug report, but please test more.

Rik <rik5>
Group administrator
Thu 02 Jun 2011 07:41:14 PM UTC, comment #4: 

But in the current dev version (rev. 12637) one still gets

octave> filter( [ 1, 1, 1 ], [ 1, 1 ], [ 1 2], [ 1, 1] )
error: filter: first dimension of SI must be of length max (length (a), length (b)) - 1

whereas in 3.4 and in matlab it is correctly:

octave> filter( [ 1, 1, 1 ], [ 1, 1 ], [ 1 2], [ 1, 1] )
ans =

   2   2

So it seems the bug is still there.

Muhali <muhali>
Sat 02 Apr 2011 02:00:23 AM UTC, comment #3: 

Fixed in this changeset (http://hg.savannah.gnu.org/hgweb/octave/rev/3b0eb443c519).  You will need to build from Mercurial sources or wait for the bug fix release 3.4.1 in order to see the fix.

Rik <rik5>
Group administrator
Fri 01 Apr 2011 10:19:52 PM UTC, comment #2: 

matlab says:
+verbose+

>> filter( [ 1, 3 ], [ 1 ], [ 1 2; 3 4; 5 6 ], [ 4, 5 ] )


ans =

     5     7
     6    10
    14    18

>> version


ans =

7.9.0.529 (R2009b)
-verbose-

Michael Godfrey <godfrey>
Group Member
Fri 01 Apr 2011 10:08:30 PM UTC, comment #1: 

I think I have a fix for this.  However, I'm still not sure filter is correctly handling the initial conditions.  Could you report what the following command does in Matlab?

+verbose+
filter( [ 1, 3 ], [ 1 ], [ 1 2; 3 4; 5 6 ], [ 4, 5 ] )
-verbose-

Rik <rik5>
Group administrator
Thu 10 Mar 2011 07:09:51 PM UTC, original submission:  

When I try to use the filter function to perform IIR filtering on each column of a matrix, specifying initial conditions produces and error:

filter( [ 1, 1 ], [ 1 ], [ 1 2; 3 4; 5 6 ], [ 1, 1 ] )
  error: filter: first dimension of si must be of length max (length (a), length (b)) - 1

Since a = [ 1 ] and b = [ 1, 1 ],
  max(length (a), length (b)) - 1 = 1.

The first dimension of my initial condition si = [ 1, 1 ] is 1, so it seems that this should work, not give me an error.

I also checked the same statement in Matlab, and it produces the expected results:

>> filter( [ 1, 1 ], [ 1 ], [ 1 2; 3 4; 5 6 ], [ 1, 1 ] )


ans =

     2     3
     4     6
     8    10

As far as I could tell, the was not fixed in Octave 3.4.0.

Anonymous

 

(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 godfrey (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by None (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 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-04-02 rik5 StatusNeed Info Fixed
        Open/ClosedOpen Closed
    2011-04-01 rik5 StatusNone Need Info

    Back to the top

    Powered by Savane 3.13-d3ae.
    Corresponding source code