mne-tools/mne-python — pull request #389 by Eric89GXL (2013-01-15 18:58:52+00:00)
Title: ENH: Faster FFT FIR filtering

This speeds up and unifies some of the filtering code. It gets the full-length filtering to be the same speed as using a shorter filter_length, which is nice. Here is the old code timing, with old/new results on each line:
```
>>> import mne
>>> import time
>>> raw = mne.fiff.Raw('Eric_SoP_001_01_raw_sss.fif', preload=True)
>>> t = time.time(); raw.filter(None, 55, n_jobs=6); print time.time() - t
Old: 109.5 New: 35.3
>>> raw = mne.fiff.Raw('Eric_SoP_001_01_raw_sss.fif', preload=True)
>>> t = time.time(); raw.filter(None, 55, n_jobs=6, filter_length=8192); print time.time() - t
Old: 33.5 New: 33.8
>>> raw = mne.fiff.Raw('Eric_SoP_001_01_raw_sss.fif', preload=True)
>>> raw.crop(0, 60, copy=False)

>>> t = time.time(); raw.filter(None, 55, n_jobs=6, filter_length=8192); print time.time() - t
Old: 6.6 New: 5.7
>>> raw = mne.fiff.Raw('Eric_SoP_001_01_raw_sss.fif', preload=True)
>>> t = time.time(); raw.notch_filter([60, 120, 180, 240], n_jobs=6, filter_length=8192); print time.time() - t
Old: 34.2 New: 33.9
```
In addition to making sure the tests pass, I also saved each filtered file in the old/new case, loaded them, and the resulting arrays were equal.

So, we get a 3x speedup in the `filter_length=None` case. Also, when we get attenuation warnings, we only get one of them now (instead of 6 for n_jobs=6) when running jobs in parallel, which is an upgrade.

@mluessi presumably you'll want to look at this, as I assume the filtering code was mostly yours.