<< fftconv | FOSSEE_Signal_Processing_Toolbox | fftn >>

FOSSEE_Signal_Processing_Toolbox >> FOSSEE_Signal_Processing_Toolbox > fftfilt

# fftfilt

Performs FFT-based FIR filtering using overlap-add method

### Syntax

    y = fftfilt(b,x)
    y = fftfilt(b,x,n)

### Parameters

x:

  real|complex numbers - vector|matrix

b:

  real|complex numbers - vector|matrix

n:

  positive integer

### Description

y = fftfilt(b,x) filters the data in vector x with the filter described by coefficient vector b. y = fftfilt(b,x,n) uses n to determine the length of the FFT.

### Examples

    fs = 360
    t = 0:1/fs:2;
    x = sin(2 * %pi * 5 * t) + 0.2 * rand(1, length(t)); // Simulated ECG with noise
    // Low-pass filter coefficients (example FIR LPF)
    b = [0.1, 0.15, 0.5, 0.15, 0.1]
    y = fftfilt(b, x);
    plot(t, x, 'r--');
    plot(t, y, 'g');
    legend(["Original ECG", "Filtered ECG"]);

Report an issue
<< fftconv | FOSSEE_Signal_Processing_Toolbox | fftn >>