{
  "name": "filt, filter and filtfilt compared with SciPy and Octave equivalents",
  "description": "Side-by-side comparison of MATLAB filt, filter and filtfilt and the SciPy and Octave filtfilt functions: what each takes, what it returns, and documented limits. Compiled from the official MathWorks, SciPy and Octave Forge reference pages.",
  "page": "https://casrai.org/guides/filt-matlab",
  "publisher": "CASRAI",
  "license": "https://creativecommons.org/licenses/by/4.0/",
  "dateModified": "2026-11-16T21:58:17Z",
  "temporalCoverage": null,
  "spatialCoverage": null,
  "columns": [
    {
      "name": "Function",
      "unit": "",
      "description": ""
    },
    {
      "name": "Environment",
      "unit": "",
      "description": ""
    },
    {
      "name": "Takes data to filter",
      "unit": "",
      "description": ""
    },
    {
      "name": "Returns",
      "unit": "",
      "description": ""
    },
    {
      "name": "Phase behaviour",
      "unit": "",
      "description": ""
    },
    {
      "name": "Documented constraint",
      "unit": "",
      "description": ""
    }
  ],
  "rows": [
    {
      "Function": "filt(numerator,denominator,ts)",
      "Environment": "MATLAB, Control System Toolbox reference",
      "Takes data to filter": "No",
      "Returns": "tf model object with Variable z^-1",
      "Phase behaviour": "Not applicable (model)",
      "Documented constraint": "Coefficients in ascending powers of z^-1; use filter for vector data"
    },
    {
      "Function": "filter(b,a,x)",
      "Environment": "MATLAB, core reference",
      "Takes data to filter": "Yes",
      "Returns": "Filtered data, same size as vector input",
      "Phase behaviour": "Conventional one-pass (delayed output in the documentation example)",
      "Documented constraint": "a(1) must be nonzero; coefficients normalized by a(1)"
    },
    {
      "Function": "filtfilt(b,a,x)",
      "Environment": "MATLAB, Signal Processing Toolbox area",
      "Takes data to filter": "Yes",
      "Returns": "Filtered data",
      "Phase behaviour": "Zero phase distortion; squared magnitude; double effective order",
      "Documented constraint": "x finite, length greater than 3 times filter order; not for differentiator or Hilbert FIR"
    },
    {
      "Function": "scipy.signal.filtfilt",
      "Environment": "Python, SciPy",
      "Takes data to filter": "Yes",
      "Returns": "Filtered data",
      "Phase behaviour": "Zero phase; order doubled",
      "Documented constraint": "Default padlen is 3*max(len(a),len(b)); sosfiltfilt preferred for most tasks"
    },
    {
      "Function": "filtfilt(b,a,x)",
      "Environment": "Octave, signal package",
      "Takes data to filter": "Yes",
      "Returns": "Filtered data",
      "Phase behaviour": "Forward and reverse filtering",
      "Documented constraint": "Phase correction not perfect; magnitude response distorted, especially in the stop band"
    }
  ],
  "sources": [
    {
      "title": "MathWorks filt reference",
      "url": "https://www.mathworks.com/help/control/ref/filt.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks filter reference",
      "url": "https://www.mathworks.com/help/matlab/ref/filter.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "MathWorks filtfilt reference",
      "url": "https://www.mathworks.com/help/signal/ref/filtfilt.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "SciPy scipy.signal.filtfilt",
      "url": "https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.filtfilt.html",
      "accessed": "2026-11-12"
    },
    {
      "title": "Octave Forge signal filtfilt",
      "url": "https://octave.sourceforge.io/signal/function/filtfilt.html",
      "accessed": "2026-11-12"
    }
  ]
}