<< filternorm | FOSSEE_Signal_Processing_Toolbox | filtic >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > filtfilt

# filtfilt

Forward and reverse filter the signa

### Syntax

    y = filtfilt(b, a, x)

### Parameters

b:

  Numerator coefficients of the filter.

a:

  Denominator coefficients of the filter.

x:

  Input signal.

y:

  Zero-phase filtered signal.

### Description

Forward and reverse filter the signal. This corrects for phase distortion introduced by a one-pass filter, though it does square the magnitude response in the process. That’s the theory at least. In practice the phase correction is not perfect, and magnitude response is distorted, particularly in the stop band.

### Examples

    [b, a]=butter(3, 0.1)                  // 5 Hz low-pass filter
    t = 0:0.01:1.0;                         // 1 second sample
    x=sin(2*%pi*t*2.3)+0.25*rand(size(t,1),size(t,2),"normal");  // 2.3 Hz sinusoid+noise
    y = filtfilt(b,a,x);
    z = filter(b,a,x); // apply filter
    plot(t,x,t,y,t,z);
    legend("data","filtfilt","filter");

### See also

- filter

### Authors

- Rashmi Patankar, FOSSEE IIT Bombay

Report an issue
<< filternorm | FOSSEE_Signal_Processing_Toolbox | filtic >>