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

 
 

bug #64899: [octave forge] (signal) decimate with FIR filter incompatible with Matlab

Submitter:  Geert van Boxtel <geertvanboxtel>
Submitted:  Wed 15 Nov 2023 09:03:35 PM UTC
   
 
Category:  Octave Package Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Matlab Compatibility
Status:  Fixed Assigned to:  lostbard
Originator Name:  Open/Closed:  * Closed
Release:  * stable Release: 
Operating System:  * Any Fixed Release:  None
Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Sat 21 Sep 2024 07:00:26 PM UTC, comment #2: 

released in v1.4.6

John Donoghue <lostbard>
Group Member
Fri 16 Aug 2024 11:39:02 PM UTC, comment #1: 

A tried a couple of tests in matlab and octave saw the same thing. Changing it to filtfilt makes octave and matlab match

I pushed up a change to the repo

John Donoghue <lostbard>
Group Member
Wed 15 Nov 2023 09:03:35 PM UTC, original submission:  

The decimate() function in the Octave signal package produces a result which is incompatible with the Matlab implementation if a FIR filter is used. Example:


decimate(1:100, 2, 'fir')


I think this is due to the fact that the decimate function calls the fftfilt() function when a FIR filter is specified, which produces a phase shift. When an IIR filter is specified, decimate() calls filtfilt(), which corrects for the phase shift. Changing line 88 in the code to


y = filtfilt (b, 1, x);


produces the same output as the Matlab function.

Hope this helps,
Geert

Geert van Boxtel <geertvanboxtel>

 

(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 lostbard (Posted a comment)
  • -email is unavailable- added by geertvanboxtel (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
    2024-09-21 lostbard StatusReady For Test Fixed
        Open/ClosedOpen Closed
    2024-08-16 lostbard StatusNone Ready For Test
        Assigned toNone lostbard
    2023-11-16 mmuetzel Carbon-CopyRemoved 102357 -
    2023-11-16 mmuetzel Summarydecimate with FIR filter incompatible with Matlab [octave forge] (signal) decimate with FIR filter incompatible with Matlab

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code