[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Octave-bug-tracker] [bug #64899] decimate with FIR filter incompatible
From: |
Geert van Boxtel |
Subject: |
[Octave-bug-tracker] [bug #64899] decimate with FIR filter incompatible with Matlab |
Date: |
Wed, 15 Nov 2023 16:03:37 -0500 (EST) |
URL:
<https://savannah.gnu.org/bugs/?64899>
Summary: decimate with FIR filter incompatible with Matlab
Group: GNU Octave
Submitter: geertvanboxtel
Submitted: Wed 15 Nov 2023 09:03:35 PM UTC
Category: Octave Forge Package
Severity: 3 - Normal
Priority: 5 - Normal
Item Group: Matlab Compatibility
Status: None
Assigned to: None
Originator Name:
Originator Email:
Open/Closed: Open
Release: stable
Discussion Lock: Any
Operating System: Any
Fixed Release: None
Planned Release: None
_______________________________________________________
Follow-up Comments:
-------------------------------------------------------
Date: Wed 15 Nov 2023 09:03:35 PM UTC By: Geert van Boxtel <geertvanboxtel>
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
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?64899>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [Octave-bug-tracker] [bug #64899] decimate with FIR filter incompatible with Matlab,
Geert van Boxtel <=