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

 
 

bug #53855: [octave forge] (signal) butter band pass filter with higher order has round-off errors

Submitted by:  Renato <yamane>
Submitted on:  Mon 07 May 2018 10:07:04 AM UTC  
 
Category:  Octave Forge Package Severity:  2 - Minor
Priority:  3 - Low Item Group:  Inaccurate Result
Status:  Confirmed Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment(Rich Markup)
   

You are not logged in

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

 

( Jump to the original submission)

Tue 08 May 2018 08:00:41 PM UTC, comment #7:

Q: This bug remains with the question: is any description needed in the butter (and cheby1, cheby2, ellip) doc string to mention this problem?

A: Of course, and an workaround will be appreciated :-)

Renato <yamane>
Tue 08 May 2018 07:45:19 PM UTC, comment #6:

Those are questions for the help mailing list, not the bug tracker.

The freqz function in Octave does not yet support a filter specified by sos (second-order sections), and the fvtool is not yet implemented either. The only way to visualize the filter frequency response at the moment is with freqz, which only supports transfer function format. A wish list bug requesting support for second-order sections in the freqz function would be appropriate.

The filter function only supports transfer function format, you would use the sosfilt function to apply a second-order section filter to your 'typenoise' signal.

This bug remains with the question: is any description needed in the butter (and cheby1, cheby2, ellip) doc string to mention this problem?

Mike Miller <mtmiller>
Project Administrator
Tue 08 May 2018 06:59:28 PM UTC, comment #5:

The MatLab documentation is not very well intuitive :-(

The documentation also says to use "hfvt", but it´s not implemented in Octave.

How to use ZPK Design instead a TF Design of this code below? :-)

Thank you,
Renato

Renato <yamane>
Tue 08 May 2018 06:02:58 PM UTC, comment #4:

Agree, this is exactly shown in the example on the Matlab help page.

The actual computed coefficients are consistent with both Matlab and SciPy.

Do we need to document this in the Octave butter function? Any doc string patches or suggestions?

Mike Miller <mtmiller>
Project Administrator
Tue 08 May 2018 04:04:13 PM UTC, comment #3:

Is not this the numerical instability as described in:

https://www.mathworks.com/help/signal/ref/butter.html

<<<
In general, use the [z,p,k] syntax to design IIR filters. To analyze or implement your filter, you can then use the [z,p,k] output with zp2sos

>>>


Dmitri.
--

Dmitri A. Sergatskov <dasergatskov>
Tue 08 May 2018 03:18:23 PM UTC, comment #2:

Same problem in MatLab...
File attached.

IF you increase the high frequency cut-off, the result is much better. But I didn't undestand why...

In the example below, I changed the high-frequency cut-off from 100Hz to 200Hz.

(file #44120)

Renato <yamane>
Mon 07 May 2018 06:53:23 PM UTC, comment #1:

Confirmed here. It would be useful to compare the filter coefficients to other software (e.g. SciPy).

Here is a simpler example, since I'm not sure where the 'noise' and 'normalize' functions are coming from, and they aren't needed.

Mike Miller <mtmiller>
Project Administrator
Mon 07 May 2018 10:07:04 AM UTC, original submission:

When n<=4, the result in low-frequency is OK.
When n >=5, the result in low-frequency is strange.

Renato <yamane>

 

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

Attach Files:
   
   
Comment:
   

Attached Files
file #44120:  test_RYamane.png added by yamane (55KiB - image/png - MatLab r2017b)
file #44109:  n5.png added by yamane (10KiB - image/png)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by dasergatskov (Posted a comment)
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by yamane (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can 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
    Tue 08 May 2018 08:02:13 PM UTC mtmiller Severity3 - Normal => 2 - Minor
    Tue 08 May 2018 06:02:58 PM UTC mtmiller Priority5 - Normal => 3 - Low
        Summary[octave forge] (signal) butter band pass filter with higher order has strange pass band => [octave forge] (signal) butter band pass filter with higher order has round-off errors
    Tue 08 May 2018 03:18:23 PM UTC yamane Attached File- => Added test_RYamane.png, #44120
    Mon 07 May 2018 06:53:23 PM UTC mtmiller Item GroupIncorrect Result => Inaccurate Result
        StatusNone => Confirmed
        Release4.4.0 => dev
        Summary[signal] butter filter with strange results => [octave forge] (signal) butter band pass filter with higher order has strange pass band
    Mon 07 May 2018 10:07:04 AM UTC yamane Attached File- => Added n5.png, #44109

    Back to the top


    Powered by Savane 3.3