# How Is the MATLAB filter() Function So Fast?

How is the filter() implemented in MATLAB? How is it so fast?
What's the fastest implementation of a FIR filter?

Actually it seems MATLAB implementation of the filter() function is pretty straight forward and not fast.

For a fast implementation, have a look at FilterM by Jan Simon.

## Update

In the latest releases of MATLAB (From R2016b and above) the performance of the filter() function has improved.
The metdhos to accelerate those operations are usually based on:

1. Utilizing SIMD Operations (SSE / AVX in x86).
• Actually fft() based will be faster only in the cases dimensions are really perfect for it which doesn't happen often in my experience. Filtration both with fft() or directly on data are usually memory bounded and the fft() approach stresses memory more. – Royi Nov 18 '19 at 14:32
• By the way, MATLAB's conv() is much faster than filter() in the cases of FIR filters. – Royi Nov 18 '19 at 14:33
• I don't know your MATLAB version but in my(old) version its help says The conv function is an M-file that uses the filter primitive.... So I don't how how it could be faster ? May be newer versions use other approaches ? – Fat32 Nov 18 '19 at 17:54