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:  None Assigned to:  None
Originator Name:  Open/Closed:  * Open
Release:  * stable Operating System:  * Any
Fixed Release:  None Planned Release:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

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 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 2 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    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.13-58d6.
    Corresponding source code