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


bug #53205: [octave forge] (signal) buttord function 's' option

Submitted by:  Botond Sandor Kirei <botondkirei>
Submitted on:  Thu 22 Feb 2018 01:17:16 PM UTC  
Category: Octave Forge PackageSeverity: 3 - Normal
Priority: 5 - NormalItem Group: Matlab Compatibility
Status: NoneAssigned to: None
Originator Name: Open/Closed: Open
Release: 4.2.1Operating System: Any

Add a New Comment(Rich Markup)

You are not logged in

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


Tue 20 Mar 2018 10:32:30 PM UTC, comment #5:

The work you have done so far to add this option to the buttord function looks very good. There has been some previous work done to add the analog option to all of the ord functions. Would you mind taking a look at bug #46444 to compare the work done there? I need to review all of this work and your work and come up with the best combined improvements.

Aside from merging your work with bug #46444 and basic functionality, some more coding style improvements would be very welcome in the revision that you have currently.

As a few examples

  • use "if (numel (Wp) == 1)" instead of "iff ( numel(Wp) == 1 )"
  • use "if (Wp(1) > Ws(1))" instead of "if Wp(1) > Ws(1)"
  • keep print_usage at the top of the function
  • don't use printf in the function, if you need to warn, use the warning function

You can also vastly simplify the test cases that you wrote at the end. Instead of making a loop over some test index, just write each as its own test block. The test function itself will take care of showing the code and the specifics of the test failure if necessary. There are plenty of examples of well written tests in Octave and in the signal package.

Mike Miller <mtmiller>
Project Administrator
Mon 26 Feb 2018 01:39:29 PM UTC, comment #4:

Dear Mike,

Would you take a look to the corrected version of buttord function, before I try to merge it to the signal package?
Here is the link:

I revised to code to comply with Octave coding style, also added comments and provided several tests (low-, high-, pass- and stop-band).

If you say it's OK, I will try a merge. Pls, let me know if you have other suggestions.


Botond Sandor Kirei <botondkirei>
Fri 23 Feb 2018 08:28:06 PM UTC, comment #3:

Yes, I will adapt the code to Octave coding style. It will take a few days.

Botond Sandor Kirei <botondkirei>
Fri 23 Feb 2018 06:02:35 PM UTC, comment #2:

Thanks for working on a fix to this missing feature. Would you mind working on it a bit more to adapt your code to Octave's coding style? https://wiki.octave.org/Octave_style_guide

Can you also add one or more test cases to the end of the function to verify that the new option works?

Mike Miller <mtmiller>
Project Administrator
Fri 23 Feb 2018 03:08:41 PM UTC, comment #1:

Added package maintainers to CC list.

Olaf Till <i7tiol>
Project Member
Thu 22 Feb 2018 01:17:16 PM UTC, original submission:

The MATALB function "buttord" is suitable to obtain the order of an analogic filter too. The common use for analog filter design is "buttord(...,'s')" - the 's' flag is appended in the argument list.

The current versions of Siganl package of OCTAVE is not compliant with the MATLAB function.

Proposed solution:

I am not sure how to contribute to octave's signal package codebase, thus I created a development branch:

The proposed implementation is in the branches buttord.m function.

Botond Sandor Kirei <botondkirei>


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

Attach File(s):

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -unavailable- added by mtmiller (Posted a comment)
  • -unavailable- added by botondkirei (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 9 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Fri 23 Feb 2018 06:02:52 PM UTCmtmillerCarbon-CopyRemoved doug stewart =>-
    Fri 23 Feb 2018 06:02:47 PM UTCmtmillerCarbon-CopyRemoved 77635=>-
    Fri 23 Feb 2018 06:02:43 PM UTCmtmillerCarbon-CopyRemoved alexander wilms =>-
    Fri 23 Feb 2018 06:02:35 PM UTCmtmillerSummary[Octave-Forge: signal pkg] buttord function MATLAB compatibility issue=>[octave forge] (signal) buttord function 's' option
    Fri 23 Feb 2018 03:02:32 PM UTCi7tiolCarbon-Copy-=>Added doug stewart
      Carbon-Copy-=>Added alexander wilms
    Fri 23 Feb 2018 04:22:25 AM UTCrik5Carbon-CopyRemoved 72865=>-
    Fri 23 Feb 2018 04:22:14 AM UTCrik5CategoryOctave Function=>Octave Forge Package
      Summarybuttord function MATLAB compatibility issue=>[Octave-Forge: signal pkg] buttord function MATLAB compatibility issue

    Back to the top

    Powered by Savane 3.1-cleanup1